@coveo/atomic-react 3.11.19 → 3.11.20

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.
@@ -8551,7 +8551,7 @@ function getWindow() {
8551
8551
  }
8552
8552
  function getAtomicEnvironment(headlessVersion) {
8553
8553
  return {
8554
- version: "3.57.2",
8554
+ version: "3.57.3",
8555
8555
  headlessVersion
8556
8556
  };
8557
8557
  }
@@ -8577,16 +8577,28 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
8577
8577
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
8578
8578
  function _typeof$2(o) { "@babel/helpers - typeof"; return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$2(o); }
8579
8579
  var UNSAFE_KEYS$1 = ['__proto__', 'constructor', 'prototype'];
8580
- function isSafeUrlSegment(v) {
8580
+ function isSafeUrlSegmentBase(v) {
8581
8581
  if (typeof v !== 'string') return false;
8582
8582
  if (v.length === 0 || v.length > 128) return false;
8583
8583
  if (UNSAFE_KEYS$1.indexOf(v) > -1) return false;
8584
8584
  if (v.indexOf('..') > -1) return false;
8585
- if (v.indexOf('/') > -1 || v.indexOf('\\') > -1) return false;
8585
+ if (v.indexOf('\\') > -1) return false;
8586
8586
  if (/[?#%\s@]/.test(v)) return false;
8587
8587
  if (/[\x00-\x1F\x7F]/.test(v)) return false;
8588
8588
  return true;
8589
8589
  }
8590
+ function isSafeLangUrlSegment(v) {
8591
+ if (!isSafeUrlSegmentBase(v)) return false;
8592
+ if (v.indexOf('/') > -1) return false;
8593
+ return true;
8594
+ }
8595
+ function isSafeNsUrlSegment(v) {
8596
+ return isSafeUrlSegmentBase(v);
8597
+ }
8598
+ var SAFETY_CHECK_BY_KEY = {
8599
+ lng: isSafeLangUrlSegment,
8600
+ ns: isSafeNsUrlSegment
8601
+ };
8590
8602
  function sanitizeLogValue(v) {
8591
8603
  if (typeof v !== 'string') return v;
8592
8604
  return v.replace(/[\r\n\x00-\x1F\x7F]/g, ' ');
@@ -8625,13 +8637,14 @@ function interpolateUrl(str, data) {
8625
8637
  if (UNSAFE_KEYS$1.indexOf(k) > -1) return match;
8626
8638
  var value = data[k];
8627
8639
  if (value == null) return match;
8640
+ var check = SAFETY_CHECK_BY_KEY[k] || isSafeLangUrlSegment;
8628
8641
  var segments = String(value).split('+');
8629
8642
  var _iterator = _createForOfIteratorHelper(segments),
8630
8643
  _step;
8631
8644
  try {
8632
8645
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
8633
8646
  var seg = _step.value;
8634
- if (!isSafeUrlSegment(seg)) {
8647
+ if (!check(seg)) {
8635
8648
  unsafe = true;
8636
8649
  return match;
8637
8650
  }