config-editor-base 3.0.4 → 3.0.6

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"
@@ -21757,6 +21818,8 @@ function parseSupportedPids(csvContent) {
21757
21818
  var SUPPORTED_PIDS_QUERY_VALUES = [0x00, 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0];
21758
21819
  var protocolsDetected = new Set();
21759
21820
  var supportedPidsSet = new Set();
21821
+ var foundSupportedPidQueries = new Set();
21822
+ var rangesIndicatingMore = new Set();
21760
21823
  for (var _iterator = _createForOfIteratorHelperLoose(relevantResponses), _step; !(_step = _iterator()).done;) {
21761
21824
  var frame = _step.value;
21762
21825
  var data = frame.dataBytes.toUpperCase();
@@ -21765,16 +21828,40 @@ function parseSupportedPids(csvContent) {
21765
21828
  var pidRangeStart = parseInt(data.substring(4, 6), 16);
21766
21829
  if (!SUPPORTED_PIDS_QUERY_VALUES.includes(pidRangeStart)) continue;
21767
21830
  protocolsDetected.add('OBD2');
21831
+ foundSupportedPidQueries.add(pidRangeStart);
21768
21832
  var supportBits = data.substring(6, 14);
21833
+ var bitmapValue = parseInt(supportBits, 16);
21834
+ if (bitmapValue & 1) {
21835
+ rangesIndicatingMore.add(pidRangeStart);
21836
+ }
21769
21837
  extractSupportedPidsFromBitmap(pidRangeStart, supportBits, supportedPidsSet);
21770
21838
  } else if (data.substring(2, 6) === '62F4') {
21771
21839
  var _pidRangeStart = parseInt(data.substring(6, 8), 16);
21772
21840
  if (!SUPPORTED_PIDS_QUERY_VALUES.includes(_pidRangeStart)) continue;
21773
21841
  protocolsDetected.add('WWH-OBD');
21842
+ foundSupportedPidQueries.add(_pidRangeStart);
21774
21843
  var _supportBits = data.substring(8, 16);
21844
+ var _bitmapValue = parseInt(_supportBits, 16);
21845
+ if (_bitmapValue & 1) {
21846
+ rangesIndicatingMore.add(_pidRangeStart);
21847
+ }
21775
21848
  extractSupportedPidsFromBitmap(_pidRangeStart, _supportBits, supportedPidsSet);
21776
21849
  }
21777
21850
  }
21851
+ var missingSupportedPidQueries = [];
21852
+ if (foundSupportedPidQueries.size > 0) {
21853
+ if (!foundSupportedPidQueries.has(0x00)) {
21854
+ missingSupportedPidQueries.push('00');
21855
+ }
21856
+ var rangeChain = [0x00, 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0];
21857
+ for (var i = 0; i < rangeChain.length - 1; i++) {
21858
+ var currentRange = rangeChain[i];
21859
+ var nextRange = rangeChain[i + 1];
21860
+ if (rangesIndicatingMore.has(currentRange) && !foundSupportedPidQueries.has(nextRange)) {
21861
+ missingSupportedPidQueries.push(nextRange.toString(16).toUpperCase().padStart(2, '0'));
21862
+ }
21863
+ }
21864
+ }
21778
21865
  var hasMixedProtocols = protocolsDetected.size > 1;
21779
21866
  var protocol = protocolsDetected.size > 0 ? Array.from(protocolsDetected)[0] : null;
21780
21867
  var supportedPids = Array.from(supportedPidsSet).sort(function (a, b) {
@@ -21793,7 +21880,8 @@ function parseSupportedPids(csvContent) {
21793
21880
  hasMixedProtocols: hasMixedProtocols,
21794
21881
  allProtocolsDetected: Array.from(protocolsDetected),
21795
21882
  obd11BitCount: obd11BitResponses.length,
21796
- obd29BitCount: obd29BitResponses.length
21883
+ obd29BitCount: obd29BitResponses.length,
21884
+ missingSupportedPidQueries: missingSupportedPidQueries
21797
21885
  };
21798
21886
  }
21799
21887
  function extractSupportedPidsFromBitmap(rangeStart, bitmapHex, supportedSet) {
@@ -22074,7 +22162,13 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
22074
22162
  stateUpdate.mixedWarning = null;
22075
22163
  }
22076
22164
  this.setState(stateUpdate);
22077
- this.props.showAlert("success", "Loaded " + result.totalFrames + " frames");
22165
+ var responseId = result.canIdType === '29bit' ? '18DAF1XX' : '7E8';
22166
+ var baseMessage = "Loaded " + result.totalFrames + " frames: " + result.supportedPids.length + " PIDs are supported with response CAN ID " + responseId + " and protocol " + (result.protocol || 'Unknown') + ".";
22167
+ if (result.missingSupportedPidQueries && result.missingSupportedPidQueries.length > 0) {
22168
+ this.props.showAlert("warning", baseMessage + "\n\nWarning: No response data was found for the following 'supported PID' PIDs: " + result.missingSupportedPidQueries.join(', ') + ".\n\nTo properly evaluate supported PIDs, use the mode 'Identify supported PIDs' to create your evaluation Configuration File.");
22169
+ } else {
22170
+ this.props.showAlert("success", baseMessage);
22171
+ }
22078
22172
  } catch (e) {
22079
22173
  this.props.showAlert("danger", "Error parsing CSV file: " + e.message);
22080
22174
  }
@@ -24259,7 +24353,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24259
24353
  });
24260
24354
  };
24261
24355
  _proto.generateFilterConfig = function generateFilterConfig() {
24262
- var _this10 = this;
24356
+ var _this0 = this;
24263
24357
  var _this$state6 = this.state,
24264
24358
  mergedEntries = _this$state6.mergedEntries,
24265
24359
  groupJ1939Pgns = _this$state6.groupJ1939Pgns,
@@ -24303,8 +24397,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24303
24397
  } else {
24304
24398
  var count11Bit = 0;
24305
24399
  var count29Bit = 0;
24306
- for (var _iterator10 = _createForOfIteratorHelperLoose(entries), _step10; !(_step10 = _iterator10()).done;) {
24307
- var entry = _step10.value;
24400
+ for (var _iterator0 = _createForOfIteratorHelperLoose(entries), _step0; !(_step0 = _iterator0()).done;) {
24401
+ var entry = _step0.value;
24308
24402
  if (entry.isGroup && entry.groupedIds) {
24309
24403
  count29Bit += 1;
24310
24404
  } else if (entry.idInt > 0x7FF) {
@@ -24341,8 +24435,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24341
24435
  var configKey = channelToConfigKey[_channel];
24342
24436
  if (!configKey) continue;
24343
24437
  var filters = [];
24344
- for (var _iterator11 = _createForOfIteratorHelperLoose(_entries), _step11; !(_step11 = _iterator11()).done;) {
24345
- var _entry4 = _step11.value;
24438
+ for (var _iterator1 = _createForOfIteratorHelperLoose(_entries), _step1; !(_step1 = _iterator1()).done;) {
24439
+ var _entry4 = _step1.value;
24346
24440
  var prescaler_type = 0;
24347
24441
  var prescaler_value = undefined;
24348
24442
  var filterTypeValue = filterType === "rejection" ? 1 : 0;
@@ -24478,12 +24572,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24478
24572
  this.setState({
24479
24573
  generatedFilterConfig: filterConfig
24480
24574
  }, function () {
24481
- _this10.testMergedFile();
24575
+ _this0.testMergedFile();
24482
24576
  });
24483
24577
  return filterConfig;
24484
24578
  };
24485
24579
  _proto.testMergedFile = function testMergedFile() {
24486
- var _this11 = this;
24580
+ var _this1 = this;
24487
24581
  var _this$state7 = this.state,
24488
24582
  generatedFilterConfig = _this$state7.generatedFilterConfig,
24489
24583
  filterMergeMode = _this$state7.filterMergeMode;
@@ -24517,7 +24611,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24517
24611
  this.setState({
24518
24612
  mergedConfig: mergedConfigTemp
24519
24613
  }, function () {
24520
- var schemaContent = _this11.props.schemaContent;
24614
+ var schemaContent = _this1.props.schemaContent;
24521
24615
  if (schemaContent && mergedConfigTemp) {
24522
24616
  try {
24523
24617
  var ajv = new Ajv({
@@ -24530,12 +24624,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24530
24624
  if (!valid && validate.errors) {
24531
24625
  console.log("AJV validation errors:", validate.errors);
24532
24626
  }
24533
- _this11.setState({
24627
+ _this1.setState({
24534
24628
  mergedConfigValid: valid
24535
24629
  });
24536
24630
  } catch (e) {
24537
24631
  console.log("AJV compilation/validation exception:", e);
24538
- _this11.setState({
24632
+ _this1.setState({
24539
24633
  mergedConfigValid: false
24540
24634
  });
24541
24635
  }
@@ -24602,8 +24696,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24602
24696
  var existing11Bit = 0;
24603
24697
  var existing29Bit = 0;
24604
24698
  if (formData[_configKey] && formData[_configKey].filter && formData[_configKey].filter.id) {
24605
- for (var _iterator12 = _createForOfIteratorHelperLoose(formData[_configKey].filter.id), _step12; !(_step12 = _iterator12()).done;) {
24606
- var filter = _step12.value;
24699
+ for (var _iterator10 = _createForOfIteratorHelperLoose(formData[_configKey].filter.id), _step10; !(_step10 = _iterator10()).done;) {
24700
+ var filter = _step10.value;
24607
24701
  if (filter.id_format === 1) {
24608
24702
  existing29Bit++;
24609
24703
  } else {
@@ -24614,8 +24708,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24614
24708
  var new11Bit = 0;
24615
24709
  var new29Bit = 0;
24616
24710
  if (generatedFilterConfig[_configKey] && generatedFilterConfig[_configKey].filter && generatedFilterConfig[_configKey].filter.id) {
24617
- for (var _iterator13 = _createForOfIteratorHelperLoose(generatedFilterConfig[_configKey].filter.id), _step13; !(_step13 = _iterator13()).done;) {
24618
- var _filter3 = _step13.value;
24711
+ for (var _iterator11 = _createForOfIteratorHelperLoose(generatedFilterConfig[_configKey].filter.id), _step11; !(_step11 = _iterator11()).done;) {
24712
+ var _filter3 = _step11.value;
24619
24713
  if (_filter3.id_format === 1) {
24620
24714
  new29Bit++;
24621
24715
  } else {
@@ -24655,8 +24749,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24655
24749
  var filters = config.phy[channel].filter;
24656
24750
  var seen = new Set();
24657
24751
  var uniqueFilters = [];
24658
- for (var _iterator14 = _createForOfIteratorHelperLoose(filters), _step14; !(_step14 = _iterator14()).done;) {
24659
- var filter = _step14.value;
24752
+ for (var _iterator12 = _createForOfIteratorHelperLoose(filters), _step12; !(_step12 = _iterator12()).done;) {
24753
+ var filter = _step12.value;
24660
24754
  var fieldsWithoutName = _objectWithoutPropertiesLoose(filter, _excluded);
24661
24755
  var key = JSON.stringify(fieldsWithoutName);
24662
24756
  if (!seen.has(key)) {
@@ -24677,8 +24771,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24677
24771
  var _filters = config[_channel3].filter.id;
24678
24772
  var _seen = new Set();
24679
24773
  var _uniqueFilters = [];
24680
- for (var _iterator15 = _createForOfIteratorHelperLoose(_filters), _step15; !(_step15 = _iterator15()).done;) {
24681
- var _filter4 = _step15.value;
24774
+ for (var _iterator13 = _createForOfIteratorHelperLoose(_filters), _step13; !(_step13 = _iterator13()).done;) {
24775
+ var _filter4 = _step13.value;
24682
24776
  var _fieldsWithoutName = _objectWithoutPropertiesLoose(_filter4, _excluded2);
24683
24777
  var _key = JSON.stringify(_fieldsWithoutName);
24684
24778
  if (!_seen.has(_key)) {
@@ -24774,15 +24868,15 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24774
24868
  });
24775
24869
  };
24776
24870
  _proto.render = function render() {
24777
- var _this12 = this;
24778
- var _this$state10 = this.state,
24779
- csvFileName = _this$state10.csvFileName,
24780
- dbcFileNames = _this$state10.dbcFileNames,
24781
- csvData = _this$state10.csvData,
24782
- mergedEntries = _this$state10.mergedEntries,
24783
- searchQuery = _this$state10.searchQuery,
24784
- groupJ1939Pgns = _this$state10.groupJ1939Pgns,
24785
- isLoading = _this$state10.isLoading;
24871
+ var _this10 = this;
24872
+ var _this$state0 = this.state,
24873
+ csvFileName = _this$state0.csvFileName,
24874
+ dbcFileNames = _this$state0.dbcFileNames,
24875
+ csvData = _this$state0.csvData,
24876
+ mergedEntries = _this$state0.mergedEntries,
24877
+ searchQuery = _this$state0.searchQuery,
24878
+ groupJ1939Pgns = _this$state0.groupJ1939Pgns,
24879
+ isLoading = _this$state0.isLoading;
24786
24880
  var filteredEntries = this.getFilteredEntries();
24787
24881
  var allFilteredSelected = filteredEntries.length > 0 && filteredEntries.every(function (e) {
24788
24882
  return e.selected;
@@ -24813,7 +24907,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24813
24907
  }, /*#__PURE__*/React.createElement(Files, {
24814
24908
  onChange: this.handleCsvUpload,
24815
24909
  onError: function onError(error) {
24816
- return _this12.props.showAlert("danger", error.message);
24910
+ return _this10.props.showAlert("danger", error.message);
24817
24911
  },
24818
24912
  accepts: [".csv"],
24819
24913
  multiple: false,
@@ -24827,7 +24921,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24827
24921
  }, /*#__PURE__*/React.createElement(Files, {
24828
24922
  onChange: this.handleDbcUpload,
24829
24923
  onError: function onError(error) {
24830
- return _this12.props.showAlert("danger", error.message);
24924
+ return _this10.props.showAlert("danger", error.message);
24831
24925
  },
24832
24926
  accepts: [".dbc"],
24833
24927
  multiple: true,
@@ -24837,14 +24931,14 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24837
24931
  }, /*#__PURE__*/React.createElement("button", {
24838
24932
  className: "btn btn-primary"
24839
24933
  }, "Load DBC(s)"))), function () {
24840
- var isFirmwareSupported = _this12.isFirmwareVersionSupported();
24841
- var isCanmod = _this12.props.deviceType === "CANmod";
24842
- var isCanmodRouter = isCanmod && _this12.isCanmodRouter();
24934
+ var isFirmwareSupported = _this10.isFirmwareVersionSupported();
24935
+ var isCanmod = _this10.props.deviceType === "CANmod";
24936
+ var isCanmodRouter = isCanmod && _this10.isCanmodRouter();
24843
24937
  var isDeviceSupported = !isCanmod || isCanmodRouter;
24844
- var hasConfig = _this12.props.formData && Object.keys(_this12.props.formData).length > 0;
24938
+ var hasConfig = _this10.props.formData && Object.keys(_this10.props.formData).length > 0;
24845
24939
  return /*#__PURE__*/React.createElement("button", {
24846
24940
  className: "btn",
24847
- onClick: _this12.onReset,
24941
+ onClick: _this10.onReset,
24848
24942
  disabled: !hasConfig || !isFirmwareSupported || !isDeviceSupported,
24849
24943
  style: {
24850
24944
  backgroundColor: "#fff",
@@ -24878,10 +24972,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24878
24972
  type: "checkbox",
24879
24973
  checked: groupJ1939Pgns,
24880
24974
  onChange: function onChange() {
24881
- _this12.setState({
24975
+ _this10.setState({
24882
24976
  groupJ1939Pgns: !groupJ1939Pgns
24883
24977
  }, function () {
24884
- _this12.mergeData();
24978
+ _this10.mergeData();
24885
24979
  });
24886
24980
  },
24887
24981
  style: {
@@ -24891,7 +24985,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24891
24985
  }), "Group 29-bit IDs as PGNs"), /*#__PURE__*/React.createElement("p", {
24892
24986
  className: "field-description field-description-shift"
24893
24987
  }, "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 () {
24894
- var isEnabled = _this12.props.formData && _this12.isFirmwareVersionSupported();
24988
+ var isEnabled = _this10.props.formData && _this10.isFirmwareVersionSupported();
24895
24989
  return /*#__PURE__*/React.createElement("div", {
24896
24990
  className: "form-group pl0 field-string",
24897
24991
  style: {
@@ -24908,9 +25002,9 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24908
25002
  }
24909
25003
  }, /*#__PURE__*/React.createElement("input", {
24910
25004
  type: "checkbox",
24911
- checked: _this12.state.showFilteredSummary,
25005
+ checked: _this10.state.showFilteredSummary,
24912
25006
  onChange: function onChange() {
24913
- return _this12.toggleFilteredSummary();
25007
+ return _this10.toggleFilteredSummary();
24914
25008
  },
24915
25009
  disabled: !isEnabled,
24916
25010
  style: {
@@ -24959,10 +25053,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24959
25053
  }, label, ":"), /*#__PURE__*/React.createElement("input", {
24960
25054
  type: "text",
24961
25055
  className: "form-control encryption-input",
24962
- value: _this12.state["channelMap" + label],
25056
+ value: _this10.state["channelMap" + label],
24963
25057
  onChange: function onChange(e) {
24964
- var _this12$setState;
24965
- return _this12.setState((_this12$setState = {}, _this12$setState["channelMap" + label] = e.target.value, _this12$setState));
25058
+ var _this10$setState;
25059
+ return _this10.setState((_this10$setState = {}, _this10$setState["channelMap" + label] = e.target.value, _this10$setState));
24966
25060
  },
24967
25061
  style: {
24968
25062
  width: "36px",
@@ -25078,11 +25172,11 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25078
25172
  marginLeft: "8px"
25079
25173
  }
25080
25174
  }, "Signals")), filteredEntries.map(function (entry) {
25081
- var isChannelValid = _this12.props.deviceType === "CANmod" ? _this12.isChannelValid(entry.channel) : true;
25175
+ var isChannelValid = _this10.props.deviceType === "CANmod" ? _this10.isChannelValid(entry.channel) : true;
25082
25176
  return /*#__PURE__*/React.createElement("div", {
25083
25177
  key: entry.uniqueId,
25084
25178
  onClick: function onClick() {
25085
- return isChannelValid && _this12.handleEntryToggle(entry.uniqueId);
25179
+ return isChannelValid && _this10.handleEntryToggle(entry.uniqueId);
25086
25180
  },
25087
25181
  style: {
25088
25182
  display: "flex",
@@ -25110,7 +25204,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25110
25204
  checked: entry.selected,
25111
25205
  disabled: !isChannelValid,
25112
25206
  onChange: function onChange() {
25113
- return isChannelValid && _this12.handleEntryToggle(entry.uniqueId);
25207
+ return isChannelValid && _this10.handleEntryToggle(entry.uniqueId);
25114
25208
  }
25115
25209
  }), /*#__PURE__*/React.createElement("span", null))), /*#__PURE__*/React.createElement("span", {
25116
25210
  className: "binary-text-alt-2",
@@ -25147,7 +25241,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25147
25241
  display: "flex",
25148
25242
  alignItems: "center"
25149
25243
  }
25150
- }, _this12.renderBarChart(entry.isGroup ? entry.groupedPercentage : entry.percentage, maxPercentage), /*#__PURE__*/React.createElement("span", {
25244
+ }, _this10.renderBarChart(entry.isGroup ? entry.groupedPercentage : entry.percentage, maxPercentage), /*#__PURE__*/React.createElement("span", {
25151
25245
  style: {
25152
25246
  marginLeft: "4px",
25153
25247
  fontFamily: "monospace",
@@ -25238,7 +25332,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25238
25332
  marginLeft: "4px"
25239
25333
  },
25240
25334
  onClick: function onClick() {
25241
- return _this12.selectTop(30);
25335
+ return _this10.selectTop(30);
25242
25336
  }
25243
25337
  }, "Top 30"), /*#__PURE__*/React.createElement("span", {
25244
25338
  style: {
@@ -25251,7 +25345,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25251
25345
  cursor: "pointer"
25252
25346
  },
25253
25347
  onClick: function onClick() {
25254
- return _this12.selectTop(50);
25348
+ return _this10.selectTop(50);
25255
25349
  }
25256
25350
  }, "Top 50"), /*#__PURE__*/React.createElement("span", {
25257
25351
  style: {
@@ -25264,7 +25358,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25264
25358
  cursor: "pointer"
25265
25359
  },
25266
25360
  onClick: function onClick() {
25267
- return _this12.selectMatched(true);
25361
+ return _this10.selectMatched(true);
25268
25362
  }
25269
25363
  }, "Matched"), /*#__PURE__*/React.createElement("span", {
25270
25364
  style: {
@@ -25277,13 +25371,13 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25277
25371
  cursor: "pointer"
25278
25372
  },
25279
25373
  onClick: function onClick() {
25280
- return _this12.selectMatched(false);
25374
+ return _this10.selectMatched(false);
25281
25375
  }
25282
25376
  }, "Unmatched")), csvData && function () {
25283
- var activeCsvData = _this12.state.showFilteredSummary && _this12.state.filteredCsvData ? _this12.state.filteredCsvData : csvData;
25284
- var isFiltered = _this12.state.showFilteredSummary && _this12.state.filteredCsvData;
25285
- var originalFileSize = _this12.csvFileSize / (1024 * 1024);
25286
- var filteredFileSize = isFiltered ? originalFileSize * (1 - _this12.state.filterReductionPercent / 100) : originalFileSize;
25377
+ var activeCsvData = _this10.state.showFilteredSummary && _this10.state.filteredCsvData ? _this10.state.filteredCsvData : csvData;
25378
+ var isFiltered = _this10.state.showFilteredSummary && _this10.state.filteredCsvData;
25379
+ var originalFileSize = _this10.csvFileSize / (1024 * 1024);
25380
+ var filteredFileSize = isFiltered ? originalFileSize * (1 - _this10.state.filterReductionPercent / 100) : originalFileSize;
25287
25381
  return /*#__PURE__*/React.createElement("div", {
25288
25382
  style: {
25289
25383
  fontSize: "12px",
@@ -25310,7 +25404,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25310
25404
  color: "#5cb85c",
25311
25405
  marginTop: "4px"
25312
25406
  }
25313
- }, "Showing filtered summary (reduction: ", /*#__PURE__*/React.createElement("strong", null, _this12.state.filterReductionPercent.toFixed(1), "%"), ")"));
25407
+ }, "Showing filtered summary (reduction: ", /*#__PURE__*/React.createElement("strong", null, _this10.state.filterReductionPercent.toFixed(1), "%"), ")"));
25314
25408
  }(), function () {
25315
25409
  var hasSelection = mergedEntries.some(function (e) {
25316
25410
  return e.selected;
@@ -25336,10 +25430,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25336
25430
  }, /*#__PURE__*/React.createElement("div", {
25337
25431
  className: "col-xs-6",
25338
25432
  style: {
25339
- opacity: _this12.props.deviceType === "CANmod" ? 0.5 : 1,
25340
- pointerEvents: _this12.props.deviceType === "CANmod" ? "none" : "auto"
25433
+ opacity: _this10.props.deviceType === "CANmod" ? 0.5 : 1,
25434
+ pointerEvents: _this10.props.deviceType === "CANmod" ? "none" : "auto"
25341
25435
  },
25342
- title: _this12.props.deviceType === "CANmod" ? "CANmod only supports acceptance filters" : ""
25436
+ title: _this10.props.deviceType === "CANmod" ? "CANmod only supports acceptance filters" : ""
25343
25437
  }, /*#__PURE__*/React.createElement(SimpleDropdown, {
25344
25438
  name: "Type",
25345
25439
  options: [{
@@ -25349,53 +25443,53 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25349
25443
  value: "rejection",
25350
25444
  label: "Rejection"
25351
25445
  }],
25352
- value: _this12.state.filterType,
25446
+ value: _this10.state.filterType,
25353
25447
  onChange: function onChange(opt) {
25354
- return _this12.setState({
25448
+ return _this10.setState({
25355
25449
  filterType: opt.value
25356
25450
  }, function () {
25357
- return _this12.generateFilterConfig();
25451
+ return _this10.generateFilterConfig();
25358
25452
  });
25359
25453
  }
25360
- })), _this12.state.filterType === "acceptance" && /*#__PURE__*/React.createElement("div", {
25454
+ })), _this10.state.filterType === "acceptance" && /*#__PURE__*/React.createElement("div", {
25361
25455
  className: "col-xs-6"
25362
25456
  }, /*#__PURE__*/React.createElement(SimpleDropdown, {
25363
25457
  name: "Prescaler",
25364
25458
  options: prescalerOptions,
25365
- value: _this12.state.prescalerType,
25459
+ value: _this10.state.prescalerType,
25366
25460
  onChange: function onChange(opt) {
25367
- return _this12.setState({
25461
+ return _this10.setState({
25368
25462
  prescalerType: opt.value
25369
25463
  }, function () {
25370
- return _this12.generateFilterConfig();
25464
+ return _this10.generateFilterConfig();
25371
25465
  });
25372
25466
  }
25373
- }))), _this12.state.filterType === "acceptance" && _this12.state.prescalerType !== "none" && /*#__PURE__*/React.createElement("div", {
25467
+ }))), _this10.state.filterType === "acceptance" && _this10.state.prescalerType !== "none" && /*#__PURE__*/React.createElement("div", {
25374
25468
  className: "form-group pl0 field-string"
25375
- }, _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", {
25469
+ }, _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", {
25376
25470
  type: "number",
25377
25471
  className: "form-control encryption-input",
25378
25472
  min: "1",
25379
- max: _this12.state.prescalerType === "count" ? 256 : 4194304,
25380
- value: _this12.state.prescalerValue,
25473
+ max: _this10.state.prescalerType === "count" ? 256 : 4194304,
25474
+ value: _this10.state.prescalerValue,
25381
25475
  onChange: function onChange(e) {
25382
- return _this12.setState({
25476
+ return _this10.setState({
25383
25477
  prescalerValue: parseInt(e.target.value) || 1
25384
25478
  }, function () {
25385
- return _this12.generateFilterConfig();
25479
+ return _this10.generateFilterConfig();
25386
25480
  });
25387
25481
  }
25388
- }), _this12.state.prescalerType === "data" && /*#__PURE__*/React.createElement("input", {
25482
+ }), _this10.state.prescalerType === "data" && /*#__PURE__*/React.createElement("input", {
25389
25483
  type: "text",
25390
25484
  className: "form-control encryption-input",
25391
- value: _this12.state.dataPrescalerMask,
25485
+ value: _this10.state.dataPrescalerMask,
25392
25486
  onChange: function onChange(e) {
25393
25487
  var val = e.target.value.toUpperCase();
25394
25488
  if (/^[a-fA-F0-9]*$/.test(val) && val.length <= 16) {
25395
- _this12.setState({
25489
+ _this10.setState({
25396
25490
  dataPrescalerMask: val
25397
25491
  }, function () {
25398
- return _this12.generateFilterConfig();
25492
+ return _this10.generateFilterConfig();
25399
25493
  });
25400
25494
  }
25401
25495
  },
@@ -25406,7 +25500,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25406
25500
  }
25407
25501
  }), /*#__PURE__*/React.createElement("span", {
25408
25502
  className: "field-description field-description-shift"
25409
- }, _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", {
25503
+ }, _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", {
25410
25504
  className: "form-group pl0 field-string",
25411
25505
  style: {
25412
25506
  marginBottom: "10px"
@@ -25429,12 +25523,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25429
25523
  type: "radio",
25430
25524
  name: "filterMergeMode",
25431
25525
  value: "replace",
25432
- checked: _this12.state.filterMergeMode === "replace",
25526
+ checked: _this10.state.filterMergeMode === "replace",
25433
25527
  onChange: function onChange(e) {
25434
- return _this12.setState({
25528
+ return _this10.setState({
25435
25529
  filterMergeMode: e.target.value
25436
25530
  }, function () {
25437
- return _this12.generateFilterConfig();
25531
+ return _this10.generateFilterConfig();
25438
25532
  });
25439
25533
  },
25440
25534
  style: {
@@ -25457,12 +25551,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25457
25551
  type: "radio",
25458
25552
  name: "filterMergeMode",
25459
25553
  value: "append_top",
25460
- checked: _this12.state.filterMergeMode === "append_top",
25554
+ checked: _this10.state.filterMergeMode === "append_top",
25461
25555
  onChange: function onChange(e) {
25462
- return _this12.setState({
25556
+ return _this10.setState({
25463
25557
  filterMergeMode: e.target.value
25464
25558
  }, function () {
25465
- return _this12.generateFilterConfig();
25559
+ return _this10.generateFilterConfig();
25466
25560
  });
25467
25561
  },
25468
25562
  style: {
@@ -25485,12 +25579,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25485
25579
  type: "radio",
25486
25580
  name: "filterMergeMode",
25487
25581
  value: "append_bottom",
25488
- checked: _this12.state.filterMergeMode === "append_bottom",
25582
+ checked: _this10.state.filterMergeMode === "append_bottom",
25489
25583
  onChange: function onChange(e) {
25490
- return _this12.setState({
25584
+ return _this10.setState({
25491
25585
  filterMergeMode: e.target.value
25492
25586
  }, function () {
25493
- return _this12.generateFilterConfig();
25587
+ return _this10.generateFilterConfig();
25494
25588
  });
25495
25589
  },
25496
25590
  style: {
@@ -25526,9 +25620,9 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25526
25620
  }, 0);
25527
25621
  return " (" + count11Bit + " 11-bit, " + count29Bit + " 29-bit) | " + sizePercent.toFixed(1) + "%";
25528
25622
  }()), function () {
25529
- var isFirmwareSupported = _this12.isFirmwareVersionSupported();
25530
- var isCanmod = _this12.props.deviceType === "CANmod";
25531
- var isCanmodRouter = isCanmod && _this12.isCanmodRouter();
25623
+ var isFirmwareSupported = _this10.isFirmwareVersionSupported();
25624
+ var isCanmod = _this10.props.deviceType === "CANmod";
25625
+ var isCanmodRouter = isCanmod && _this10.isCanmodRouter();
25532
25626
  var minFirmware = isCanmod ? MIN_FIRMWARE_CANMOD_ROUTER : MIN_FIRMWARE_CANEDGE;
25533
25627
  var isDeviceSupported = !isCanmod || isCanmodRouter;
25534
25628
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
@@ -25539,25 +25633,25 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25539
25633
  }
25540
25634
  }, /*#__PURE__*/React.createElement("button", {
25541
25635
  className: "btn btn-primary",
25542
- onClick: _this12.onMerge,
25543
- disabled: !_this12.props.formData || Object.keys(_this12.props.formData).length === 0 || _this12.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported
25636
+ onClick: _this10.onMerge,
25637
+ disabled: !_this10.props.formData || Object.keys(_this10.props.formData).length === 0 || _this10.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported
25544
25638
  }, "Merge files"), /*#__PURE__*/React.createElement("button", {
25545
25639
  className: "btn btn-default",
25546
- onClick: _this12.onDownload,
25547
- disabled: Object.keys(_this12.state.generatedFilterConfig).length === 0
25640
+ onClick: _this10.onDownload,
25641
+ disabled: Object.keys(_this10.state.generatedFilterConfig).length === 0
25548
25642
  }, "Download JSON")), function () {
25549
- var mergeDisabled = !_this12.props.formData || Object.keys(_this12.props.formData).length === 0 || _this12.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported;
25643
+ var mergeDisabled = !_this10.props.formData || Object.keys(_this10.props.formData).length === 0 || _this10.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported;
25550
25644
  if (!mergeDisabled) return null;
25551
25645
  var reason = "";
25552
- if (!_this12.props.formData || Object.keys(_this12.props.formData).length === 0) {
25646
+ if (!_this10.props.formData || Object.keys(_this10.props.formData).length === 0) {
25553
25647
  reason = "No configuration file loaded";
25554
25648
  } else if (!isDeviceSupported) {
25555
25649
  reason = "Only CANmod.router is supported for CANmod devices";
25556
25650
  } else if (!isFirmwareSupported) {
25557
25651
  reason = "Merging requires firmware " + minFirmware + ".XX+ - please update your device";
25558
- } else if (_this12.state.mergedConfigValid === "Unknown") {
25652
+ } else if (_this10.state.mergedConfigValid === "Unknown") {
25559
25653
  reason = "No filters selected";
25560
- } else if (_this12.state.mergedConfigValid === false) {
25654
+ } else if (_this10.state.mergedConfigValid === false) {
25561
25655
  reason = "Generated filter configuration is invalid";
25562
25656
  }
25563
25657
  return reason ? /*#__PURE__*/React.createElement("div", {
@@ -25568,7 +25662,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25568
25662
  }
25569
25663
  }, reason) : null;
25570
25664
  }());
25571
- }(), Object.keys(_this12.state.generatedFilterConfig).length > 0 && /*#__PURE__*/React.createElement("div", {
25665
+ }(), Object.keys(_this10.state.generatedFilterConfig).length > 0 && /*#__PURE__*/React.createElement("div", {
25572
25666
  style: {
25573
25667
  marginTop: "10px"
25574
25668
  }
@@ -25581,17 +25675,17 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25581
25675
  }
25582
25676
  }, /*#__PURE__*/React.createElement("input", {
25583
25677
  type: "checkbox",
25584
- checked: _this12.state.showFilterPreview,
25678
+ checked: _this10.state.showFilterPreview,
25585
25679
  onChange: function onChange() {
25586
- return _this12.setState({
25587
- showFilterPreview: !_this12.state.showFilterPreview
25680
+ return _this10.setState({
25681
+ showFilterPreview: !_this10.state.showFilterPreview
25588
25682
  });
25589
25683
  },
25590
25684
  style: {
25591
25685
  marginRight: "6px",
25592
25686
  marginBottom: "4px"
25593
25687
  }
25594
- }), "Show partial config preview"), _this12.state.showFilterPreview && /*#__PURE__*/React.createElement("div", {
25688
+ }), "Show partial config preview"), _this10.state.showFilterPreview && /*#__PURE__*/React.createElement("div", {
25595
25689
  style: {
25596
25690
  marginTop: "10px"
25597
25691
  }
@@ -25602,7 +25696,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25602
25696
  overflow: "auto",
25603
25697
  fontSize: "11px"
25604
25698
  }
25605
- }, JSON.stringify(_this12.state.generatedFilterConfig, null, 2)))));
25699
+ }, JSON.stringify(_this10.state.generatedFilterConfig, null, 2)))));
25606
25700
  }()), /*#__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)));
25607
25701
  };
25608
25702
  return FilterBuilderTool;