videomail-client 16.0.0 → 16.0.2

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/README.md CHANGED
@@ -282,9 +282,7 @@ When the client sends the second, host-form request, enable `submitWithVideomail
282
282
 
283
283
  ## Privacy and error reporting
284
284
 
285
- Recording sends webcam frames, and audio samples when enabled, to the configured Videomail service for encoding. The package does not provide offline recording.
286
-
287
- The `reportErrors` option defaults to `true`. When an error occurs, the client can send the error, recent client logs, browser and operating-system details, page location, screen and orientation data, supported media constraints, and enumerated media-device information to the configured API. Set `reportErrors: false` if your privacy policy requires local-only error handling.
285
+ Read about our privacy and error reporting practices in [Privacy and error reporting](./docs/PRIVACY_ERROR_REPORTING.md).
288
286
 
289
287
  ## Whitelist
290
288
 
@@ -5977,9 +5977,57 @@ var __webpack_modules__ = {
5977
5977
  },
5978
5978
  s1 (module, __unused_rspack_exports, __webpack_require__) {
5979
5979
  "use strict";
5980
+ var getSideChannel = __webpack_require__("M");
5980
5981
  var utils = __webpack_require__("K0");
5981
5982
  var has = Object.prototype.hasOwnProperty;
5982
5983
  var isArray = Array.isArray;
5984
+ var getPrototypeOf = Object.getPrototypeOf;
5985
+ var isPlainContainer = function(value) {
5986
+ if (!value || 'object' != typeof value) return false;
5987
+ if (isArray(value)) return true;
5988
+ var proto = getPrototypeOf(value);
5989
+ return proto === Object.prototype || null === proto;
5990
+ };
5991
+ var emptyCopyOf = function(value) {
5992
+ if (isArray(value)) {
5993
+ var arr = [];
5994
+ arr.length = value.length;
5995
+ return arr;
5996
+ }
5997
+ return null === getPrototypeOf(value) ? {
5998
+ __proto__: null
5999
+ } : {};
6000
+ };
6001
+ var copyInput = function(input) {
6002
+ var copies = getSideChannel();
6003
+ var result = {};
6004
+ var queue = [
6005
+ {
6006
+ source: input,
6007
+ target: result
6008
+ }
6009
+ ];
6010
+ for(var i = 0; i < queue.length; ++i){
6011
+ var source = queue[i].source;
6012
+ var target = queue[i].target;
6013
+ var keys = Object.keys(source);
6014
+ for(var j = 0; j < keys.length; ++j){
6015
+ var value = source[keys[j]];
6016
+ if (isPlainContainer(value)) {
6017
+ if (!copies.has(value)) {
6018
+ var copy = emptyCopyOf(value);
6019
+ copies.set(value, copy);
6020
+ queue[queue.length] = {
6021
+ source: value,
6022
+ target: copy
6023
+ };
6024
+ }
6025
+ target[keys[j]] = copies.get(value);
6026
+ } else target[keys[j]] = value;
6027
+ }
6028
+ }
6029
+ return result;
6030
+ };
5983
6031
  var defaults = {
5984
6032
  allowDots: false,
5985
6033
  allowEmptyArrays: false,
@@ -6051,6 +6099,7 @@ var __webpack_modules__ = {
6051
6099
  var part = parts[i];
6052
6100
  var bracketEqualsPos = part.indexOf(']=');
6053
6101
  var pos = -1 === bracketEqualsPos ? part.indexOf('=') : bracketEqualsPos + 1;
6102
+ var isEmptyBracketKey = pos > 1 && '[]' === part.slice(pos - 2, pos);
6054
6103
  var key;
6055
6104
  var val;
6056
6105
  if (-1 === pos) {
@@ -6063,13 +6112,13 @@ var __webpack_modules__ = {
6063
6112
  });
6064
6113
  }
6065
6114
  if (val && options.interpretNumericEntities && 'iso-8859-1' === charset) val = interpretNumericEntities(String(val));
6066
- if (part.indexOf('[]=') > -1) val = isArray(val) ? [
6115
+ if (isEmptyBracketKey) val = isArray(val) ? [
6067
6116
  val
6068
6117
  ] : val;
6069
6118
  if (options.comma && isArray(val) && val.length > options.arrayLimit) val = utils.combine([], val, options.arrayLimit, options.plainObjects, options.throwOnLimitExceeded);
6070
6119
  if (null !== key) {
6071
6120
  var existing = has.call(obj, key);
6072
- if (existing && ('combine' === options.duplicates || part.indexOf('[]=') > -1)) obj[key] = utils.combine(obj[key], val, options.arrayLimit, options.plainObjects, options.throwOnLimitExceeded);
6121
+ if (existing && ('combine' === options.duplicates || isEmptyBracketKey)) obj[key] = utils.combine(obj[key], val, options.arrayLimit, options.plainObjects, options.throwOnLimitExceeded);
6073
6122
  else if (!existing || 'last' === options.duplicates) obj[key] = val;
6074
6123
  }
6075
6124
  }
@@ -6111,8 +6160,29 @@ var __webpack_modules__ = {
6111
6160
  }
6112
6161
  return leaf;
6113
6162
  };
6163
+ var topLevelDotsToBrackets = function(key) {
6164
+ var result = '';
6165
+ var depth = 0;
6166
+ for(var i = 0; i < key.length; i += 1){
6167
+ var cu = key.charCodeAt(i);
6168
+ if (0x5B === cu) {
6169
+ depth += 1;
6170
+ result += '[';
6171
+ } else if (0x5D === cu) {
6172
+ if (depth > 0) depth -= 1;
6173
+ result += ']';
6174
+ } else if (0x2E === cu && 0 === depth && i + 1 < key.length && 0x2E !== key.charCodeAt(i + 1) && 0x5B !== key.charCodeAt(i + 1)) {
6175
+ var start = i + 1;
6176
+ var j = start;
6177
+ while(j < key.length && 0x2E !== key.charCodeAt(j) && 0x5B !== key.charCodeAt(j))j += 1;
6178
+ result += '[' + key.slice(start, j) + ']';
6179
+ i = j - 1;
6180
+ } else result += key.charAt(i);
6181
+ }
6182
+ return result;
6183
+ };
6114
6184
  var splitKeyIntoSegments = function(originalKey, options) {
6115
- var key = options.allowDots ? originalKey.replace(/\.([^.[]+)/g, '[$1]') : originalKey;
6185
+ var key = options.allowDots ? topLevelDotsToBrackets(originalKey) : originalKey;
6116
6186
  if (options.depth <= 0) {
6117
6187
  if (!options.plainObjects && has.call(Object.prototype, key)) {
6118
6188
  if (!options.allowPrototypes) return;
@@ -6210,7 +6280,7 @@ var __webpack_modules__ = {
6210
6280
  if ('' === str || null == str) return options.plainObjects ? {
6211
6281
  __proto__: null
6212
6282
  } : {};
6213
- var tempObj = 'string' == typeof str ? parseValues(str, options) : str;
6283
+ var tempObj = 'string' == typeof str ? parseValues(str, options) : copyInput(str);
6214
6284
  var obj = options.plainObjects ? {
6215
6285
  __proto__: null
6216
6286
  } : {};
@@ -6318,11 +6388,11 @@ var __webpack_modules__ = {
6318
6388
  var objKeys;
6319
6389
  if ('comma' === generateArrayPrefix && isArray(obj)) {
6320
6390
  if (encodeValuesOnly && encoder) obj = utils.maybeMap(obj, function(v) {
6321
- return null == v ? v : encoder(v);
6391
+ return null == v ? v : encoder(v, defaults.encoder, charset, 'value', format);
6322
6392
  });
6323
6393
  objKeys = [
6324
6394
  {
6325
- value: obj.length > 0 ? obj.join(',') || null : void 0
6395
+ value: obj.length > 0 ? utils.toCoercible(obj).join(',') || null : void 0
6326
6396
  }
6327
6397
  ];
6328
6398
  } else if (isArray(filter)) objKeys = filter;
@@ -6330,7 +6400,7 @@ var __webpack_modules__ = {
6330
6400
  var keys = Object.keys(obj);
6331
6401
  objKeys = sort ? keys.sort(sort) : keys;
6332
6402
  }
6333
- var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
6403
+ var encodedPrefix = String(prefix);
6334
6404
  var adjustedPrefix = commaRoundTrip && isArray(obj) && 1 === obj.length ? encodedPrefix + '[]' : encodedPrefix;
6335
6405
  if (allowEmptyArrays && isArray(obj) && 0 === obj.length && 0 === Object.keys(obj).length) return adjustedPrefix + '[]';
6336
6406
  for(var j = 0; j < objKeys.length; ++j){
@@ -6363,7 +6433,7 @@ var __webpack_modules__ = {
6363
6433
  var filter = defaults.filter;
6364
6434
  if ('function' == typeof opts.filter || isArray(opts.filter)) filter = opts.filter;
6365
6435
  var arrayFormat;
6366
- arrayFormat = opts.arrayFormat in arrayPrefixGenerators ? opts.arrayFormat : 'indices' in opts ? opts.indices ? 'indices' : 'repeat' : defaults.arrayFormat;
6436
+ arrayFormat = has.call(arrayPrefixGenerators, opts.arrayFormat) ? opts.arrayFormat : 'indices' in opts ? opts.indices ? 'indices' : 'repeat' : defaults.arrayFormat;
6367
6437
  if ('commaRoundTrip' in opts && 'boolean' != typeof opts.commaRoundTrip) throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
6368
6438
  var allowDots = void 0 === opts.allowDots ? true === opts.encodeDotInKeys ? true : defaults.allowDots : !!opts.allowDots;
6369
6439
  return {
@@ -6446,6 +6516,17 @@ var __webpack_modules__ = {
6446
6516
  var setMaxIndex = function(obj, maxIndex) {
6447
6517
  overflowChannel.set(obj, maxIndex);
6448
6518
  };
6519
+ var conflictChannel = getSideChannel();
6520
+ var markConflict = function(obj, maxIndex) {
6521
+ conflictChannel.set(obj, maxIndex);
6522
+ return obj;
6523
+ };
6524
+ var isConflict = function(obj) {
6525
+ return conflictChannel.has(obj);
6526
+ };
6527
+ var getConflictIndex = function(obj) {
6528
+ return conflictChannel.get(obj);
6529
+ };
6449
6530
  var hexTable = function() {
6450
6531
  var array = [];
6451
6532
  for(var i = 0; i < 256; ++i)array[array.length] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();
@@ -6478,6 +6559,26 @@ var __webpack_modules__ = {
6478
6559
  });
6479
6560
  else obj[key] = value;
6480
6561
  };
6562
+ var maxNumericIndex = function(obj, min) {
6563
+ var max = min;
6564
+ var keys = Object.keys(obj);
6565
+ for(var i = 0; i < keys.length; ++i){
6566
+ var num = parseInt(keys[i], 10);
6567
+ if (String(num) === keys[i] && num > max) max = num;
6568
+ }
6569
+ return max;
6570
+ };
6571
+ var limitedPair = function(first, second, options) {
6572
+ var pair = [
6573
+ first,
6574
+ second
6575
+ ];
6576
+ if (options && 'number' == typeof options.arrayLimit && pair.length > options.arrayLimit) {
6577
+ if (options.throwOnLimitExceeded) throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (1 === options.arrayLimit ? '' : 's') + ' allowed in an array.');
6578
+ return markOverflow(arrayToObject(pair, options), 1);
6579
+ }
6580
+ return pair;
6581
+ };
6481
6582
  var merge = function merge(target, source, options) {
6482
6583
  if (!source) return target;
6483
6584
  if ('object' != typeof source && 'function' != typeof source) {
@@ -6488,19 +6589,20 @@ var __webpack_modules__ = {
6488
6589
  return markOverflow(arrayToObject(target.concat(source), options), nextIndex);
6489
6590
  }
6490
6591
  target[nextIndex] = source;
6491
- } else if (!target || 'object' != typeof target) return [
6492
- target,
6493
- source
6494
- ];
6592
+ } else if (!target || 'object' != typeof target) return limitedPair(target, source, options);
6495
6593
  else if (isOverflow(target)) {
6496
6594
  var newIndex = getMaxIndex(target) + 1;
6497
6595
  target[newIndex] = source;
6498
6596
  setMaxIndex(target, newIndex);
6499
- } else if (options && options.strictMerge) return [
6500
- target,
6501
- source
6502
- ];
6503
- else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) target[source] = true;
6597
+ } else if (options && options.strictMerge && isConflict(target)) {
6598
+ var nextConflict = getConflictIndex(target) + 1;
6599
+ if (options.throwOnLimitExceeded && 'number' == typeof options.arrayLimit && nextConflict >= options.arrayLimit) throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (1 === options.arrayLimit ? '' : 's') + ' allowed in an array.');
6600
+ target[nextConflict] = source;
6601
+ markConflict(target, nextConflict);
6602
+ } else if (options && options.strictMerge) {
6603
+ var conflict = limitedPair(target, source, options);
6604
+ return isArray(conflict) ? markConflict(conflict, 1) : conflict;
6605
+ } else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) target[source] = true;
6504
6606
  return target;
6505
6607
  }
6506
6608
  if (!target || 'object' != typeof target) {
@@ -6528,7 +6630,10 @@ var __webpack_modules__ = {
6528
6630
  return combined;
6529
6631
  }
6530
6632
  var mergeTarget = target;
6531
- if (isArray(target) && !isArray(source)) mergeTarget = arrayToObject(target, options);
6633
+ if (isArray(target) && !isArray(source)) {
6634
+ mergeTarget = arrayToObject(target, options);
6635
+ if (isConflict(target)) markConflict(mergeTarget, target.length - 1);
6636
+ }
6532
6637
  if (isArray(target) && isArray(source)) {
6533
6638
  source.forEach(function(item, i) {
6534
6639
  if (has.call(target, i)) {
@@ -6546,11 +6651,15 @@ var __webpack_modules__ = {
6546
6651
  return Object.keys(source).reduce(function(acc, key) {
6547
6652
  var value = source[key];
6548
6653
  has.call(acc, key) ? setProperty(acc, key, merge(acc[key], value, options)) : setProperty(acc, key, value);
6549
- if (isOverflow(source) && !isOverflow(acc)) markOverflow(acc, getMaxIndex(source));
6654
+ if (isOverflow(source) && !isOverflow(acc)) markOverflow(acc, maxNumericIndex(acc, getMaxIndex(source)));
6550
6655
  if (isOverflow(acc)) {
6551
6656
  var keyNum = parseInt(key, 10);
6552
6657
  if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) setMaxIndex(acc, keyNum);
6553
6658
  }
6659
+ if (isConflict(acc)) {
6660
+ var conflictKey = parseInt(key, 10);
6661
+ if (String(conflictKey) === key && conflictKey > getConflictIndex(acc)) markConflict(acc, conflictKey);
6662
+ }
6554
6663
  return acc;
6555
6664
  }, mergeTarget);
6556
6665
  };
@@ -6561,6 +6670,7 @@ var __webpack_modules__ = {
6561
6670
  }, target);
6562
6671
  };
6563
6672
  var decode = function(str, defaultDecoder, charset) {
6673
+ if ('string' == typeof str && -1 === str.indexOf('%')) return -1 === str.indexOf('+') ? str : str.replace(/\+/g, ' ');
6564
6674
  var strWithoutPlus = str.replace(/\+/g, ' ');
6565
6675
  if ('iso-8859-1' === charset) return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
6566
6676
  try {
@@ -6569,15 +6679,47 @@ var __webpack_modules__ = {
6569
6679
  return strWithoutPlus;
6570
6680
  }
6571
6681
  };
6682
+ var hasToPrimitive = 'function' == typeof Symbol && 'symbol' == typeof Symbol.toPrimitive;
6683
+ var arrayJoin = Array.prototype.join;
6684
+ var arrayToString = Array.prototype.toString;
6685
+ var objectToString = Object.prototype.toString;
6686
+ var toCoercible = function toCoercible(value, joining) {
6687
+ if (!value || 'object' != typeof value && 'function' != typeof value) return value;
6688
+ if (hasToPrimitive && null != value[Symbol.toPrimitive]) return value;
6689
+ if (isArray(value) && value.toString === arrayToString && value.join === arrayJoin) {
6690
+ var ancestors = joining || getSideChannel();
6691
+ if (ancestors.has(value)) return '';
6692
+ ancestors.set(value, true);
6693
+ var copy;
6694
+ for(var i = 0; i < value.length; i += 1){
6695
+ var item = value[i];
6696
+ var coerced = toCoercible(item, ancestors);
6697
+ if (!copy && coerced !== item) {
6698
+ copy = [];
6699
+ for(var j = 0; j < i; j += 1)copy[j] = value[j];
6700
+ }
6701
+ if (copy) copy[i] = coerced;
6702
+ }
6703
+ ancestors['delete'](value);
6704
+ return copy || value;
6705
+ }
6706
+ if ('function' == typeof value.toString) return value;
6707
+ var valueOf = value.valueOf;
6708
+ if ('function' == typeof valueOf) {
6709
+ var primitive = valueOf.call(value);
6710
+ if (!primitive || 'object' != typeof primitive && 'function' != typeof primitive) return String(primitive);
6711
+ }
6712
+ return objectToString.call(value);
6713
+ };
6572
6714
  var limit = 1024;
6573
6715
  var encode = function(str, defaultEncoder, charset, kind, format) {
6574
6716
  if (0 === str.length) return str;
6575
6717
  var string = str;
6576
6718
  if ('symbol' == typeof str) string = Symbol.prototype.toString.call(str);
6577
- else if ('string' != typeof str) string = String(str);
6719
+ else if ('string' != typeof str) string = String(toCoercible(str));
6578
6720
  if ('iso-8859-1' === charset) return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
6579
6721
  return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
6580
- });
6722
+ }).replace(/\+/g, '%2B');
6581
6723
  var out = '';
6582
6724
  for(var j = 0; j < string.length; j += limit){
6583
6725
  var segment = string.length >= limit ? string.slice(j, j + limit) : string;
@@ -6694,7 +6836,8 @@ var __webpack_modules__ = {
6694
6836
  isRegExp: isRegExp,
6695
6837
  markOverflow: markOverflow,
6696
6838
  maybeMap: maybeMap,
6697
- merge: merge
6839
+ merge: merge,
6840
+ toCoercible: toCoercible
6698
6841
  };
6699
6842
  },
6700
6843
  jY (module, __unused_rspack_exports, __webpack_require__) {
@@ -8105,7 +8248,7 @@ var __webpack_modules__ = {
8105
8248
  });
8106
8249
  });
8107
8250
  },
8108
- S (__unused_rspack_module, exports1, __webpack_require__) {
8251
+ Sy (__unused_rspack_module, exports1, __webpack_require__) {
8109
8252
  var process = __webpack_require__("zT");
8110
8253
  var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function(obj) {
8111
8254
  var keys = Object.keys(obj);
@@ -10471,7 +10614,7 @@ var __webpack_modules__ = {
10471
10614
  return i[1];
10472
10615
  };
10473
10616
  },
10474
- RR (module) {
10617
+ R (module) {
10475
10618
  "use strict";
10476
10619
  var stylesInDOM = [];
10477
10620
  function getIndexByIdentifier(identifier) {
@@ -10972,7 +11115,7 @@ var __webpack_exports__ = {};
10972
11115
  var client = __webpack_require__("Q");
10973
11116
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10974
11117
  var package_namespaceObject = {
10975
- rE: "16.0.0"
11118
+ rE: "16.0.2"
10976
11119
  };
10977
11120
  function isAudioEnabled(options) {
10978
11121
  return Boolean(options.audio.enabled);
@@ -10984,7 +11127,7 @@ var __webpack_exports__ = {};
10984
11127
  function isAutoPauseEnabled(options) {
10985
11128
  return options.enableAutoPause && options.enablePause;
10986
11129
  }
10987
- var util = __webpack_require__("S");
11130
+ var util = __webpack_require__("Sy");
10988
11131
  var util_default = /*#__PURE__*/ __webpack_require__.n(util);
10989
11132
  function getEventDetails(event) {
10990
11133
  const eventWithErrorDetails = event;
@@ -14450,7 +14593,7 @@ var __webpack_exports__ = {};
14450
14593
  }
14451
14594
  constructor(message, options, classList, errData){
14452
14595
  var _ref;
14453
- super(message, errData), VideomailError_define_property(this, "title", "Error from videomail-client npm package"), VideomailError_define_property(this, "location", window.location.href), VideomailError_define_property(this, "logLines", void 0), VideomailError_define_property(this, "whitelistKey", void 0), VideomailError_define_property(this, "cookie", void 0), VideomailError_define_property(this, "err", void 0), VideomailError_define_property(this, "promise", void 0), VideomailError_define_property(this, "reason", void 0), VideomailError_define_property(this, "browser", void 0), VideomailError_define_property(this, "cpu", void 0), VideomailError_define_property(this, "device", void 0), VideomailError_define_property(this, "engine", void 0), VideomailError_define_property(this, "os", void 0), VideomailError_define_property(this, "screen", void 0), VideomailError_define_property(this, "orientation", void 0), VideomailError_define_property(this, "versions", void 0), VideomailError_define_property(this, "classList", void 0);
14596
+ super(message, errData), VideomailError_define_property(this, "title", "Error from videomail-client npm package"), VideomailError_define_property(this, "location", window.location.href), VideomailError_define_property(this, "logLines", void 0), VideomailError_define_property(this, "whitelistKey", void 0), VideomailError_define_property(this, "err", void 0), VideomailError_define_property(this, "promise", void 0), VideomailError_define_property(this, "reason", void 0), VideomailError_define_property(this, "browser", void 0), VideomailError_define_property(this, "cpu", void 0), VideomailError_define_property(this, "device", void 0), VideomailError_define_property(this, "engine", void 0), VideomailError_define_property(this, "os", void 0), VideomailError_define_property(this, "screen", void 0), VideomailError_define_property(this, "orientation", void 0), VideomailError_define_property(this, "versions", void 0), VideomailError_define_property(this, "classList", void 0);
14454
14597
  this.explanation = null == errData ? void 0 : errData.explanation;
14455
14598
  this.logLines = null == errData ? void 0 : errData.logLines;
14456
14599
  this.whitelistKey = options.whitelistKey;
@@ -14462,9 +14605,6 @@ var __webpack_exports__ = {};
14462
14605
  this.device = usefulClientData.device.type ? usefulClientData.device : void 0;
14463
14606
  this.engine = usefulClientData.engine;
14464
14607
  this.os = usefulClientData.os;
14465
- let cookie;
14466
- if (__webpack_require__.g.document.cookie.length > 0) cookie = __webpack_require__.g.document.cookie.split(",").map((c)=>c.trim());
14467
- this.cookie = cookie && cookie.length > 0 ? cookie : void 0;
14468
14608
  this.screen = [
14469
14609
  screen.width,
14470
14610
  screen.height,
@@ -14654,6 +14794,53 @@ var __webpack_exports__ = {};
14654
14794
  return exc;
14655
14795
  }
14656
14796
  const error_findOriginalExc = findOriginalExc;
14797
+ const REDACTED = "[redacted]";
14798
+ const PRIVATE_FIELDS = "cookies?|set[-_]?cookie|(?:proxy[-_]?)?authorization|pass(?:word|phrase|wd)|(?:client[-_]?)?secret|(?:x[-_]?)?api[-_]?key|(?:access|refresh|id|auth|session)[-_]?token|token|(?:x[-_]?)?(?:csrf|xsrf)(?:[-_]?token)?|session(?:[-_]?id)?|e[-_]?mail|from|to|cc|bcc|recipients?|sender";
14799
+ const PRIVATE_FIELD = new RegExp(`^(?:${PRIVATE_FIELDS})$`, "iu");
14800
+ const PRIVATE_CONTENT_FIELD = /^(?:subject|body)$/iu;
14801
+ const URL_FIELD = /^(?:url|uri|href|location|recordLocation|blockedURI|responseURL)$/iu;
14802
+ const LOG_ASSIGNMENT = String.raw`(["']?\b(?:${PRIVATE_FIELDS}|subject|body)["']?\s*[:=]\s*)`;
14803
+ const LOG_VALUES = [
14804
+ /"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'/u.source,
14805
+ /(?:Bearer|Basic)\s+[^\s,;}]+/u.source,
14806
+ /[^\s,;{}[\]]+/u.source
14807
+ ].join("|");
14808
+ const PRIVATE_LOG_VALUE = new RegExp(`${LOG_ASSIGNMENT}(?:${LOG_VALUES})`, "giu");
14809
+ function sanitizeUrl(value, base) {
14810
+ try {
14811
+ const url = new URL(value, base);
14812
+ url.username = "";
14813
+ url.password = "";
14814
+ url.search = "";
14815
+ url.hash = "";
14816
+ return url.href;
14817
+ } catch (unused) {
14818
+ return REDACTED;
14819
+ }
14820
+ }
14821
+ function sanitizeText(text) {
14822
+ return text.replace(/\b(?:https?|wss?):\/\/[^\s"'<>(){}]+/giu, (value)=>{
14823
+ var _ref;
14824
+ var _exec;
14825
+ const position = null != (_ref = null == (_exec = /:\d+:\d+$/u.exec(value)) ? void 0 : _exec[0]) ? _ref : "";
14826
+ const address = position ? value.slice(0, -position.length) : value;
14827
+ return `${sanitizeUrl(address)}${position}`;
14828
+ }).replace(PRIVATE_LOG_VALUE, `$1${REDACTED}`).replace(/\b(Bearer|Basic)\s+[\w.+/~=-]+/giu, `$1 ${REDACTED}`).replace(/\b[\w.%+-]+@[\w.-]+\.[a-z]{2,}\b/giu, REDACTED);
14829
+ }
14830
+ function sanitizeErrorReport(report) {
14831
+ function redactField(key, value) {
14832
+ if (PRIVATE_FIELD.test(key)) return REDACTED;
14833
+ if ("string" != typeof value) return value;
14834
+ if (PRIVATE_CONTENT_FIELD.test(key)) return REDACTED;
14835
+ const text = URL_FIELD.test(key) ? sanitizeUrl(value, report.location) : value;
14836
+ return sanitizeText(text);
14837
+ }
14838
+ const json = JSON.stringify(serializeError(report), redactField);
14839
+ const sanitized = JSON.parse(json);
14840
+ if (null === sanitized || "object" != typeof sanitized) throw new TypeError("An error report must serialize to an object.");
14841
+ return sanitized;
14842
+ }
14843
+ const error_sanitizeErrorReport = sanitizeErrorReport;
14657
14844
  function _extends() {
14658
14845
  _extends = Object.assign || function(target) {
14659
14846
  for(var i = 1; i < arguments.length; i++){
@@ -15312,7 +15499,6 @@ var __webpack_exports__ = {};
15312
15499
  },
15313
15500
  browser: err.browser,
15314
15501
  code: err.code,
15315
- cookie: err.cookie,
15316
15502
  cause: err.cause instanceof Error ? serializeError(err.cause) : err.cause,
15317
15503
  cpu: err.cpu,
15318
15504
  device: err.device,
@@ -15333,7 +15519,7 @@ var __webpack_exports__ = {};
15333
15519
  enumerateDevices,
15334
15520
  usedConstraints: err.usedConstraints
15335
15521
  };
15336
- yield client_default()(FormMethod.POST, url).query(queryParams).set("Timezone-Id", this.timezoneId).withCredentials().send(fullVideomailErrorData).timeout(this.options.timeouts.connection);
15522
+ yield client_default()(FormMethod.POST, url).query(queryParams).set("Timezone-Id", this.timezoneId).withCredentials().send(error_sanitizeErrorReport(fullVideomailErrorData)).timeout(this.options.timeouts.connection);
15337
15523
  }).call(this);
15338
15524
  }
15339
15525
  post(videomail) {
@@ -15602,7 +15788,7 @@ var __webpack_exports__ = {};
15602
15788
  return newOptions;
15603
15789
  }
15604
15790
  const options_mergeWithDefaultOptions = mergeWithDefaultOptions;
15605
- var injectStylesIntoStyleTag = __webpack_require__("RR");
15791
+ var injectStylesIntoStyleTag = __webpack_require__("R");
15606
15792
  var injectStylesIntoStyleTag_default = /*#__PURE__*/ __webpack_require__.n(injectStylesIntoStyleTag);
15607
15793
  var styleDomAPI = __webpack_require__("Bd");
15608
15794
  var styleDomAPI_default = /*#__PURE__*/ __webpack_require__.n(styleDomAPI);
@@ -19910,6 +20096,7 @@ var __webpack_exports__ = {};
19910
20096
  this.options.logger.debug(debugLine);
19911
20097
  const canReconnect = this.canReconnectAfterStreamClose();
19912
20098
  this.connected = false;
20099
+ this.stopPings();
19913
20100
  if (this.shouldIgnoreStreamClose()) return;
19914
20101
  if (this.mediaTransmissionStarted) this.failInterruptedRecording();
19915
20102
  else if (canReconnect) {
@@ -19926,7 +20113,38 @@ var __webpack_exports__ = {};
19926
20113
  }, 0);
19927
20114
  }
19928
20115
  shouldIgnoreStreamClose() {
19929
- return this.recordingTransportFailed || Boolean(this.unloaded);
20116
+ return this.recordingTransportFailed || Boolean(this.unloaded) || this.validate();
20117
+ }
20118
+ handleStreamError(url2Connect, err) {
20119
+ var _this_lastSocketError;
20120
+ if ("u" > typeof Event && err instanceof Event) this.lastSocketError = error_getEventDetails(err);
20121
+ else this.lastSocketError = serializeError(err);
20122
+ const debugLine = string_summarize(`${PIPE_SYMBOL}Stream *error* event emitted:`, {
20123
+ error: serializeError(err)
20124
+ });
20125
+ this.options.logger.debug(debugLine);
20126
+ if (this.validate()) {
20127
+ this.connected = false;
20128
+ this.stopPings();
20129
+ this.discardSocket();
20130
+ return;
20131
+ }
20132
+ if (!this.connected) return void this.handleConnectionFailure({
20133
+ url2Connect,
20134
+ cause: "error"
20135
+ });
20136
+ const streamError = err instanceof Error ? err : new Error("WebSocket stream emitted an error event", {
20137
+ cause: null != (_this_lastSocketError = this.lastSocketError) ? _this_lastSocketError : err
20138
+ });
20139
+ if (this.mediaTransmissionStarted) return void this.failInterruptedRecording();
20140
+ this.emit("ERROR", {
20141
+ err: error_createError({
20142
+ message: "WebSocket stream error",
20143
+ explanation: `The WebSocket stream emitted an error event. Details: ${string_pretty(err)}`,
20144
+ options: this.options,
20145
+ exc: streamError
20146
+ })
20147
+ });
19930
20148
  }
19931
20149
  sendPings() {
19932
20150
  this.stopPings();
@@ -19937,6 +20155,7 @@ var __webpack_exports__ = {};
19937
20155
  }
19938
20156
  stopPings() {
19939
20157
  if (void 0 === this.pingInterval) return;
20158
+ this.options.logger.debug("Recorder: stopping pings...");
19940
20159
  window.clearInterval(this.pingInterval);
19941
20160
  this.pingInterval = void 0;
19942
20161
  }
@@ -20089,7 +20308,7 @@ var __webpack_exports__ = {};
20089
20308
  });
20090
20309
  }
20091
20310
  shouldIgnoreConnectionFailure() {
20092
- return this.connectionFailed || this.connected || Boolean(this.unloaded);
20311
+ return this.connectionFailed || this.connected || Boolean(this.unloaded) || this.validate();
20093
20312
  }
20094
20313
  calculateFrameProgress() {
20095
20314
  return `${(this.confirmedFrameNumber / (this.framesCount || 1) * 100).toFixed(2)}%`;
@@ -20297,29 +20516,7 @@ var __webpack_exports__ = {};
20297
20516
  }
20298
20517
  });
20299
20518
  stream.on("error", (err)=>{
20300
- var _this_lastSocketError;
20301
- if ("u" > typeof Event && err instanceof Event) this.lastSocketError = error_getEventDetails(err);
20302
- else this.lastSocketError = serializeError(err);
20303
- const debugLine = string_summarize(`${PIPE_SYMBOL}Stream *error* event emitted:`, {
20304
- error: serializeError(err)
20305
- });
20306
- this.options.logger.debug(debugLine);
20307
- if (!this.connected) return void this.handleConnectionFailure({
20308
- url2Connect,
20309
- cause: "error"
20310
- });
20311
- const streamError = err instanceof Error ? err : new Error("WebSocket stream emitted an error event", {
20312
- cause: null != (_this_lastSocketError = this.lastSocketError) ? _this_lastSocketError : err
20313
- });
20314
- if (this.mediaTransmissionStarted) return void this.failInterruptedRecording();
20315
- this.emit("ERROR", {
20316
- err: error_createError({
20317
- message: "WebSocket stream error",
20318
- explanation: `The WebSocket stream emitted an error event. Details: ${string_pretty(err)}`,
20319
- options: this.options,
20320
- exc: streamError
20321
- })
20322
- });
20519
+ this.handleStreamError(url2Connect, err);
20323
20520
  });
20324
20521
  stream.on("drain", ()=>{
20325
20522
  this.handleStreamDrain(stream);
@@ -20667,6 +20864,7 @@ var __webpack_exports__ = {};
20667
20864
  }
20668
20865
  back(cb) {
20669
20866
  this.emit("GOING_BACK");
20867
+ this.key = void 0;
20670
20868
  this.recordingDimensions = void 0;
20671
20869
  this.unloaded = false;
20672
20870
  this.show();
@@ -20733,7 +20931,7 @@ var __webpack_exports__ = {};
20733
20931
  this.stopTimeout = void 0;
20734
20932
  }
20735
20933
  validate() {
20736
- return this.connected && void 0 === this.canvas;
20934
+ return Boolean(this.key) && void 0 === this.canvas;
20737
20935
  }
20738
20936
  isReady() {
20739
20937
  var _this_userMedia;