videomail-client 16.4.1 → 16.6.0

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/dist/umd/index.js CHANGED
@@ -5,13 +5,13 @@
5
5
  else root["VideomailClient"] = factory();
6
6
  })(globalThis, ()=>(()=>{
7
7
  var __webpack_modules__ = {
8
- pJ (module1, __webpack_exports__, __webpack_require__) {
8
+ eq (module1, __webpack_exports__, __webpack_require__) {
9
9
  "use strict";
10
- var _node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1 = __webpack_require__("K7");
11
- var _node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1_default = /*#__PURE__*/ __webpack_require__.n(_node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1);
12
- var _node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0 = __webpack_require__("Ly");
13
- var _node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0_default = /*#__PURE__*/ __webpack_require__.n(_node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0);
14
- var ___CSS_LOADER_EXPORT___ = _node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0_default()(_node_modules_rslib_core_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1_default());
10
+ var _node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1 = __webpack_require__("erX");
11
+ var _node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1_default = /*#__PURE__*/ __webpack_require__.n(_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1);
12
+ var _node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0 = __webpack_require__("zm");
13
+ var _node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0_default = /*#__PURE__*/ __webpack_require__.n(_node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0);
14
+ var ___CSS_LOADER_EXPORT___ = _node_modules_rsbuild_core_compiled_css_loader_api_js__rspack_import_0_default()(_node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_1_default());
15
15
  ___CSS_LOADER_EXPORT___.push([
16
16
  module1.id,
17
17
  `@keyframes blink {
@@ -159,7 +159,7 @@
159
159
  });
160
160
  },
161
161
  b6 (module1, exports1, __webpack_require__) {
162
- var EventEmitter = __webpack_require__("qU").EventEmitter, inherits = __webpack_require__("c5"), raf = __webpack_require__("jY"), methods;
162
+ var EventEmitter = __webpack_require__("q").EventEmitter, inherits = __webpack_require__("c5"), raf = __webpack_require__("jY"), methods;
163
163
  var defaultRAFObject = {
164
164
  requestAnimationFrame: raf,
165
165
  cancelAnimationFrame: raf.cancel
@@ -1837,7 +1837,7 @@
1837
1837
  },
1838
1838
  xF (module1, __unused_rspack_exports, __webpack_require__) {
1839
1839
  "use strict";
1840
- var document1 = __webpack_require__("gM");
1840
+ var document1 = __webpack_require__("g");
1841
1841
  var Event1 = __webpack_require__("cE");
1842
1842
  var Keys = __webpack_require__("Dy");
1843
1843
  module1.exports = Visibility;
@@ -2192,7 +2192,7 @@
2192
2192
  var isArray = __webpack_require__("ab");
2193
2193
  var Duplex;
2194
2194
  Readable.ReadableState = ReadableState;
2195
- __webpack_require__("qU").EventEmitter;
2195
+ __webpack_require__("q").EventEmitter;
2196
2196
  var EElistenerCount = function(emitter, type) {
2197
2197
  return emitter.listeners(type).length;
2198
2198
  };
@@ -3456,7 +3456,7 @@
3456
3456
  };
3457
3457
  },
3458
3458
  tb (module1, __unused_rspack_exports, __webpack_require__) {
3459
- module1.exports = __webpack_require__("qU").EventEmitter;
3459
+ module1.exports = __webpack_require__("q").EventEmitter;
3460
3460
  },
3461
3461
  GB (module1, exports1, __webpack_require__) {
3462
3462
  exports1 = module1.exports = __webpack_require__("rp");
@@ -3853,7 +3853,7 @@
3853
3853
  "use strict";
3854
3854
  module1.exports = Object;
3855
3855
  },
3856
- qU (module1) {
3856
+ q (module1) {
3857
3857
  "use strict";
3858
3858
  var R = 'object' == typeof Reflect ? Reflect : null;
3859
3859
  var ReflectApply = R && 'function' == typeof R.apply ? R.apply : function(target, receiver, args) {
@@ -4903,7 +4903,7 @@
4903
4903
  return tuple.listen;
4904
4904
  }
4905
4905
  },
4906
- gM (module1, __unused_rspack_exports, __webpack_require__) {
4906
+ g (module1, __unused_rspack_exports, __webpack_require__) {
4907
4907
  var topLevel = void 0 !== __webpack_require__.g ? __webpack_require__.g : "u" > typeof window ? window : {};
4908
4908
  var minDoc = __webpack_require__("MM");
4909
4909
  var doccy;
@@ -5993,6 +5993,7 @@
5993
5993
  var has = Object.prototype.hasOwnProperty;
5994
5994
  var isArray = Array.isArray;
5995
5995
  var getPrototypeOf = Object.getPrototypeOf;
5996
+ var fromCharCode = String.fromCharCode;
5996
5997
  var isPlainContainer = function(value) {
5997
5998
  if (!value || 'object' != typeof value) return false;
5998
5999
  if (isArray(value)) return true;
@@ -6065,7 +6066,12 @@
6065
6066
  };
6066
6067
  var interpretNumericEntities = function(str) {
6067
6068
  return str.replace(/&#(\d+);/g, function($0, numberStr) {
6068
- return String.fromCharCode(parseInt(numberStr, 10));
6069
+ var c = parseInt(numberStr, 10);
6070
+ if (c > 0xFFFF && c <= 0x10FFFF) {
6071
+ c -= 0x10000;
6072
+ return fromCharCode(0xD800 | c >> 10, 0xDC00 | 0x3FF & c);
6073
+ }
6074
+ return fromCharCode(c);
6069
6075
  });
6070
6076
  };
6071
6077
  var parseArrayValue = function(val, options, currentArrayLength) {
@@ -6137,6 +6143,9 @@
6137
6143
  }
6138
6144
  return obj;
6139
6145
  };
6146
+ var stripWrappingBrackets = function(key) {
6147
+ return '[' === key.charAt(0) && ']' === key.charAt(key.length - 1) ? key.slice(1, -1) : key;
6148
+ };
6140
6149
  var parseObject = function(chain, val, options, valuesParsed) {
6141
6150
  var currentArrayLength = 0;
6142
6151
  if (chain.length > 0 && '[]' === chain[chain.length - 1]) {
@@ -6152,7 +6161,7 @@
6152
6161
  obj = options.plainObjects ? {
6153
6162
  __proto__: null
6154
6163
  } : {};
6155
- var cleanRoot = '[' === root.charAt(0) && ']' === root.charAt(root.length - 1) ? root.slice(1, -1) : root;
6164
+ var cleanRoot = stripWrappingBrackets(root);
6156
6165
  var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/gi, '.') : cleanRoot;
6157
6166
  var index = parseInt(decodedRoot, 10);
6158
6167
  var isValidArrayIndex = !isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays;
@@ -6165,9 +6174,7 @@
6165
6174
  obj[index] = leaf;
6166
6175
  utils.markOverflow(obj, index);
6167
6176
  } else if ('__proto__' !== decodedRoot) obj[decodedRoot] = leaf;
6168
- } else obj = {
6169
- 0: leaf
6170
- };
6177
+ } else obj[0] = leaf;
6171
6178
  }
6172
6179
  leaf = obj;
6173
6180
  }
@@ -6197,7 +6204,7 @@
6197
6204
  var splitKeyIntoSegments = function(originalKey, options) {
6198
6205
  var key = options.allowDots ? topLevelDotsToBrackets(originalKey) : originalKey;
6199
6206
  if (options.depth <= 0) {
6200
- if (!options.plainObjects && has.call(Object.prototype, key)) {
6207
+ if (!options.plainObjects && has.call(Object.prototype, stripWrappingBrackets(key))) {
6201
6208
  if (!options.allowPrototypes) return;
6202
6209
  }
6203
6210
  return [
@@ -6581,6 +6588,11 @@
6581
6588
  }
6582
6589
  return max;
6583
6590
  };
6591
+ var countElements = function(arr) {
6592
+ var count = 0;
6593
+ for(var i = 0; i < arr.length; ++i)if (has.call(arr, i)) count += 1;
6594
+ return count;
6595
+ };
6584
6596
  var limitedPair = function(first, second, options) {
6585
6597
  var pair = [
6586
6598
  first,
@@ -6597,7 +6609,7 @@
6597
6609
  if ('object' != typeof source && 'function' != typeof source) {
6598
6610
  if (isArray(target)) {
6599
6611
  var nextIndex = target.length;
6600
- if (options && 'number' == typeof options.arrayLimit && nextIndex >= options.arrayLimit) {
6612
+ if (options && 'number' == typeof options.arrayLimit && countElements(target) >= options.arrayLimit) {
6601
6613
  if (options.throwOnLimitExceeded) throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (1 === options.arrayLimit ? '' : 's') + ' allowed in an array.');
6602
6614
  return markOverflow(arrayToObject(target.concat(source), options), nextIndex);
6603
6615
  }
@@ -6655,7 +6667,7 @@
6655
6667
  else target[target.length] = item;
6656
6668
  } else target[i] = item;
6657
6669
  });
6658
- if (options && 'number' == typeof options.arrayLimit && target.length > options.arrayLimit) {
6670
+ if (options && 'number' == typeof options.arrayLimit && countElements(target) > options.arrayLimit) {
6659
6671
  if (options.throwOnLimitExceeded) throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (1 === options.arrayLimit ? '' : 's') + ' allowed in an array.');
6660
6672
  return markOverflow(arrayToObject(target, options), target.length - 1);
6661
6673
  }
@@ -8817,7 +8829,7 @@
8817
8829
  var isArray = __webpack_require__("N3");
8818
8830
  var Duplex;
8819
8831
  Readable.ReadableState = ReadableState;
8820
- __webpack_require__("qU").EventEmitter;
8832
+ __webpack_require__("q").EventEmitter;
8821
8833
  var EElistenerCount = function(emitter, type) {
8822
8834
  return emitter.listeners(type).length;
8823
8835
  };
@@ -8836,7 +8848,7 @@
8836
8848
  var debug = void 0;
8837
8849
  debug = debugUtil && debugUtil.debuglog ? debugUtil.debuglog('stream') : function() {};
8838
8850
  var BufferList = __webpack_require__("aI");
8839
- var destroyImpl = __webpack_require__("R");
8851
+ var destroyImpl = __webpack_require__("R5");
8840
8852
  var StringDecoder;
8841
8853
  util.inherits(Readable, Stream);
8842
8854
  var kProxyEvents = [
@@ -9571,7 +9583,7 @@
9571
9583
  function _isUint8Array(obj) {
9572
9584
  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
9573
9585
  }
9574
- var destroyImpl = __webpack_require__("R");
9586
+ var destroyImpl = __webpack_require__("R5");
9575
9587
  util.inherits(Writable, Stream);
9576
9588
  function nop() {}
9577
9589
  function WritableState(options, stream) {
@@ -10025,7 +10037,7 @@
10025
10037
  return this.constructor.name + ' ' + obj;
10026
10038
  };
10027
10039
  },
10028
- R (module1, __unused_rspack_exports, __webpack_require__) {
10040
+ R5 (module1, __unused_rspack_exports, __webpack_require__) {
10029
10041
  "use strict";
10030
10042
  var pna = __webpack_require__("sj");
10031
10043
  function destroy(err, cb) {
@@ -10081,7 +10093,7 @@
10081
10093
  };
10082
10094
  },
10083
10095
  O (module1, __unused_rspack_exports, __webpack_require__) {
10084
- module1.exports = __webpack_require__("qU").EventEmitter;
10096
+ module1.exports = __webpack_require__("q").EventEmitter;
10085
10097
  },
10086
10098
  Fo (module1, exports1, __webpack_require__) {
10087
10099
  exports1 = module1.exports = __webpack_require__("w");
@@ -10571,7 +10583,7 @@
10571
10583
  a () {},
10572
10584
  Av () {},
10573
10585
  eD () {},
10574
- Ly (module1) {
10586
+ zm (module1) {
10575
10587
  "use strict";
10576
10588
  module1.exports = function(cssWithMappingToString) {
10577
10589
  var list = [];
@@ -10625,13 +10637,13 @@
10625
10637
  return list;
10626
10638
  };
10627
10639
  },
10628
- K7 (module1) {
10640
+ erX (module1) {
10629
10641
  "use strict";
10630
10642
  module1.exports = function(i) {
10631
10643
  return i[1];
10632
10644
  };
10633
10645
  },
10634
- q (module1) {
10646
+ R (module1) {
10635
10647
  "use strict";
10636
10648
  var stylesInDOM = [];
10637
10649
  function getIndexByIdentifier(identifier) {
@@ -10710,7 +10722,7 @@
10710
10722
  };
10711
10723
  };
10712
10724
  },
10713
- f (module1) {
10725
+ uZ (module1) {
10714
10726
  "use strict";
10715
10727
  var memo = {};
10716
10728
  function getTarget(target) {
@@ -10732,7 +10744,7 @@
10732
10744
  }
10733
10745
  module1.exports = insertBySelector;
10734
10746
  },
10735
- z7 (module1) {
10747
+ mK (module1) {
10736
10748
  "use strict";
10737
10749
  function insertStyleElement(options) {
10738
10750
  var element = document.createElement("style");
@@ -10742,7 +10754,7 @@
10742
10754
  }
10743
10755
  module1.exports = insertStyleElement;
10744
10756
  },
10745
- g (module1, __unused_rspack_exports, __webpack_require__) {
10757
+ kU (module1, __unused_rspack_exports, __webpack_require__) {
10746
10758
  "use strict";
10747
10759
  function setAttributesWithoutAttributes(styleElement) {
10748
10760
  var nonce = __webpack_require__.nc;
@@ -10750,7 +10762,7 @@
10750
10762
  }
10751
10763
  module1.exports = setAttributesWithoutAttributes;
10752
10764
  },
10753
- V (module1) {
10765
+ Bd (module1) {
10754
10766
  "use strict";
10755
10767
  function apply(styleElement, options, obj) {
10756
10768
  var css = "";
@@ -10787,7 +10799,7 @@
10787
10799
  }
10788
10800
  module1.exports = domAPI;
10789
10801
  },
10790
- AD (module1) {
10802
+ snK (module1) {
10791
10803
  "use strict";
10792
10804
  function styleTagTransform(css, styleElement) {
10793
10805
  if (styleElement.styleSheet) styleElement.styleSheet.cssText = css;
@@ -11132,7 +11144,7 @@
11132
11144
  var client = __webpack_require__("Q");
11133
11145
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
11134
11146
  var package_namespaceObject = {
11135
- rE: "16.4.1"
11147
+ rE: "16.6.0"
11136
11148
  };
11137
11149
  function isAudioEnabled(options) {
11138
11150
  return Boolean(options.audio.enabled);
@@ -14647,12 +14659,12 @@
14647
14659
  const errName = err?.name ?? err?.constructor.name;
14648
14660
  switch(errName){
14649
14661
  case error_VideomailError.SECURITY_ERROR:
14650
- message = "The operation was insecure";
14651
- explanation = "Probably you have disallowed Cookies for this page?";
14662
+ message = "Your browser blocked this action";
14663
+ explanation = "Check this page's camera permissions and security settings.";
14652
14664
  classList.push(error_VideomailError.BROWSER_PROBLEM);
14653
14665
  break;
14654
14666
  case error_VideomailError.OVERCONSTRAINED:
14655
- message = "Invalid webcam constraints";
14667
+ message = "Your webcam cannot use these settings";
14656
14668
  if (err && "constraint" in err) {
14657
14669
  const overconstrainedError = err;
14658
14670
  const constraint = overconstrainedError.constraint;
@@ -14663,64 +14675,64 @@
14663
14675
  break;
14664
14676
  case "MediaDeviceFailedDueToShutdown":
14665
14677
  message = "Webcam is shutting down";
14666
- explanation = "This happens your webcam is already switching off and not giving you permission to use it.";
14678
+ explanation = "Wait for your webcam to finish switching off, then try again.";
14667
14679
  break;
14668
14680
  case "SourceUnavailableError":
14669
- message = "Source of your webcam cannot be accessed";
14670
- explanation = "Probably it is locked from another process or has a hardware error.";
14681
+ message = "Cannot access your webcam";
14682
+ explanation = "Another app may be using it, or there may be a hardware problem.";
14671
14683
  break;
14672
14684
  case "NO_DEVICES_FOUND":
14673
14685
  if (audioEnabled) {
14674
- message = "No webcam nor microphone found";
14675
- explanation = "Your browser cannot find a webcam with microphone attached to your machine.";
14686
+ message = "No webcam or microphone found";
14687
+ explanation = "Check that your webcam and microphone are connected.";
14676
14688
  } else {
14677
14689
  message = "No webcam found";
14678
- explanation = "Your browser cannot find a webcam attached to your machine.";
14690
+ explanation = "Check that your webcam is connected.";
14679
14691
  }
14680
14692
  classList.push(error_VideomailError.WEBCAM_PROBLEM);
14681
14693
  break;
14682
14694
  case "PermissionDismissedError":
14683
- message = "Ooops, you didn't give me any permissions?";
14684
- explanation = "Looks like you skipped the webcam permission dialogue.<br/>Please grant access next time the dialogue appears.";
14695
+ message = "Camera permission is needed";
14696
+ explanation = "The camera permission prompt was closed.<br/>Please allow access when it appears again.";
14685
14697
  classList.push(error_VideomailError.WEBCAM_PROBLEM);
14686
14698
  break;
14687
14699
  case error_VideomailError.NOT_ALLOWED_ERROR:
14688
14700
  case error_VideomailError.PERMISSION_DENIED:
14689
14701
  case "PermissionDeniedError":
14690
14702
  message = "Permission denied";
14691
- explanation = "Cannot access your webcam. This can have two reasons:<br/>a) you blocked access to webcam; or<br/>b) your webcam is already in use.";
14703
+ explanation = "We cannot access your webcam. Check these possibilities:<ul><li>Camera access is blocked in your browser settings.</li><li>Another app is using your webcam.</li></ul>";
14692
14704
  classList.push(error_VideomailError.WEBCAM_PROBLEM);
14693
14705
  break;
14694
14706
  case "HARDWARE_UNAVAILABLE":
14695
14707
  case "AbortError":
14696
14708
  message = "Webcam is unavailable";
14697
- explanation = "Maybe it is already busy in another window?";
14709
+ explanation = "Another window may be using it. Close it and try again.";
14698
14710
  classList.push(error_VideomailError.WEBCAM_PROBLEM);
14699
14711
  break;
14700
14712
  case "NO_VIDEO_FEED":
14701
- message = "No video feed found!";
14702
- explanation = "Your webcam is already used in another browser.";
14713
+ message = "No video feed found";
14714
+ explanation = "Another browser may be using your webcam.";
14703
14715
  classList.push(error_VideomailError.WEBCAM_PROBLEM);
14704
14716
  break;
14705
14717
  case error_VideomailError.STARTING_FAILED:
14706
- message = "Starting video failed";
14707
- explanation = "Most likely this happens when the webcam is already active in another browser";
14718
+ message = "Could not start recording";
14719
+ explanation = "Another browser may be using your webcam.";
14708
14720
  classList.push(error_VideomailError.WEBCAM_PROBLEM);
14709
14721
  break;
14710
14722
  case "DevicesNotFoundError":
14711
- message = "No available webcam could be found";
14712
- explanation = "Looks like you do not have any webcam attached to your machine; or the one you plugged in is already used.";
14723
+ message = "No available webcam found";
14724
+ explanation = "Check that your webcam is connected and not being used by another app.";
14713
14725
  classList.push(error_VideomailError.WEBCAM_PROBLEM);
14714
14726
  break;
14715
14727
  case error_VideomailError.NOT_READABLE_ERROR:
14716
14728
  case error_VideomailError.TRACK_START_ERROR:
14717
- message = "No access to webcam";
14718
- explanation = "Perhaps you are already using it in another browser?";
14729
+ message = "Cannot access your webcam";
14730
+ explanation = "Another browser may be using it. Close it and try again.";
14719
14731
  classList.push(error_VideomailError.WEBCAM_PROBLEM);
14720
14732
  break;
14721
14733
  case error_VideomailError.INVALID_STATE_ERROR:
14722
- message = "Invalid state";
14723
- explanation = "Video recording stream from your webcam already has finished";
14734
+ message = "Your camera stream has ended";
14735
+ explanation = "The webcam stream is no longer active.";
14724
14736
  classList.push(error_VideomailError.WEBCAM_PROBLEM);
14725
14737
  break;
14726
14738
  case error_VideomailError.DOM_EXCEPTION:
@@ -15048,6 +15060,7 @@
15048
15060
  submitButtonFormAttribute = null;
15049
15061
  generatedFormId;
15050
15062
  isSubmitting = false;
15063
+ submissionDisabledStates = new Map();
15051
15064
  FORM_FIELDS = {};
15052
15065
  constructor(container, formElement, options){
15053
15066
  super("Form", options);
@@ -15172,6 +15185,17 @@
15172
15185
  enable(buttonsToo) {
15173
15186
  this.setDisabled(false, buttonsToo);
15174
15187
  }
15188
+ disableForSubmission() {
15189
+ for (const formControl of this.formElement.elements){
15190
+ this.submissionDisabledStates.set(formControl, formControl.hasAttribute("disabled"));
15191
+ formControl.setAttribute("disabled", "disabled");
15192
+ }
15193
+ }
15194
+ restoreAfterFailedSubmission() {
15195
+ for (const [formControl, wasDisabled] of this.submissionDisabledStates)if (wasDisabled) formControl.setAttribute("disabled", "disabled");
15196
+ else formControl.removeAttribute("disabled");
15197
+ this.submissionDisabledStates.clear();
15198
+ }
15175
15199
  build() {
15176
15200
  this.options.logger.debug("Form: build()");
15177
15201
  this.keyInput = this.formElement.querySelector(`input[name="${this.options.selectors.keyInputName}"]`);
@@ -15700,19 +15724,19 @@
15700
15724
  return newOptions;
15701
15725
  }
15702
15726
  const options_mergeWithDefaultOptions = mergeWithDefaultOptions;
15703
- var injectStylesIntoStyleTag = __webpack_require__("q");
15727
+ var injectStylesIntoStyleTag = __webpack_require__("R");
15704
15728
  var injectStylesIntoStyleTag_default = /*#__PURE__*/ __webpack_require__.n(injectStylesIntoStyleTag);
15705
- var styleDomAPI = __webpack_require__("V");
15729
+ var styleDomAPI = __webpack_require__("Bd");
15706
15730
  var styleDomAPI_default = /*#__PURE__*/ __webpack_require__.n(styleDomAPI);
15707
- var insertBySelector = __webpack_require__("f");
15731
+ var insertBySelector = __webpack_require__("uZ");
15708
15732
  var insertBySelector_default = /*#__PURE__*/ __webpack_require__.n(insertBySelector);
15709
- var setAttributesWithoutAttributes = __webpack_require__("g");
15733
+ var setAttributesWithoutAttributes = __webpack_require__("kU");
15710
15734
  var setAttributesWithoutAttributes_default = /*#__PURE__*/ __webpack_require__.n(setAttributesWithoutAttributes);
15711
- var insertStyleElement = __webpack_require__("z7");
15735
+ var insertStyleElement = __webpack_require__("mK");
15712
15736
  var insertStyleElement_default = /*#__PURE__*/ __webpack_require__.n(insertStyleElement);
15713
- var styleTagTransform = __webpack_require__("AD");
15737
+ var styleTagTransform = __webpack_require__("snK");
15714
15738
  var styleTagTransform_default = /*#__PURE__*/ __webpack_require__.n(styleTagTransform);
15715
- var main = __webpack_require__("pJ");
15739
+ var main = __webpack_require__("eq");
15716
15740
  var main_options = {};
15717
15741
  main_options.styleTagTransform = styleTagTransform_default();
15718
15742
  main_options.setAttributes = setAttributesWithoutAttributes_default();
@@ -18019,8 +18043,13 @@
18019
18043
  this.hide();
18020
18044
  }
18021
18045
  onUserMediaReady(params) {
18022
- this.onFormReady();
18046
+ this.onFormReady(params);
18023
18047
  html_showElement(this.buttonsElement);
18048
+ if (params.recovering && params.paused) {
18049
+ html_hideElement(this.recordButton);
18050
+ html_disableElement(this.recordButton);
18051
+ return;
18052
+ }
18024
18053
  html_showElement(this.audioOnRadioPair);
18025
18054
  html_showElement(this.audioOffRadioPair);
18026
18055
  if (html_isShown(this.recordButton) && !params.recordWhenReady) html_enableElement(this.recordButton);
@@ -18676,8 +18705,8 @@
18676
18705
  this.on("PAUSED", ()=>{
18677
18706
  this.pauseRecording();
18678
18707
  });
18679
- this.on("ERROR", ()=>{
18680
- this.onResetting();
18708
+ this.on("ERROR", ({ recoverable })=>{
18709
+ if (!recoverable) this.onResetting();
18681
18710
  });
18682
18711
  this.on("RESETTING", ()=>{
18683
18712
  this.onResetting();
@@ -18852,12 +18881,12 @@
18852
18881
  this.entertainTimeoutId = void 0;
18853
18882
  this.entertaining = false;
18854
18883
  }
18855
- error(err) {
18884
+ error(err, blocking = true) {
18856
18885
  const message = err.message;
18857
18886
  const explanation = err.explanation;
18858
18887
  if (!message) this.options.logger.debug(`Weird empty error message generated for error ${string_pretty(err)}`);
18859
18888
  this.notify(message, explanation, {
18860
- blocking: true,
18889
+ blocking,
18861
18890
  problem: true,
18862
18891
  classList: err.getClassList(),
18863
18892
  removeDimensions: util_getBrowser(this.options).isMobile()
@@ -20277,6 +20306,9 @@
20277
20306
  if (this.streamBackpressured) this.resumeAfterDrain = true;
20278
20307
  else loop.start();
20279
20308
  }
20309
+ resumeMediaForCountdown() {
20310
+ this.userMedia?.resume();
20311
+ }
20280
20312
  onFlushed(opts) {
20281
20313
  const frameNumber = opts.frameNumber;
20282
20314
  if (1 === frameNumber) this.emit("FIRST_FRAME_SENT");
@@ -20959,10 +20991,7 @@
20959
20991
  "droidcam"
20960
20992
  ];
20961
20993
  function isVirtualCamera(videoTrack) {
20962
- const capabilities = videoTrack.getCapabilities();
20963
- if (!capabilities.frameRate) return true;
20964
- const isVirtual = VIRTUAL_KEYWORDS.some((keyword)=>videoTrack.label.toLowerCase().includes(keyword));
20965
- return isVirtual;
20994
+ return VIRTUAL_KEYWORDS.some((keyword)=>videoTrack.label.toLowerCase().includes(keyword));
20966
20995
  }
20967
20996
  const util_isVirtualCamera = isVirtualCamera;
20968
20997
  const EVENT_ASCII = "|—O—|";
@@ -21357,7 +21386,7 @@
21357
21386
  let explanation = "(No explanation given)";
21358
21387
  if (command.args?.err?.message) explanation = command.args.err.message;
21359
21388
  const err = error_createError({
21360
- message: "Websocket error from Videomail server",
21389
+ message: "WebSocket error from the Videomail server",
21361
21390
  explanation,
21362
21391
  err: deserializeError(command.args?.err),
21363
21392
  options: this.options
@@ -21970,21 +21999,36 @@
21970
21999
  this.clearCameraRecoveryNotice();
21971
22000
  return this.recorder.recoverCamera();
21972
22001
  }
21973
- resume() {
22002
+ canResumeCountdown(restored) {
22003
+ return restored && Boolean(this.recorderInsides.isCountingDown());
22004
+ }
22005
+ async resumeCountdown() {
22006
+ const restored = await this.recoverCamera();
22007
+ if (!this.canResumeCountdown(restored)) return;
22008
+ this.recorder.resumeMediaForCountdown();
22009
+ this.recorderInsides.resumeCountdown();
22010
+ this.recorderInsides.hidePause();
22011
+ }
22012
+ async resume() {
21974
22013
  this.clearCameraRecoveryNotice();
21975
- if (this.recorderInsides.isCountingDown()) {
21976
- this.recorderInsides.resumeCountdown();
21977
- this.recorderInsides.hidePause();
21978
- } else {
22014
+ if (this.recorderInsides.isCountingDown()) await this.resumeCountdown();
22015
+ else {
21979
22016
  this.recorder.resume();
21980
22017
  if (!this.recorder.isPaused()) this.recorderInsides.hidePause();
21981
22018
  }
21982
22019
  }
22020
+ resumeFromControl() {
22021
+ this.resume().catch((exc)=>{
22022
+ this.emit("ERROR", {
22023
+ exc
22024
+ });
22025
+ });
22026
+ }
21983
22027
  pauseOrResume() {
21984
- if (this.cameraRecoveryFailed && this.recorder.isPaused()) this.resume();
22028
+ if (this.cameraRecoveryFailed && this.recorder.isPaused()) this.resumeFromControl();
21985
22029
  else if (this.isRecordable()) {
21986
22030
  if (this.isRecording()) this.pause();
21987
- else if (this.recorder.isPaused()) this.resume();
22031
+ else if (this.recorder.isPaused()) this.resumeFromControl();
21988
22032
  else if (this.recorder.isReady()) this.recorder.record();
21989
22033
  }
21990
22034
  }
@@ -22013,8 +22057,8 @@
22013
22057
  isPaused() {
22014
22058
  return this.recorder.isPaused();
22015
22059
  }
22016
- error(err) {
22017
- this.notifier.error(err);
22060
+ error(err, blocking = true) {
22061
+ this.notifier.error(err, blocking);
22018
22062
  }
22019
22063
  hide() {
22020
22064
  if (this.visualsElement) {
@@ -22105,6 +22149,7 @@
22105
22149
  }
22106
22150
  }
22107
22151
  const wrappers_visuals = Visuals;
22152
+ const INTERACTIVE_SPACE_TARGETS = "button, input, select, textarea, a[href], summary, label, audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch'], [role='menuitem'], [role='tab'], [tabindex]:not([tabindex='-1'])";
22108
22153
  class Container extends util_Despot {
22109
22154
  visibility = document_visibility_default()();
22110
22155
  htmlElement = document.querySelector("html");
@@ -22128,14 +22173,16 @@
22128
22173
  });
22129
22174
  };
22130
22175
  handleKeyDown = (e)=>{
22131
- const element = e.target;
22132
- const tagName = element.tagName;
22133
- const isEditable = element.isContentEditable || "true" === element.contentEditable;
22134
- if (!isEditable && tagName && "INPUT" !== tagName.toUpperCase() && "TEXTAREA" !== tagName.toUpperCase() && "Space" === e.code) {
22135
- e.preventDefault();
22136
- if (this.options.enablePause) this.visuals.pauseOrResume();
22137
- else this.visuals.recordOrStop();
22138
- }
22176
+ const containerElement = this.containerElement;
22177
+ if (!containerElement) return;
22178
+ const eventPath = e.composedPath();
22179
+ const targetContainerIndex = eventPath.findIndex((eventTarget)=>eventTarget instanceof Element && eventTarget.classList.contains(this.options.selectors.containerClass));
22180
+ const targetContainer = eventPath[targetContainerIndex];
22181
+ const isInteractiveTarget = eventPath.slice(0, targetContainerIndex + 1).some((eventTarget)=>eventTarget instanceof Element && eventTarget.matches(INTERACTIVE_SPACE_TARGETS));
22182
+ if (!eventPath.includes(containerElement) || targetContainer !== containerElement || isInteractiveTarget || e.defaultPrevented || e.repeat || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || "Space" !== e.code) return;
22183
+ e.preventDefault();
22184
+ if (this.options.enablePause) this.visuals.pauseOrResume();
22185
+ else this.visuals.recordOrStop();
22139
22186
  };
22140
22187
  constructor(options){
22141
22188
  super("Container", options);
@@ -22213,9 +22260,9 @@
22213
22260
  if (params.exc.stack) this.options.logger.error(params.exc.stack);
22214
22261
  else if (params.exc.message) this.options.logger.error(params.exc.message);
22215
22262
  } else this.options.logger.error(params.exc);
22216
- if (this.options.displayErrors && params.err) this.visuals.error(params.err);
22217
- else if (this.options.displayErrors && params.exc && params.exc instanceof error_VideomailError) this.visuals.error(params.exc);
22218
- else this.visuals.reset();
22263
+ if (this.options.displayErrors && params.err) this.visuals.error(params.err, !params.recoverable);
22264
+ else if (this.options.displayErrors && params.exc && params.exc instanceof error_VideomailError) this.visuals.error(params.exc, !params.recoverable);
22265
+ else if (!params.recoverable) this.visuals.reset();
22219
22266
  }
22220
22267
  initEvents(playerOnly = false) {
22221
22268
  this.options.logger.debug(`Container: initEvents (playerOnly = ${playerOnly})`);
@@ -22233,7 +22280,7 @@
22233
22280
  }
22234
22281
  });
22235
22282
  if (this.options.enableSpace) {
22236
- if (!playerOnly) window.addEventListener("keydown", this.handleKeyDown);
22283
+ if (!playerOnly) this.containerElement?.addEventListener("keydown", this.handleKeyDown);
22237
22284
  }
22238
22285
  this.on("ERROR", (params)=>{
22239
22286
  this.processError(params);
@@ -22273,7 +22320,7 @@
22273
22320
  removeBrowserEventListeners() {
22274
22321
  window.removeEventListener("resize", this.handleWindowResize);
22275
22322
  window.removeEventListener("beforeunload", this.handleBeforeUnload);
22276
- window.removeEventListener("keydown", this.handleKeyDown);
22323
+ this.containerElement?.removeEventListener("keydown", this.handleKeyDown);
22277
22324
  this.stopListeningToVisibility?.();
22278
22325
  this.stopListeningToVisibility = void 0;
22279
22326
  }
@@ -22512,6 +22559,7 @@
22512
22559
  async submitAll(formData, method, url, hasHostAction = false) {
22513
22560
  let response;
22514
22561
  let hostResponse;
22562
+ let submissionFailed = false;
22515
22563
  const videomailKey = formData[this.options.selectors.keyInputName];
22516
22564
  try {
22517
22565
  const hasVideomailKey = Boolean(videomailKey);
@@ -22522,7 +22570,7 @@
22522
22570
  ].filter(Boolean).join(": ");
22523
22571
  this.options.logger.debug(`Container: submitAll(${output})`);
22524
22572
  this.beginWaiting();
22525
- if (this.options.disableFormWhenSubmitting) this.disableForm(true);
22573
+ if (this.options.disableFormWhenSubmitting) this.form?.disableForSubmission();
22526
22574
  this.emit("SUBMITTING");
22527
22575
  if (hasVideomailKey) {
22528
22576
  response = this.getPendingHostSubmissionResponse(videomailKey) ?? await this.submitVideomail(formData, method);
@@ -22552,15 +22600,18 @@
22552
22600
  });
22553
22601
  }
22554
22602
  } catch (exc) {
22603
+ submissionFailed = true;
22555
22604
  const err = error_createError({
22556
22605
  exc,
22557
22606
  options: this.options
22558
22607
  });
22559
22608
  this.emit("ERROR", {
22560
- err
22609
+ err,
22610
+ recoverable: true
22561
22611
  });
22562
22612
  } finally{
22563
22613
  const finalResponse = hostResponse ?? response;
22614
+ if (submissionFailed && this.options.disableFormWhenSubmitting) this.form?.restoreAfterFailedSubmission();
22564
22615
  if (finalResponse?.text && "text/html" === finalResponse.type) document.body.innerHTML = purify_default.sanitize(finalResponse.text);
22565
22616
  this.endWaiting();
22566
22617
  }
@@ -22601,7 +22652,7 @@
22601
22652
  }
22602
22653
  async submit() {
22603
22654
  this.options.logger.debug("Container: submit()");
22604
- if (this.lastValidation) return await this.form?.doTheSubmit();
22655
+ if (!this.options.enableAutoValidation || this.lastValidation) return await this.form?.doTheSubmit();
22605
22656
  return false;
22606
22657
  }
22607
22658
  isCountingDown() {
@@ -22614,7 +22665,11 @@
22614
22665
  this.visuals.record();
22615
22666
  }
22616
22667
  resume() {
22617
- this.visuals.resume();
22668
+ this.visuals.resume().catch((exc)=>{
22669
+ this.emit("ERROR", {
22670
+ exc
22671
+ });
22672
+ });
22618
22673
  }
22619
22674
  stop() {
22620
22675
  this.visuals.stop();