config-editor-base 3.0.5 → 3.0.7

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.
@@ -1442,7 +1442,7 @@ var lodash = createCommonjsModule(function (module, exports) {
1442
1442
  var undefined$1;
1443
1443
 
1444
1444
  /** Used as the semantic version number. */
1445
- var VERSION = '4.17.21';
1445
+ var VERSION = '4.17.23';
1446
1446
 
1447
1447
  /** Used as the size to enable large array optimizations. */
1448
1448
  var LARGE_ARRAY_SIZE = 200;
@@ -5196,7 +5196,7 @@ var lodash = createCommonjsModule(function (module, exports) {
5196
5196
  if (isArray(iteratee)) {
5197
5197
  return function(value) {
5198
5198
  return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
5199
- }
5199
+ };
5200
5200
  }
5201
5201
  return iteratee;
5202
5202
  });
@@ -5800,8 +5800,47 @@ var lodash = createCommonjsModule(function (module, exports) {
5800
5800
  */
5801
5801
  function baseUnset(object, path) {
5802
5802
  path = castPath(path, object);
5803
- object = parent(object, path);
5804
- return object == null || delete object[toKey(last(path))];
5803
+
5804
+ // Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
5805
+ var index = -1,
5806
+ length = path.length;
5807
+
5808
+ if (!length) {
5809
+ return true;
5810
+ }
5811
+
5812
+ var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');
5813
+
5814
+ while (++index < length) {
5815
+ var key = path[index];
5816
+
5817
+ // skip non-string keys (e.g., Symbols, numbers)
5818
+ if (typeof key !== 'string') {
5819
+ continue;
5820
+ }
5821
+
5822
+ // Always block "__proto__" anywhere in the path if it's not expected
5823
+ if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
5824
+ return false;
5825
+ }
5826
+
5827
+ // Block "constructor.prototype" chains
5828
+ if (key === 'constructor' &&
5829
+ (index + 1) < length &&
5830
+ typeof path[index + 1] === 'string' &&
5831
+ path[index + 1] === 'prototype') {
5832
+
5833
+ // Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')
5834
+ if (isRootPrimitive && index === 0) {
5835
+ continue;
5836
+ }
5837
+
5838
+ return false;
5839
+ }
5840
+ }
5841
+
5842
+ var obj = parent(object, path);
5843
+ return obj == null || delete obj[toKey(last(path))];
5805
5844
  }
5806
5845
 
5807
5846
  /**
@@ -18992,8 +19031,18 @@ var EditorToolModalWrapper = /*#__PURE__*/function (_React$Component) {
18992
19031
  var _proto = EditorToolModalWrapper.prototype;
18993
19032
  _proto.render = function render() {
18994
19033
  return /*#__PURE__*/React.createElement("div", {
18995
- className: "tools-side-bar"
18996
- }, /*#__PURE__*/React.createElement("button", {
19034
+ className: classNames('tools-side-bar', {
19035
+ 'tools-side-bar-expanded': this.props.isExpanded
19036
+ })
19037
+ }, this.props.name === 'filter-builder-modal' && /*#__PURE__*/React.createElement("button", {
19038
+ type: "button",
19039
+ className: "close expand-toggle",
19040
+ onClick: this.props.onToggleExpand
19041
+ }, /*#__PURE__*/React.createElement("span", {
19042
+ style: {
19043
+ color: "gray"
19044
+ }
19045
+ }, this.props.isExpanded ? "\xBB" : "\xAB")), /*#__PURE__*/React.createElement("button", {
18997
19046
  type: "button",
18998
19047
  className: "close",
18999
19048
  onClick: this.props.onClick
@@ -19271,6 +19320,7 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19271
19320
  isDownloadConfig: false,
19272
19321
  isCompareChanges: false,
19273
19322
  activeSideBar: 'schema-modal',
19323
+ isSideBarExpanded: false,
19274
19324
  showNewToolsHighlight: true
19275
19325
  };
19276
19326
  setTimeout(function () {
@@ -19278,6 +19328,7 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19278
19328
  showNewToolsHighlight: false
19279
19329
  });
19280
19330
  }, 10000);
19331
+ _this.toggleSideBarExpand = _this.toggleSideBarExpand.bind(_this);
19281
19332
  _this.input = '';
19282
19333
  _this.s3 = _this.props.fetchFileContentExt ? true : false;
19283
19334
  return _this;
@@ -19293,11 +19344,17 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19293
19344
  var _this2 = this;
19294
19345
  var sideBar = this.state.activeSideBar == name ? 'none' : name;
19295
19346
  this.setState({
19296
- activeSideBar: sideBar
19347
+ activeSideBar: sideBar,
19348
+ isSideBarExpanded: sideBar === 'none' ? false : this.state.isSideBarExpanded
19297
19349
  }, function () {
19298
19350
  _this2.props.setConfigContentPreSubmit();
19299
19351
  });
19300
19352
  };
19353
+ _proto.toggleSideBarExpand = function toggleSideBarExpand() {
19354
+ this.setState({
19355
+ isSideBarExpanded: !this.state.isSideBarExpanded
19356
+ });
19357
+ };
19301
19358
  _proto.hideUischemaModal = function hideUischemaModal() {
19302
19359
  this.setState({
19303
19360
  showUischemaModal: false
@@ -19487,7 +19544,8 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19487
19544
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
19488
19545
  className: classNames({
19489
19546
  'config-editor fe-header': true,
19490
- 'encryption-padding': this.state.activeSideBar != 'none'
19547
+ 'encryption-padding': this.state.activeSideBar != 'none' && !this.state.isSideBarExpanded,
19548
+ 'encryption-padding-expanded': this.state.activeSideBar != 'none' && this.state.isSideBarExpanded
19491
19549
  })
19492
19550
  }, /*#__PURE__*/React.createElement("header", {
19493
19551
  className: "top-header-offline"
@@ -19499,9 +19557,12 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19499
19557
  }
19500
19558
  }, /*#__PURE__*/React.createElement(EditorToolModalWrapper, {
19501
19559
  modal: modal.modal,
19560
+ name: modal.name,
19502
19561
  onClick: function onClick() {
19503
19562
  return _this6.subMenuBtnClick('none');
19504
- }
19563
+ },
19564
+ isExpanded: _this6.state.isSideBarExpanded,
19565
+ onToggleExpand: _this6.toggleSideBarExpand
19505
19566
  }));
19506
19567
  }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", null, editorConfigFiles.length == 0 && this.props.demoMode == false ? /*#__PURE__*/React.createElement("div", {
19507
19568
  className: "schema-loader-callout config-loader"
@@ -24018,16 +24079,24 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24018
24079
  var fileList = dbcData.filesWithoutPrefix.join(', ');
24019
24080
  this.props.showAlert("warning", "No valid CAN channel prefix found for: " + fileList + ". Specify the relevant channel via e.g. \"can1-\", \"can2-\" prefixes in the DBC file names.");
24020
24081
  }
24082
+ var validFileNames = dbcData.parsedFiles.filter(function (f) {
24083
+ return f.hasValidPrefix;
24084
+ }).map(function (f) {
24085
+ return f.filename;
24086
+ });
24021
24087
  this.setState({
24022
24088
  dbcData: dbcData,
24089
+ dbcFileNames: validFileNames,
24023
24090
  isLoading: false
24024
24091
  }, function () {
24025
24092
  _this5.mergeData();
24026
24093
  });
24027
- var validFiles = dbcData.parsedFiles.filter(function (f) {
24028
- return f.hasValidPrefix;
24029
- }).length;
24030
- this.props.showAlert("success", "Loaded " + validFiles + " DBC file(s) with valid prefix");
24094
+ var validFiles = validFileNames.length;
24095
+ if (validFiles === 0) {
24096
+ this.props.showAlert("warning", "Loaded 0 DBC file(s) with valid prefix - add a prefix such as 'can1-' or 'can2-' in order to use the DBC");
24097
+ } else {
24098
+ this.props.showAlert("success", "Loaded " + validFiles + " DBC file(s) with valid prefix");
24099
+ }
24031
24100
  } catch (e) {
24032
24101
  this.props.showAlert("danger", "Error parsing DBC files: " + e.message);
24033
24102
  this.setState({
@@ -24292,7 +24361,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24292
24361
  });
24293
24362
  };
24294
24363
  _proto.generateFilterConfig = function generateFilterConfig() {
24295
- var _this10 = this;
24364
+ var _this0 = this;
24296
24365
  var _this$state6 = this.state,
24297
24366
  mergedEntries = _this$state6.mergedEntries,
24298
24367
  groupJ1939Pgns = _this$state6.groupJ1939Pgns,
@@ -24336,8 +24405,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24336
24405
  } else {
24337
24406
  var count11Bit = 0;
24338
24407
  var count29Bit = 0;
24339
- for (var _iterator10 = _createForOfIteratorHelperLoose(entries), _step10; !(_step10 = _iterator10()).done;) {
24340
- var entry = _step10.value;
24408
+ for (var _iterator0 = _createForOfIteratorHelperLoose(entries), _step0; !(_step0 = _iterator0()).done;) {
24409
+ var entry = _step0.value;
24341
24410
  if (entry.isGroup && entry.groupedIds) {
24342
24411
  count29Bit += 1;
24343
24412
  } else if (entry.idInt > 0x7FF) {
@@ -24374,8 +24443,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24374
24443
  var configKey = channelToConfigKey[_channel];
24375
24444
  if (!configKey) continue;
24376
24445
  var filters = [];
24377
- for (var _iterator11 = _createForOfIteratorHelperLoose(_entries), _step11; !(_step11 = _iterator11()).done;) {
24378
- var _entry4 = _step11.value;
24446
+ for (var _iterator1 = _createForOfIteratorHelperLoose(_entries), _step1; !(_step1 = _iterator1()).done;) {
24447
+ var _entry4 = _step1.value;
24379
24448
  var prescaler_type = 0;
24380
24449
  var prescaler_value = undefined;
24381
24450
  var filterTypeValue = filterType === "rejection" ? 1 : 0;
@@ -24511,12 +24580,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24511
24580
  this.setState({
24512
24581
  generatedFilterConfig: filterConfig
24513
24582
  }, function () {
24514
- _this10.testMergedFile();
24583
+ _this0.testMergedFile();
24515
24584
  });
24516
24585
  return filterConfig;
24517
24586
  };
24518
24587
  _proto.testMergedFile = function testMergedFile() {
24519
- var _this11 = this;
24588
+ var _this1 = this;
24520
24589
  var _this$state7 = this.state,
24521
24590
  generatedFilterConfig = _this$state7.generatedFilterConfig,
24522
24591
  filterMergeMode = _this$state7.filterMergeMode;
@@ -24550,7 +24619,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24550
24619
  this.setState({
24551
24620
  mergedConfig: mergedConfigTemp
24552
24621
  }, function () {
24553
- var schemaContent = _this11.props.schemaContent;
24622
+ var schemaContent = _this1.props.schemaContent;
24554
24623
  if (schemaContent && mergedConfigTemp) {
24555
24624
  try {
24556
24625
  var ajv = new Ajv({
@@ -24563,12 +24632,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24563
24632
  if (!valid && validate.errors) {
24564
24633
  console.log("AJV validation errors:", validate.errors);
24565
24634
  }
24566
- _this11.setState({
24635
+ _this1.setState({
24567
24636
  mergedConfigValid: valid
24568
24637
  });
24569
24638
  } catch (e) {
24570
24639
  console.log("AJV compilation/validation exception:", e);
24571
- _this11.setState({
24640
+ _this1.setState({
24572
24641
  mergedConfigValid: false
24573
24642
  });
24574
24643
  }
@@ -24635,8 +24704,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24635
24704
  var existing11Bit = 0;
24636
24705
  var existing29Bit = 0;
24637
24706
  if (formData[_configKey] && formData[_configKey].filter && formData[_configKey].filter.id) {
24638
- for (var _iterator12 = _createForOfIteratorHelperLoose(formData[_configKey].filter.id), _step12; !(_step12 = _iterator12()).done;) {
24639
- var filter = _step12.value;
24707
+ for (var _iterator10 = _createForOfIteratorHelperLoose(formData[_configKey].filter.id), _step10; !(_step10 = _iterator10()).done;) {
24708
+ var filter = _step10.value;
24640
24709
  if (filter.id_format === 1) {
24641
24710
  existing29Bit++;
24642
24711
  } else {
@@ -24647,8 +24716,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24647
24716
  var new11Bit = 0;
24648
24717
  var new29Bit = 0;
24649
24718
  if (generatedFilterConfig[_configKey] && generatedFilterConfig[_configKey].filter && generatedFilterConfig[_configKey].filter.id) {
24650
- for (var _iterator13 = _createForOfIteratorHelperLoose(generatedFilterConfig[_configKey].filter.id), _step13; !(_step13 = _iterator13()).done;) {
24651
- var _filter3 = _step13.value;
24719
+ for (var _iterator11 = _createForOfIteratorHelperLoose(generatedFilterConfig[_configKey].filter.id), _step11; !(_step11 = _iterator11()).done;) {
24720
+ var _filter3 = _step11.value;
24652
24721
  if (_filter3.id_format === 1) {
24653
24722
  new29Bit++;
24654
24723
  } else {
@@ -24688,8 +24757,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24688
24757
  var filters = config.phy[channel].filter;
24689
24758
  var seen = new Set();
24690
24759
  var uniqueFilters = [];
24691
- for (var _iterator14 = _createForOfIteratorHelperLoose(filters), _step14; !(_step14 = _iterator14()).done;) {
24692
- var filter = _step14.value;
24760
+ for (var _iterator12 = _createForOfIteratorHelperLoose(filters), _step12; !(_step12 = _iterator12()).done;) {
24761
+ var filter = _step12.value;
24693
24762
  var fieldsWithoutName = _objectWithoutPropertiesLoose(filter, _excluded);
24694
24763
  var key = JSON.stringify(fieldsWithoutName);
24695
24764
  if (!seen.has(key)) {
@@ -24710,8 +24779,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24710
24779
  var _filters = config[_channel3].filter.id;
24711
24780
  var _seen = new Set();
24712
24781
  var _uniqueFilters = [];
24713
- for (var _iterator15 = _createForOfIteratorHelperLoose(_filters), _step15; !(_step15 = _iterator15()).done;) {
24714
- var _filter4 = _step15.value;
24782
+ for (var _iterator13 = _createForOfIteratorHelperLoose(_filters), _step13; !(_step13 = _iterator13()).done;) {
24783
+ var _filter4 = _step13.value;
24715
24784
  var _fieldsWithoutName = _objectWithoutPropertiesLoose(_filter4, _excluded2);
24716
24785
  var _key = JSON.stringify(_fieldsWithoutName);
24717
24786
  if (!_seen.has(_key)) {
@@ -24807,15 +24876,15 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24807
24876
  });
24808
24877
  };
24809
24878
  _proto.render = function render() {
24810
- var _this12 = this;
24811
- var _this$state10 = this.state,
24812
- csvFileName = _this$state10.csvFileName,
24813
- dbcFileNames = _this$state10.dbcFileNames,
24814
- csvData = _this$state10.csvData,
24815
- mergedEntries = _this$state10.mergedEntries,
24816
- searchQuery = _this$state10.searchQuery,
24817
- groupJ1939Pgns = _this$state10.groupJ1939Pgns,
24818
- isLoading = _this$state10.isLoading;
24879
+ var _this10 = this;
24880
+ var _this$state0 = this.state,
24881
+ csvFileName = _this$state0.csvFileName,
24882
+ dbcFileNames = _this$state0.dbcFileNames,
24883
+ csvData = _this$state0.csvData,
24884
+ mergedEntries = _this$state0.mergedEntries,
24885
+ searchQuery = _this$state0.searchQuery,
24886
+ groupJ1939Pgns = _this$state0.groupJ1939Pgns,
24887
+ isLoading = _this$state0.isLoading;
24819
24888
  var filteredEntries = this.getFilteredEntries();
24820
24889
  var allFilteredSelected = filteredEntries.length > 0 && filteredEntries.every(function (e) {
24821
24890
  return e.selected;
@@ -24846,7 +24915,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24846
24915
  }, /*#__PURE__*/React.createElement(Files, {
24847
24916
  onChange: this.handleCsvUpload,
24848
24917
  onError: function onError(error) {
24849
- return _this12.props.showAlert("danger", error.message);
24918
+ return _this10.props.showAlert("danger", error.message);
24850
24919
  },
24851
24920
  accepts: [".csv"],
24852
24921
  multiple: false,
@@ -24860,7 +24929,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24860
24929
  }, /*#__PURE__*/React.createElement(Files, {
24861
24930
  onChange: this.handleDbcUpload,
24862
24931
  onError: function onError(error) {
24863
- return _this12.props.showAlert("danger", error.message);
24932
+ return _this10.props.showAlert("danger", error.message);
24864
24933
  },
24865
24934
  accepts: [".dbc"],
24866
24935
  multiple: true,
@@ -24870,14 +24939,14 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24870
24939
  }, /*#__PURE__*/React.createElement("button", {
24871
24940
  className: "btn btn-primary"
24872
24941
  }, "Load DBC(s)"))), function () {
24873
- var isFirmwareSupported = _this12.isFirmwareVersionSupported();
24874
- var isCanmod = _this12.props.deviceType === "CANmod";
24875
- var isCanmodRouter = isCanmod && _this12.isCanmodRouter();
24942
+ var isFirmwareSupported = _this10.isFirmwareVersionSupported();
24943
+ var isCanmod = _this10.props.deviceType === "CANmod";
24944
+ var isCanmodRouter = isCanmod && _this10.isCanmodRouter();
24876
24945
  var isDeviceSupported = !isCanmod || isCanmodRouter;
24877
- var hasConfig = _this12.props.formData && Object.keys(_this12.props.formData).length > 0;
24946
+ var hasConfig = _this10.props.formData && Object.keys(_this10.props.formData).length > 0;
24878
24947
  return /*#__PURE__*/React.createElement("button", {
24879
24948
  className: "btn",
24880
- onClick: _this12.onReset,
24949
+ onClick: _this10.onReset,
24881
24950
  disabled: !hasConfig || !isFirmwareSupported || !isDeviceSupported,
24882
24951
  style: {
24883
24952
  backgroundColor: "#fff",
@@ -24911,10 +24980,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24911
24980
  type: "checkbox",
24912
24981
  checked: groupJ1939Pgns,
24913
24982
  onChange: function onChange() {
24914
- _this12.setState({
24983
+ _this10.setState({
24915
24984
  groupJ1939Pgns: !groupJ1939Pgns
24916
24985
  }, function () {
24917
- _this12.mergeData();
24986
+ _this10.mergeData();
24918
24987
  });
24919
24988
  },
24920
24989
  style: {
@@ -24924,7 +24993,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24924
24993
  }), "Group 29-bit IDs as PGNs"), /*#__PURE__*/React.createElement("p", {
24925
24994
  className: "field-description field-description-shift"
24926
24995
  }, "In J1939/ISOBUS/NMEA protocol use cases it can be relevant to evaluate messages at the 18-bit PGN level instead of the 29-bit ID level.")), csvData && function () {
24927
- var isEnabled = _this12.props.formData && _this12.isFirmwareVersionSupported();
24996
+ var isEnabled = _this10.props.formData && _this10.isFirmwareVersionSupported();
24928
24997
  return /*#__PURE__*/React.createElement("div", {
24929
24998
  className: "form-group pl0 field-string",
24930
24999
  style: {
@@ -24941,9 +25010,9 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24941
25010
  }
24942
25011
  }, /*#__PURE__*/React.createElement("input", {
24943
25012
  type: "checkbox",
24944
- checked: _this12.state.showFilteredSummary,
25013
+ checked: _this10.state.showFilteredSummary,
24945
25014
  onChange: function onChange() {
24946
- return _this12.toggleFilteredSummary();
25015
+ return _this10.toggleFilteredSummary();
24947
25016
  },
24948
25017
  disabled: !isEnabled,
24949
25018
  style: {
@@ -24992,10 +25061,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24992
25061
  }, label, ":"), /*#__PURE__*/React.createElement("input", {
24993
25062
  type: "text",
24994
25063
  className: "form-control encryption-input",
24995
- value: _this12.state["channelMap" + label],
25064
+ value: _this10.state["channelMap" + label],
24996
25065
  onChange: function onChange(e) {
24997
- var _this12$setState;
24998
- return _this12.setState((_this12$setState = {}, _this12$setState["channelMap" + label] = e.target.value, _this12$setState));
25066
+ var _this10$setState;
25067
+ return _this10.setState((_this10$setState = {}, _this10$setState["channelMap" + label] = e.target.value, _this10$setState));
24999
25068
  },
25000
25069
  style: {
25001
25070
  width: "36px",
@@ -25111,11 +25180,11 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25111
25180
  marginLeft: "8px"
25112
25181
  }
25113
25182
  }, "Signals")), filteredEntries.map(function (entry) {
25114
- var isChannelValid = _this12.props.deviceType === "CANmod" ? _this12.isChannelValid(entry.channel) : true;
25183
+ var isChannelValid = _this10.props.deviceType === "CANmod" ? _this10.isChannelValid(entry.channel) : true;
25115
25184
  return /*#__PURE__*/React.createElement("div", {
25116
25185
  key: entry.uniqueId,
25117
25186
  onClick: function onClick() {
25118
- return isChannelValid && _this12.handleEntryToggle(entry.uniqueId);
25187
+ return isChannelValid && _this10.handleEntryToggle(entry.uniqueId);
25119
25188
  },
25120
25189
  style: {
25121
25190
  display: "flex",
@@ -25143,7 +25212,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25143
25212
  checked: entry.selected,
25144
25213
  disabled: !isChannelValid,
25145
25214
  onChange: function onChange() {
25146
- return isChannelValid && _this12.handleEntryToggle(entry.uniqueId);
25215
+ return isChannelValid && _this10.handleEntryToggle(entry.uniqueId);
25147
25216
  }
25148
25217
  }), /*#__PURE__*/React.createElement("span", null))), /*#__PURE__*/React.createElement("span", {
25149
25218
  className: "binary-text-alt-2",
@@ -25180,7 +25249,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25180
25249
  display: "flex",
25181
25250
  alignItems: "center"
25182
25251
  }
25183
- }, _this12.renderBarChart(entry.isGroup ? entry.groupedPercentage : entry.percentage, maxPercentage), /*#__PURE__*/React.createElement("span", {
25252
+ }, _this10.renderBarChart(entry.isGroup ? entry.groupedPercentage : entry.percentage, maxPercentage), /*#__PURE__*/React.createElement("span", {
25184
25253
  style: {
25185
25254
  marginLeft: "4px",
25186
25255
  fontFamily: "monospace",
@@ -25271,7 +25340,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25271
25340
  marginLeft: "4px"
25272
25341
  },
25273
25342
  onClick: function onClick() {
25274
- return _this12.selectTop(30);
25343
+ return _this10.selectTop(30);
25275
25344
  }
25276
25345
  }, "Top 30"), /*#__PURE__*/React.createElement("span", {
25277
25346
  style: {
@@ -25284,7 +25353,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25284
25353
  cursor: "pointer"
25285
25354
  },
25286
25355
  onClick: function onClick() {
25287
- return _this12.selectTop(50);
25356
+ return _this10.selectTop(50);
25288
25357
  }
25289
25358
  }, "Top 50"), /*#__PURE__*/React.createElement("span", {
25290
25359
  style: {
@@ -25297,7 +25366,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25297
25366
  cursor: "pointer"
25298
25367
  },
25299
25368
  onClick: function onClick() {
25300
- return _this12.selectMatched(true);
25369
+ return _this10.selectMatched(true);
25301
25370
  }
25302
25371
  }, "Matched"), /*#__PURE__*/React.createElement("span", {
25303
25372
  style: {
@@ -25310,13 +25379,13 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25310
25379
  cursor: "pointer"
25311
25380
  },
25312
25381
  onClick: function onClick() {
25313
- return _this12.selectMatched(false);
25382
+ return _this10.selectMatched(false);
25314
25383
  }
25315
25384
  }, "Unmatched")), csvData && function () {
25316
- var activeCsvData = _this12.state.showFilteredSummary && _this12.state.filteredCsvData ? _this12.state.filteredCsvData : csvData;
25317
- var isFiltered = _this12.state.showFilteredSummary && _this12.state.filteredCsvData;
25318
- var originalFileSize = _this12.csvFileSize / (1024 * 1024);
25319
- var filteredFileSize = isFiltered ? originalFileSize * (1 - _this12.state.filterReductionPercent / 100) : originalFileSize;
25385
+ var activeCsvData = _this10.state.showFilteredSummary && _this10.state.filteredCsvData ? _this10.state.filteredCsvData : csvData;
25386
+ var isFiltered = _this10.state.showFilteredSummary && _this10.state.filteredCsvData;
25387
+ var originalFileSize = _this10.csvFileSize / (1024 * 1024);
25388
+ var filteredFileSize = isFiltered ? originalFileSize * (1 - _this10.state.filterReductionPercent / 100) : originalFileSize;
25320
25389
  return /*#__PURE__*/React.createElement("div", {
25321
25390
  style: {
25322
25391
  fontSize: "12px",
@@ -25343,7 +25412,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25343
25412
  color: "#5cb85c",
25344
25413
  marginTop: "4px"
25345
25414
  }
25346
- }, "Showing filtered summary (reduction: ", /*#__PURE__*/React.createElement("strong", null, _this12.state.filterReductionPercent.toFixed(1), "%"), ")"));
25415
+ }, "Showing filtered summary (reduction: ", /*#__PURE__*/React.createElement("strong", null, _this10.state.filterReductionPercent.toFixed(1), "%"), ")"));
25347
25416
  }(), function () {
25348
25417
  var hasSelection = mergedEntries.some(function (e) {
25349
25418
  return e.selected;
@@ -25369,10 +25438,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25369
25438
  }, /*#__PURE__*/React.createElement("div", {
25370
25439
  className: "col-xs-6",
25371
25440
  style: {
25372
- opacity: _this12.props.deviceType === "CANmod" ? 0.5 : 1,
25373
- pointerEvents: _this12.props.deviceType === "CANmod" ? "none" : "auto"
25441
+ opacity: _this10.props.deviceType === "CANmod" ? 0.5 : 1,
25442
+ pointerEvents: _this10.props.deviceType === "CANmod" ? "none" : "auto"
25374
25443
  },
25375
- title: _this12.props.deviceType === "CANmod" ? "CANmod only supports acceptance filters" : ""
25444
+ title: _this10.props.deviceType === "CANmod" ? "CANmod only supports acceptance filters" : ""
25376
25445
  }, /*#__PURE__*/React.createElement(SimpleDropdown, {
25377
25446
  name: "Type",
25378
25447
  options: [{
@@ -25382,53 +25451,53 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25382
25451
  value: "rejection",
25383
25452
  label: "Rejection"
25384
25453
  }],
25385
- value: _this12.state.filterType,
25454
+ value: _this10.state.filterType,
25386
25455
  onChange: function onChange(opt) {
25387
- return _this12.setState({
25456
+ return _this10.setState({
25388
25457
  filterType: opt.value
25389
25458
  }, function () {
25390
- return _this12.generateFilterConfig();
25459
+ return _this10.generateFilterConfig();
25391
25460
  });
25392
25461
  }
25393
- })), _this12.state.filterType === "acceptance" && /*#__PURE__*/React.createElement("div", {
25462
+ })), _this10.state.filterType === "acceptance" && /*#__PURE__*/React.createElement("div", {
25394
25463
  className: "col-xs-6"
25395
25464
  }, /*#__PURE__*/React.createElement(SimpleDropdown, {
25396
25465
  name: "Prescaler",
25397
25466
  options: prescalerOptions,
25398
- value: _this12.state.prescalerType,
25467
+ value: _this10.state.prescalerType,
25399
25468
  onChange: function onChange(opt) {
25400
- return _this12.setState({
25469
+ return _this10.setState({
25401
25470
  prescalerType: opt.value
25402
25471
  }, function () {
25403
- return _this12.generateFilterConfig();
25472
+ return _this10.generateFilterConfig();
25404
25473
  });
25405
25474
  }
25406
- }))), _this12.state.filterType === "acceptance" && _this12.state.prescalerType !== "none" && /*#__PURE__*/React.createElement("div", {
25475
+ }))), _this10.state.filterType === "acceptance" && _this10.state.prescalerType !== "none" && /*#__PURE__*/React.createElement("div", {
25407
25476
  className: "form-group pl0 field-string"
25408
- }, _this12.state.prescalerType === "count" && "Count value", _this12.state.prescalerType === "time" && "Time interval (ms)", _this12.state.prescalerType === "data" && "Data mask (hex)", (_this12.state.prescalerType === "count" || _this12.state.prescalerType === "time") && /*#__PURE__*/React.createElement("input", {
25477
+ }, _this10.state.prescalerType === "count" && "Count value", _this10.state.prescalerType === "time" && "Time interval (ms)", _this10.state.prescalerType === "data" && "Data mask (hex)", (_this10.state.prescalerType === "count" || _this10.state.prescalerType === "time") && /*#__PURE__*/React.createElement("input", {
25409
25478
  type: "number",
25410
25479
  className: "form-control encryption-input",
25411
25480
  min: "1",
25412
- max: _this12.state.prescalerType === "count" ? 256 : 4194304,
25413
- value: _this12.state.prescalerValue,
25481
+ max: _this10.state.prescalerType === "count" ? 256 : 4194304,
25482
+ value: _this10.state.prescalerValue,
25414
25483
  onChange: function onChange(e) {
25415
- return _this12.setState({
25484
+ return _this10.setState({
25416
25485
  prescalerValue: parseInt(e.target.value) || 1
25417
25486
  }, function () {
25418
- return _this12.generateFilterConfig();
25487
+ return _this10.generateFilterConfig();
25419
25488
  });
25420
25489
  }
25421
- }), _this12.state.prescalerType === "data" && /*#__PURE__*/React.createElement("input", {
25490
+ }), _this10.state.prescalerType === "data" && /*#__PURE__*/React.createElement("input", {
25422
25491
  type: "text",
25423
25492
  className: "form-control encryption-input",
25424
- value: _this12.state.dataPrescalerMask,
25493
+ value: _this10.state.dataPrescalerMask,
25425
25494
  onChange: function onChange(e) {
25426
25495
  var val = e.target.value.toUpperCase();
25427
25496
  if (/^[a-fA-F0-9]*$/.test(val) && val.length <= 16) {
25428
- _this12.setState({
25497
+ _this10.setState({
25429
25498
  dataPrescalerMask: val
25430
25499
  }, function () {
25431
- return _this12.generateFilterConfig();
25500
+ return _this10.generateFilterConfig();
25432
25501
  });
25433
25502
  }
25434
25503
  },
@@ -25439,7 +25508,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25439
25508
  }
25440
25509
  }), /*#__PURE__*/React.createElement("span", {
25441
25510
  className: "field-description field-description-shift"
25442
- }, _this12.state.prescalerType === "count" && "Accept every Nth message (1-256)", _this12.state.prescalerType === "time" && "Minimum time between messages (1-4194304 ms)", _this12.state.prescalerType === "data" && "Hex mask for data change detection")), /*#__PURE__*/React.createElement("div", {
25511
+ }, _this10.state.prescalerType === "count" && "Accept every Nth message (1-256)", _this10.state.prescalerType === "time" && "Minimum time between messages (1-4194304 ms)", _this10.state.prescalerType === "data" && "Hex mask for data change detection")), /*#__PURE__*/React.createElement("div", {
25443
25512
  className: "form-group pl0 field-string",
25444
25513
  style: {
25445
25514
  marginBottom: "10px"
@@ -25462,12 +25531,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25462
25531
  type: "radio",
25463
25532
  name: "filterMergeMode",
25464
25533
  value: "replace",
25465
- checked: _this12.state.filterMergeMode === "replace",
25534
+ checked: _this10.state.filterMergeMode === "replace",
25466
25535
  onChange: function onChange(e) {
25467
- return _this12.setState({
25536
+ return _this10.setState({
25468
25537
  filterMergeMode: e.target.value
25469
25538
  }, function () {
25470
- return _this12.generateFilterConfig();
25539
+ return _this10.generateFilterConfig();
25471
25540
  });
25472
25541
  },
25473
25542
  style: {
@@ -25490,12 +25559,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25490
25559
  type: "radio",
25491
25560
  name: "filterMergeMode",
25492
25561
  value: "append_top",
25493
- checked: _this12.state.filterMergeMode === "append_top",
25562
+ checked: _this10.state.filterMergeMode === "append_top",
25494
25563
  onChange: function onChange(e) {
25495
- return _this12.setState({
25564
+ return _this10.setState({
25496
25565
  filterMergeMode: e.target.value
25497
25566
  }, function () {
25498
- return _this12.generateFilterConfig();
25567
+ return _this10.generateFilterConfig();
25499
25568
  });
25500
25569
  },
25501
25570
  style: {
@@ -25518,12 +25587,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25518
25587
  type: "radio",
25519
25588
  name: "filterMergeMode",
25520
25589
  value: "append_bottom",
25521
- checked: _this12.state.filterMergeMode === "append_bottom",
25590
+ checked: _this10.state.filterMergeMode === "append_bottom",
25522
25591
  onChange: function onChange(e) {
25523
- return _this12.setState({
25592
+ return _this10.setState({
25524
25593
  filterMergeMode: e.target.value
25525
25594
  }, function () {
25526
- return _this12.generateFilterConfig();
25595
+ return _this10.generateFilterConfig();
25527
25596
  });
25528
25597
  },
25529
25598
  style: {
@@ -25559,9 +25628,9 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25559
25628
  }, 0);
25560
25629
  return " (" + count11Bit + " 11-bit, " + count29Bit + " 29-bit) | " + sizePercent.toFixed(1) + "%";
25561
25630
  }()), function () {
25562
- var isFirmwareSupported = _this12.isFirmwareVersionSupported();
25563
- var isCanmod = _this12.props.deviceType === "CANmod";
25564
- var isCanmodRouter = isCanmod && _this12.isCanmodRouter();
25631
+ var isFirmwareSupported = _this10.isFirmwareVersionSupported();
25632
+ var isCanmod = _this10.props.deviceType === "CANmod";
25633
+ var isCanmodRouter = isCanmod && _this10.isCanmodRouter();
25565
25634
  var minFirmware = isCanmod ? MIN_FIRMWARE_CANMOD_ROUTER : MIN_FIRMWARE_CANEDGE;
25566
25635
  var isDeviceSupported = !isCanmod || isCanmodRouter;
25567
25636
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
@@ -25572,25 +25641,25 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25572
25641
  }
25573
25642
  }, /*#__PURE__*/React.createElement("button", {
25574
25643
  className: "btn btn-primary",
25575
- onClick: _this12.onMerge,
25576
- disabled: !_this12.props.formData || Object.keys(_this12.props.formData).length === 0 || _this12.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported
25644
+ onClick: _this10.onMerge,
25645
+ disabled: !_this10.props.formData || Object.keys(_this10.props.formData).length === 0 || _this10.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported
25577
25646
  }, "Merge files"), /*#__PURE__*/React.createElement("button", {
25578
25647
  className: "btn btn-default",
25579
- onClick: _this12.onDownload,
25580
- disabled: Object.keys(_this12.state.generatedFilterConfig).length === 0
25648
+ onClick: _this10.onDownload,
25649
+ disabled: Object.keys(_this10.state.generatedFilterConfig).length === 0
25581
25650
  }, "Download JSON")), function () {
25582
- var mergeDisabled = !_this12.props.formData || Object.keys(_this12.props.formData).length === 0 || _this12.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported;
25651
+ var mergeDisabled = !_this10.props.formData || Object.keys(_this10.props.formData).length === 0 || _this10.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported;
25583
25652
  if (!mergeDisabled) return null;
25584
25653
  var reason = "";
25585
- if (!_this12.props.formData || Object.keys(_this12.props.formData).length === 0) {
25654
+ if (!_this10.props.formData || Object.keys(_this10.props.formData).length === 0) {
25586
25655
  reason = "No configuration file loaded";
25587
25656
  } else if (!isDeviceSupported) {
25588
25657
  reason = "Only CANmod.router is supported for CANmod devices";
25589
25658
  } else if (!isFirmwareSupported) {
25590
25659
  reason = "Merging requires firmware " + minFirmware + ".XX+ - please update your device";
25591
- } else if (_this12.state.mergedConfigValid === "Unknown") {
25660
+ } else if (_this10.state.mergedConfigValid === "Unknown") {
25592
25661
  reason = "No filters selected";
25593
- } else if (_this12.state.mergedConfigValid === false) {
25662
+ } else if (_this10.state.mergedConfigValid === false) {
25594
25663
  reason = "Generated filter configuration is invalid";
25595
25664
  }
25596
25665
  return reason ? /*#__PURE__*/React.createElement("div", {
@@ -25601,7 +25670,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25601
25670
  }
25602
25671
  }, reason) : null;
25603
25672
  }());
25604
- }(), Object.keys(_this12.state.generatedFilterConfig).length > 0 && /*#__PURE__*/React.createElement("div", {
25673
+ }(), Object.keys(_this10.state.generatedFilterConfig).length > 0 && /*#__PURE__*/React.createElement("div", {
25605
25674
  style: {
25606
25675
  marginTop: "10px"
25607
25676
  }
@@ -25614,17 +25683,17 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25614
25683
  }
25615
25684
  }, /*#__PURE__*/React.createElement("input", {
25616
25685
  type: "checkbox",
25617
- checked: _this12.state.showFilterPreview,
25686
+ checked: _this10.state.showFilterPreview,
25618
25687
  onChange: function onChange() {
25619
- return _this12.setState({
25620
- showFilterPreview: !_this12.state.showFilterPreview
25688
+ return _this10.setState({
25689
+ showFilterPreview: !_this10.state.showFilterPreview
25621
25690
  });
25622
25691
  },
25623
25692
  style: {
25624
25693
  marginRight: "6px",
25625
25694
  marginBottom: "4px"
25626
25695
  }
25627
- }), "Show partial config preview"), _this12.state.showFilterPreview && /*#__PURE__*/React.createElement("div", {
25696
+ }), "Show partial config preview"), _this10.state.showFilterPreview && /*#__PURE__*/React.createElement("div", {
25628
25697
  style: {
25629
25698
  marginTop: "10px"
25630
25699
  }
@@ -25635,7 +25704,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25635
25704
  overflow: "auto",
25636
25705
  fontSize: "11px"
25637
25706
  }
25638
- }, JSON.stringify(_this12.state.generatedFilterConfig, null, 2)))));
25707
+ }, JSON.stringify(_this10.state.generatedFilterConfig, null, 2)))));
25639
25708
  }()), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null)));
25640
25709
  };
25641
25710
  return FilterBuilderTool;