videomail-client 10.3.4 → 10.3.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.
package/dist/esm/index.js CHANGED
@@ -1,10 +1,11 @@
1
- import superagent from "superagent";
2
1
  import { deserializeError, serializeError } from "serialize-error";
2
+ import superagent from "superagent";
3
3
  import defined from "defined";
4
4
  import { UAParser } from "ua-parser-js";
5
5
  import get_form_data from "get-form-data";
6
6
  import hidden_0 from "hidden";
7
7
  import { createNanoEvents } from "nanoevents";
8
+ import deepmerge from "deepmerge";
8
9
  import document_visibility from "document-visibility";
9
10
  import contains from "contains";
10
11
  import animitter from "animitter";
@@ -12,7 +13,6 @@ import canvas_to_buffer from "canvas-to-buffer";
12
13
  import websocket_stream from "websocket-stream";
13
14
  import audio_sample from "audio-sample";
14
15
  import is_power_of_two from "is-power-of-two";
15
- import deepmerge from "deepmerge";
16
16
  var __webpack_modules__ = {
17
17
  "./node_modules/base64-js/index.js": function(__unused_webpack_module, exports) {
18
18
  exports.byteLength = byteLength;
@@ -3601,46 +3601,20 @@ const constants = {
3601
3601
  ENC_TYPE_FORM: "application/x-www-form-urlencoded"
3602
3602
  }
3603
3603
  };
3604
- var util = __webpack_require__("./node_modules/util/util.js");
3605
- var util_default = /*#__PURE__*/ __webpack_require__.n(util);
3606
- function inspect(element) {
3607
- return util_default().inspect(element, {
3608
- colors: true,
3609
- compact: true,
3610
- depth: 4,
3611
- breakLength: 1 / 0
3612
- }).replace(/\s+/gu, " ").replace(/\r?\n/gu, "");
3613
- }
3614
- function pretty(anything) {
3615
- if (anything instanceof HTMLElement) {
3616
- if (anything.id) return `#${anything.id}`;
3617
- if (anything.className) return `.${anything.className}`;
3618
- return "(No HTML identifier available)";
3619
- }
3620
- return inspect(anything);
3621
- }
3622
- const util_pretty = pretty;
3623
- function isAudioEnabled(options) {
3624
- return Boolean(options.audio.enabled);
3625
- }
3626
- function setAudioEnabled(enabled, options) {
3627
- options.audio.enabled = enabled;
3628
- return options;
3629
- }
3630
- function isAutoPauseEnabled(options) {
3631
- return options.enableAutoPause && options.enablePause;
3632
- }
3604
+ var package_namespaceObject = {
3605
+ i8: "10.3.6"
3606
+ };
3607
+ var VideoType_VideoType = /*#__PURE__*/ function(VideoType) {
3608
+ VideoType["WebM"] = "webm";
3609
+ VideoType["MP4"] = "mp4";
3610
+ return VideoType;
3611
+ }({});
3633
3612
  function canPlayType_canPlayType(video, type) {
3634
3613
  const canPlayType = video.canPlayType(`video/${type}`);
3635
3614
  if ("" === canPlayType) return false;
3636
3615
  return canPlayType;
3637
3616
  }
3638
3617
  const media_canPlayType = canPlayType_canPlayType;
3639
- var VideoType_VideoType = /*#__PURE__*/ function(VideoType) {
3640
- VideoType["WebM"] = "webm";
3641
- VideoType["MP4"] = "mp4";
3642
- return VideoType;
3643
- }({});
3644
3618
  const FALLBACK_VIDEO_TYPE = VideoType_VideoType.MP4;
3645
3619
  class Browser {
3646
3620
  options;
@@ -3723,6 +3697,35 @@ function getBrowser(localOptions) {
3723
3697
  return getBrowser_browser;
3724
3698
  }
3725
3699
  const util_getBrowser = getBrowser;
3700
+ function isAudioEnabled(options) {
3701
+ return Boolean(options.audio.enabled);
3702
+ }
3703
+ function setAudioEnabled(enabled, options) {
3704
+ options.audio.enabled = enabled;
3705
+ return options;
3706
+ }
3707
+ function isAutoPauseEnabled(options) {
3708
+ return options.enableAutoPause && options.enablePause;
3709
+ }
3710
+ var util = __webpack_require__("./node_modules/util/util.js");
3711
+ var util_default = /*#__PURE__*/ __webpack_require__.n(util);
3712
+ function inspect(element) {
3713
+ return util_default().inspect(element, {
3714
+ colors: false,
3715
+ compact: true,
3716
+ depth: 4,
3717
+ breakLength: 1 / 0
3718
+ }).replace(/\s+/gu, " ").replace(/\r?\n/gu, "");
3719
+ }
3720
+ function pretty(anything) {
3721
+ if (anything instanceof HTMLElement) {
3722
+ if (anything.id) return `#${anything.id}`;
3723
+ if (anything.className) return `.${anything.className}`;
3724
+ return "(No HTML identifier available)";
3725
+ }
3726
+ return inspect(anything);
3727
+ }
3728
+ const util_pretty = pretty;
3726
3729
  class HTTPVideomailError_HTTPVideomailError extends Error {
3727
3730
  code;
3728
3731
  status;
@@ -3979,6 +3982,10 @@ class Despot {
3979
3982
  }
3980
3983
  }
3981
3984
  const util_Despot = Despot;
3985
+ function isNotButton(element) {
3986
+ return "BUTTON" !== element.tagName && "submit" !== element.getAttribute("type");
3987
+ }
3988
+ const html_isNotButton = isNotButton;
3982
3989
  const REGEX = /[ ,]+/u;
3983
3990
  function trimEmail(email) {
3984
3991
  return email.replace(REGEX, "");
@@ -3987,10 +3994,6 @@ function trimEmails(emails) {
3987
3994
  const trimmedEmails = emails.split(REGEX).map((item)=>item.trim()).filter(Boolean);
3988
3995
  return trimmedEmails;
3989
3996
  }
3990
- function isNotButton(element) {
3991
- return "BUTTON" !== element.tagName && "submit" !== element.getAttribute("type");
3992
- }
3993
- const html_isNotButton = isNotButton;
3994
3997
  var form_FormMethod = /*#__PURE__*/ function(FormMethod) {
3995
3998
  FormMethod["POST"] = "post";
3996
3999
  FormMethod["PUT"] = "put";
@@ -4242,9 +4245,6 @@ class Form extends util_Despot {
4242
4245
  }
4243
4246
  }
4244
4247
  const wrappers_form = Form;
4245
- var package_namespaceObject = {
4246
- i8: "10.3.4"
4247
- };
4248
4248
  function findOriginalExc(exc) {
4249
4249
  if (exc instanceof Error && "response" in exc) {
4250
4250
  const response = exc.response;
@@ -4405,95 +4405,333 @@ class Resource {
4405
4405
  }
4406
4406
  }
4407
4407
  const src_resource = Resource;
4408
- function disableElement(element) {
4409
- if (!element) return;
4410
- if ("INPUT" === element.tagName || "BUTTON" === element.tagName) element.setAttribute("disabled", "true");
4411
- else element.classList.add("disabled");
4412
- }
4413
- const html_disableElement = disableElement;
4414
- function enableElement(element) {
4415
- if (!element) return;
4416
- if ("INPUT" === element.tagName || "BUTTON" === element.tagName) element.removeAttribute("disabled");
4417
- else element.classList.remove("disabled");
4418
- }
4419
- const html_enableElement = enableElement;
4420
- function hideElement_hideElement(element) {
4421
- if (!element) return;
4422
- hidden_0(element, true);
4423
- }
4424
- const hideElement = hideElement_hideElement;
4425
- function showElement(element) {
4426
- if (!element) return;
4427
- hidden_0(element, false);
4428
- }
4429
- const html_showElement = showElement;
4430
- function isShown_isShown(element) {
4431
- if (!element) return false;
4432
- return !hidden_0(element);
4408
+ const NodeEnvType = {
4409
+ DEVELOPMENT: "development",
4410
+ PRODUCTION: "production"
4411
+ };
4412
+ var process = __webpack_require__("./node_modules/process/browser.js");
4413
+ function getNodeEnv() {
4414
+ if (!process.env.NODE_ENV) return NodeEnvType.DEVELOPMENT;
4415
+ return process.env.NODE_ENV;
4433
4416
  }
4434
- const isShown = isShown_isShown;
4435
- function adjustButton(buttonElement, show, type, disabled) {
4436
- if (disabled) html_disableElement(buttonElement);
4437
- if (type) buttonElement.type = type;
4438
- if (!show) hideElement(buttonElement);
4439
- return buttonElement;
4417
+ const util_getNodeEnv = getNodeEnv;
4418
+ function isProductionMode() {
4419
+ return util_getNodeEnv() === NodeEnvType.PRODUCTION;
4440
4420
  }
4441
- const html_adjustButton = adjustButton;
4442
- class Buttons extends util_Despot {
4443
- container;
4444
- buttonsElement;
4445
- recordButton;
4446
- pauseButton;
4447
- resumeButton;
4448
- previewButton;
4449
- recordAgainButton;
4450
- submitButton;
4451
- audioOnRadioPair;
4452
- audioOffRadioPair;
4453
- built = false;
4454
- constructor(container, options){
4455
- super("Buttons", options);
4456
- this.container = container;
4457
- }
4458
- replaceClickHandler(element, clickHandler) {
4459
- const wrappedClickHandler = (ev)=>{
4460
- ev.preventDefault();
4461
- try {
4462
- clickHandler({
4463
- event: ev
4464
- });
4465
- } catch (exc) {
4466
- this.emit("ERROR", {
4467
- exc
4468
- });
4469
- }
4470
- };
4471
- element.onclick = wrappedClickHandler;
4472
- }
4473
- makeRadioButtonPair(options) {
4474
- let radioButtonElement;
4475
- let radioButtonGroup;
4476
- if (options.id) radioButtonElement = document.querySelector(`#${options.id}`);
4477
- if (!radioButtonElement) {
4478
- radioButtonElement = document.createElement("input");
4479
- radioButtonElement.id = options.id;
4480
- radioButtonElement.type = "radio";
4481
- radioButtonElement.name = options.name;
4482
- radioButtonElement.value = options.value;
4483
- radioButtonElement.checked = options.checked;
4484
- radioButtonGroup = document.createElement("span");
4485
- radioButtonGroup.classList.add("radioGroup");
4486
- radioButtonGroup.appendChild(radioButtonElement);
4487
- const radioLabel = document.createElement("label");
4488
- radioLabel.htmlFor = options.id;
4489
- radioLabel.textContent = options.label;
4490
- radioButtonGroup.appendChild(radioLabel);
4491
- if (this.submitButton && contains(this.buttonsElement, this.submitButton)) this.buttonsElement?.insertBefore(radioButtonGroup, this.submitButton);
4492
- else this.buttonsElement?.appendChild(radioButtonGroup);
4421
+ const util_isProductionMode = isProductionMode;
4422
+ const PRODUCTION = util_isProductionMode();
4423
+ const options_options = {
4424
+ logger: console,
4425
+ logStackSize: 30,
4426
+ verbose: !PRODUCTION,
4427
+ baseUrl: "https://videomail.io",
4428
+ socketUrl: "wss://videomail.io",
4429
+ siteName: "videomail-client-demo",
4430
+ enablePause: true,
4431
+ enableAutoPause: true,
4432
+ enableSpace: true,
4433
+ submitWithVideomail: false,
4434
+ disableSubmit: false,
4435
+ enableAutoValidation: true,
4436
+ enableAutoUnload: true,
4437
+ enableAutoSubmission: true,
4438
+ enctype: "application/json",
4439
+ selectors: {
4440
+ containerId: void 0,
4441
+ containerClass: "videomail",
4442
+ replayClass: "replay",
4443
+ userMediaClass: "userMedia",
4444
+ visualsClass: "visuals",
4445
+ buttonClass: void 0,
4446
+ buttonsClass: "buttons",
4447
+ recordButtonClass: "record",
4448
+ pauseButtonClass: "pause",
4449
+ resumeButtonClass: "resume",
4450
+ previewButtonClass: "preview",
4451
+ recordAgainButtonClass: "recordAgain",
4452
+ submitButtonClass: "submit",
4453
+ subjectInputName: "subject",
4454
+ fromInputName: "from",
4455
+ toInputName: "to",
4456
+ ccInputName: "cc",
4457
+ bccInputName: "bcc",
4458
+ bodyInputName: "body",
4459
+ sendCopyInputName: "sendCopy",
4460
+ keyInputName: "videomail_key",
4461
+ parentKeyInputName: "videomail_parent_key",
4462
+ formId: void 0,
4463
+ submitButtonId: void 0,
4464
+ submitButtonSelector: void 0
4465
+ },
4466
+ audio: {
4467
+ enabled: false,
4468
+ switch: false,
4469
+ volume: 0.2,
4470
+ bufferSize: "auto"
4471
+ },
4472
+ video: {
4473
+ fps: 15,
4474
+ limitSeconds: 30,
4475
+ countdown: 3,
4476
+ width: void 0,
4477
+ height: void 0,
4478
+ facingMode: "user",
4479
+ facingModeButton: false,
4480
+ stretch: false
4481
+ },
4482
+ image: {
4483
+ quality: 0.42,
4484
+ types: [
4485
+ "webp",
4486
+ "jpeg"
4487
+ ]
4488
+ },
4489
+ text: {
4490
+ pausedHeader: "Paused",
4491
+ pausedHint: void 0,
4492
+ sending: "Teleporting",
4493
+ encoding: "Encoding",
4494
+ limitReached: "Limit reached",
4495
+ audioOff: "Audio off",
4496
+ audioOn: "Audio on",
4497
+ buttons: {
4498
+ record: "Record video",
4499
+ recordAgain: "Record again",
4500
+ resume: "Resume",
4501
+ pause: "Pause",
4502
+ preview: "Preview"
4493
4503
  }
4494
- radioButtonElement.onchange = options.changeHandler;
4495
- html_disableElement(radioButtonElement);
4496
- return radioButtonElement;
4504
+ },
4505
+ notifier: {
4506
+ entertain: false,
4507
+ entertainClass: "bg",
4508
+ entertainLimit: 6,
4509
+ entertainInterval: 9000
4510
+ },
4511
+ timeouts: {
4512
+ userMedia: 20e3,
4513
+ connection: 1e4,
4514
+ pingInterval: 30e3
4515
+ },
4516
+ loadUserMediaOnRecord: false,
4517
+ callbacks: {
4518
+ adjustFormDataBeforePosting: void 0
4519
+ },
4520
+ defaults: {
4521
+ from: void 0,
4522
+ to: void 0,
4523
+ cc: void 0,
4524
+ bcc: void 0,
4525
+ subject: void 0,
4526
+ body: void 0
4527
+ },
4528
+ displayErrors: true,
4529
+ adjustFormOnBrowserError: true,
4530
+ reportErrors: true,
4531
+ fakeUaString: void 0,
4532
+ versions: {
4533
+ videomailNinjaFormPlugin: void 0
4534
+ }
4535
+ };
4536
+ const src_options = options_options;
4537
+ class CollectLogger_CollectLogger {
4538
+ browser;
4539
+ logger;
4540
+ stack = [];
4541
+ options;
4542
+ constructor(options){
4543
+ this.options = options;
4544
+ this.browser = util_getBrowser(options);
4545
+ this.logger = options.logger;
4546
+ }
4547
+ lifo(level, parameters) {
4548
+ const line = parameters.join();
4549
+ if (this.stack.length > this.options.logStackSize) this.stack.pop();
4550
+ this.stack.push(`[${level}] ${line}`);
4551
+ return line;
4552
+ }
4553
+ debug(...args) {
4554
+ const output = this.lifo("debug", args);
4555
+ if (this.options.verbose) if (this.browser.isFirefox()) this.logger.debug(output);
4556
+ else if (this.logger.groupCollapsed) {
4557
+ this.logger.groupCollapsed(output);
4558
+ this.logger.trace("Trace");
4559
+ this.logger.groupEnd();
4560
+ } else if (this.logger.debug) this.logger.debug(output);
4561
+ else console.log(output);
4562
+ }
4563
+ error(...args) {
4564
+ this.logger.error(this.lifo("error", args));
4565
+ }
4566
+ warn(...args) {
4567
+ this.logger.warn(this.lifo("warn", args));
4568
+ }
4569
+ info(...args) {
4570
+ this.logger.info(this.lifo("info", args));
4571
+ }
4572
+ getLines() {
4573
+ return this.stack;
4574
+ }
4575
+ }
4576
+ const CollectLogger = CollectLogger_CollectLogger;
4577
+ var isTest_process = __webpack_require__("./node_modules/process/browser.js");
4578
+ function isTest() {
4579
+ return "test" === isTest_process.env.ENVIRON;
4580
+ }
4581
+ const util_isTest = isTest;
4582
+ function mergeWithDefaultOptions_mergeWithDefaultOptions(options = {}) {
4583
+ const newOptions = deepmerge(src_options, options, {
4584
+ arrayMerge (_destination, source) {
4585
+ return source;
4586
+ }
4587
+ });
4588
+ const collectLogger = new CollectLogger(newOptions);
4589
+ newOptions.logger = collectLogger;
4590
+ if (util_isTest()) newOptions.verbose = false;
4591
+ return newOptions;
4592
+ }
4593
+ const mergeWithDefaultOptions = mergeWithDefaultOptions_mergeWithDefaultOptions;
4594
+ var injectStylesIntoStyleTag = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js");
4595
+ var injectStylesIntoStyleTag_default = /*#__PURE__*/ __webpack_require__.n(injectStylesIntoStyleTag);
4596
+ var styleDomAPI = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js");
4597
+ var styleDomAPI_default = /*#__PURE__*/ __webpack_require__.n(styleDomAPI);
4598
+ var insertBySelector = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js");
4599
+ var insertBySelector_default = /*#__PURE__*/ __webpack_require__.n(insertBySelector);
4600
+ var setAttributesWithoutAttributes = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js");
4601
+ var setAttributesWithoutAttributes_default = /*#__PURE__*/ __webpack_require__.n(setAttributesWithoutAttributes);
4602
+ var insertStyleElement = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js");
4603
+ var insertStyleElement_default = /*#__PURE__*/ __webpack_require__.n(insertStyleElement);
4604
+ var styleTagTransform = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js");
4605
+ var styleTagTransform_default = /*#__PURE__*/ __webpack_require__.n(styleTagTransform);
4606
+ var main = __webpack_require__("./node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[12].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[12].use[2]!./node_modules/stylus-loader/dist/cjs.js??ruleSet[1].rules[12].use[3]!./src/styles/main.styl");
4607
+ var main_options = {};
4608
+ main_options.styleTagTransform = styleTagTransform_default();
4609
+ main_options.setAttributes = setAttributesWithoutAttributes_default();
4610
+ main_options.insert = insertBySelector_default().bind(null, "head");
4611
+ main_options.domAPI = styleDomAPI_default();
4612
+ main_options.insertStyleElement = insertStyleElement_default();
4613
+ injectStylesIntoStyleTag_default()(main.Z, main_options);
4614
+ main.Z && main.Z.locals && main.Z.locals;
4615
+ function limitHeight(height, options, calledFrom) {
4616
+ let limitedHeight = document.documentElement.clientHeight;
4617
+ if (height) limitedHeight = Math.min(height, limitedHeight);
4618
+ if (limitedHeight < 1) throw error_createError({
4619
+ message: `Limited height ${limitedHeight} cannot be less than 1! (Called from ${calledFrom})`,
4620
+ options
4621
+ });
4622
+ return limitedHeight;
4623
+ }
4624
+ const dimensions_limitHeight = limitHeight;
4625
+ function getOuterWidth_getOuterWidth(element) {
4626
+ let rect = element.getBoundingClientRect();
4627
+ let outerWidth = rect.right - rect.left;
4628
+ if (outerWidth < 1) {
4629
+ rect = document.body.getBoundingClientRect();
4630
+ outerWidth = rect.right - rect.left;
4631
+ }
4632
+ return outerWidth;
4633
+ }
4634
+ const getOuterWidth = getOuterWidth_getOuterWidth;
4635
+ function limitWidth_limitWidth(element, options, width) {
4636
+ let limitedWidth;
4637
+ const outerWidth = getOuterWidth(element);
4638
+ limitedWidth = width && "number" == typeof width ? outerWidth > 0 && outerWidth < width ? outerWidth : width : outerWidth;
4639
+ if (Number.isInteger(limitedWidth) && limitedWidth < 1) throw error_createError({
4640
+ message: "Limited width cannot be less than 1!",
4641
+ options
4642
+ });
4643
+ return limitedWidth;
4644
+ }
4645
+ const limitWidth = limitWidth_limitWidth;
4646
+ function disableElement(element) {
4647
+ if (!element) return;
4648
+ if ("INPUT" === element.tagName || "BUTTON" === element.tagName) element.setAttribute("disabled", "true");
4649
+ else element.classList.add("disabled");
4650
+ }
4651
+ const html_disableElement = disableElement;
4652
+ function hideElement(element) {
4653
+ if (!element) return;
4654
+ hidden_0(element, true);
4655
+ }
4656
+ const html_hideElement = hideElement;
4657
+ function adjustButton(buttonElement, show, type, disabled) {
4658
+ if (disabled) html_disableElement(buttonElement);
4659
+ if (type) buttonElement.type = type;
4660
+ if (!show) html_hideElement(buttonElement);
4661
+ return buttonElement;
4662
+ }
4663
+ const html_adjustButton = adjustButton;
4664
+ function enableElement(element) {
4665
+ if (!element) return;
4666
+ if ("INPUT" === element.tagName || "BUTTON" === element.tagName) element.removeAttribute("disabled");
4667
+ else element.classList.remove("disabled");
4668
+ }
4669
+ const html_enableElement = enableElement;
4670
+ function isShown(element) {
4671
+ if (!element) return false;
4672
+ return !hidden_0(element);
4673
+ }
4674
+ const html_isShown = isShown;
4675
+ function showElement(element) {
4676
+ if (!element) return;
4677
+ hidden_0(element, false);
4678
+ }
4679
+ const html_showElement = showElement;
4680
+ class Buttons extends util_Despot {
4681
+ container;
4682
+ buttonsElement;
4683
+ recordButton;
4684
+ pauseButton;
4685
+ resumeButton;
4686
+ previewButton;
4687
+ recordAgainButton;
4688
+ submitButton;
4689
+ audioOnRadioPair;
4690
+ audioOffRadioPair;
4691
+ built = false;
4692
+ constructor(container, options){
4693
+ super("Buttons", options);
4694
+ this.container = container;
4695
+ }
4696
+ replaceClickHandler(element, clickHandler) {
4697
+ const wrappedClickHandler = (ev)=>{
4698
+ ev.preventDefault();
4699
+ try {
4700
+ clickHandler({
4701
+ event: ev
4702
+ });
4703
+ } catch (exc) {
4704
+ this.emit("ERROR", {
4705
+ exc
4706
+ });
4707
+ }
4708
+ };
4709
+ element.onclick = wrappedClickHandler;
4710
+ }
4711
+ makeRadioButtonPair(options) {
4712
+ let radioButtonElement;
4713
+ let radioButtonGroup;
4714
+ if (options.id) radioButtonElement = document.querySelector(`#${options.id}`);
4715
+ if (!radioButtonElement) {
4716
+ radioButtonElement = document.createElement("input");
4717
+ radioButtonElement.id = options.id;
4718
+ radioButtonElement.type = "radio";
4719
+ radioButtonElement.name = options.name;
4720
+ radioButtonElement.value = options.value;
4721
+ radioButtonElement.checked = options.checked;
4722
+ radioButtonGroup = document.createElement("span");
4723
+ radioButtonGroup.classList.add("radioGroup");
4724
+ radioButtonGroup.appendChild(radioButtonElement);
4725
+ const radioLabel = document.createElement("label");
4726
+ radioLabel.htmlFor = options.id;
4727
+ radioLabel.textContent = options.label;
4728
+ radioButtonGroup.appendChild(radioLabel);
4729
+ if (this.submitButton && contains(this.buttonsElement, this.submitButton)) this.buttonsElement?.insertBefore(radioButtonGroup, this.submitButton);
4730
+ else this.buttonsElement?.appendChild(radioButtonGroup);
4731
+ }
4732
+ radioButtonElement.onchange = options.changeHandler;
4733
+ html_disableElement(radioButtonElement);
4734
+ return radioButtonElement;
4497
4735
  }
4498
4736
  makeButton(buttonClass, text, clickHandler, show, id, type, selector, disabled = true) {
4499
4737
  let buttonElement;
@@ -4546,17 +4784,17 @@ class Buttons extends util_Despot {
4546
4784
  }
4547
4785
  }
4548
4786
  onFormReady(params) {
4549
- if (!isShown(this.recordAgainButton)) {
4787
+ if (!html_isShown(this.recordAgainButton)) {
4550
4788
  if (!params?.paused) html_showElement(this.recordButton);
4551
4789
  }
4552
4790
  if (!params?.paused) {
4553
4791
  html_disableElement(this.previewButton);
4554
- hideElement(this.previewButton);
4792
+ html_hideElement(this.previewButton);
4555
4793
  }
4556
4794
  if (!this.options.enableAutoValidation) html_enableElement(this.submitButton);
4557
4795
  }
4558
4796
  onGoingBack() {
4559
- hideElement(this.recordAgainButton);
4797
+ html_hideElement(this.recordAgainButton);
4560
4798
  html_showElement(this.recordButton);
4561
4799
  html_showElement(this.submitButton);
4562
4800
  }
@@ -4568,12 +4806,12 @@ class Buttons extends util_Despot {
4568
4806
  html_showElement(this.buttonsElement);
4569
4807
  html_showElement(this.audioOnRadioPair);
4570
4808
  html_showElement(this.audioOffRadioPair);
4571
- if (isShown(this.recordButton) && !params.recordWhenReady) html_enableElement(this.recordButton);
4572
- else if (isShown(this.recordAgainButton) && !params.recordWhenReady) html_enableElement(this.recordAgainButton);
4809
+ if (html_isShown(this.recordButton) && !params.recordWhenReady) html_enableElement(this.recordButton);
4810
+ else if (html_isShown(this.recordAgainButton) && !params.recordWhenReady) html_enableElement(this.recordAgainButton);
4573
4811
  if (this.options.enableAutoValidation) html_disableElement(this.submitButton);
4574
4812
  if (!params.recordWhenReady) {
4575
- if (isShown(this.audioOnRadioPair)) html_enableElement(this.audioOnRadioPair);
4576
- if (isShown(this.audioOffRadioPair)) html_enableElement(this.audioOffRadioPair);
4813
+ if (html_isShown(this.audioOnRadioPair)) html_enableElement(this.audioOnRadioPair);
4814
+ if (html_isShown(this.audioOffRadioPair)) html_enableElement(this.audioOffRadioPair);
4577
4815
  }
4578
4816
  }
4579
4817
  onResetting() {
@@ -4581,8 +4819,8 @@ class Buttons extends util_Despot {
4581
4819
  this.reset();
4582
4820
  }
4583
4821
  onPreview() {
4584
- hideElement(this.recordButton);
4585
- hideElement(this.previewButton);
4822
+ html_hideElement(this.recordButton);
4823
+ html_hideElement(this.previewButton);
4586
4824
  html_disableElement(this.audioOnRadioPair);
4587
4825
  html_disableElement(this.audioOffRadioPair);
4588
4826
  html_showElement(this.recordAgainButton);
@@ -4594,17 +4832,17 @@ class Buttons extends util_Despot {
4594
4832
  }
4595
4833
  adjustButtonsForPause() {
4596
4834
  if (!this.isCountingDown()) {
4597
- if (this.pauseButton) hideElement(this.pauseButton);
4835
+ if (this.pauseButton) html_hideElement(this.pauseButton);
4598
4836
  html_showElement(this.resumeButton);
4599
4837
  html_enableElement(this.resumeButton);
4600
- hideElement(this.recordButton);
4838
+ html_hideElement(this.recordButton);
4601
4839
  html_showElement(this.previewButton);
4602
4840
  html_enableElement(this.previewButton);
4603
4841
  }
4604
4842
  }
4605
4843
  onFirstFrameSent() {
4606
- hideElement(this.recordButton);
4607
- hideElement(this.recordAgainButton);
4844
+ html_hideElement(this.recordButton);
4845
+ html_hideElement(this.recordAgainButton);
4608
4846
  if (this.pauseButton) {
4609
4847
  html_showElement(this.pauseButton);
4610
4848
  html_enableElement(this.pauseButton);
@@ -4622,8 +4860,8 @@ class Buttons extends util_Despot {
4622
4860
  }
4623
4861
  }
4624
4862
  onResuming() {
4625
- hideElement(this.resumeButton);
4626
- hideElement(this.recordButton);
4863
+ html_hideElement(this.resumeButton);
4864
+ html_hideElement(this.recordButton);
4627
4865
  if (this.pauseButton) {
4628
4866
  html_enableElement(this.pauseButton);
4629
4867
  html_showElement(this.pauseButton);
@@ -4632,8 +4870,8 @@ class Buttons extends util_Despot {
4632
4870
  onStopping() {
4633
4871
  html_disableElement(this.previewButton);
4634
4872
  html_disableElement(this.recordButton);
4635
- hideElement(this.pauseButton);
4636
- hideElement(this.resumeButton);
4873
+ html_hideElement(this.pauseButton);
4874
+ html_hideElement(this.resumeButton);
4637
4875
  }
4638
4876
  onCountdown() {
4639
4877
  html_disableElement(this.recordButton);
@@ -4658,12 +4896,12 @@ class Buttons extends util_Despot {
4658
4896
  if (this.options.enableAutoValidation) html_enableElement(this.submitButton);
4659
4897
  }
4660
4898
  onHidden() {
4661
- hideElement(this.recordButton);
4662
- hideElement(this.previewButton);
4663
- hideElement(this.recordAgainButton);
4664
- hideElement(this.resumeButton);
4665
- hideElement(this.audioOnRadioPair);
4666
- hideElement(this.audioOffRadioPair);
4899
+ html_hideElement(this.recordButton);
4900
+ html_hideElement(this.previewButton);
4901
+ html_hideElement(this.recordAgainButton);
4902
+ html_hideElement(this.resumeButton);
4903
+ html_hideElement(this.audioOnRadioPair);
4904
+ html_hideElement(this.audioOffRadioPair);
4667
4905
  }
4668
4906
  onEnablingAudio() {
4669
4907
  this.options.logger.debug("Buttons: onEnablingAudio()");
@@ -4756,7 +4994,7 @@ class Buttons extends util_Despot {
4756
4994
  });
4757
4995
  this.on("CONNECTED", ()=>{
4758
4996
  if (this.options.loadUserMediaOnRecord) {
4759
- if (isShown(this.recordButton)) html_enableElement(this.recordButton);
4997
+ if (html_isShown(this.recordButton)) html_enableElement(this.recordButton);
4760
4998
  }
4761
4999
  });
4762
5000
  this.on("DISCONNECTED", ()=>{
@@ -4801,7 +5039,7 @@ class Buttons extends util_Despot {
4801
5039
  this.buttonsElement.classList.add(this.options.selectors.buttonsClass);
4802
5040
  this.container.appendChild(this.buttonsElement);
4803
5041
  }
4804
- hideElement(this.buttonsElement);
5042
+ html_hideElement(this.buttonsElement);
4805
5043
  this.buildButtons();
4806
5044
  if (!this.built) this.initEvents();
4807
5045
  this.built = true;
@@ -4816,16 +5054,16 @@ class Buttons extends util_Despot {
4816
5054
  }
4817
5055
  }
4818
5056
  hide(deep = false) {
4819
- hideElement(this.buttonsElement);
5057
+ html_hideElement(this.buttonsElement);
4820
5058
  if (deep) {
4821
- hideElement(this.recordButton);
4822
- hideElement(this.pauseButton);
4823
- hideElement(this.resumeButton);
4824
- hideElement(this.previewButton);
4825
- hideElement(this.recordAgainButton);
4826
- hideElement(this.submitButton);
4827
- hideElement(this.audioOnRadioPair);
4828
- hideElement(this.audioOffRadioPair);
5059
+ html_hideElement(this.recordButton);
5060
+ html_hideElement(this.pauseButton);
5061
+ html_hideElement(this.resumeButton);
5062
+ html_hideElement(this.previewButton);
5063
+ html_hideElement(this.recordAgainButton);
5064
+ html_hideElement(this.submitButton);
5065
+ html_hideElement(this.audioOnRadioPair);
5066
+ html_hideElement(this.audioOffRadioPair);
4829
5067
  }
4830
5068
  }
4831
5069
  show() {
@@ -5031,7 +5269,9 @@ class RecordNote {
5031
5269
  }
5032
5270
  const recorder_recordNote = RecordNote;
5033
5271
  function pad(n) {
5034
- return n < 10 ? `0${n}` : n;
5272
+ const absNum = Math.abs(n);
5273
+ if (absNum < 10) return n < 0 ? `-0${absNum}` : `0${absNum}`;
5274
+ return String(n);
5035
5275
  }
5036
5276
  const util_pad = pad;
5037
5277
  class RecordTimer {
@@ -5446,168 +5686,90 @@ class Notifier extends util_Despot {
5446
5686
  this.options.logger.debug(`Notifier: notify(${params.join(", ")})`);
5447
5687
  const stillWait = notifyOptions.stillWait ?? false;
5448
5688
  const entertain = notifyOptions.entertain ?? false;
5449
- const blocking = notifyOptions.blocking ?? false;
5450
- const classList = notifyOptions.classList ?? false;
5451
- const removeDimensions = notifyOptions.removeDimensions ?? false;
5452
- if (this.notifyElement) {
5453
- if (!entertain) this.notifyElement.className = "notifier";
5454
- if (classList) classList.forEach((className)=>{
5455
- this.notifyElement?.classList.add(className);
5456
- });
5457
- if (removeDimensions) {
5458
- this.notifyElement.style.width = "auto";
5459
- this.notifyElement.style.height = "auto";
5460
- }
5461
- }
5462
- if (blocking) {
5463
- this.notifyElement?.classList.add("blocking");
5464
- this.emit("BLOCKING");
5465
- } else this.emit("NOTIFYING");
5466
- this.visuals.hideReplay();
5467
- this.visuals.hideRecorder();
5468
- this.setMessage(message, notifyOptions);
5469
- if (explanation && explanation.length > 0) this.setExplanation(explanation);
5470
- if (entertain) this.runEntertainment();
5471
- else this.cancelEntertainment();
5472
- this.visuals.showVisuals();
5473
- this.show();
5474
- if (!stillWait) this.visuals.endWaiting();
5475
- }
5476
- }
5477
- const notifier = Notifier;
5478
- function isPromise(anything) {
5479
- return anything && "undefined" != typeof Promise && anything instanceof Promise;
5480
- }
5481
- const util_isPromise = isPromise;
5482
- const NodeEnvType = {
5483
- DEVELOPMENT: "development",
5484
- PRODUCTION: "production"
5485
- };
5486
- var process = __webpack_require__("./node_modules/process/browser.js");
5487
- function getNodeEnv() {
5488
- if (!process.env.NODE_ENV) return NodeEnvType.DEVELOPMENT;
5489
- return process.env.NODE_ENV;
5490
- }
5491
- const util_getNodeEnv = getNodeEnv;
5492
- function isProductionMode() {
5493
- return util_getNodeEnv() === NodeEnvType.PRODUCTION;
5494
- }
5495
- const util_isProductionMode = isProductionMode;
5496
- const PRODUCTION = util_isProductionMode();
5497
- const options_options = {
5498
- logger: console,
5499
- logStackSize: 30,
5500
- verbose: !PRODUCTION,
5501
- baseUrl: "https://videomail.io",
5502
- socketUrl: "wss://videomail.io",
5503
- siteName: "videomail-client-demo",
5504
- enablePause: true,
5505
- enableAutoPause: true,
5506
- enableSpace: true,
5507
- submitWithVideomail: false,
5508
- disableSubmit: false,
5509
- enableAutoValidation: true,
5510
- enableAutoUnload: true,
5511
- enableAutoSubmission: true,
5512
- enctype: "application/json",
5513
- selectors: {
5514
- containerId: void 0,
5515
- containerClass: "videomail",
5516
- replayClass: "replay",
5517
- userMediaClass: "userMedia",
5518
- visualsClass: "visuals",
5519
- buttonClass: void 0,
5520
- buttonsClass: "buttons",
5521
- recordButtonClass: "record",
5522
- pauseButtonClass: "pause",
5523
- resumeButtonClass: "resume",
5524
- previewButtonClass: "preview",
5525
- recordAgainButtonClass: "recordAgain",
5526
- submitButtonClass: "submit",
5527
- subjectInputName: "subject",
5528
- fromInputName: "from",
5529
- toInputName: "to",
5530
- ccInputName: "cc",
5531
- bccInputName: "bcc",
5532
- bodyInputName: "body",
5533
- sendCopyInputName: "sendCopy",
5534
- keyInputName: "videomail_key",
5535
- parentKeyInputName: "videomail_parent_key",
5536
- formId: void 0,
5537
- submitButtonId: void 0,
5538
- submitButtonSelector: void 0
5539
- },
5540
- audio: {
5541
- enabled: false,
5542
- switch: false,
5543
- volume: 0.2,
5544
- bufferSize: "auto"
5545
- },
5546
- video: {
5547
- fps: 15,
5548
- limitSeconds: 30,
5549
- countdown: 3,
5550
- width: void 0,
5551
- height: void 0,
5552
- facingMode: "user",
5553
- facingModeButton: false,
5554
- stretch: false
5555
- },
5556
- image: {
5557
- quality: 0.42,
5558
- types: [
5559
- "webp",
5560
- "jpeg"
5561
- ]
5562
- },
5563
- text: {
5564
- pausedHeader: "Paused",
5565
- pausedHint: void 0,
5566
- sending: "Teleporting",
5567
- encoding: "Encoding",
5568
- limitReached: "Limit reached",
5569
- audioOff: "Audio off",
5570
- audioOn: "Audio on",
5571
- buttons: {
5572
- record: "Record video",
5573
- recordAgain: "Record again",
5574
- resume: "Resume",
5575
- pause: "Pause",
5576
- preview: "Preview"
5577
- }
5578
- },
5579
- notifier: {
5580
- entertain: false,
5581
- entertainClass: "bg",
5582
- entertainLimit: 6,
5583
- entertainInterval: 9000
5584
- },
5585
- timeouts: {
5586
- userMedia: 20e3,
5587
- connection: 1e4,
5588
- pingInterval: 30e3
5589
- },
5590
- loadUserMediaOnRecord: false,
5591
- callbacks: {
5592
- adjustFormDataBeforePosting: void 0
5593
- },
5594
- defaults: {
5595
- from: void 0,
5596
- to: void 0,
5597
- cc: void 0,
5598
- bcc: void 0,
5599
- subject: void 0,
5600
- body: void 0
5601
- },
5602
- displayErrors: true,
5603
- adjustFormOnBrowserError: true,
5604
- reportErrors: true,
5605
- fakeUaString: void 0,
5606
- versions: {
5607
- videomailNinjaFormPlugin: void 0
5689
+ const blocking = notifyOptions.blocking ?? false;
5690
+ const classList = notifyOptions.classList ?? false;
5691
+ const removeDimensions = notifyOptions.removeDimensions ?? false;
5692
+ if (this.notifyElement) {
5693
+ if (!entertain) this.notifyElement.className = "notifier";
5694
+ if (classList) classList.forEach((className)=>{
5695
+ this.notifyElement?.classList.add(className);
5696
+ });
5697
+ if (removeDimensions) {
5698
+ this.notifyElement.style.width = "auto";
5699
+ this.notifyElement.style.height = "auto";
5700
+ }
5701
+ }
5702
+ if (blocking) {
5703
+ this.notifyElement?.classList.add("blocking");
5704
+ this.emit("BLOCKING");
5705
+ } else this.emit("NOTIFYING");
5706
+ this.visuals.hideReplay();
5707
+ this.visuals.hideRecorder();
5708
+ this.setMessage(message, notifyOptions);
5709
+ if (explanation && explanation.length > 0) this.setExplanation(explanation);
5710
+ if (entertain) this.runEntertainment();
5711
+ else this.cancelEntertainment();
5712
+ this.visuals.showVisuals();
5713
+ this.show();
5714
+ if (!stillWait) this.visuals.endWaiting();
5608
5715
  }
5609
- };
5610
- const src_options = options_options;
5716
+ }
5717
+ const notifier = Notifier;
5718
+ function figureMinHeight(height, options) {
5719
+ let minHeight;
5720
+ if (options.video.height) {
5721
+ minHeight = Math.min(options.video.height, height);
5722
+ if (minHeight < 1) throw error_createError({
5723
+ message: `Got a min height less than 1 (${minHeight})!`,
5724
+ options
5725
+ });
5726
+ } else minHeight = height;
5727
+ return minHeight;
5728
+ }
5729
+ const dimensions_figureMinHeight = figureMinHeight;
5730
+ function getRatio_getRatio(options, videoHeight, videoWidth) {
5731
+ let ratio = 1;
5732
+ const hasVideoDimensions = videoHeight && videoWidth;
5733
+ const desiredHeight = options.video.height;
5734
+ const desiredWidth = options.video.width;
5735
+ const hasDesiredDimensions = desiredHeight && desiredWidth;
5736
+ if (hasDesiredDimensions) ratio = hasVideoDimensions ? videoHeight < desiredHeight || videoWidth < desiredWidth ? videoHeight / videoWidth : desiredHeight / desiredWidth : desiredHeight / desiredWidth;
5737
+ else if (hasVideoDimensions) ratio = videoHeight / videoWidth;
5738
+ return ratio;
5739
+ }
5740
+ const getRatio = getRatio_getRatio;
5741
+ function calculateHeight(responsive, videoWidth, options, target, ratio, element) {
5742
+ let width = videoWidth;
5743
+ if (width < 1) throw error_createError({
5744
+ message: `Unable to calculate height for target ${target} when width is less than 1 (= ${width}) and responsive mode is set to ${responsive}`,
5745
+ options
5746
+ });
5747
+ if (responsive && element) width = limitWidth(element, options, width);
5748
+ const chosenRatio = ratio ?? getRatio(options, void 0, videoWidth);
5749
+ const height = Math.round(width * chosenRatio);
5750
+ if (Number.isInteger(height) && height < 1) throw error_createError({
5751
+ message: "Just calculated a height less than 1 which is wrong.",
5752
+ options
5753
+ });
5754
+ return dimensions_figureMinHeight(height, options);
5755
+ }
5756
+ const dimensions_calculateHeight = calculateHeight;
5757
+ function calculateWidth(responsive, videoHeight, options, ratio) {
5758
+ let height = dimensions_figureMinHeight(videoHeight, options);
5759
+ if (responsive) height = dimensions_limitHeight(height, options, "calculateWidth");
5760
+ if (!height || height < 1) throw error_createError({
5761
+ message: `Height ${height} cannot be smaller than 1 when calculating width.`,
5762
+ options
5763
+ });
5764
+ const chosenRatio = ratio ?? getRatio(options, videoHeight);
5765
+ const calculatedWidth = Math.round(height / chosenRatio);
5766
+ if (calculatedWidth < 1) throw error_createError({
5767
+ message: "Calculated width cannot be smaller than 1!",
5768
+ options
5769
+ });
5770
+ return calculatedWidth;
5771
+ }
5772
+ const dimensions_calculateWidth = calculateWidth;
5611
5773
  const CHANNELS = 1;
5612
5774
  function getAudioContextClass() {
5613
5775
  return window.AudioContext;
@@ -5693,6 +5855,13 @@ class AudioRecorder_AudioRecorder {
5693
5855
  }
5694
5856
  }
5695
5857
  const AudioRecorder = AudioRecorder_AudioRecorder;
5858
+ function getFirstVideoTrack(localMediaStream) {
5859
+ const videoTracks = localMediaStream.getVideoTracks();
5860
+ let videoTrack;
5861
+ if (videoTracks[0]) videoTrack = videoTracks[0];
5862
+ return videoTrack;
5863
+ }
5864
+ const media_getFirstVideoTrack = getFirstVideoTrack;
5696
5865
  const MEDIA_EVENTS = [
5697
5866
  "loadstart",
5698
5867
  "suspend",
@@ -5714,13 +5883,10 @@ const MEDIA_EVENTS = [
5714
5883
  "volumechange"
5715
5884
  ];
5716
5885
  const mediaEvents = MEDIA_EVENTS;
5717
- function getFirstVideoTrack(localMediaStream) {
5718
- const videoTracks = localMediaStream.getVideoTracks();
5719
- let videoTrack;
5720
- if (videoTracks[0]) videoTrack = videoTracks[0];
5721
- return videoTrack;
5886
+ function isPromise_isPromise(anything) {
5887
+ return Boolean(anything && "undefined" != typeof Promise && "[object Promise]" === Object.prototype.toString.call(anything));
5722
5888
  }
5723
- const media_getFirstVideoTrack = getFirstVideoTrack;
5889
+ const isPromise = isPromise_isPromise;
5724
5890
  const EVENT_ASCII = "|\u2014O\u2014|";
5725
5891
  class UserMedia extends util_Despot {
5726
5892
  recorder;
@@ -5811,7 +5977,7 @@ class UserMedia extends util_Despot {
5811
5977
  } catch (exc) {
5812
5978
  this.options.logger.warn(`Caught raw user media play exception: ${exc}`);
5813
5979
  }
5814
- if (util_isPromise(p)) p.then(()=>{
5980
+ if (isPromise(p)) p.then(()=>{
5815
5981
  if (!this.playingPromiseReached) {
5816
5982
  this.options.logger.debug("UserMedia: play promise successful. Playing now.");
5817
5983
  this.playingPromiseReached = true;
@@ -6011,92 +6177,6 @@ class UserMedia extends util_Despot {
6011
6177
  }
6012
6178
  }
6013
6179
  const visuals_userMedia = UserMedia;
6014
- function figureMinHeight(height, options) {
6015
- let minHeight;
6016
- if (options.video.height) {
6017
- minHeight = Math.min(options.video.height, height);
6018
- if (minHeight < 1) throw error_createError({
6019
- message: `Got a min height less than 1 (${minHeight})!`,
6020
- options
6021
- });
6022
- } else minHeight = height;
6023
- return minHeight;
6024
- }
6025
- const dimensions_figureMinHeight = figureMinHeight;
6026
- function getRatio_getRatio(options, videoHeight, videoWidth) {
6027
- let ratio = 1;
6028
- const hasVideoDimensions = videoHeight && videoWidth;
6029
- const desiredHeight = options.video.height;
6030
- const desiredWidth = options.video.width;
6031
- const hasDesiredDimensions = desiredHeight && desiredWidth;
6032
- if (hasDesiredDimensions) ratio = hasVideoDimensions ? videoHeight < desiredHeight || videoWidth < desiredWidth ? videoHeight / videoWidth : desiredHeight / desiredWidth : desiredHeight / desiredWidth;
6033
- else if (hasVideoDimensions) ratio = videoHeight / videoWidth;
6034
- return ratio;
6035
- }
6036
- const getRatio = getRatio_getRatio;
6037
- function limitHeight(height, options, calledFrom) {
6038
- let limitedHeight = document.documentElement.clientHeight;
6039
- if (height) limitedHeight = Math.min(height, limitedHeight);
6040
- if (limitedHeight < 1) throw error_createError({
6041
- message: `Limited height ${limitedHeight} cannot be less than 1! (Called from ${calledFrom})`,
6042
- options
6043
- });
6044
- return limitedHeight;
6045
- }
6046
- const dimensions_limitHeight = limitHeight;
6047
- function calculateWidth(responsive, videoHeight, options, ratio) {
6048
- let height = dimensions_figureMinHeight(videoHeight, options);
6049
- if (responsive) height = dimensions_limitHeight(height, options, "calculateWidth");
6050
- if (!height || height < 1) throw error_createError({
6051
- message: `Height ${height} cannot be smaller than 1 when calculating width.`,
6052
- options
6053
- });
6054
- const chosenRatio = ratio ?? getRatio(options, videoHeight);
6055
- const calculatedWidth = Math.round(height / chosenRatio);
6056
- if (calculatedWidth < 1) throw error_createError({
6057
- message: "Calculated width cannot be smaller than 1!",
6058
- options
6059
- });
6060
- return calculatedWidth;
6061
- }
6062
- const dimensions_calculateWidth = calculateWidth;
6063
- function getOuterWidth_getOuterWidth(element) {
6064
- let rect = element.getBoundingClientRect();
6065
- let outerWidth = rect.right - rect.left;
6066
- if (outerWidth < 1) {
6067
- rect = document.body.getBoundingClientRect();
6068
- outerWidth = rect.right - rect.left;
6069
- }
6070
- return outerWidth;
6071
- }
6072
- const getOuterWidth = getOuterWidth_getOuterWidth;
6073
- function limitWidth(element, options, width) {
6074
- let limitedWidth;
6075
- const outerWidth = getOuterWidth(element);
6076
- limitedWidth = width && "number" == typeof width ? outerWidth > 0 && outerWidth < width ? outerWidth : width : outerWidth;
6077
- if (Number.isInteger(limitedWidth) && limitedWidth < 1) throw error_createError({
6078
- message: "Limited width cannot be less than 1!",
6079
- options
6080
- });
6081
- return limitedWidth;
6082
- }
6083
- const dimensions_limitWidth = limitWidth;
6084
- function calculateHeight(responsive, videoWidth, options, target, ratio, element) {
6085
- let width = videoWidth;
6086
- if (width < 1) throw error_createError({
6087
- message: `Unable to calculate height for target ${target} when width is less than 1 (= ${width}) and responsive mode is set to ${responsive}`,
6088
- options
6089
- });
6090
- if (responsive && element) width = dimensions_limitWidth(element, options, width);
6091
- const chosenRatio = ratio ?? getRatio(options, void 0, videoWidth);
6092
- const height = Math.round(width * chosenRatio);
6093
- if (Number.isInteger(height) && height < 1) throw error_createError({
6094
- message: "Just calculated a height less than 1 which is wrong.",
6095
- options
6096
- });
6097
- return dimensions_figureMinHeight(height, options);
6098
- }
6099
- const dimensions_calculateHeight = calculateHeight;
6100
6180
  var Buffer = __webpack_require__("./node_modules/buffer/index.js")["Buffer"];
6101
6181
  const PIPE_SYMBOL = "\xb0\xba\xa4\xf8,\xb8\xb8,\xf8\xa4\xba\xb0`\xb0\xba\xa4\xf8,\xb8,\xf8\xa4\xb0\xba\xa4\xf8,\xb8\xb8,\xf8\xa4\xba\xb0`\xb0\xba\xa4\xf8,\xb8 ";
6102
6182
  class Recorder extends util_Despot {
@@ -7550,27 +7630,6 @@ class Visuals extends util_Despot {
7550
7630
  }
7551
7631
  }
7552
7632
  const wrappers_visuals = Visuals;
7553
- var injectStylesIntoStyleTag = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js");
7554
- var injectStylesIntoStyleTag_default = /*#__PURE__*/ __webpack_require__.n(injectStylesIntoStyleTag);
7555
- var styleDomAPI = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/styleDomAPI.js");
7556
- var styleDomAPI_default = /*#__PURE__*/ __webpack_require__.n(styleDomAPI);
7557
- var insertBySelector = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/insertBySelector.js");
7558
- var insertBySelector_default = /*#__PURE__*/ __webpack_require__.n(insertBySelector);
7559
- var setAttributesWithoutAttributes = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/setAttributesWithoutAttributes.js");
7560
- var setAttributesWithoutAttributes_default = /*#__PURE__*/ __webpack_require__.n(setAttributesWithoutAttributes);
7561
- var insertStyleElement = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/insertStyleElement.js");
7562
- var insertStyleElement_default = /*#__PURE__*/ __webpack_require__.n(insertStyleElement);
7563
- var styleTagTransform = __webpack_require__("./node_modules/@rsbuild/core/compiled/style-loader/runtime/styleTagTransform.js");
7564
- var styleTagTransform_default = /*#__PURE__*/ __webpack_require__.n(styleTagTransform);
7565
- var main = __webpack_require__("./node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[12].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[12].use[2]!./node_modules/stylus-loader/dist/cjs.js??ruleSet[1].rules[12].use[3]!./src/styles/main.styl");
7566
- var main_options = {};
7567
- main_options.styleTagTransform = styleTagTransform_default();
7568
- main_options.setAttributes = setAttributesWithoutAttributes_default();
7569
- main_options.insert = insertBySelector_default().bind(null, "head");
7570
- main_options.domAPI = styleDomAPI_default();
7571
- main_options.insertStyleElement = insertStyleElement_default();
7572
- injectStylesIntoStyleTag_default()(main.Z, main_options);
7573
- main.Z && main.Z.locals && main.Z.locals;
7574
7633
  class Container extends util_Despot {
7575
7634
  visibility = document_visibility();
7576
7635
  htmlElement = document.querySelector("html");
@@ -7744,7 +7803,7 @@ class Container extends util_Despot {
7744
7803
  }
7745
7804
  limitWidth(width) {
7746
7805
  if (!this.containerElement) return;
7747
- return dimensions_limitWidth(this.containerElement, this.options, width);
7806
+ return limitWidth(this.containerElement, this.options, width);
7748
7807
  }
7749
7808
  limitHeight(height) {
7750
7809
  return dimensions_limitHeight(height, this.options, "containers limitHeight fn");
@@ -8049,69 +8108,12 @@ class Container extends util_Despot {
8049
8108
  }
8050
8109
  }
8051
8110
  const wrappers_container = Container;
8052
- class CollectLogger_CollectLogger {
8053
- browser;
8054
- logger;
8055
- stack = [];
8056
- options;
8057
- constructor(options){
8058
- this.options = options;
8059
- this.browser = util_getBrowser(options);
8060
- this.logger = options.logger;
8061
- }
8062
- lifo(level, parameters) {
8063
- const line = parameters.join();
8064
- if (this.stack.length > this.options.logStackSize) this.stack.pop();
8065
- this.stack.push(`[${level}] ${line}`);
8066
- return line;
8067
- }
8068
- debug(...args) {
8069
- const output = this.lifo("debug", args);
8070
- if (this.options.verbose) if (this.browser.isFirefox()) this.logger.debug(output);
8071
- else if (this.logger.groupCollapsed) {
8072
- this.logger.groupCollapsed(output);
8073
- this.logger.trace("Trace");
8074
- this.logger.groupEnd();
8075
- } else if (this.logger.debug) this.logger.debug(output);
8076
- else console.log(output);
8077
- }
8078
- error(...args) {
8079
- this.logger.error(this.lifo("error", args));
8080
- }
8081
- warn(...args) {
8082
- this.logger.warn(this.lifo("warn", args));
8083
- }
8084
- info(...args) {
8085
- this.logger.info(this.lifo("info", args));
8086
- }
8087
- getLines() {
8088
- return this.stack;
8089
- }
8090
- }
8091
- const CollectLogger = CollectLogger_CollectLogger;
8092
- var isTest_process = __webpack_require__("./node_modules/process/browser.js");
8093
- function isTest() {
8094
- return "test" === isTest_process.env.ENVIRON;
8095
- }
8096
- const util_isTest = isTest;
8097
- function mergeWithDefaultOptions(options = {}) {
8098
- const newOptions = deepmerge(src_options, options, {
8099
- arrayMerge (_destination, source) {
8100
- return source;
8101
- }
8102
- });
8103
- const collectLogger = new CollectLogger(newOptions);
8104
- newOptions.logger = collectLogger;
8105
- if (util_isTest()) newOptions.verbose = false;
8106
- return newOptions;
8107
- }
8108
- const options_mergeWithDefaultOptions = mergeWithDefaultOptions;
8109
8111
  class VideomailClient extends util_Despot {
8110
8112
  container;
8111
8113
  static ENC_TYPE_APP_JSON = constants["public"].ENC_TYPE_APP_JSON;
8112
8114
  static ENC_TYPE_FORM = constants["public"].ENC_TYPE_FORM;
8113
8115
  constructor(options = {}){
8114
- super("VideomailClient", options_mergeWithDefaultOptions(options));
8116
+ super("VideomailClient", mergeWithDefaultOptions(options));
8115
8117
  this.validateOptions();
8116
8118
  util_Despot.removeAllListeners();
8117
8119
  this.container = new wrappers_container(this.options);