@myinterview/widget-react 1.1.23-development-b93fb54 → 1.1.23-from-21-to-dev

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/cjs/index.js CHANGED
@@ -8,26 +8,51 @@ var reactDom = require('react-dom');
8
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
9
 
10
10
  function _interopNamespace(e) {
11
- if (e && e.__esModule) return e;
12
- var n = Object.create(null);
13
- if (e) {
14
- Object.keys(e).forEach(function (k) {
15
- if (k !== 'default') {
16
- var d = Object.getOwnPropertyDescriptor(e, k);
17
- Object.defineProperty(n, k, d.get ? d : {
18
- enumerable: true,
19
- get: function () { return e[k]; }
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
20
22
  });
21
- }
22
- });
23
- }
24
- n["default"] = e;
25
- return Object.freeze(n);
23
+ }
24
+ n["default"] = e;
25
+ return Object.freeze(n);
26
26
  }
27
27
 
28
28
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
29
29
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
30
30
 
31
+ /*! *****************************************************************************
32
+ Copyright (c) Microsoft Corporation.
33
+
34
+ Permission to use, copy, modify, and/or distribute this software for any
35
+ purpose with or without fee is hereby granted.
36
+
37
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
38
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
39
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
40
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
41
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
42
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
43
+ PERFORMANCE OF THIS SOFTWARE.
44
+ ***************************************************************************** */
45
+
46
+ function __awaiter(thisArg, _arguments, P, generator) {
47
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
48
+ return new (P || (P = Promise))(function (resolve, reject) {
49
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
50
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
51
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
52
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
53
+ });
54
+ }
55
+
31
56
  // eslint-disable-next-line @typescript-eslint/unbound-method
32
57
  const objectToString = Object.prototype.toString;
33
58
 
@@ -396,19 +421,83 @@ function getLocationHref() {
396
421
  }
397
422
  }
398
423
 
399
- /** An error emitted by Sentry SDKs and related utilities. */
400
- class SentryError extends Error {
401
- /** Display name of this error instance. */
424
+ /** Prefix for logging strings */
425
+ const PREFIX = 'Sentry Logger ';
402
426
 
403
- constructor( message, logLevel = 'warn') {
404
- super(message);this.message = message;
405
- this.name = new.target.prototype.constructor.name;
406
- // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line
407
- // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes
408
- // instances of `SentryError` fail `obj instanceof SentryError` checks.
409
- Object.setPrototypeOf(this, new.target.prototype);
410
- this.logLevel = logLevel;
427
+ const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] ;
428
+
429
+ /**
430
+ * Temporarily disable sentry console instrumentations.
431
+ *
432
+ * @param callback The function to run against the original `console` messages
433
+ * @returns The results of the callback
434
+ */
435
+ function consoleSandbox(callback) {
436
+ if (!('console' in GLOBAL_OBJ)) {
437
+ return callback();
438
+ }
439
+
440
+ const originalConsole = GLOBAL_OBJ.console ;
441
+ const wrappedLevels = {};
442
+
443
+ // Restore all wrapped console methods
444
+ CONSOLE_LEVELS.forEach(level => {
445
+ // TODO(v7): Remove this check as it's only needed for Node 6
446
+ const originalWrappedFunc =
447
+ originalConsole[level] && (originalConsole[level] ).__sentry_original__;
448
+ if (level in originalConsole && originalWrappedFunc) {
449
+ wrappedLevels[level] = originalConsole[level] ;
450
+ originalConsole[level] = originalWrappedFunc ;
451
+ }
452
+ });
453
+
454
+ try {
455
+ return callback();
456
+ } finally {
457
+ // Revert restoration to wrapped state
458
+ Object.keys(wrappedLevels).forEach(level => {
459
+ originalConsole[level] = wrappedLevels[level ];
460
+ });
461
+ }
462
+ }
463
+
464
+ function makeLogger() {
465
+ let enabled = false;
466
+ const logger = {
467
+ enable: () => {
468
+ enabled = true;
469
+ },
470
+ disable: () => {
471
+ enabled = false;
472
+ },
473
+ };
474
+
475
+ if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
476
+ CONSOLE_LEVELS.forEach(name => {
477
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
478
+ logger[name] = (...args) => {
479
+ if (enabled) {
480
+ consoleSandbox(() => {
481
+ GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);
482
+ });
483
+ }
484
+ };
485
+ });
486
+ } else {
487
+ CONSOLE_LEVELS.forEach(name => {
488
+ logger[name] = () => undefined;
489
+ });
411
490
  }
491
+
492
+ return logger ;
493
+ }
494
+
495
+ // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
496
+ let logger;
497
+ if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
498
+ logger = getGlobalSingleton('logger', makeLogger);
499
+ } else {
500
+ logger = makeLogger();
412
501
  }
413
502
 
414
503
  /** Regular expression used to parse a Dsn. */
@@ -439,13 +528,16 @@ function dsnToString(dsn, withPassword = false) {
439
528
  * Parses a Dsn from a given string.
440
529
  *
441
530
  * @param str A Dsn as string
442
- * @returns Dsn as DsnComponents
531
+ * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string
443
532
  */
444
533
  function dsnFromString(str) {
445
534
  const match = DSN_REGEX.exec(str);
446
535
 
447
536
  if (!match) {
448
- throw new SentryError(`Invalid Sentry Dsn: ${str}`);
537
+ // This should be logged to the console
538
+ // eslint-disable-next-line no-console
539
+ console.error(`Invalid Sentry Dsn: ${str}`);
540
+ return undefined;
449
541
  }
450
542
 
451
543
  const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);
@@ -482,117 +574,67 @@ function dsnFromComponents(components) {
482
574
 
483
575
  function validateDsn(dsn) {
484
576
  if (!(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
485
- return;
577
+ return true;
486
578
  }
487
579
 
488
580
  const { port, projectId, protocol } = dsn;
489
581
 
490
582
  const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];
491
- requiredComponents.forEach(component => {
583
+ const hasMissingRequiredComponent = requiredComponents.find(component => {
492
584
  if (!dsn[component]) {
493
- throw new SentryError(`Invalid Sentry Dsn: ${component} missing`);
585
+ logger.error(`Invalid Sentry Dsn: ${component} missing`);
586
+ return true;
494
587
  }
588
+ return false;
495
589
  });
496
590
 
591
+ if (hasMissingRequiredComponent) {
592
+ return false;
593
+ }
594
+
497
595
  if (!projectId.match(/^\d+$/)) {
498
- throw new SentryError(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);
596
+ logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);
597
+ return false;
499
598
  }
500
599
 
501
600
  if (!isValidProtocol(protocol)) {
502
- throw new SentryError(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);
601
+ logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);
602
+ return false;
503
603
  }
504
604
 
505
605
  if (port && isNaN(parseInt(port, 10))) {
506
- throw new SentryError(`Invalid Sentry Dsn: Invalid port ${port}`);
606
+ logger.error(`Invalid Sentry Dsn: Invalid port ${port}`);
607
+ return false;
507
608
  }
508
609
 
509
610
  return true;
510
611
  }
511
612
 
512
- /** The Sentry Dsn, identifying a Sentry instance and project. */
513
- function makeDsn(from) {
514
- const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);
515
- validateDsn(components);
516
- return components;
517
- }
518
-
519
- /** Prefix for logging strings */
520
- const PREFIX = 'Sentry Logger ';
521
-
522
- const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] ;
523
-
524
613
  /**
525
- * Temporarily disable sentry console instrumentations.
526
- *
527
- * @param callback The function to run against the original `console` messages
528
- * @returns The results of the callback
614
+ * Creates a valid Sentry Dsn object, identifying a Sentry instance and project.
615
+ * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source
529
616
  */
530
- function consoleSandbox(callback) {
531
- if (!('console' in GLOBAL_OBJ)) {
532
- return callback();
533
- }
534
-
535
- const originalConsole = GLOBAL_OBJ.console ;
536
- const wrappedLevels = {};
537
-
538
- // Restore all wrapped console methods
539
- CONSOLE_LEVELS.forEach(level => {
540
- // TODO(v7): Remove this check as it's only needed for Node 6
541
- const originalWrappedFunc =
542
- originalConsole[level] && (originalConsole[level] ).__sentry_original__;
543
- if (level in originalConsole && originalWrappedFunc) {
544
- wrappedLevels[level] = originalConsole[level] ;
545
- originalConsole[level] = originalWrappedFunc ;
546
- }
547
- });
548
-
549
- try {
550
- return callback();
551
- } finally {
552
- // Revert restoration to wrapped state
553
- Object.keys(wrappedLevels).forEach(level => {
554
- originalConsole[level] = wrappedLevels[level ];
555
- });
617
+ function makeDsn(from) {
618
+ const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);
619
+ if (!components || !validateDsn(components)) {
620
+ return undefined;
556
621
  }
622
+ return components;
557
623
  }
558
624
 
559
- function makeLogger() {
560
- let enabled = false;
561
- const logger = {
562
- enable: () => {
563
- enabled = true;
564
- },
565
- disable: () => {
566
- enabled = false;
567
- },
568
- };
625
+ /** An error emitted by Sentry SDKs and related utilities. */
626
+ class SentryError extends Error {
627
+ /** Display name of this error instance. */
569
628
 
570
- if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
571
- CONSOLE_LEVELS.forEach(name => {
572
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
573
- logger[name] = (...args) => {
574
- if (enabled) {
575
- consoleSandbox(() => {
576
- GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);
577
- });
578
- }
579
- };
580
- });
581
- } else {
582
- CONSOLE_LEVELS.forEach(name => {
583
- logger[name] = () => undefined;
584
- });
629
+ constructor( message, logLevel = 'warn') {
630
+ super(message);this.message = message;
631
+ this.name = new.target.prototype.constructor.name;
632
+ // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line
633
+ // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes
634
+ // instances of `SentryError` fail `obj instanceof SentryError` checks.
635
+ Object.setPrototypeOf(this, new.target.prototype);
636
+ this.logLevel = logLevel;
585
637
  }
586
-
587
- return logger ;
588
- }
589
-
590
- // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
591
- let logger;
592
- if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
593
- logger = getGlobalSingleton('logger', makeLogger);
594
- } else {
595
- logger = makeLogger();
596
638
  }
597
639
 
598
640
  /**
@@ -5092,16 +5134,20 @@ class BaseClient {
5092
5134
  */
5093
5135
  constructor(options) {BaseClient.prototype.__init.call(this);BaseClient.prototype.__init2.call(this);BaseClient.prototype.__init3.call(this);BaseClient.prototype.__init4.call(this);BaseClient.prototype.__init5.call(this);
5094
5136
  this._options = options;
5137
+
5095
5138
  if (options.dsn) {
5096
5139
  this._dsn = makeDsn(options.dsn);
5140
+ } else {
5141
+ (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('No DSN provided, client will not do anything.');
5142
+ }
5143
+
5144
+ if (this._dsn) {
5097
5145
  const url = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);
5098
5146
  this._transport = options.transport({
5099
5147
  recordDroppedEvent: this.recordDroppedEvent.bind(this),
5100
5148
  ...options.transportOptions,
5101
5149
  url,
5102
5150
  });
5103
- } else {
5104
- (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('No DSN provided, client will not do anything.');
5105
5151
  }
5106
5152
  }
5107
5153
 
@@ -5820,7 +5866,7 @@ function getEventForEnvelopeItem(item, type) {
5820
5866
  return Array.isArray(item) ? (item )[1] : undefined;
5821
5867
  }
5822
5868
 
5823
- const SDK_VERSION = '7.52.1';
5869
+ const SDK_VERSION = '7.53.0';
5824
5870
 
5825
5871
  let originalFunctionToString;
5826
5872
 
@@ -6053,9 +6099,9 @@ function _getEventFilterUrl(event) {
6053
6099
  }
6054
6100
 
6055
6101
  var Integrations = /*#__PURE__*/Object.freeze({
6056
- __proto__: null,
6057
- FunctionToString: FunctionToString,
6058
- InboundFilters: InboundFilters
6102
+ __proto__: null,
6103
+ FunctionToString: FunctionToString,
6104
+ InboundFilters: InboundFilters
6059
6105
  });
6060
6106
 
6061
6107
  const WINDOW$1 = GLOBAL_OBJ ;
@@ -8279,13 +8325,13 @@ function startSessionTracking() {
8279
8325
  }
8280
8326
 
8281
8327
  var index$1 = /*#__PURE__*/Object.freeze({
8282
- __proto__: null,
8283
- GlobalHandlers: GlobalHandlers,
8284
- TryCatch: TryCatch,
8285
- Breadcrumbs: Breadcrumbs,
8286
- LinkedErrors: LinkedErrors,
8287
- HttpContext: HttpContext,
8288
- Dedupe: Dedupe
8328
+ __proto__: null,
8329
+ GlobalHandlers: GlobalHandlers,
8330
+ TryCatch: TryCatch,
8331
+ Breadcrumbs: Breadcrumbs,
8332
+ LinkedErrors: LinkedErrors,
8333
+ HttpContext: HttpContext,
8334
+ Dedupe: Dedupe
8289
8335
  });
8290
8336
 
8291
8337
  // exporting a separate copy of `WINDOW` rather than exporting the one from `@sentry/browser`
@@ -11572,6 +11618,23 @@ var NodeType;
11572
11618
  NodeType[NodeType["Comment"] = 5] = "Comment";
11573
11619
  })(NodeType || (NodeType = {}));
11574
11620
 
11621
+ /* eslint-disable @typescript-eslint/naming-convention */
11622
+
11623
+ var EventType; (function (EventType) {
11624
+ const DomContentLoaded = 0; EventType[EventType["DomContentLoaded"] = DomContentLoaded] = "DomContentLoaded";
11625
+ const Load = 1; EventType[EventType["Load"] = Load] = "Load";
11626
+ const FullSnapshot = 2; EventType[EventType["FullSnapshot"] = FullSnapshot] = "FullSnapshot";
11627
+ const IncrementalSnapshot = 3; EventType[EventType["IncrementalSnapshot"] = IncrementalSnapshot] = "IncrementalSnapshot";
11628
+ const Meta = 4; EventType[EventType["Meta"] = Meta] = "Meta";
11629
+ const Custom = 5; EventType[EventType["Custom"] = Custom] = "Custom";
11630
+ const Plugin = 6; EventType[EventType["Plugin"] = Plugin] = "Plugin";
11631
+ })(EventType || (EventType = {}));
11632
+
11633
+ /**
11634
+ * This is a partial copy of rrweb's eventWithTime type which only contains the properties
11635
+ * we specifcally need in the SDK.
11636
+ */
11637
+
11575
11638
  /**
11576
11639
  * Converts a timestamp to ms, if it was in s, or keeps it as ms.
11577
11640
  */
@@ -11614,7 +11677,18 @@ async function addEvent(
11614
11677
  replay.eventBuffer.clear();
11615
11678
  }
11616
11679
 
11617
- return await replay.eventBuffer.addEvent(event);
11680
+ const replayOptions = replay.getOptions();
11681
+
11682
+ const eventAfterPossibleCallback =
11683
+ typeof replayOptions.beforeAddRecordingEvent === 'function' && event.type === EventType.Custom
11684
+ ? replayOptions.beforeAddRecordingEvent(event)
11685
+ : event;
11686
+
11687
+ if (!eventAfterPossibleCallback) {
11688
+ return;
11689
+ }
11690
+
11691
+ return await replay.eventBuffer.addEvent(eventAfterPossibleCallback);
11618
11692
  } catch (error) {
11619
11693
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(error);
11620
11694
  await replay.stop('addEvent');
@@ -14590,23 +14664,6 @@ function debounce(func, wait, options) {
14590
14664
  return debounced;
14591
14665
  }
14592
14666
 
14593
- /* eslint-disable @typescript-eslint/naming-convention */
14594
-
14595
- var EventType; (function (EventType) {
14596
- const DomContentLoaded = 0; EventType[EventType["DomContentLoaded"] = DomContentLoaded] = "DomContentLoaded";
14597
- const Load = 1; EventType[EventType["Load"] = Load] = "Load";
14598
- const FullSnapshot = 2; EventType[EventType["FullSnapshot"] = FullSnapshot] = "FullSnapshot";
14599
- const IncrementalSnapshot = 3; EventType[EventType["IncrementalSnapshot"] = IncrementalSnapshot] = "IncrementalSnapshot";
14600
- const Meta = 4; EventType[EventType["Meta"] = Meta] = "Meta";
14601
- const Custom = 5; EventType[EventType["Custom"] = Custom] = "Custom";
14602
- const Plugin = 6; EventType[EventType["Plugin"] = Plugin] = "Plugin";
14603
- })(EventType || (EventType = {}));
14604
-
14605
- /**
14606
- * This is a partial copy of rrweb's eventWithTime type which only contains the properties
14607
- * we specifcally need in the SDK.
14608
- */
14609
-
14610
14667
  /**
14611
14668
  * Handler for recording events.
14612
14669
  *
@@ -14680,6 +14737,30 @@ function getHandleRecordingEmit(replay) {
14680
14737
  }
14681
14738
  }
14682
14739
 
14740
+ const options = replay.getOptions();
14741
+
14742
+ // TODO: We want this as an experiment so that we can test
14743
+ // internally and create metrics before making this the default
14744
+ if (options._experiments.delayFlushOnCheckout) {
14745
+ // If the full snapshot is due to an initial load, we will not have
14746
+ // a previous session ID. In this case, we want to buffer events
14747
+ // for a set amount of time before flushing. This can help avoid
14748
+ // capturing replays of users that immediately close the window.
14749
+ setTimeout(() => replay.conditionalFlush(), options._experiments.delayFlushOnCheckout);
14750
+
14751
+ // Cancel any previously debounced flushes to ensure there are no [near]
14752
+ // simultaneous flushes happening. The latter request should be
14753
+ // insignificant in this case, so wait for additional user interaction to
14754
+ // trigger a new flush.
14755
+ //
14756
+ // This can happen because there's no guarantee that a recording event
14757
+ // happens first. e.g. a mouse click can happen and trigger a debounced
14758
+ // flush before the checkout.
14759
+ replay.cancelFlush();
14760
+
14761
+ return true;
14762
+ }
14763
+
14683
14764
  // Flush immediately so that we do not miss the first segment, otherwise
14684
14765
  // it can prevent loading on the UI. This will cause an increase in short
14685
14766
  // replays (e.g. opening and closing a tab quickly), but these can be
@@ -15445,7 +15526,17 @@ class ReplayContainer {
15445
15526
  }
15446
15527
 
15447
15528
  /**
15448
- *
15529
+ * Only flush if `this.recordingMode === 'session'`
15530
+ */
15531
+ conditionalFlush() {
15532
+ if (this.recordingMode === 'buffer') {
15533
+ return Promise.resolve();
15534
+ }
15535
+
15536
+ return this.flushImmediate();
15537
+ }
15538
+
15539
+ /**
15449
15540
  * Always flush via `_debouncedFlush` so that we do not have flushes triggered
15450
15541
  * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be
15451
15542
  * cases of mulitple flushes happening closely together.
@@ -15456,6 +15547,13 @@ class ReplayContainer {
15456
15547
  return this._debouncedFlush.flush() ;
15457
15548
  }
15458
15549
 
15550
+ /**
15551
+ * Cancels queued up flushes.
15552
+ */
15553
+ cancelFlush() {
15554
+ this._debouncedFlush.cancel();
15555
+ }
15556
+
15459
15557
  /** Get the current sesion (=replay) ID */
15460
15558
  getSessionId() {
15461
15559
  return this.session && this.session.id;
@@ -15705,7 +15803,7 @@ class ReplayContainer {
15705
15803
  // Send replay when the page/tab becomes hidden. There is no reason to send
15706
15804
  // replay if it becomes visible, since no actions we care about were done
15707
15805
  // while it was hidden
15708
- this._conditionalFlush();
15806
+ void this.conditionalFlush();
15709
15807
  }
15710
15808
 
15711
15809
  /**
@@ -15789,17 +15887,6 @@ class ReplayContainer {
15789
15887
  return Promise.all(createPerformanceSpans(this, createPerformanceEntries(entries)));
15790
15888
  }
15791
15889
 
15792
- /**
15793
- * Only flush if `this.recordingMode === 'session'`
15794
- */
15795
- _conditionalFlush() {
15796
- if (this.recordingMode === 'buffer') {
15797
- return;
15798
- }
15799
-
15800
- void this.flushImmediate();
15801
- }
15802
-
15803
15890
  /**
15804
15891
  * Clear _context
15805
15892
  */
@@ -16161,6 +16248,8 @@ class Replay {
16161
16248
  ignore = [],
16162
16249
  maskFn,
16163
16250
 
16251
+ beforeAddRecordingEvent,
16252
+
16164
16253
  // eslint-disable-next-line deprecation/deprecation
16165
16254
  blockClass,
16166
16255
  // eslint-disable-next-line deprecation/deprecation
@@ -16218,6 +16307,7 @@ class Replay {
16218
16307
  networkCaptureBodies,
16219
16308
  networkRequestHeaders: _getMergedNetworkHeaders(networkRequestHeaders),
16220
16309
  networkResponseHeaders: _getMergedNetworkHeaders(networkResponseHeaders),
16310
+ beforeAddRecordingEvent,
16221
16311
 
16222
16312
  _experiments,
16223
16313
  };
@@ -25586,6 +25676,7 @@ var STATES$5;
25586
25676
  STATES["RE_INIT_RECORDER__NEXT_QUESTION"] = "reInitRecorderNextQuestion";
25587
25677
  STATES["UPLOADING"] = "uploading";
25588
25678
  STATES["CONFIRM"] = "confirm";
25679
+ STATES["CONFIRM_WATING"] = "confirmWaiting";
25589
25680
  STATES["FINISHED"] = "finished";
25590
25681
  STATES["ERROR"] = "error";
25591
25682
  })(STATES$5 || (STATES$5 = {}));
@@ -25639,6 +25730,7 @@ var ACTIONS$6;
25639
25730
  ACTIONS["RESET_FAILED_RECORDING_ATTEMPTS"] = "resetFailedRecordingAttempts";
25640
25731
  ACTIONS["CLEAR_VIDEO_ERROR"] = "clearVideoError";
25641
25732
  ACTIONS["UPDATE_VIDEO_DIMENSIONS"] = "updateVideoDimensions";
25733
+ ACTIONS["UPDATE_UPLOADED_FALSE_COUNT"] = "updateUploadedFalseCount";
25642
25734
  })(ACTIONS$6 || (ACTIONS$6 = {}));
25643
25735
  var EVENTS$5;
25644
25736
  (function (EVENTS) {
@@ -25694,6 +25786,7 @@ var GUARDS$3;
25694
25786
  GUARDS["IS_RECORDER_READY"] = "isRecorderReady";
25695
25787
  GUARDS["IS_ASSESSMENT_QUESTION"] = "isAssessmentQuestion";
25696
25788
  GUARDS["IS_TIMES_UP"] = "isTimesUp";
25789
+ GUARDS["SHOULD_TRY_TO_CONFIRM"] = "shouldTryToConfirm";
25697
25790
  })(GUARDS$3 || (GUARDS$3 = {}));
25698
25791
  var TAGS;
25699
25792
  (function (TAGS) {
@@ -25703,6 +25796,7 @@ var TAGS;
25703
25796
  TAGS["DISPLAY_OUTER_VIEW"] = "displayOuterView";
25704
25797
  TAGS["DISPLAY_QUESTION"] = "displayQuestion";
25705
25798
  TAGS["DISPLAY_QUESTIONS_LIST"] = "displayQuestionsList";
25799
+ TAGS["DISPLAY_UPLOAD"] = "displayUpload";
25706
25800
  TAGS["LOADING"] = "loading";
25707
25801
  })(TAGS || (TAGS = {}));
25708
25802
 
@@ -30424,7 +30518,7 @@ const configGenerator = () => {
30424
30518
  let release;
30425
30519
  try {
30426
30520
  environment !== null && environment !== void 0 ? environment : (environment = "staging");
30427
- release !== null && release !== void 0 ? release : (release = "1.1.23");
30521
+ release !== null && release !== void 0 ? release : (release = "1.1.23-from-21-to-dev");
30428
30522
  }
30429
30523
  catch (_a) {
30430
30524
  console.error('sentry configGenerator error');
@@ -30897,6 +30991,7 @@ const SECONDS_LEFT_HIGHLIGHT = 10;
30897
30991
  const DEFAULT_ASSESSMENT_MAX_CHARS = 300;
30898
30992
  const DEFAULT_ASSESSMENT_DURATION = 0;
30899
30993
  const DEFAULT_VIDEO_DIMENSIONS = { width: 1280, height: 720 }; // Transcoder default dimensions (720p)
30994
+ const MAX_CONFIRM_ATTEMPTS = 5;
30900
30995
  // Font
30901
30996
  const FONT_URL = 'https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700&display=swap';
30902
30997
  var RETAKE_SPEED;
@@ -35057,8 +35152,8 @@ function memoizeOne(resultFn, isEqual) {
35057
35152
  }
35058
35153
 
35059
35154
  var memoizeOne_esm = /*#__PURE__*/Object.freeze({
35060
- __proto__: null,
35061
- 'default': memoizeOne
35155
+ __proto__: null,
35156
+ 'default': memoizeOne
35062
35157
  });
35063
35158
 
35064
35159
  var require$$2 = /*@__PURE__*/getAugmentedNamespace(memoizeOne_esm);
@@ -39018,6 +39113,11 @@ var EVENT_TYPES;
39018
39113
  EVENT_TYPES["SOUND_RESTORED"] = "soundRestored";
39019
39114
  EVENT_TYPES["TIMES_UP"] = "timesUp";
39020
39115
  EVENT_TYPES["COMPLETED_INTERVIEW"] = "completedInterview";
39116
+ EVENT_TYPES["RECONNECTED"] = "reconnected";
39117
+ EVENT_TYPES["CONFIRM_UPLOADED_FAILED"] = "confirmUploadedFailed";
39118
+ EVENT_TYPES["FINISHED"] = "finished";
39119
+ EVENT_TYPES["ON_FINISH_SUCCEED"] = "onFinishSucceed";
39120
+ EVENT_TYPES["ON_FINISH_FAILED"] = "onFinishFailed";
39021
39121
  })(EVENT_TYPES || (EVENT_TYPES = {}));
39022
39122
  let event_id;
39023
39123
  const updateEventId = (eventId) => { event_id = eventId; };
@@ -39567,31 +39667,6 @@ const Setup = ({ widgetMachine, sendToWidget, isPracticeDisabled, recordWithoutV
39567
39667
  React__default["default"].createElement(C, { className: startButtonClassNames, color: "special", backgroundColor: "white", onClick: () => sendToWidget(EVENTS$5.QUESTION_MODE), disabled: !canStartInterview }, t(isResumed ? 'welcome.resumeInterview' : 'buttons.btn_start').toUpperCase()))));
39568
39668
  };
39569
39669
 
39570
- /*! *****************************************************************************
39571
- Copyright (c) Microsoft Corporation.
39572
-
39573
- Permission to use, copy, modify, and/or distribute this software for any
39574
- purpose with or without fee is hereby granted.
39575
-
39576
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
39577
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
39578
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
39579
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
39580
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39581
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39582
- PERFORMANCE OF THIS SOFTWARE.
39583
- ***************************************************************************** */
39584
-
39585
- function __awaiter(thisArg, _arguments, P, generator) {
39586
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
39587
- return new (P || (P = Promise))(function (resolve, reject) {
39588
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39589
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
39590
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
39591
- step((generator = generator.apply(thisArg, _arguments || [])).next());
39592
- });
39593
- }
39594
-
39595
39670
  const uploadToS3 = (url, data, onProgress, timeout = 0) => s3AxiosInstance.put(url, data, {
39596
39671
  headers: { 'Content-Type': 'video/webm' }, onUploadProgress: onProgress, timeout,
39597
39672
  });
@@ -39662,8 +39737,8 @@ const OuterView = ({ widgetMachine, sendToWidget, recorderRef }) => {
39662
39737
  const isQuestionDisplayed = widgetMachine.hasTag(TAGS.DISPLAY_QUESTION) || (isVideoQuestionState && !currentQuestionObj.thinkingTime);
39663
39738
  const isPreviewState = widgetMachine.matches(STATES$5.PREVIEW);
39664
39739
  const isUploadingState = widgetMachine.matches(STATES$5.UPLOADING);
39665
- const isConfirmState = widgetMachine.matches(STATES$5.CONFIRM);
39666
39740
  const isQuestionsListDisplayed = widgetMachine.hasTag(TAGS.DISPLAY_QUESTIONS_LIST);
39741
+ const isUploadDisplayed = widgetMachine.hasTag(TAGS.DISPLAY_UPLOAD);
39667
39742
  const isRecording = recorderMachine.matches({ [STATES$6.RECORDING]: STATES$6.COLLECTING_BLOBS });
39668
39743
  const isCountDown = recorderMachine.matches({ [STATES$6.RECORDING]: STATES$6.COUNT_DOWN });
39669
39744
  const isPracticeMode = recordingType === TAKE_TYPES.PRACTICE;
@@ -39681,7 +39756,7 @@ const OuterView = ({ widgetMachine, sendToWidget, recorderRef }) => {
39681
39756
  isSetupState && React__default["default"].createElement(Setup, { recordWithoutVideo: recordWithoutVideo, widgetMachine: widgetMachine, sendToWidget: sendToWidget, isPracticeDisabled: !!config.disablePractice }),
39682
39757
  isQuestionsListDisplayed && React__default["default"].createElement(QuestionsList, { questions: questions, currentQuestion: currentQuestion, isPracticeMode: isPracticeMode, questionsStatus: questionsStatus }),
39683
39758
  isQuestionDisplayed && React__default["default"].createElement(Question, { questionObj: currentQuestionObj }),
39684
- (isUploadingState || isConfirmState) && (React__default["default"].createElement(Upload, { isConnected: isConnected, totalFileSize: totalFileSize, totalUploadedFilesSize: totalUploadedFilesSize, totalUploadSpeed: totalUploadSpeed }))));
39759
+ isUploadDisplayed && (React__default["default"].createElement(Upload, { isConnected: isConnected, totalFileSize: totalFileSize, totalUploadedFilesSize: totalUploadedFilesSize, totalUploadSpeed: totalUploadSpeed }))));
39685
39760
  };
39686
39761
 
39687
39762
  var actions = {};
@@ -44778,7 +44853,7 @@ const accUploaderMachine = createMachine({
44778
44853
  actions: [ACTIONS$2.SENTRY],
44779
44854
  },
44780
44855
  {
44781
- actions: [ACTIONS$2.SET_UPLOADED, ACTIONS$2.SENTRY],
44856
+ actions: [ACTIONS$2.SENTRY],
44782
44857
  target: `#uploader.${STATES$2.UPLOADED}`, // In case the video already uploaded
44783
44858
  },
44784
44859
  ],
@@ -44795,7 +44870,6 @@ const accUploaderMachine = createMachine({
44795
44870
  id: 'uploadToS3',
44796
44871
  src: ({ signedUrl, file }) => (callback) => uploadToS3(signedUrl, file, callback),
44797
44872
  onDone: {
44798
- // actions: [ACTIONS.SET_UPLOADED],
44799
44873
  target: `#uploader.${STATES$2.UPLOADED}`,
44800
44874
  },
44801
44875
  onError: {
@@ -45151,10 +45225,14 @@ const accWidgetMachine = createMachine({
45151
45225
  failedRecordingMessage: VIDEO_CORRUPTED_STATES.NO_ERROR,
45152
45226
  isResumed: false,
45153
45227
  videoDimensions: DEFAULT_VIDEO_DIMENSIONS,
45228
+ confirmUploadedFalseCount: 0,
45154
45229
  },
45155
45230
  on: {
45156
45231
  [EVENTS$1.CONNECTION_CHANGED]: {
45157
- actions: [ACTIONS$6.SET_CONNECTION],
45232
+ actions: [
45233
+ ACTIONS$6.SET_CONNECTION,
45234
+ { type: ACTIONS$6.EMIT_TRACKING_EVENT, data: { eventType: EVENT_TYPES.RECONNECTED } },
45235
+ ],
45158
45236
  },
45159
45237
  [EVENTS$5.UPLOADER_PROGRESS]: {
45160
45238
  actions: [ACTIONS$6.UPDATE_TOTAL_UPLOADED_FILES_SIZE],
@@ -45681,7 +45759,7 @@ const accWidgetMachine = createMachine({
45681
45759
  },
45682
45760
  },
45683
45761
  [STATES$5.UPLOADING]: {
45684
- tags: [TAGS.DISPLAY_OUTER_VIEW],
45762
+ tags: [TAGS.DISPLAY_OUTER_VIEW, TAGS.DISPLAY_UPLOAD],
45685
45763
  entry: [
45686
45764
  { type: ACTIONS$6.SESSION_EVENT, data: { event: 'widget_completed', type: 'date' } },
45687
45765
  { type: ACTIONS$6.CONSOLE_DEBUG, data: { message: DEBUG.UPLOADING_STATE } },
@@ -45695,30 +45773,57 @@ const accWidgetMachine = createMachine({
45695
45773
  },
45696
45774
  },
45697
45775
  },
45776
+ [STATES$5.CONFIRM_WATING]: {
45777
+ tags: [TAGS.DISPLAY_OUTER_VIEW, TAGS.DISPLAY_UPLOAD],
45778
+ always: {
45779
+ target: STATES$5.CONFIRM,
45780
+ cond: GUARDS$3.IS_CONNECTED,
45781
+ },
45782
+ },
45698
45783
  [STATES$5.CONFIRM]: {
45699
- tags: [TAGS.DISPLAY_OUTER_VIEW],
45784
+ tags: [TAGS.DISPLAY_OUTER_VIEW, TAGS.DISPLAY_UPLOAD],
45700
45785
  invoke: {
45701
45786
  id: 'getVideo',
45702
45787
  src: (context) => { var _a; return getVideo(((_a = context.widgetConfig.video) === null || _a === void 0 ? void 0 : _a.video_id) || ''); },
45703
- onDone: {
45704
- target: STATES$5.FINISHED,
45705
- cond: (_, event) => !!event.data.data.data.video.uploaded,
45706
- },
45788
+ onDone: [
45789
+ {
45790
+ target: STATES$5.FINISHED,
45791
+ cond: (_, event) => !!event.data.data.data.video.uploaded,
45792
+ },
45793
+ {
45794
+ actions: [
45795
+ ACTIONS$6.UPDATE_UPLOADED_FALSE_COUNT,
45796
+ { type: ACTIONS$6.SENTRY, data: { eventName: 'CONFIRM::UPLOADED_FALSE' } },
45797
+ ],
45798
+ target: STATES$5.CONFIRM_WATING,
45799
+ cond: GUARDS$3.SHOULD_TRY_TO_CONFIRM,
45800
+ },
45801
+ {
45802
+ actions: [
45803
+ { type: ACTIONS$6.SET_VIDEO_ERROR, data: { errorMessage: 'Error, Please contact support' } },
45804
+ { type: ACTIONS$6.EMIT_TRACKING_EVENT, data: { eventType: EVENT_TYPES.CONFIRM_UPLOADED_FAILED } },
45805
+ ],
45806
+ target: STATES$5.ERROR,
45807
+ },
45808
+ ],
45707
45809
  onError: [
45708
45810
  {
45709
- actions: [() => console.error('UPDATE_VIDEO_UPLADED_ERROR:'), console.error, ACTIONS$6.SENTRY],
45811
+ actions: [() => console.error('UPDATE_VIDEO_UPLADED_ERROR:'), console.error, { type: ACTIONS$6.SENTRY, data: { eventName: 'CONFIRM::ERROR__NOT_FOUND' } }],
45710
45812
  target: STATES$5.FINISHED,
45711
45813
  cond: (_, event) => event.data.response.status === STATUS_CODES.NOT_FOUND,
45712
45814
  },
45713
45815
  {
45714
- actions: [ACTIONS$6.SENTRY],
45715
- target: STATES$5.CONFIRM,
45816
+ actions: [() => console.error('UPDATE_VIDEO_UPLADED_ERROR:'), console.error, { type: ACTIONS$6.SENTRY, data: { eventName: 'CONFIRM::ERROR' } }],
45817
+ target: STATES$5.CONFIRM_WATING,
45716
45818
  },
45717
45819
  ],
45718
45820
  },
45719
45821
  },
45720
45822
  [STATES$5.FINISHED]: {
45721
- entry: [{ type: ACTIONS$6.CONSOLE_DEBUG, data: { message: DEBUG.INTERVIEW_SUBMITTED } }],
45823
+ entry: [
45824
+ { type: ACTIONS$6.CONSOLE_DEBUG, data: { message: DEBUG.INTERVIEW_SUBMITTED } },
45825
+ { type: ACTIONS$6.EMIT_TRACKING_EVENT, data: { eventType: EVENT_TYPES.FINISHED } },
45826
+ ],
45722
45827
  type: 'final',
45723
45828
  },
45724
45829
  [STATES$5.ERROR]: {
@@ -45914,9 +46019,12 @@ const accWidgetMachine = createMachine({
45914
46019
  widgetConfig: Object.assign(Object.assign({}, widgetConfig), { video: Object.assign(Object.assign({}, widgetConfig.video), { videos: (_b = (_a = widgetConfig.video) === null || _a === void 0 ? void 0 : _a.videos) === null || _b === void 0 ? void 0 : _b.map((video, idx) => ((idx !== questionNumber - 1) ? video : videoFile)) }) }),
45915
46020
  });
45916
46021
  }),
45917
- [ACTIONS$6.SET_VIDEO_ERROR]: assign$2((_, event) => ({
45918
- error: event.data.response.data || { errorMessage: event.data.message },
45919
- })),
46022
+ [ACTIONS$6.SET_VIDEO_ERROR]: assign$2((_, event, meta) => {
46023
+ var _a, _b, _c, _d;
46024
+ return ({
46025
+ error: ((_b = (_a = event.data) === null || _a === void 0 ? void 0 : _a.response) === null || _b === void 0 ? void 0 : _b.data) || { errorMessage: ((_c = event.data) === null || _c === void 0 ? void 0 : _c.message) || ((_d = meta.action.data) === null || _d === void 0 ? void 0 : _d.errorMessage) },
46026
+ });
46027
+ }),
45920
46028
  [ACTIONS$6.REVOKE_MEMORY]: send$2((_, event) => ({ type: EVENTS$4.REMOVE_TAKES, data: { questionToRemove: event.data.questionNumber } }), { to: ({ storageRef }) => storageRef }),
45921
46029
  [ACTIONS$6.UPDATE_VIDEO_OBJECT]: assign$2(({ widgetConfig, recordingType }) => {
45922
46030
  var _a, _b;
@@ -45950,6 +46058,9 @@ const accWidgetMachine = createMachine({
45950
46058
  height: event.data.height,
45951
46059
  },
45952
46060
  })),
46061
+ [ACTIONS$6.UPDATE_UPLOADED_FALSE_COUNT]: assign$2(({ confirmUploadedFalseCount }) => ({
46062
+ confirmUploadedFalseCount: confirmUploadedFalseCount + 1,
46063
+ })),
45953
46064
  },
45954
46065
  services: {
45955
46066
  [SERVICES$1.UPDATE_VIDEO_OBJECT_CALL]: ({ widgetConfig: { video }, recordingType, speedTestResult }, event, meta) => (callback, onReceive) => {
@@ -45993,6 +46104,7 @@ const accWidgetMachine = createMachine({
45993
46104
  [GUARDS$3.IS_RECORDER_READY]: ({ recorderRef }) => (recorderRef === null || recorderRef === void 0 ? void 0 : recorderRef.getSnapshot().value) === STATES$6.IDLE,
45994
46105
  [GUARDS$3.IS_ASSESSMENT_QUESTION]: ({ questions, currentQuestion }) => !!questions[currentQuestion - 1].answerType && questions[currentQuestion - 1].answerType !== ANSWER_TYPES.VIDEO,
45995
46106
  [GUARDS$3.IS_TIMES_UP]: (_, event) => !!event.data.isTimesUp,
46107
+ [GUARDS$3.SHOULD_TRY_TO_CONFIRM]: ({ confirmUploadedFalseCount }) => confirmUploadedFalseCount <= MAX_CONFIRM_ATTEMPTS,
45996
46108
  },
45997
46109
  });
45998
46110
 
@@ -48515,10 +48627,25 @@ const Main = ({ widgetConfig, setShouldShowWaterMark, myinterviewRef, isWidgetMi
48515
48627
  React.useEffect(() => {
48516
48628
  setShouldShowWaterMark(!!(company === null || company === void 0 ? void 0 : company.shouldShowWaterMark));
48517
48629
  }, [company === null || company === void 0 ? void 0 : company.shouldShowWaterMark]);
48630
+ const _onFinish = () => __awaiter(void 0, void 0, void 0, function* () { var _a, _b; return (_b = (_a = widgetConfig.config).onFinish) === null || _b === void 0 ? void 0 : _b.call(_a, { redirectUrl: candidate.redirectUrl, video_id: (video === null || video === void 0 ? void 0 : video.video_id) || '' }); });
48518
48631
  React.useEffect(() => {
48519
- var _a, _b;
48520
48632
  if (machine.done) {
48521
- (_b = (_a = widgetConfig.config).onFinish) === null || _b === void 0 ? void 0 : _b.call(_a, { redirectUrl: candidate.redirectUrl, video_id: (video === null || video === void 0 ? void 0 : video.video_id) || '' });
48633
+ if (widgetConfig.config.onFinish) {
48634
+ _onFinish().then(() => {
48635
+ emitTrackEvent({ eventType: EVENT_TYPES.ON_FINISH_SUCCEED });
48636
+ }).catch((err) => {
48637
+ var _a;
48638
+ let errorMessage = '';
48639
+ try {
48640
+ errorMessage = (err === null || err === void 0 ? void 0 : err.message) || (err === null || err === void 0 ? void 0 : err.msg) || ((_a = err === null || err === void 0 ? void 0 : err.data) === null || _a === void 0 ? void 0 : _a.message);
48641
+ }
48642
+ catch (_b) {
48643
+ //
48644
+ }
48645
+ emitTrackEvent({ eventType: EVENT_TYPES.ON_FINISH_FAILED, extraData: { errorMessage } });
48646
+ throw err;
48647
+ });
48648
+ }
48522
48649
  }
48523
48650
  }, [machine.done]);
48524
48651
  React.useEffect(() => {
@@ -48534,11 +48661,16 @@ const Main = ({ widgetConfig, setShouldShowWaterMark, myinterviewRef, isWidgetMi
48534
48661
  });
48535
48662
  }
48536
48663
  }, [candidate, job === null || job === void 0 ? void 0 : job.language]);
48664
+ const setBackgroundOpacity = () => {
48665
+ var _a;
48666
+ (_a = myinterviewRef === null || myinterviewRef === void 0 ? void 0 : myinterviewRef.current) === null || _a === void 0 ? void 0 : _a.style.setProperty('--myinterview-background-opacity', isLoading || isErrorState ? '0' : '1');
48667
+ };
48537
48668
  React.useEffect(() => {
48538
48669
  var _a, _b;
48539
48670
  if (isErrorState && (error === null || error === void 0 ? void 0 : error.statusCode) === 400) {
48540
48671
  (_b = (_a = widgetConfig.config).onError) === null || _b === void 0 ? void 0 : _b.call(_a, { messageType: 'applied' });
48541
48672
  }
48673
+ setBackgroundOpacity();
48542
48674
  }, [isErrorState]);
48543
48675
  const isResumed = React.useMemo(() => { var _a, _b; return !!((_b = (_a = widgetConfig.video) === null || _a === void 0 ? void 0 : _a.videos) === null || _b === void 0 ? void 0 : _b.some((v) => v.uploaded)); }, [widgetConfig.video]);
48544
48676
  const handleScroll = (e) => {
@@ -48548,8 +48680,7 @@ const Main = ({ widgetConfig, setShouldShowWaterMark, myinterviewRef, isWidgetMi
48548
48680
  (_b = viewsRef === null || viewsRef === void 0 ? void 0 : viewsRef.current) === null || _b === void 0 ? void 0 : _b.style.setProperty('--myinterview-widget-practice-opacity', scrollTop > 10 ? '0' : '1');
48549
48681
  };
48550
48682
  React.useEffect(() => {
48551
- var _a;
48552
- (_a = myinterviewRef === null || myinterviewRef === void 0 ? void 0 : myinterviewRef.current) === null || _a === void 0 ? void 0 : _a.style.setProperty('--myinterview-background-opacity', isLoading || isErrorState ? '0' : '1');
48683
+ setBackgroundOpacity();
48553
48684
  }, [isLoading]);
48554
48685
  const onRetry = () => {
48555
48686
  send(EVENTS$5.RETRY);
@@ -48747,15 +48878,15 @@ const Widget = ({ candidate, job, video, config, disabled = false, buttonText =
48747
48878
  revertBodyStyling();
48748
48879
  setIsWidgetOpen(false);
48749
48880
  };
48750
- const onInterviewCompleted = (data) => {
48881
+ const onInterviewCompleted = (data) => __awaiter(void 0, void 0, void 0, function* () {
48751
48882
  var _a;
48752
- (_a = config.onFinish) === null || _a === void 0 ? void 0 : _a.call(config, data);
48753
48883
  onCloseWidget();
48754
- };
48884
+ yield ((_a = config.onFinish) === null || _a === void 0 ? void 0 : _a.call(config, data));
48885
+ });
48755
48886
  const onError = (data) => {
48756
48887
  var _a;
48757
- (_a = config.onError) === null || _a === void 0 ? void 0 : _a.call(config, data);
48758
48888
  onCloseWidget();
48889
+ (_a = config.onError) === null || _a === void 0 ? void 0 : _a.call(config, data);
48759
48890
  };
48760
48891
  const openWidget = () => {
48761
48892
  var _a;