@snapcall/stream-ui 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,8 @@
1
1
  import {jsx as $3Sbms$jsx, jsxs as $3Sbms$jsxs, Fragment as $3Sbms$Fragment} from "react/jsx-runtime";
2
2
  import {render as $3Sbms$render, createPortal as $3Sbms$createPortal} from "react-dom";
3
+ import $3Sbms$hotjarbrowser from "@hotjar/browser";
3
4
  import $3Sbms$reacthottoast, {toast as $3Sbms$toast, Toaster as $3Sbms$Toaster, ToastBar as $3Sbms$ToastBar} from "react-hot-toast";
4
- import $3Sbms$styledcomponents, {keyframes as $3Sbms$keyframes, ThemeProvider as $3Sbms$ThemeProvider, css as $3Sbms$css, createGlobalStyle as $3Sbms$createGlobalStyle} from "styled-components";
5
+ import $3Sbms$styledcomponents, {keyframes as $3Sbms$keyframes, ThemeProvider as $3Sbms$ThemeProvider, css as $3Sbms$css, ThemeContext as $3Sbms$ThemeContext, createGlobalStyle as $3Sbms$createGlobalStyle} from "styled-components";
5
6
  import {useState as $3Sbms$useState, useRef as $3Sbms$useRef, useEffect as $3Sbms$useEffect, useContext as $3Sbms$useContext, useMemo as $3Sbms$useMemo, createContext as $3Sbms$createContext, useReducer as $3Sbms$useReducer, useLayoutEffect as $3Sbms$useLayoutEffect, useCallback as $3Sbms$useCallback} from "react";
6
7
  import "inobounce";
7
8
  import $3Sbms$i18next from "i18next";
@@ -16,6 +17,7 @@ import {toCanvas as $3Sbms$toCanvas} from "qrcode";
16
17
 
17
18
 
18
19
 
20
+
19
21
  const $365e765f9890497b$var$isObject = (obj)=>{
20
22
  if (typeof obj === "object" && obj !== null) {
21
23
  if (typeof Object.getPrototypeOf === "function") {
@@ -306,6 +308,7 @@ const $a5146f9062d7bf28$export$3a57e165650c636f = (message, options = {})=>{
306
308
 
307
309
 
308
310
 
311
+
309
312
  const $a3e657fb86ae23f3$export$604ba5624273df44 = ()=>{
310
313
  try {
311
314
  const storedTheme = localStorage.getItem("stream_ui_language");
@@ -340,7 +343,9 @@ const $18fb8799f38eb407$export$84584c2a98eb6753 = {
340
343
  tooLate: "You arrived too late",
341
344
  callIsOver: "The call is over or deleted",
342
345
  callEnded: "The call is now ended",
343
- callLeft: "You left the call"
346
+ callLeft: "You left the call",
347
+ full: "You can't join this call",
348
+ fullDescription: "The room is full. Please try to join the call later."
344
349
  },
345
350
  menu: {
346
351
  title: "Menu",
@@ -383,14 +388,12 @@ const $18fb8799f38eb407$export$84584c2a98eb6753 = {
383
388
  sendResolution: "Send Resolution (maximum)"
384
389
  },
385
390
  shareLink: {
386
- title: "Share link",
387
- title2: "Share a link",
388
- linkUrl: "LINK URL",
391
+ title: "Create link",
392
+ title2: "Create a link",
389
393
  invalid: "Invalid link",
390
394
  sentToUsers: "Link sent to users",
391
395
  sentToUser: "Link sent to {{user}}",
392
396
  failed: "Failed to send link",
393
- creating: "Link is creating...",
394
397
  poweredBy: "Powered by",
395
398
  invoice: "{{user}} sent you an invoice.",
396
399
  pay: "Pay"
@@ -420,7 +423,7 @@ const $18fb8799f38eb407$export$84584c2a98eb6753 = {
420
423
  request: "{{user}} would like you to share your {{device}}",
421
424
  timedOut: "Your request has timed out.",
422
425
  declined: "Your request has been declined.",
423
- userDeclined: "{{name}} has declined your request."
426
+ userDeclined: "{{user}} has declined your request."
424
427
  },
425
428
  leave: {
426
429
  title: "Leave",
@@ -466,7 +469,9 @@ const $c5472fb74fa04782$export$acb2a88f7d552ebf = {
466
469
  tooLate: "Vous \xeates arrivez trop tard",
467
470
  callIsOver: "Cet appel est termin\xe9 ou supprim\xe9",
468
471
  callEnded: "Cet appel est termin\xe9",
469
- callLeft: "Vous avez quitt\xe9 l'appel"
472
+ callLeft: "Vous avez quitt\xe9 l'appel",
473
+ full: "Impossible de rejoindre l'appel",
474
+ fullDescription: "Limite d'utilisateurs atteinte. Merci de rejoindre l'appel ult\xe9rieurement."
470
475
  },
471
476
  menu: {
472
477
  title: "Menu",
@@ -511,12 +516,10 @@ const $c5472fb74fa04782$export$acb2a88f7d552ebf = {
511
516
  shareLink: {
512
517
  title: "Partager un lien",
513
518
  title2: "Partager un lien",
514
- linkUrl: "URL DU LIEN",
515
519
  invalid: "Lien invalide",
516
520
  sentToUsers: "Lien envoy\xe9 aux participants",
517
521
  sentToUser: "Lien envoy\xe9 \xe0 {{user}}",
518
522
  failed: "Une erreur est survenue pendant l'envoi du lien",
519
- creating: "Lien en cours de cr\xe9ation...",
520
523
  poweredBy: "Propos\xe9 par",
521
524
  invoice: "{{user}} vous a envoy\xe9 une facture.",
522
525
  pay: "Payer"
@@ -546,7 +549,7 @@ const $c5472fb74fa04782$export$acb2a88f7d552ebf = {
546
549
  request: "{{user}} voudrait que vous partagiez votre {{device}}",
547
550
  timedOut: "Votre requ\xeate n'a pas eu de r\xe9ponse",
548
551
  declined: "Votre requ\xeate a \xe9t\xe9 refus\xe9.",
549
- userDeclined: "{{name}} a d\xe9clin\xe9 votre requ\xeate."
552
+ userDeclined: "{{user}} a d\xe9clin\xe9 votre requ\xeate."
550
553
  },
551
554
  leave: {
552
555
  title: "Quitter",
@@ -592,7 +595,9 @@ const $b7790fb9e48df5c4$export$3486a10f30cf1ee4 = {
592
595
  tooLate: "Sei arrivato troppo tardi",
593
596
  callIsOver: "Questa chiamata \xe8 finita o \xe8 stata eliminata",
594
597
  callEnded: "Questa chiamata \xe8 finita",
595
- callLeft: "Hai lasciato la chiamata"
598
+ callLeft: "Hai lasciato la chiamata",
599
+ full: "Impossibile partecipare alla chiamata",
600
+ fullDescription: "Limite d'uso attenente."
596
601
  },
597
602
  menu: {
598
603
  title: "Men\xf9",
@@ -637,12 +642,10 @@ const $b7790fb9e48df5c4$export$3486a10f30cf1ee4 = {
637
642
  shareLink: {
638
643
  title: "Condividi un link",
639
644
  title2: "Condividi un link",
640
- linkUrl: "Link URL",
641
645
  invalid: "Collegamento non valido",
642
646
  sentToUsers: "Link inviato ai partecipanti",
643
647
  sentToUser: "Link inviato a {{user}}",
644
648
  failed: "Si \xe8 verificato un errore durante l'invio del link",
645
- creating: "Link che viene creato...",
646
649
  poweredBy: "Proposto da",
647
650
  invoice: "{{User}} ti ha inviato una fattura.",
648
651
  pay: "Paga"
@@ -672,7 +675,7 @@ const $b7790fb9e48df5c4$export$3486a10f30cf1ee4 = {
672
675
  request: "{{user}} vorrebbe condividere il tuo {{device}}",
673
676
  timedOut: "La tua richiesta non ha ricevuto risposta",
674
677
  declined: "La tua richiesta \xe8 stata rifiutata.",
675
- userDeclined: "{{name}} ha rifiutato la tua richiesta"
678
+ userDeclined: "{{user}} ha rifiutato la tua richiesta"
676
679
  },
677
680
  leave: {
678
681
  title: "Lasciare",
@@ -720,6 +723,7 @@ var $384d985bb9605c35$export$2e2bcd8739ae039 = (0, $3Sbms$i18next);
720
723
 
721
724
 
722
725
 
726
+
723
727
  const $0f65a9eaf4a1e910$var$LogLevel = {
724
728
  error: 1,
725
729
  warn: 2,
@@ -1127,7 +1131,8 @@ const $c31e3fb4360572af$export$818d60b2e626da0c = {
1127
1131
  WEBRTC_RECOVER_ERROR: "WRTC2",
1128
1132
  CREATE_TRANSPORT_FAILED: "TRANS1",
1129
1133
  CONSUME_ERROR: "CONS1",
1130
- SOCKET_LOST: "SOCK1"
1134
+ SOCKET_LOST: "SOCK1",
1135
+ USER_LIMIT: "USERLIMIT"
1131
1136
  };
1132
1137
  const $c31e3fb4360572af$export$d21ffcc5eb136bfa = {
1133
1138
  qvga: {
@@ -1355,7 +1360,9 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1355
1360
  this.protoo.on("close", ()=>$c31e3fb4360572af$var$log.log("protoo.on", "close :("));
1356
1361
  this.protoo.on("notification", async (notification)=>{
1357
1362
  $c31e3fb4360572af$var$log.log("notification", notification);
1358
- if (notification.method === "newPeer") {
1363
+ if (notification.method === "error") {
1364
+ if (notification.data?.reason === "reached user limit") this.onCriticalError($c31e3fb4360572af$export$818d60b2e626da0c.USER_LIMIT);
1365
+ } else if (notification.method === "newPeer") {
1359
1366
  const { id: id , profile: profile } = notification.data;
1360
1367
  this.peers.set(id, {
1361
1368
  id: id,
@@ -1490,9 +1497,13 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1490
1497
  }
1491
1498
  });
1492
1499
  }
1493
- closeWebrtcTransport(transport) {
1494
- transport?.transport?.close();
1495
- clearTimeout(transport?.disconnectTimeout);
1500
+ closeWebrtcTransport(key) {
1501
+ const transport = this.mediasoupTransport[key];
1502
+ if (transport) {
1503
+ transport?.transport?.close();
1504
+ clearTimeout(transport?.disconnectTimeout);
1505
+ delete this.mediasoupTransport[key];
1506
+ }
1496
1507
  }
1497
1508
  async getTransport(kind, direction) {
1498
1509
  if (!this.streamerMediasoup) throw new Error("streamerMediasoup not initialized");
@@ -1765,7 +1776,7 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
1765
1776
  }
1766
1777
  release() {
1767
1778
  $c31e3fb4360572af$var$log.log("release");
1768
- for(let key in this.mediasoupTransport)this.closeWebrtcTransport(this.mediasoupTransport[key]);
1779
+ for(let key in this.mediasoupTransport)this.closeWebrtcTransport(key);
1769
1780
  this.webcamTrack?.stop();
1770
1781
  this.webcamTrack = null;
1771
1782
  this.protooTransport.close();
@@ -3261,6 +3272,7 @@ const $f235befa4cdc42d6$var$Header = ()=>{
3261
3272
  };
3262
3273
  const onScanQuickConnectClick = ()=>{
3263
3274
  setIsQuickConnectPopupVisible(true);
3275
+ (0, $3Sbms$hotjarbrowser).event("quickConnectClick");
3264
3276
  };
3265
3277
  const onSettingsMenuClick = ()=>{
3266
3278
  setIsSettingsMenuVisible(true);
@@ -4871,7 +4883,7 @@ const $5939a59dc7c96d41$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
4871
4883
  if (streams.length === 1) {
4872
4884
  const userName = streams[0].profile.name || t("misc.user");
4873
4885
  notificationMessage = t("snapshot.sentToUser", {
4874
- name: userName
4886
+ user: userName
4875
4887
  });
4876
4888
  }
4877
4889
  (0, $a5146f9062d7bf28$export$3a57e165650c636f)(notificationMessage, {
@@ -6217,6 +6229,7 @@ var $cdab47bb8796991e$export$2e2bcd8739ae039 = $cdab47bb8796991e$var$Video;
6217
6229
 
6218
6230
 
6219
6231
 
6232
+
6220
6233
  const $f0e90fb231c59fab$var$HangUp = ()=>/*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
6221
6234
  width: "25",
6222
6235
  height: "24",
@@ -6313,6 +6326,7 @@ var $8b7bd174d29d9a1f$export$2e2bcd8739ae039 = $8b7bd174d29d9a1f$var$Spinner;
6313
6326
 
6314
6327
 
6315
6328
 
6329
+
6316
6330
  const $a2d206a438475087$var$YoutubeIcon = ()=>/*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
6317
6331
  width: "24",
6318
6332
  height: "25",
@@ -6328,7 +6342,7 @@ var $a2d206a438475087$export$2e2bcd8739ae039 = $a2d206a438475087$var$YoutubeIcon
6328
6342
 
6329
6343
 
6330
6344
 
6331
- const $1ec1d06e0a21fdaa$var$Link = ()=>{
6345
+ const $1ec1d06e0a21fdaa$var$Link = ({ color: color })=>{
6332
6346
  return /*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
6333
6347
  width: "24",
6334
6348
  height: "24",
@@ -6337,7 +6351,7 @@ const $1ec1d06e0a21fdaa$var$Link = ()=>{
6337
6351
  xmlns: "http://www.w3.org/2000/svg",
6338
6352
  children: /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
6339
6353
  d: "m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1.004 1.004 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1.004 1.004 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1.004 1.004 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.471 2.471 0 0 1 0 3.5l-3.88 3.88a1.002 1.002 0 0 0 .325 1.639.999.999 0 0 0 1.095-.219l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1.004 1.004 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z",
6340
- fill: "#fff"
6354
+ fill: color || "#fff"
6341
6355
  })
6342
6356
  });
6343
6357
  };
@@ -6442,9 +6456,12 @@ const $db92fac48417791a$var$HighlightButton = ()=>{
6442
6456
  const onScreenshareClick = async ()=>{
6443
6457
  setIsHighlightMenuOpen(false);
6444
6458
  try {
6459
+ (0, $3Sbms$hotjarbrowser).event("screenshareClick");
6445
6460
  await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).enableScreenshare();
6461
+ (0, $3Sbms$hotjarbrowser).event("enableScreenshare");
6446
6462
  } catch (screenshareError) {
6447
6463
  console.warn(screenshareError);
6464
+ (0, $3Sbms$hotjarbrowser).event("screenshareCancel");
6448
6465
  (0, $3Sbms$reacthottoast)(t("notifications.screensharingError"), {
6449
6466
  className: "error"
6450
6467
  });
@@ -6453,10 +6470,12 @@ const $db92fac48417791a$var$HighlightButton = ()=>{
6453
6470
  const onYoutubeClick = ()=>{
6454
6471
  setIsHighlightMenuOpen(false);
6455
6472
  setIsYoutubePopupVisible(true);
6473
+ (0, $3Sbms$hotjarbrowser).event("youtubeClick");
6456
6474
  };
6457
6475
  const onLinkshareClick = ()=>{
6458
6476
  setIsHighlightMenuOpen(false);
6459
6477
  setIsLinksharePopupVisible(true);
6478
+ (0, $3Sbms$hotjarbrowser).event("linkshareClick");
6460
6479
  };
6461
6480
  const menuCategories = [
6462
6481
  {
@@ -6524,8 +6543,13 @@ const $69a9c49ece80e773$var$ControlBar = ()=>{
6524
6543
  const onMicrophoneClick = async ()=>{
6525
6544
  try {
6526
6545
  const devicesState = (0, $c9e496369b59be7a$export$2f377c2162fd02b2).getDevicesState();
6527
- if (devicesState.microphone.enabled) await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).toggleMute();
6528
- else await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).enableMicrophone();
6546
+ if (devicesState.microphone.enabled) {
6547
+ (0, $3Sbms$hotjarbrowser).event("toggleMicrophone");
6548
+ await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).toggleMute();
6549
+ } else {
6550
+ (0, $3Sbms$hotjarbrowser).event("enableMicrophone");
6551
+ await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).enableMicrophone();
6552
+ }
6529
6553
  } catch (muteError) {
6530
6554
  console.warn(muteError);
6531
6555
  (0, $3Sbms$reacthottoast)(t("notifications.microphoneError"), {
@@ -6535,9 +6559,12 @@ const $69a9c49ece80e773$var$ControlBar = ()=>{
6535
6559
  };
6536
6560
  const onCameraClick = async ()=>{
6537
6561
  try {
6538
- if (streaming) await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).disableVideo();
6539
- else {
6562
+ if (streaming) {
6563
+ (0, $3Sbms$hotjarbrowser).event("disableCamera");
6564
+ await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).disableVideo();
6565
+ } else {
6540
6566
  setIsCameraLoading(true);
6567
+ (0, $3Sbms$hotjarbrowser).event("enableCamera");
6541
6568
  await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).enableVideo();
6542
6569
  }
6543
6570
  } catch (cameraError) {
@@ -6551,6 +6578,7 @@ const $69a9c49ece80e773$var$ControlBar = ()=>{
6551
6578
  };
6552
6579
  const onRotateClick = async ()=>{
6553
6580
  try {
6581
+ (0, $3Sbms$hotjarbrowser).event("rotateCamera");
6554
6582
  await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).rotateVideo();
6555
6583
  } catch (rotateError) {
6556
6584
  console.warn(rotateError);
@@ -7602,6 +7630,7 @@ var $c11e4c21ca692a16$export$2e2bcd8739ae039 = $c11e4c21ca692a16$var$Menu;
7602
7630
 
7603
7631
 
7604
7632
 
7633
+
7605
7634
  const $d677836e2f373a45$export$b679a9a7caefa4b1 = (0, $3Sbms$styledcomponents).div`
7606
7635
  position: absolute;
7607
7636
  width: 100%;
@@ -7740,6 +7769,7 @@ const $49372cd9190da903$var$YoutubePopup = ()=>{
7740
7769
  const onShareClick = (event)=>{
7741
7770
  event.preventDefault();
7742
7771
  setErrorMessage(null);
7772
+ (0, $3Sbms$hotjarbrowser).event("youtubeShare");
7743
7773
  const [, videoId] = youtubeInputValue.match($49372cd9190da903$var$youtubeIDRegExp) || [];
7744
7774
  if (videoId) {
7745
7775
  dispatch({
@@ -7832,6 +7862,23 @@ var $49372cd9190da903$export$2e2bcd8739ae039 = $49372cd9190da903$var$YoutubePopu
7832
7862
 
7833
7863
 
7834
7864
 
7865
+ const $5dd22e058f46af7f$var$CircledTopArrow = ()=>/*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
7866
+ width: "21",
7867
+ height: "20",
7868
+ viewBox: "0 0 21 20",
7869
+ fill: "none",
7870
+ xmlns: "http://www.w3.org/2000/svg",
7871
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)("path", {
7872
+ d: "M11.091 6.908a.833.833 0 0 0-.275-.175.833.833 0 0 0-.633 0 .833.833 0 0 0-.275.175l-2.5 2.5a.837.837 0 1 0 1.183 1.184l1.075-1.084V12.5a.833.833 0 1 0 1.667 0V9.508l1.075 1.084a.833.833 0 0 0 1.183 0 .833.833 0 0 0 0-1.184l-2.5-2.5Zm-.592-5.242a8.333 8.333 0 1 0 0 16.667 8.333 8.333 0 0 0 0-16.666Zm0 15a6.667 6.667 0 1 1 0-13.334 6.667 6.667 0 0 1 0 13.334Z",
7873
+ fill: "#fff"
7874
+ })
7875
+ });
7876
+ var $5dd22e058f46af7f$export$2e2bcd8739ae039 = $5dd22e058f46af7f$var$CircledTopArrow;
7877
+
7878
+
7879
+
7880
+
7881
+
7835
7882
 
7836
7883
  const $dc26e7b014ddcf8c$var$PaypalWhite = ()=>/*#__PURE__*/ (0, $3Sbms$jsx)("svg", {
7837
7884
  width: "24",
@@ -7892,15 +7939,16 @@ var $dc26e7b014ddcf8c$export$2e2bcd8739ae039 = $dc26e7b014ddcf8c$var$Paypal;
7892
7939
 
7893
7940
 
7894
7941
 
7942
+ const $554f3984e3212196$var$modalHeight = (desktop)=>desktop ? "215px" : "227px";
7895
7943
  const $554f3984e3212196$export$ed0d510542cc4e55 = (0, $3Sbms$styledcomponents).div`
7896
7944
  position: absolute;
7897
7945
  width: 100%;
7898
- bottom: ${(props)=>props.open ? 0 : "-220px"};
7946
+ bottom: ${(props)=>props.open ? 0 : `-${$554f3984e3212196$var$modalHeight(props.desktop)}`};
7899
7947
  transition: all 0.4s;
7900
7948
 
7901
7949
  ${(props)=>{
7902
7950
  if (props.desktop) return (0, $3Sbms$css)`
7903
- bottom: ${props.open ? 0 : "calc(-220px - (100vh / 2))"};
7951
+ bottom: ${props.open ? 0 : `calc(-${$554f3984e3212196$var$modalHeight(props.desktop)} - (100vh / 2))`};
7904
7952
  height: 100%;
7905
7953
  display: flex;
7906
7954
  justify-content: center;
@@ -7912,12 +7960,12 @@ const $554f3984e3212196$export$93c2cc854b34757d = (0, $3Sbms$styledcomponents).d
7912
7960
  display: flex;
7913
7961
  flex-direction: column;
7914
7962
  width: ${(props)=>props.desktop ? "375px" : "100%"};
7915
- height: 220px;
7963
+ height: ${({ desktop: desktop })=>$554f3984e3212196$var$modalHeight(desktop)};
7916
7964
  max-height: 100vh;
7917
- background-color: ${(props)=>props.theme.settingsBackgroundColor};
7918
- color: ${(props)=>props.theme.settingsTextColor};
7965
+ background-color: ${(props)=>props.theme.popupBackgroundPrimaryColor};
7966
+ color: ${(props)=>props.theme.popupTitleColor};
7919
7967
  border-radius: ${(props)=>props.desktop ? "20px" : "20px 20px 0 0"};
7920
- padding: 12px 14px 30px;
7968
+ padding: ${({ desktop: desktop })=>desktop ? "16px 14px" : "16px 14px 28px"};
7921
7969
  box-sizing: border-box;
7922
7970
  `;
7923
7971
  const $554f3984e3212196$export$f0162ebc287dd01 = (0, $3Sbms$styledcomponents).div`
@@ -7946,7 +7994,7 @@ const $554f3984e3212196$export$fcade06574a60ff0 = (0, $3Sbms$styledcomponents).b
7946
7994
  justify-content: center;
7947
7995
  align-items: center;
7948
7996
  border: none;
7949
- background-color: ${(props)=>props.theme.settingsCloseBackgroundColor};
7997
+ background-color: ${(props)=>props.theme.popupBackgroundSecondaryColor};
7950
7998
  border-radius: 50%;
7951
7999
  height: 24px;
7952
8000
  width: 24px;
@@ -7970,20 +8018,12 @@ const $554f3984e3212196$export$dcb32b2b413109d8 = (0, $3Sbms$styledcomponents).d
7970
8018
  flex-direction: column;
7971
8019
  position: relative;
7972
8020
 
7973
- label {
7974
- font-size: 10px;
7975
- font-weight: 700;
7976
- line-height: 10px;
7977
- color: #fff;
7978
- margin-bottom: 10px;
7979
- }
7980
-
7981
8021
  input {
7982
8022
  padding: 16px 10px 16px 20px;
7983
8023
  border-radius: 15px;
7984
- background-color: #4e4e4e;
7985
- border: 1px solid ${(props)=>props.errored ? "#d84949" : "transparent"};
7986
- color: #fff;
8024
+ background-color: ${({ theme: theme })=>theme.popupBackgroundSecondaryColor};
8025
+ border: 1px solid ${(props)=>props.errored ? "#d84949" : props.theme.popupBorderColor};
8026
+ color: #878787;
7987
8027
 
7988
8028
  &:focus {
7989
8029
  outline: none;
@@ -8003,14 +8043,25 @@ const $554f3984e3212196$export$711a92c06f80c3bd = (0, $3Sbms$styledcomponents).s
8003
8043
  `;
8004
8044
  const $554f3984e3212196$export$aec21c9a4da7a1b7 = (0, $3Sbms$styledcomponents).button`
8005
8045
  background-color: ${({ theme: theme })=>theme.primaryColor};
8006
- padding: 8px 18px;
8007
- border-radius: 50px;
8046
+ padding: ${({ status: status })=>status !== "waiting" ? "auto" : "8px 18px"};
8047
+ width: ${({ status: status })=>status !== "waiting" ? "46px" : "100%"};
8048
+ height: 46px;
8049
+ border-radius: ${({ status: status })=>status !== "waiting" ? "50%" : "15px"};
8008
8050
  margin: 30px auto 0;
8009
8051
  border: none;
8010
8052
  color: #fff;
8011
8053
  font-size: 16px;
8012
8054
  font-weight: 700;
8013
8055
  line-height: 18px;
8056
+ transition: border-radius 0.3s ease-in, width 0.3s;
8057
+
8058
+ span {
8059
+ display: flex;
8060
+ flex-direction: row;
8061
+ gap: 5px;
8062
+ align-items: center;
8063
+ justify-content: center;
8064
+ }
8014
8065
  `;
8015
8066
  const $554f3984e3212196$export$9e155375d8fb1f67 = (0, $3Sbms$styledcomponents).img`
8016
8067
  width: 36px;
@@ -8019,7 +8070,8 @@ const $554f3984e3212196$export$9e155375d8fb1f67 = (0, $3Sbms$styledcomponents).i
8019
8070
  `;
8020
8071
  const $554f3984e3212196$export$5e3f251c730829 = (0, $3Sbms$styledcomponents).div`
8021
8072
  display: flex;
8022
- gap: 5px;
8073
+ align-items: center;
8074
+ justify-content: center;
8023
8075
  `;
8024
8076
 
8025
8077
 
@@ -8061,7 +8113,7 @@ const $98933bbc579a3e66$var$sendLinkNotification = (data, t)=>{
8061
8113
  const $98933bbc579a3e66$var$sendPaypalInvoiceNotification = (senderName, url, t)=>{
8062
8114
  const userName = senderName || t("misc.user");
8063
8115
  const title = t("shareLink.invoice", {
8064
- name: userName
8116
+ user: userName
8065
8117
  });
8066
8118
  (0, $a5146f9062d7bf28$export$3a57e165650c636f)(title, {
8067
8119
  button: {
@@ -8087,11 +8139,12 @@ const $98933bbc579a3e66$var$sendPaypalInvoiceNotification = (senderName, url, t)
8087
8139
  };
8088
8140
  const $98933bbc579a3e66$var$LinksharePopup = ()=>{
8089
8141
  const { t: t } = (0, $3Sbms$useTranslation)();
8142
+ const themeContext = (0, $3Sbms$useContext)((0, $3Sbms$ThemeContext));
8090
8143
  const linksharePopupRef = (0, $3Sbms$useRef)(null);
8091
8144
  const linkshareInputRef = (0, $3Sbms$useRef)(null);
8092
8145
  const [linkshareInputValue, setLinkshareInputValue] = (0, $3Sbms$useState)("");
8093
8146
  const [errorMessage, setErrorMessage] = (0, $3Sbms$useState)(null);
8094
- const [isLoading, setIsLoading] = (0, $3Sbms$useState)(false);
8147
+ const [status, setStatus] = (0, $3Sbms$useState)("waiting");
8095
8148
  const { isLinksharePopupVisible: isLinksharePopupVisible , setIsLinksharePopupVisible: setIsLinksharePopupVisible , orientation: orientation , options: options } = (0, $3Sbms$useContext)((0, $5f30d8bf4f04621e$export$2e2bcd8739ae039));
8096
8149
  const { streams: streams } = (0, $cce9fd41d8a55a18$export$b5633a7cfbe42d9f)();
8097
8150
  const desktop = orientation === "landscape";
@@ -8110,7 +8163,8 @@ const $98933bbc579a3e66$var$LinksharePopup = ()=>{
8110
8163
  event.preventDefault();
8111
8164
  if (!linkshareInputValue) return;
8112
8165
  setErrorMessage(null);
8113
- setIsLoading(true);
8166
+ setStatus("loading");
8167
+ (0, $3Sbms$hotjarbrowser).event("linkshareShare");
8114
8168
  let url;
8115
8169
  try {
8116
8170
  url = new URL(linkshareInputValue);
@@ -8142,7 +8196,7 @@ const $98933bbc579a3e66$var$LinksharePopup = ()=>{
8142
8196
  if (streams.length < 2) {
8143
8197
  const userName = streams[0]?.profile?.name || t("misc.user");
8144
8198
  (0, $3Sbms$reacthottoast)(t("shareLink.sentToUser", {
8145
- name: userName
8199
+ user: userName
8146
8200
  }));
8147
8201
  } else (0, $3Sbms$reacthottoast)(t("shareLink.sentToUsers"));
8148
8202
  setIsLinksharePopupVisible(false);
@@ -8154,7 +8208,7 @@ const $98933bbc579a3e66$var$LinksharePopup = ()=>{
8154
8208
  }
8155
8209
  setLinkshareInputValue("");
8156
8210
  }
8157
- setIsLoading(false);
8211
+ setStatus("done");
8158
8212
  };
8159
8213
  const onCloseClick = ()=>setIsLinksharePopupVisible(false);
8160
8214
  (0, $3Sbms$useEffect)(()=>{
@@ -8167,6 +8221,7 @@ const $98933bbc579a3e66$var$LinksharePopup = ()=>{
8167
8221
  ]);
8168
8222
  const onPopupTransitionEnd = ()=>{
8169
8223
  if (isLinksharePopupVisible) linkshareInputRef.current?.focus();
8224
+ if (status === "done") setStatus("waiting");
8170
8225
  };
8171
8226
  return /*#__PURE__*/ (0, $3Sbms$jsx)((0, $554f3984e3212196$export$ed0d510542cc4e55), {
8172
8227
  open: isLinksharePopupVisible,
@@ -8180,7 +8235,9 @@ const $98933bbc579a3e66$var$LinksharePopup = ()=>{
8180
8235
  children: [
8181
8236
  /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $554f3984e3212196$export$7563f0d47f114601), {
8182
8237
  children: [
8183
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $1ec1d06e0a21fdaa$export$2e2bcd8739ae039), {}),
8238
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $1ec1d06e0a21fdaa$export$2e2bcd8739ae039), {
8239
+ color: themeContext.popupTitleColor
8240
+ }),
8184
8241
  /*#__PURE__*/ (0, $3Sbms$jsx)("h4", {
8185
8242
  children: t("shareLink.title2")
8186
8243
  })
@@ -8198,10 +8255,6 @@ const $98933bbc579a3e66$var$LinksharePopup = ()=>{
8198
8255
  /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $554f3984e3212196$export$dcb32b2b413109d8), {
8199
8256
  errored: Boolean(errorMessage),
8200
8257
  children: [
8201
- /*#__PURE__*/ (0, $3Sbms$jsx)("label", {
8202
- htmlFor: "linkshare-popup-input",
8203
- children: t("shareLink.linkUrl")
8204
- }),
8205
8258
  /*#__PURE__*/ (0, $3Sbms$jsx)("input", {
8206
8259
  id: "linkshare-popup-input",
8207
8260
  ref: linkshareInputRef,
@@ -8219,17 +8272,18 @@ const $98933bbc579a3e66$var$LinksharePopup = ()=>{
8219
8272
  }),
8220
8273
  /*#__PURE__*/ (0, $3Sbms$jsx)((0, $554f3984e3212196$export$aec21c9a4da7a1b7), {
8221
8274
  type: "submit",
8222
- disabled: isLoading,
8223
- children: isLoading ? /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $554f3984e3212196$export$5e3f251c730829), {
8275
+ disabled: status !== "waiting",
8276
+ status: status,
8277
+ children: status !== "waiting" ? /*#__PURE__*/ (0, $3Sbms$jsx)((0, $554f3984e3212196$export$5e3f251c730829), {
8278
+ children: /*#__PURE__*/ (0, $3Sbms$jsx)((0, $8b7bd174d29d9a1f$export$2e2bcd8739ae039), {
8279
+ size: "18px"
8280
+ })
8281
+ }) : /*#__PURE__*/ (0, $3Sbms$jsxs)("span", {
8224
8282
  children: [
8225
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $8b7bd174d29d9a1f$export$2e2bcd8739ae039), {
8226
- size: "18px"
8227
- }),
8228
- /*#__PURE__*/ (0, $3Sbms$jsx)("span", {
8229
- children: t("shareLink.creating")
8230
- })
8283
+ /*#__PURE__*/ (0, $3Sbms$jsx)((0, $5dd22e058f46af7f$export$2e2bcd8739ae039), {}),
8284
+ t("shareLink.title")
8231
8285
  ]
8232
- }) : t("shareLink.title")
8286
+ })
8233
8287
  })
8234
8288
  ]
8235
8289
  })
@@ -8318,6 +8372,7 @@ const $df41bfe6da05853a$var$EndView = ()=>{
8318
8372
  const ended = streamState === "ended";
8319
8373
  const terminated = streamState === "terminated";
8320
8374
  const expired = streamState === "expired";
8375
+ const full = streamState === "full";
8321
8376
  const onGoBackClick = ()=>{
8322
8377
  (0, $c9e496369b59be7a$export$2f377c2162fd02b2).init();
8323
8378
  setStreamState("streaming");
@@ -8330,24 +8385,28 @@ const $df41bfe6da05853a$var$EndView = ()=>{
8330
8385
  /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $61b9018279e658f9$export$51071a7ce784448), {
8331
8386
  children: [
8332
8387
  (ended || terminated) && "\uD83D\uDC4B",
8333
- expired && "\uD83E\uDD7A"
8388
+ (expired || full) && "\uD83E\uDD7A"
8334
8389
  ]
8335
8390
  }),
8336
8391
  /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $61b9018279e658f9$export$eebc018855fb0cb6), {
8337
8392
  children: [
8338
8393
  ended && t("endView.callLeft"),
8339
8394
  terminated && t("endView.callEnded"),
8340
- expired && t("endView.tooLate")
8395
+ expired && t("endView.tooLate"),
8396
+ full && t("endView.full")
8341
8397
  ]
8342
8398
  }),
8343
8399
  expired && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $61b9018279e658f9$export$f4e7b895a81715e9), {
8344
8400
  children: t("endView.callIsOver")
8345
8401
  }),
8346
- ended && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $61b9018279e658f9$export$3a4deda42b6182b7), {
8402
+ full && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $61b9018279e658f9$export$f4e7b895a81715e9), {
8403
+ children: t("endView.fullDescription")
8404
+ }),
8405
+ (ended || full) && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $61b9018279e658f9$export$3a4deda42b6182b7), {
8347
8406
  onClick: onGoBackClick,
8348
8407
  children: t("endView.goBack")
8349
8408
  }),
8350
- /*#__PURE__*/ (0, $3Sbms$jsx)((0, $f81bfa56534026c2$export$ad5f39c592532e2d), {})
8409
+ !full && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $f81bfa56534026c2$export$ad5f39c592532e2d), {})
8351
8410
  ]
8352
8411
  });
8353
8412
  };
@@ -8532,7 +8591,11 @@ const $52580db2e49cdd90$export$f30cb9bc4f736419 = {
8532
8591
  settingsBackgroundColor: "#fff",
8533
8592
  settingsHeaderTextColor: "#000",
8534
8593
  settingsTextColor: "#000",
8535
- settingsCloseBackgroundColor: "#eaebec"
8594
+ settingsCloseBackgroundColor: "#eaebec",
8595
+ popupBackgroundPrimaryColor: "#fff",
8596
+ popupBackgroundSecondaryColor: "#f3f3f3",
8597
+ popupBorderColor: "#d4d4d4",
8598
+ popupTitleColor: "#2d2d2d"
8536
8599
  };
8537
8600
  const $52580db2e49cdd90$export$3e936a8db52a10a0 = {
8538
8601
  primaryColor: "#268AFA",
@@ -8548,7 +8611,11 @@ const $52580db2e49cdd90$export$3e936a8db52a10a0 = {
8548
8611
  settingsBackgroundColor: "#242324",
8549
8612
  settingsHeaderTextColor: "#f9f9f9",
8550
8613
  settingsTextColor: "#fff",
8551
- settingsCloseBackgroundColor: "#7b7c7e"
8614
+ settingsCloseBackgroundColor: "#7b7c7e",
8615
+ popupBackgroundPrimaryColor: "#fff",
8616
+ popupBackgroundSecondaryColor: "#f3f3f3",
8617
+ popupBorderColor: "#d4d4d4",
8618
+ popupTitleColor: "#2d2d2d"
8552
8619
  };
8553
8620
 
8554
8621
 
@@ -9168,15 +9235,23 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
9168
9235
  setStreamState("expired");
9169
9236
  };
9170
9237
  const onAgentIdentity = (event)=>{
9171
- const { success: success } = event.detail;
9172
- if (success) setIsAgent(true);
9173
- else (0, $3Sbms$reacthottoast)("An error occured while trying to join the room as an agent", {
9238
+ const { success: success , email: email } = event.detail;
9239
+ if (success) {
9240
+ setIsAgent(true);
9241
+ if (email) (0, $3Sbms$hotjarbrowser).identify(null, {
9242
+ email: email
9243
+ });
9244
+ } else (0, $3Sbms$reacthottoast)("An error occured while trying to join the room as an agent", {
9174
9245
  className: "error"
9175
9246
  });
9176
9247
  };
9177
9248
  const onCriticalError = (event)=>{
9178
9249
  const duration = 20000;
9179
9250
  const now = Date.now();
9251
+ if (event.detail.code === "USERLIMIT") {
9252
+ setStreamState("full");
9253
+ return;
9254
+ }
9180
9255
  if ($26ed036cbc17809a$var$timestampCriticalError !== -1 && $26ed036cbc17809a$var$timestampCriticalError + duration > now) return;
9181
9256
  $26ed036cbc17809a$var$timestampCriticalError = now;
9182
9257
  (0, $a5146f9062d7bf28$export$3a57e165650c636f)(`A critical error has occurred (error ${event.detail.code}).`, {
@@ -9298,7 +9373,7 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: options })=>{
9298
9373
  ]
9299
9374
  })
9300
9375
  }),
9301
- (streamState === "ended" || streamState === "terminated" || streamState === "expired") && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $df41bfe6da05853a$export$2e2bcd8739ae039), {})
9376
+ (streamState === "ended" || streamState === "terminated" || streamState === "full" || streamState === "expired") && /*#__PURE__*/ (0, $3Sbms$jsx)((0, $df41bfe6da05853a$export$2e2bcd8739ae039), {})
9302
9377
  ]
9303
9378
  })
9304
9379
  ]
@@ -9309,6 +9384,14 @@ var $26ed036cbc17809a$export$2e2bcd8739ae039 = $26ed036cbc17809a$var$StreamUI;
9309
9384
 
9310
9385
 
9311
9386
 
9387
+ // https://help.hotjar.com/hc/en-us/articles/360033640653-Identify-API-Reference#01G2A279ZXW4JT60NKXKX69G49
9388
+ // prettier-ignore
9389
+ // @ts-ignore
9390
+ window.hj = window.hj || function() {
9391
+ (hj.q = hj.q || []).push(arguments);
9392
+ };
9393
+
9394
+
9312
9395
 
9313
9396
  const $24075a5d702d64b3$var$currentURL = new URL(window.location.href);
9314
9397
  const $24075a5d702d64b3$var$microphoneEnabled = $24075a5d702d64b3$var$currentURL.searchParams.get("microphone-enabled") !== "0";
@@ -9329,7 +9412,8 @@ const $24075a5d702d64b3$var$defaultOptions = {
9329
9412
  available: true
9330
9413
  }
9331
9414
  },
9332
- streamApiURL: String("https://apistream.snapcall.io")
9415
+ streamApiURL: String("https://apistream.snapcall.io"),
9416
+ tracking: false
9333
9417
  };
9334
9418
  const $24075a5d702d64b3$export$3f94917203ab7078 = {
9335
9419
  init: ({ element: element , ...options })=>{
@@ -9338,6 +9422,7 @@ const $24075a5d702d64b3$export$3f94917203ab7078 = {
9338
9422
  (0, $3Sbms$render)(/*#__PURE__*/ (0, $3Sbms$jsx)((0, $26ed036cbc17809a$export$2e2bcd8739ae039), {
9339
9423
  options: mergedOptions
9340
9424
  }), element);
9425
+ if (mergedOptions.tracking) (0, $3Sbms$hotjarbrowser).init(3111933, 6);
9341
9426
  },
9342
9427
  setExtraSettingsOptions: (extraOptions)=>{
9343
9428
  const event = new CustomEvent("streamUISetExtraSettingsOptions", {