@snapcall/stream-ui 1.9.0 → 1.10.1

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/stream-ui.js CHANGED
@@ -1,5 +1,5 @@
1
1
  var $jQDcL$reactjsxruntime = require("react/jsx-runtime");
2
- var $jQDcL$reactdom = require("react-dom");
2
+ var $jQDcL$reactdomclient = require("react-dom/client");
3
3
  var $jQDcL$hotjarbrowser = require("@hotjar/browser");
4
4
  var $jQDcL$reacthottoast = require("react-hot-toast");
5
5
  var $jQDcL$styledcomponents = require("styled-components");
@@ -14,6 +14,7 @@ var $jQDcL$sentrybrowser = require("@sentry/browser");
14
14
  var $jQDcL$mediasoupclientlibProducer = require("mediasoup-client/lib/Producer");
15
15
  var $jQDcL$mediasoupclient = require("mediasoup-client");
16
16
  var $jQDcL$mediapipeselfie_segmentation = require("@mediapipe/selfie_segmentation");
17
+ var $jQDcL$reactdom = require("react-dom");
17
18
  var $jQDcL$qrcode = require("qrcode");
18
19
 
19
20
  function $parcel$interopDefault(a) {
@@ -333,6 +334,9 @@ const $393bda1b33846dfc$export$604ba5624273df44 = ()=>{
333
334
  const $91fcbf58e59aae79$export$84584c2a98eb6753 = {
334
335
  name: "English",
335
336
  translation: {
337
+ header: {
338
+ free: "Free version"
339
+ },
336
340
  notifications: {
337
341
  screensharingError: "An error occured when trying to toggle screensharing",
338
342
  microphoneError: "An error occured when trying to toggle the microphone",
@@ -364,6 +368,14 @@ const $91fcbf58e59aae79$export$84584c2a98eb6753 = {
364
368
  pictureInPicture: "Picture-in-Picture",
365
369
  screenSharing: "Screen sharing"
366
370
  },
371
+ blockedFeature: {
372
+ titleConnected: "Upgrade to Pro",
373
+ titleGuest: "Feature not available",
374
+ descriptionConnected: "On a free plan, you can't use this feature. Upgrade your plan to enjoy all in-call features.",
375
+ descriptionGuest: "You are participating in a call created with a free version of SnapCall. This feature is only available with a Pro version.",
376
+ dismissGuest: "Okay",
377
+ dismissConnected: "Upgrade to Pro"
378
+ },
367
379
  copyLink: {
368
380
  title: "Copy link",
369
381
  description: "Copy link into clipboard",
@@ -473,6 +485,9 @@ const $91fcbf58e59aae79$export$84584c2a98eb6753 = {
473
485
  const $e52ca91c2b296e41$export$acb2a88f7d552ebf = {
474
486
  name: "Fran\xe7ais",
475
487
  translation: {
488
+ header: {
489
+ free: "Version gratuite"
490
+ },
476
491
  notifications: {
477
492
  screensharingError: "Une erreur est survenue pendant l'activation du partage d'\xe9cran",
478
493
  microphoneError: "Une erreur est survenue pendant l'activation du micro",
@@ -504,6 +519,14 @@ const $e52ca91c2b296e41$export$acb2a88f7d552ebf = {
504
519
  pictureInPicture: "Picture-in-Picture",
505
520
  screenSharing: "Partage d'\xe9cran"
506
521
  },
522
+ blockedFeature: {
523
+ titleConnected: "Souscrire au plan Pro",
524
+ titleGuest: "Fonctionnalit\xe9 non disponible",
525
+ descriptionConnected: "Vous n'avez pas acc\xe8s \xe0 cette fonctionnalit\xe9. Souscrivez au plan Pro pour d\xe9bloquer toutes les fonctionnalit\xe9s de SnapCall.",
526
+ descriptionGuest: "Vous participez \xe0 un appel cr\xe9\xe9 avec la version gratuite de SnapCall. Cette fonctionnalit\xe9 n'est disponible qu'avec une version Pro.",
527
+ dismissGuest: "D'accord",
528
+ dismissConnected: "Souscrire \xe0 Pro"
529
+ },
507
530
  copyLink: {
508
531
  title: "Copier le lien",
509
532
  description: "Copier le lien dans le presse-papiers",
@@ -613,6 +636,9 @@ const $e52ca91c2b296e41$export$acb2a88f7d552ebf = {
613
636
  const $e0ae3d23c2381da3$export$3486a10f30cf1ee4 = {
614
637
  name: "Italiano",
615
638
  translation: {
639
+ header: {
640
+ free: "Versione gratuita"
641
+ },
616
642
  notifications: {
617
643
  screensharingError: "Si \xe8 verificato un errore durante l'attivazione della condivisione dello schermo",
618
644
  microphoneError: "Si \xe8 verificato un errore durante l'attivazione del microfono",
@@ -644,6 +670,14 @@ const $e0ae3d23c2381da3$export$3486a10f30cf1ee4 = {
644
670
  pictureInPicture: "Immagine nell'immagine",
645
671
  screenSharing: "Condivisione dello schermo"
646
672
  },
673
+ blockedFeature: {
674
+ titleConnected: "L'aggiornamento a Pro",
675
+ titleGuest: "Funzione non disponibile",
676
+ descriptionConnected: "Su un piano gratuito, non puoi utilizzare questa funzione. Aggiorna il tuo piano per usufruire di tutte le funzionalit\xe0 in chiamata.",
677
+ descriptionGuest: "Stai partecipando a una chiamata creata con una versione gratuita di SnapCall. Questa funzione \xe8 disponibile solo con una versione Pro.",
678
+ dismissGuest: "Okay",
679
+ dismissConnected: "L'aggiornamento a Pro"
680
+ },
647
681
  copyLink: {
648
682
  title: "Copia il link",
649
683
  description: "Copia il link negli appunti",
@@ -779,6 +813,8 @@ var $b45c0bcc142f0b5e$export$2e2bcd8739ae039 = (0, ($parcel$interopDefault($jQDc
779
813
 
780
814
 
781
815
 
816
+
817
+
782
818
  const $d0c6baf97675ab49$var$LogLevel = {
783
819
  error: 1,
784
820
  warn: 2,
@@ -1413,6 +1449,8 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
1413
1449
  pendingDeviceRequest = {};
1414
1450
  joinOptions = {};
1415
1451
  devicesList = [];
1452
+ plan = undefined;
1453
+ permissions = [];
1416
1454
  constructor(){
1417
1455
  super();
1418
1456
  navigator.mediaDevices.addEventListener("devicechange", ()=>this.onDeviceChange());
@@ -1467,10 +1505,8 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
1467
1505
  }
1468
1506
  };
1469
1507
  peer.producersData.forEach((producer)=>{
1470
- if (producer.deviceType === "microphone") {
1471
- deviceState.microphone.enabled = true;
1472
- deviceState.microphone.muted = producer.paused;
1473
- } else if (producer.deviceType === "screen") deviceState.screenshare.enabled = true;
1508
+ if (producer.deviceType === "microphone") deviceState.microphone.enabled = true;
1509
+ else if (producer.deviceType === "screen") deviceState.screenshare.enabled = true;
1474
1510
  else if (producer.deviceType === "webcam") deviceState.camera.enabled = true;
1475
1511
  });
1476
1512
  peers.push({
@@ -1536,7 +1572,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
1536
1572
  if (!this.peerId) this.peerId = (0, $jQDcL$uuid.v4)();
1537
1573
  let url;
1538
1574
  try {
1539
- const { instanceId: instanceId } = await fetch(`${this.config.streamerApi}/instance/${this.roomId}`, {
1575
+ const { streamer_instance: instanceId , plan: { permissions: permissions , name: name } , } = await fetch(`${this.config.apiUrl}/streams/${room}/info`, {
1540
1576
  method: "get",
1541
1577
  headers: {
1542
1578
  "Content-Type": "application/json"
@@ -1545,6 +1581,8 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
1545
1581
  if (response.ok) return response.json();
1546
1582
  throw new Error("Invalid room ID");
1547
1583
  });
1584
+ this.permissions = permissions;
1585
+ this.plan = name;
1548
1586
  url = `${this.config.streamerServer}/${instanceId}/?roomId=${room}&peerId=${this.peerId}`;
1549
1587
  } catch (roomError) {
1550
1588
  const event = new $1dedebd5ff3002eb$var$SnapcallEvent("invalidRoom", {
@@ -1577,18 +1615,20 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
1577
1615
  if (notification.method === "error") {
1578
1616
  if (notification.data?.reason === "reached user limit") this.onCriticalError($1dedebd5ff3002eb$export$818d60b2e626da0c.USER_LIMIT);
1579
1617
  } else if (notification.method === "newPeer") {
1580
- const { id: id , profile: profile } = notification.data;
1618
+ const { id: id , profile: profile , muted: muted } = notification.data;
1581
1619
  this.peers.set(id, {
1582
1620
  id: id,
1583
1621
  peerId: id,
1584
1622
  profile: profile,
1623
+ muted: muted,
1585
1624
  producersData: []
1586
1625
  });
1587
1626
  const event = new $1dedebd5ff3002eb$var$SnapcallEvent("newPeer", {
1588
1627
  detail: {
1589
1628
  peerId: id,
1590
1629
  displayName: profile.name,
1591
- profile: profile
1630
+ profile: profile,
1631
+ muted: muted
1592
1632
  }
1593
1633
  });
1594
1634
  this.dispatchEvent(event);
@@ -1667,6 +1707,26 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
1667
1707
  }
1668
1708
  });
1669
1709
  this.dispatchEvent(event);
1710
+ } else if (notification.method === "mute") {
1711
+ const { peerId: peerId , device: device } = notification.data;
1712
+ const event = new $1dedebd5ff3002eb$var$SnapcallEvent("mediaPause", {
1713
+ detail: {
1714
+ peerId: peerId,
1715
+ deviceType: device,
1716
+ paused: true
1717
+ }
1718
+ });
1719
+ this.dispatchEvent(event);
1720
+ } else if (notification.method === "unmute") {
1721
+ const { peerId: peerId , device: device } = notification.data;
1722
+ const event = new $1dedebd5ff3002eb$var$SnapcallEvent("mediaResume", {
1723
+ detail: {
1724
+ peerId: peerId,
1725
+ deviceType: device,
1726
+ paused: false
1727
+ }
1728
+ });
1729
+ this.dispatchEvent(event);
1670
1730
  } else if (notification.method === "requestDeviceResult") {
1671
1731
  const event = new $1dedebd5ff3002eb$var$SnapcallEvent(notification.method, {
1672
1732
  detail: notification.data
@@ -1814,7 +1874,9 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
1814
1874
  peerId: peer.id || peer.peerId
1815
1875
  };
1816
1876
  }),
1817
- callId: callId
1877
+ callId: callId,
1878
+ plan: this.plan,
1879
+ permissions: this.permissions
1818
1880
  }
1819
1881
  }));
1820
1882
  $1dedebd5ff3002eb$var$log.log("joinRoom", "peers", peers);
@@ -1952,28 +2014,30 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
1952
2014
  this.dispatchEvent(event);
1953
2015
  }
1954
2016
  }
1955
- async muteMicrophone() {
2017
+ muteMicrophone() {
1956
2018
  if (this.micProducer) {
1957
2019
  this.onStopSpeak();
1958
- this.micProducer?.pause();
1959
- await this.protoo.request("pauseProducer", {
1960
- producerId: this.micProducer?.id
1961
- });
2020
+ this.micProducer.pause();
1962
2021
  this.muted = true;
2022
+ const device = "microphone";
2023
+ this.protoo.notify("mute", {
2024
+ device: device
2025
+ });
1963
2026
  const event = new $1dedebd5ff3002eb$var$SnapcallEvent("microphoneMute", {
1964
2027
  detail: {}
1965
2028
  });
1966
2029
  this.dispatchEvent(event);
1967
2030
  }
1968
2031
  }
1969
- async unMuteMicrophone() {
2032
+ unMuteMicrophone() {
1970
2033
  if (this.micProducer) {
1971
2034
  this.micProducer.resume();
1972
2035
  this.resolvePendingDeviceRequest("microphone", true);
1973
- await this.protoo.request("resumeProducer", {
1974
- producerId: this.micProducer.id
1975
- });
1976
2036
  this.muted = false;
2037
+ const device = "microphone";
2038
+ this.protoo.notify("unmute", {
2039
+ device: device
2040
+ });
1977
2041
  const event = new $1dedebd5ff3002eb$var$SnapcallEvent("microphoneUnmute", {
1978
2042
  detail: {}
1979
2043
  });
@@ -2134,6 +2198,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
2134
2198
  this.mediaPipeOption = options;
2135
2199
  }
2136
2200
  async initVideoBackground() {
2201
+ if (!this.permissions.find((permission)=>permission === "virtual_background")) throw new Error("feature not allowed");
2137
2202
  if (this.useVideoBackground === true) return;
2138
2203
  this.useVideoBackground = true;
2139
2204
  if (!this.webcamProducer || this.webcamProducer.closed) return;
@@ -2173,6 +2238,11 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
2173
2238
  },
2174
2239
  qualityIndex: 2
2175
2240
  };
2241
+ await this.webcamProducer?.replaceTrack?.({
2242
+ track: null
2243
+ }).catch((err)=>{
2244
+ $1dedebd5ff3002eb$var$log.error("switchCamera", "clean track failed", err);
2245
+ });
2176
2246
  const mediaStream = await this.handleGetUserMediaError("webcam", navigator.mediaDevices.getUserMedia({
2177
2247
  video: {
2178
2248
  deviceId: {
@@ -2310,6 +2380,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
2310
2380
  this.dispatchEvent(event);
2311
2381
  }
2312
2382
  async enableScreenshare() {
2383
+ if (!this.permissions.find((permission)=>permission === "screen_sharing")) throw new Error("feature not allowed");
2313
2384
  const stream = await this.handleGetUserMediaError("screen", navigator.mediaDevices.getDisplayMedia({
2314
2385
  audio: false,
2315
2386
  video: {
@@ -2402,11 +2473,13 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
2402
2473
  } else $1dedebd5ff3002eb$var$log.error("requestVideo", `Video consumer ${consumer} not found`);
2403
2474
  }
2404
2475
  async captureVideo(videoElement) {
2405
- let image;
2406
- if (videoElement) image = await (0, $3575c8a563f2a1da$export$674c90a250a8b2c5)(videoElement);
2407
- else if (this.webcamProducer && this.webcamProducer.track) image = await (0, $3575c8a563f2a1da$export$4a210166cc9cb64b)(this.webcamProducer.track);
2408
- else throw new Error("no video to capture");
2409
- return image;
2476
+ if (this.permissions.find((permission)=>permission === "instant_picture")) {
2477
+ let image;
2478
+ if (videoElement) image = await (0, $3575c8a563f2a1da$export$674c90a250a8b2c5)(videoElement);
2479
+ else if (this.webcamProducer && this.webcamProducer.track) image = await (0, $3575c8a563f2a1da$export$4a210166cc9cb64b)(this.webcamProducer.track);
2480
+ else throw new Error("no video to capture");
2481
+ return image;
2482
+ } else throw new Error("feature not allowed");
2410
2483
  }
2411
2484
  requestLocalVideo(element) {
2412
2485
  $1dedebd5ff3002eb$var$log.info("requestLocalVideo");
@@ -2472,6 +2545,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
2472
2545
  deviceType: deviceType
2473
2546
  });
2474
2547
  this.scaleVideoEncodingsParameter();
2548
+ const paused = peer ? peer.muted : false;
2475
2549
  const event = new $1dedebd5ff3002eb$var$SnapcallEvent("mediaStart", {
2476
2550
  detail: {
2477
2551
  peerId: peerId,
@@ -2524,6 +2598,7 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
2524
2598
  this.dispatchEvent(event);
2525
2599
  }
2526
2600
  async requestPeerDevice(remotePeerId, deviceType) {
2601
+ if (!this.permissions.find((permission)=>permission === "request_input")) throw new Error("feature not allowed");
2527
2602
  return this.protoo.request("requestPeerDevice", {
2528
2603
  remotePeerId: remotePeerId,
2529
2604
  deviceType: deviceType
@@ -2692,6 +2767,9 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
2692
2767
  ...config
2693
2768
  };
2694
2769
  }
2770
+ getPermissions() {
2771
+ return this.permissions;
2772
+ }
2695
2773
  }
2696
2774
 
2697
2775
 
@@ -3035,8 +3113,9 @@ const $cce7f1c9e9c29503$export$d5424e4dfe4be076 = ({ color: color })=>/*#__PURE
3035
3113
 
3036
3114
  const $326cea7dbbcb019a$export$71b2224f1ce5e08e = (ref, action)=>{
3037
3115
  (0, $jQDcL$react.useEffect)(()=>{
3116
+ const effectTimestamp = performance.now();
3038
3117
  const onWindowClick = (event)=>{
3039
- if (!ref?.current?.contains(event.target)) action();
3118
+ if (!ref?.current?.contains(event.target) && event.timeStamp > effectTimestamp) action();
3040
3119
  };
3041
3120
  if (ref?.current) {
3042
3121
  window.addEventListener("click", onWindowClick);
@@ -3125,7 +3204,9 @@ const $82c4f35718e0facf$var$Menu = ({ categories: categories })=>{
3125
3204
  children: category.title
3126
3205
  }),
3127
3206
  category.items.map((item)=>/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $4890069d0b6c2ba3$export$44020656de05f2b4), {
3128
- onClick: item.action,
3207
+ onClick: ()=>{
3208
+ item.action();
3209
+ },
3129
3210
  danger: item.danger,
3130
3211
  children: [
3131
3212
  item.jsxIcon && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $4890069d0b6c2ba3$export$5912a8d3f489e1c1), {
@@ -3171,7 +3252,7 @@ const $1949f8f101c8cf77$export$4dc2e6a0e59ffa13 = (0, ($parcel$interopDefault($j
3171
3252
  font-size: 16px;
3172
3253
  font-weight: 300;
3173
3254
  line-height: 16px;
3174
- color: #fff;
3255
+ color: rgba(255, 255, 255, 0.5);
3175
3256
  margin-left: 5px;
3176
3257
  position: relative;
3177
3258
  bottom: 1px;
@@ -3546,7 +3627,7 @@ const $e1930b467e7d8845$var$multiPiP = new (0, $21395e477f83709c$export$45fabd1c
3546
3627
  const $e1930b467e7d8845$var$browser = $jQDcL$bowser.parse(window.navigator.userAgent);
3547
3628
  const $e1930b467e7d8845$var$Header = ()=>{
3548
3629
  const { t: t } = (0, $jQDcL$reacti18next.useTranslation)();
3549
- const { setIsQuickConnectPopupVisible: setIsQuickConnectPopupVisible , setIsSettingsMenuVisible: setIsSettingsMenuVisible , setIsVirtualBackgroundPopupVisible: setIsVirtualBackgroundPopupVisible , options: options , muted: muted , streaming: streaming , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
3630
+ const { setIsQuickConnectPopupVisible: setIsQuickConnectPopupVisible , setIsSettingsMenuVisible: setIsSettingsMenuVisible , setIsVirtualBackgroundPopupVisible: setIsVirtualBackgroundPopupVisible , options: options , muted: muted , streaming: streaming , permissions: permissions , plan: plan , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
3550
3631
  const { streams: streams } = (0, $3f6e908c45fcc5b3$export$b5633a7cfbe42d9f)();
3551
3632
  const [extraOptions, setExtraOptions] = (0, $jQDcL$react.useState)(options.extraSettingsOptions || []);
3552
3633
  const onSetExtraSettingsOptions = (event)=>{
@@ -3594,14 +3675,17 @@ const $e1930b467e7d8845$var$Header = ()=>{
3594
3675
  (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).endCall();
3595
3676
  };
3596
3677
  const onScanQuickConnectClick = ()=>{
3597
- setIsQuickConnectPopupVisible(true);
3598
- (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("quickConnectClick");
3678
+ if (permissions.find((permission)=>permission === "quick_connect")) {
3679
+ setIsQuickConnectPopupVisible(true);
3680
+ (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("quickConnectClick");
3681
+ } else setBlockedFeaturePopupOpen(true);
3599
3682
  };
3600
3683
  const onSettingsMenuClick = ()=>{
3601
3684
  setIsSettingsMenuVisible(true);
3602
3685
  };
3603
3686
  const onVirtualBackgroundClick = ()=>{
3604
- setIsVirtualBackgroundPopupVisible(true);
3687
+ if (permissions.find((permission)=>permission === "virtual_background")) setIsVirtualBackgroundPopupVisible(true);
3688
+ else setBlockedFeaturePopupOpen(true);
3605
3689
  };
3606
3690
  const computedCategories = [
3607
3691
  {
@@ -3658,13 +3742,15 @@ const $e1930b467e7d8845$var$Header = ()=>{
3658
3742
  });
3659
3743
  return computedCategories;
3660
3744
  }, [
3745
+ t,
3746
+ options.sharedURL,
3661
3747
  muted,
3662
3748
  streaming,
3663
- options.sharedURL,
3749
+ permissions,
3664
3750
  setIsQuickConnectPopupVisible,
3751
+ setBlockedFeaturePopupOpen,
3665
3752
  setIsSettingsMenuVisible,
3666
- setIsVirtualBackgroundPopupVisible,
3667
- t,
3753
+ setIsVirtualBackgroundPopupVisible,
3668
3754
  ]);
3669
3755
  return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $1949f8f101c8cf77$export$1e86fd0e1db89578), {
3670
3756
  children: [
@@ -3674,7 +3760,10 @@ const $e1930b467e7d8845$var$Header = ()=>{
3674
3760
  size: options.logo?.size
3675
3761
  }),
3676
3762
  options.logo?.text && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $1949f8f101c8cf77$export$4dc2e6a0e59ffa13), {
3677
- children: options.logo.text
3763
+ children: options.logo?.text
3764
+ }),
3765
+ plan === "individual" && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $1949f8f101c8cf77$export$4dc2e6a0e59ffa13), {
3766
+ children: `${options.logo?.text ? " \xb7 " : ""}${t("header.free")}`
3678
3767
  })
3679
3768
  ]
3680
3769
  }),
@@ -4510,7 +4599,7 @@ const $07e749066c746c7c$var$StreamTile = ({ stream: stream , width: width = 0 ,
4510
4599
  const [requestingDevice, setRequestingDevice] = (0, $jQDcL$react.useState)(null);
4511
4600
  const [flashAnimation, setFlashAnimation] = (0, $jQDcL$react.useState)(false);
4512
4601
  const requestingDeviceTimeoutRef = (0, $jQDcL$react.useRef)(null);
4513
- const { selfPeerId: selfPeerId } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
4602
+ const { selfPeerId: selfPeerId , permissions: permissions , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
4514
4603
  const { highlightedTile: highlightedTile } = (0, $3f6e908c45fcc5b3$export$b5633a7cfbe42d9f)();
4515
4604
  const isSharingScreen = highlightedTile?.type === "screenshare" && highlightedTile.peerId === selfPeerId;
4516
4605
  const microphoneActive = stream.microphone && !stream.muted;
@@ -4522,16 +4611,22 @@ const $07e749066c746c7c$var$StreamTile = ({ stream: stream , width: width = 0 ,
4522
4611
  const onMouseEnter = ()=>setHover(true);
4523
4612
  const onMouseLeave = ()=>setHover(false);
4524
4613
  const requestMicrophone = ()=>{
4525
- (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestPeerDevice(stream.id, "microphone");
4526
- setRequestingDevice("microphone");
4614
+ if (permissions.find((permission)=>permission === "request_input")) {
4615
+ (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestPeerDevice(stream.id, "microphone");
4616
+ setRequestingDevice("microphone");
4617
+ } else setBlockedFeaturePopupOpen(true);
4527
4618
  };
4528
4619
  const requestWebcam = ()=>{
4529
- (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestPeerDevice(stream.id, "webcam");
4530
- setRequestingDevice("webcam");
4620
+ if (permissions.find((permission)=>permission === "request_input")) {
4621
+ (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestPeerDevice(stream.id, "webcam");
4622
+ setRequestingDevice("webcam");
4623
+ } else setBlockedFeaturePopupOpen(true);
4531
4624
  };
4532
4625
  const requestScreen = ()=>{
4533
- (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestPeerDevice(stream.id, "screen");
4534
- setRequestingDevice("screen");
4626
+ if (permissions.find((permission)=>permission === "request_input")) {
4627
+ (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).requestPeerDevice(stream.id, "screen");
4628
+ setRequestingDevice("screen");
4629
+ } else setBlockedFeaturePopupOpen(true);
4535
4630
  };
4536
4631
  (0, $jQDcL$react.useEffect)(()=>{
4537
4632
  if (!videoElementRef.current) throw new Error("videoElementRef not available");
@@ -5169,7 +5264,7 @@ const $8393b5c887e16c8c$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
5169
5264
  const videoElementRef = (0, $jQDcL$react.useRef)(null);
5170
5265
  const videoMediaProviderRef = (0, $jQDcL$react.useRef)(null);
5171
5266
  const SelfTileRef = (0, $jQDcL$react.useRef)(null);
5172
- const { videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , profile: profile , muted: muted , streaming: streaming , orientation: orientation , options: options , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
5267
+ const { videosContainerRef: videosContainerRef , remoteTilesContainerRef: remoteTilesContainerRef , profile: profile , muted: muted , streaming: streaming , orientation: orientation , options: options , permissions: permissions , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
5173
5268
  const { streams: streams } = (0, $3f6e908c45fcc5b3$export$b5633a7cfbe42d9f)();
5174
5269
  const [containerWidth, containerHeight] = (0, $56e1e7a85d8bf4bb$export$2b86bedf890eab8)(videosContainerRef.current);
5175
5270
  const cursor = streaming && !extended ? "pointer" : "default";
@@ -5213,42 +5308,44 @@ const $8393b5c887e16c8c$var$SelfStreamTile = ({ isSomeonePresenting: isSomeonePr
5213
5308
  }
5214
5309
  };
5215
5310
  const onSnapshotClick = async ()=>{
5216
- if (!snapshotAnimation && !snapshotImage) {
5217
- if (!videoElementRef.current) throw new Error("Video element is not available");
5218
- setSnapshotAnimation(true);
5219
- const base64Image = await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).captureVideo(videoElementRef.current);
5220
- setSnapshotImage(base64Image);
5221
- try {
5222
- const { objectUrl: objectUrl } = await fetch(`${options.streamApiURL}/uploadSnapshot`, {
5223
- method: "POST",
5224
- body: JSON.stringify({
5225
- file: base64Image
5226
- })
5227
- }).then((rawResponse)=>rawResponse.json());
5228
- await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).sendCustomMessageToAll({
5229
- type: "snapshot",
5230
- imageSrc: objectUrl
5231
- });
5232
- let notificationMessage = t("snapshot.sentToUsers");
5233
- if (streams.length === 1) {
5234
- const userName = streams[0].profile.name || t("misc.user");
5235
- notificationMessage = t("snapshot.sentToUser", {
5236
- user: userName
5311
+ if (permissions.find((permission)=>permission === "instant_picture")) {
5312
+ if (!snapshotAnimation && !snapshotImage) {
5313
+ if (!videoElementRef.current) throw new Error("Video element is not available");
5314
+ setSnapshotAnimation(true);
5315
+ const base64Image = await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).captureVideo(videoElementRef.current);
5316
+ setSnapshotImage(base64Image);
5317
+ try {
5318
+ const { objectUrl: objectUrl } = await fetch(`${options.streamApiURL}/uploadSnapshot`, {
5319
+ method: "POST",
5320
+ body: JSON.stringify({
5321
+ file: base64Image
5322
+ })
5323
+ }).then((rawResponse)=>rawResponse.json());
5324
+ await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).sendCustomMessageToAll({
5325
+ type: "snapshot",
5326
+ imageSrc: objectUrl
5327
+ });
5328
+ let notificationMessage = t("snapshot.sentToUsers");
5329
+ if (streams.length === 1) {
5330
+ const userName = streams[0].profile.name || t("misc.user");
5331
+ notificationMessage = t("snapshot.sentToUser", {
5332
+ user: userName
5333
+ });
5334
+ }
5335
+ (0, $84c6cbcbb594d072$export$3a57e165650c636f)(notificationMessage, {
5336
+ icon: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $2c45d365ee8aa1ab$export$26fe7ec9351ff761), {
5337
+ src: base64Image
5338
+ }),
5339
+ duration: 2500
5237
5340
  });
5341
+ } catch (sendMessageError) {
5342
+ (0, ($parcel$interopDefault($jQDcL$reacthottoast)))(t("snapshot.error"), {
5343
+ className: "error"
5344
+ });
5345
+ console.error(sendMessageError);
5238
5346
  }
5239
- (0, $84c6cbcbb594d072$export$3a57e165650c636f)(notificationMessage, {
5240
- icon: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $2c45d365ee8aa1ab$export$26fe7ec9351ff761), {
5241
- src: base64Image
5242
- }),
5243
- duration: 2500
5244
- });
5245
- } catch (sendMessageError) {
5246
- (0, ($parcel$interopDefault($jQDcL$reacthottoast)))(t("snapshot.error"), {
5247
- className: "error"
5248
- });
5249
- console.error(sendMessageError);
5250
5347
  }
5251
- }
5348
+ } else setBlockedFeaturePopupOpen(true);
5252
5349
  };
5253
5350
  const onDeviceRequest = (event)=>{
5254
5351
  const { peerId: peerId , deviceType: deviceType } = event.detail;
@@ -6459,7 +6556,8 @@ const $88b23a8428e67b66$var$Video = ()=>{
6459
6556
  const { peers: peers } = event.detail;
6460
6557
  const roomStreams = peers.map((peer)=>({
6461
6558
  id: peer.peerId,
6462
- profile: peer.profile
6559
+ profile: peer.profile,
6560
+ muted: peer.muted
6463
6561
  }));
6464
6562
  dispatch({
6465
6563
  type: (0, $a4027a5418fcd07a$export$96a9662a3eda31f6).SET_STREAMS,
@@ -6788,7 +6886,7 @@ const $9dfd9e2286cffa66$var$HighlightButton = ()=>{
6788
6886
  const { t: t } = (0, $jQDcL$reacti18next.useTranslation)();
6789
6887
  const highlightMenuRef = (0, $jQDcL$react.useRef)(null);
6790
6888
  const [isHighlightMenuOpen, setIsHighlightMenuOpen] = (0, $jQDcL$react.useState)(false);
6791
- const { setIsYoutubePopupVisible: setIsYoutubePopupVisible , setIsLinksharePopupVisible: setIsLinksharePopupVisible , selfPeerId: selfPeerId } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
6889
+ const { setIsYoutubePopupVisible: setIsYoutubePopupVisible , setIsLinksharePopupVisible: setIsLinksharePopupVisible , selfPeerId: selfPeerId , permissions: permissions , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
6792
6890
  const { highlightedTile: highlightedTile , dispatch: dispatch } = (0, $3f6e908c45fcc5b3$export$b5633a7cfbe42d9f)();
6793
6891
  const isPresenting = Boolean(highlightedTile?.isGlobal && highlightedTile?.peerId === selfPeerId);
6794
6892
  (0, $326cea7dbbcb019a$export$71b2224f1ce5e08e)(highlightMenuRef, ()=>setIsHighlightMenuOpen(false));
@@ -6799,18 +6897,20 @@ const $9dfd9e2286cffa66$var$HighlightButton = ()=>{
6799
6897
  else setIsHighlightMenuOpen((previousValue)=>!previousValue);
6800
6898
  };
6801
6899
  const onScreenshareClick = async ()=>{
6802
- setIsHighlightMenuOpen(false);
6803
- try {
6804
- (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("screenshareClick");
6805
- await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).enableScreenshare();
6806
- (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("enableScreenshare");
6807
- } catch (screenshareError) {
6808
- console.warn(screenshareError);
6809
- (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("screenshareCancel");
6810
- (0, ($parcel$interopDefault($jQDcL$reacthottoast)))(t("notifications.screensharingError"), {
6811
- className: "error"
6812
- });
6813
- }
6900
+ if (permissions.find((permission)=>permission === "screen_sharing")) {
6901
+ setIsHighlightMenuOpen(false);
6902
+ try {
6903
+ (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("screenshareClick");
6904
+ await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).enableScreenshare();
6905
+ (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("enableScreenshare");
6906
+ } catch (screenshareError) {
6907
+ console.warn(screenshareError);
6908
+ (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("screenshareCancel");
6909
+ (0, ($parcel$interopDefault($jQDcL$reacthottoast)))(t("notifications.screensharingError"), {
6910
+ className: "error"
6911
+ });
6912
+ }
6913
+ } else setBlockedFeaturePopupOpen(true);
6814
6914
  };
6815
6915
  const onYoutubeClick = ()=>{
6816
6916
  setIsHighlightMenuOpen(false);
@@ -6818,9 +6918,11 @@ const $9dfd9e2286cffa66$var$HighlightButton = ()=>{
6818
6918
  (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("youtubeClick");
6819
6919
  };
6820
6920
  const onLinkshareClick = ()=>{
6821
- setIsHighlightMenuOpen(false);
6822
- setIsLinksharePopupVisible(true);
6823
- (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("linkshareClick");
6921
+ if (permissions.find((permission)=>permission === "share_link")) {
6922
+ setIsHighlightMenuOpen(false);
6923
+ setIsLinksharePopupVisible(true);
6924
+ (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).event("linkshareClick");
6925
+ } else setBlockedFeaturePopupOpen(true);
6824
6926
  };
6825
6927
  const menuCategories = [
6826
6928
  {
@@ -7393,6 +7495,16 @@ const $41e530447f5fd995$var$Checkmark = ()=>/*#__PURE__*/ (0, $jQDcL$reactjsxrun
7393
7495
  fill: "#fff"
7394
7496
  })
7395
7497
  });
7498
+ const $41e530447f5fd995$export$f8e32eb727ccae99 = ()=>/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("svg", {
7499
+ xmlns: "http://www.w3.org/2000/svg",
7500
+ width: "17",
7501
+ height: "18",
7502
+ fill: "none",
7503
+ children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)("path", {
7504
+ fill: "#fff",
7505
+ d: "M10.767 6.325 7.192 9.908 5.817 8.533a.833.833 0 1 0-1.175 1.175L6.6 11.675a.831.831 0 0 0 .592.241.833.833 0 0 0 .583-.241l4.166-4.167a.833.833 0 1 0-1.175-1.183ZM8.5.667a8.333 8.333 0 1 0 0 16.666A8.333 8.333 0 0 0 8.5.667Zm0 15a6.667 6.667 0 1 1 0-13.334 6.667 6.667 0 0 1 0 13.333Z"
7506
+ })
7507
+ });
7396
7508
  var $41e530447f5fd995$export$2e2bcd8739ae039 = $41e530447f5fd995$var$Checkmark;
7397
7509
 
7398
7510
 
@@ -9118,6 +9230,170 @@ var $8a52c9358bc52b86$export$2e2bcd8739ae039 = $8a52c9358bc52b86$var$VirtualBack
9118
9230
 
9119
9231
 
9120
9232
 
9233
+
9234
+
9235
+ const $72e3731384b9cb71$var$modalHeight = (desktop)=>desktop ? "225px" : "237px";
9236
+ const $72e3731384b9cb71$export$6e1d6efa4a5a1be4 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9237
+ position: absolute;
9238
+ width: 100%;
9239
+ bottom: ${(props)=>props.open ? 0 : `-${$72e3731384b9cb71$var$modalHeight(props.desktop)}`};
9240
+ transition: all 0.4s;
9241
+
9242
+ ${(props)=>{
9243
+ if (props.desktop) return (0, $jQDcL$styledcomponents.css)`
9244
+ bottom: ${props.open ? 0 : `calc(-${$72e3731384b9cb71$var$modalHeight(props.desktop)} - (100vh / 2))`};
9245
+ height: 100%;
9246
+ display: flex;
9247
+ justify-content: center;
9248
+ align-items: center;
9249
+ `;
9250
+ }}
9251
+ `;
9252
+ const $72e3731384b9cb71$export$ed7a64955cfa5a69 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9253
+ display: flex;
9254
+ flex-direction: column;
9255
+ width: ${(props)=>props.desktop ? "375px" : "100%"};
9256
+ height: ${({ desktop: desktop })=>$72e3731384b9cb71$var$modalHeight(desktop)};
9257
+ max-height: 100vh;
9258
+ background-color: ${(props)=>props.theme.popupBackgroundPrimaryColor};
9259
+ color: ${(props)=>props.theme.popupTitleColor};
9260
+ border-radius: ${(props)=>props.desktop ? "20px" : "20px 20px 0 0"};
9261
+ box-sizing: border-box;
9262
+ `;
9263
+ const $72e3731384b9cb71$export$6334857f32bd1136 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9264
+ display: flex;
9265
+ justify-content: space-between;
9266
+ align-items: center;
9267
+ border-bottom: 2px solid #f7f7f7;
9268
+ `;
9269
+ const $72e3731384b9cb71$export$a27d59de3a7a8b8e = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9270
+ display: flex;
9271
+ align-items: center;
9272
+ margin: 16px auto 16px 16px;
9273
+ `;
9274
+ const $72e3731384b9cb71$export$47ef2d2839b7d95a = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9275
+ font-family: 'Lato';
9276
+ font-style: normal;
9277
+ font-weight: 600;
9278
+ font-size: 18px;
9279
+ line-height: 22px;
9280
+ letter-spacing: -0.02em;
9281
+ `;
9282
+ const $72e3731384b9cb71$export$219c8e53e235e8b7 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).button`
9283
+ display: flex;
9284
+ justify-content: center;
9285
+ align-items: center;
9286
+ border: none;
9287
+ background-color: ${(props)=>props.theme.popupBackgroundSecondaryColor};
9288
+ border-radius: 50%;
9289
+ height: 30px;
9290
+ width: 30px;
9291
+ padding: 0;
9292
+ margin: 16px 16px 16px auto;
9293
+
9294
+ svg {
9295
+ height: 15px;
9296
+ width: 15px;
9297
+
9298
+ path {
9299
+ fill: #000;
9300
+ }
9301
+ }
9302
+ `;
9303
+ const $72e3731384b9cb71$export$5197cd1b80f9682b = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9304
+ display: flex;
9305
+ align-items: center;
9306
+ justify-content: center;
9307
+ font-size: 12px;
9308
+ color: #2d2d2d;
9309
+ margin: 16px 32px auto 32px;
9310
+ font-family: 'Lato';
9311
+ font-style: normal;
9312
+ font-weight: 400;
9313
+ font-size: 16px;
9314
+ line-height: 19px;
9315
+ text-align: left;
9316
+ letter-spacing: -0.02em;
9317
+ `;
9318
+ const $72e3731384b9cb71$export$5f79cadb3a637092 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).button`
9319
+ background-color: ${({ theme: theme })=>theme.primaryColor};
9320
+ padding: 8px 18px;
9321
+ height: 46px;
9322
+ max-width: 100%;
9323
+ border-radius: 15px;
9324
+ margin: 20px 32px 20px 32px;
9325
+ border: none;
9326
+ color: #fff;
9327
+ font-size: 16px;
9328
+ font-weight: 700;
9329
+ line-height: 18px;
9330
+
9331
+ span {
9332
+ display: flex;
9333
+ flex-direction: row;
9334
+ gap: 5px;
9335
+ alig-items: center;
9336
+ justify-content: center;
9337
+ }
9338
+ `;
9339
+
9340
+
9341
+
9342
+
9343
+
9344
+
9345
+
9346
+ const $5b8a9a2976fbc419$var$BlockedFeaturePopup = ()=>{
9347
+ const { t: t } = (0, $jQDcL$reacti18next.useTranslation)();
9348
+ const { isBlockedFeaturePopupOpen: isBlockedFeaturePopupOpen , setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen , orientation: orientation , isAgent: isAgent } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
9349
+ const popupRef = (0, $jQDcL$react.useRef)(null);
9350
+ const desktop = orientation === "landscape";
9351
+ (0, $326cea7dbbcb019a$export$71b2224f1ce5e08e)(popupRef, ()=>{
9352
+ if (isBlockedFeaturePopupOpen) setBlockedFeaturePopupOpen(false);
9353
+ });
9354
+ return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $72e3731384b9cb71$export$6e1d6efa4a5a1be4), {
9355
+ open: isBlockedFeaturePopupOpen,
9356
+ desktop: desktop,
9357
+ children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $72e3731384b9cb71$export$ed7a64955cfa5a69), {
9358
+ ref: popupRef,
9359
+ desktop: desktop,
9360
+ children: [
9361
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $72e3731384b9cb71$export$6334857f32bd1136), {
9362
+ children: [
9363
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $72e3731384b9cb71$export$a27d59de3a7a8b8e), {
9364
+ children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $72e3731384b9cb71$export$47ef2d2839b7d95a), {
9365
+ children: isAgent && t("blockedFeature.titleConnected") || t("blockedFeature.titleGuest")
9366
+ })
9367
+ }),
9368
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $72e3731384b9cb71$export$219c8e53e235e8b7), {
9369
+ onClick: ()=>setBlockedFeaturePopupOpen(false),
9370
+ children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $6f36db3b1217f099$export$2e2bcd8739ae039), {})
9371
+ })
9372
+ ]
9373
+ }),
9374
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $72e3731384b9cb71$export$5197cd1b80f9682b), {
9375
+ children: isAgent && t("blockedFeature.descriptionConnected") || t("blockedFeature.descriptionGuest")
9376
+ }),
9377
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $72e3731384b9cb71$export$5f79cadb3a637092), {
9378
+ onClick: ()=>{
9379
+ setBlockedFeaturePopupOpen(false);
9380
+ if (isAgent) window.open(`${"https://app.snapcall.io"}/settings/workspace/plans-invoices`, "_blank");
9381
+ },
9382
+ children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)("span", {
9383
+ children: [
9384
+ isAgent && /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $41e530447f5fd995$export$f8e32eb727ccae99), {}),
9385
+ isAgent && t("blockedFeature.dismissConnected") || t("blockedFeature.dismissGuest")
9386
+ ]
9387
+ })
9388
+ })
9389
+ ]
9390
+ })
9391
+ });
9392
+ };
9393
+ var $5b8a9a2976fbc419$export$2e2bcd8739ae039 = $5b8a9a2976fbc419$var$BlockedFeaturePopup;
9394
+
9395
+
9396
+
9121
9397
  const $e6950939129bcd4b$export$8376625f8bb18347 = (0, ($parcel$interopDefault($jQDcL$styledcomponents))).div`
9122
9398
  position: absolute;
9123
9399
  width: 100%;
@@ -9130,8 +9406,8 @@ const $e6950939129bcd4b$export$8376625f8bb18347 = (0, ($parcel$interopDefault($j
9130
9406
 
9131
9407
 
9132
9408
  const $5f509eaff0d9c05a$var$Settings = ()=>{
9133
- const { isQuickConnectPopupVisible: isQuickConnectPopupVisible , isSettingsMenuVisible: isSettingsMenuVisible , isYoutubePopupVisible: isYoutubePopupVisible , isLinksharePopupVisible: isLinksharePopupVisible , isVirtualBackgroundPopupVisible: isVirtualBackgroundPopupVisible , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
9134
- const open = isQuickConnectPopupVisible || isSettingsMenuVisible || isYoutubePopupVisible || isLinksharePopupVisible || isVirtualBackgroundPopupVisible;
9409
+ const { isQuickConnectPopupVisible: isQuickConnectPopupVisible , isSettingsMenuVisible: isSettingsMenuVisible , isYoutubePopupVisible: isYoutubePopupVisible , isLinksharePopupVisible: isLinksharePopupVisible , isVirtualBackgroundPopupVisible: isVirtualBackgroundPopupVisible , isBlockedFeaturePopupOpen: isBlockedFeaturePopupOpen , } = (0, $jQDcL$react.useContext)((0, $8b39f32976a7698a$export$2e2bcd8739ae039));
9410
+ const open = isQuickConnectPopupVisible || isSettingsMenuVisible || isYoutubePopupVisible || isBlockedFeaturePopupOpen || isLinksharePopupVisible || isVirtualBackgroundPopupVisible;
9135
9411
  return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $e6950939129bcd4b$export$8376625f8bb18347), {
9136
9412
  open: open,
9137
9413
  children: [
@@ -9139,7 +9415,8 @@ const $5f509eaff0d9c05a$var$Settings = ()=>{
9139
9415
  /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $7d4fa7ceb4c29739$export$2e2bcd8739ae039), {}),
9140
9416
  /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $696ded7a5399bcd4$export$2e2bcd8739ae039), {}),
9141
9417
  /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $e38290b50aaba0e3$export$2e2bcd8739ae039), {}),
9142
- /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $8a52c9358bc52b86$export$2e2bcd8739ae039), {})
9418
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $8a52c9358bc52b86$export$2e2bcd8739ae039), {}),
9419
+ /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $5b8a9a2976fbc419$export$2e2bcd8739ae039), {})
9143
9420
  ]
9144
9421
  });
9145
9422
  };
@@ -10033,6 +10310,9 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
10033
10310
  const [userInteractionTriggered, setUserInteractionTriggered] = (0, $jQDcL$react.useState)(false);
10034
10311
  const [containerWidth, containerHeight] = (0, $56e1e7a85d8bf4bb$export$2b86bedf890eab8)(streamUIContainerRef.current);
10035
10312
  const [isBlockedDevicesPopupOpen, setBlockedDevicesPopupOpen] = (0, $jQDcL$react.useState)(false);
10313
+ const [isBlockedFeaturePopupOpen, setBlockedFeaturePopupOpen] = (0, $jQDcL$react.useState)(false);
10314
+ const [permissions, setPermissions] = (0, $jQDcL$react.useState)([]);
10315
+ const [plan, setPlan] = (0, $jQDcL$react.useState)(undefined);
10036
10316
  const orientation = (containerWidth || window.screen.width) > (containerHeight || window.screen.height) ? "landscape" : "portrait";
10037
10317
  const styledTheme = theme === "dark" ? (0, $9295e87e6b93e693$export$3e936a8db52a10a0) : (0, $9295e87e6b93e693$export$f30cb9bc4f736419);
10038
10318
  const onWebcamUpdate = (event)=>{
@@ -10161,6 +10441,9 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
10161
10441
  (0, $jQDcL$react.useEffect)(()=>{
10162
10442
  const onEnterRoom = async (event)=>{
10163
10443
  const peerId = event.detail.peerId;
10444
+ setPlan(event.detail.plan);
10445
+ setPermissions(event.detail.permissions);
10446
+ console.log(event.detail.permissions);
10164
10447
  setSelfPeerId(peerId);
10165
10448
  try {
10166
10449
  await (0, $c3d5253d9d597eb5$export$494039379563c94d)(options);
@@ -10179,6 +10462,8 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
10179
10462
  ]);
10180
10463
  return /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $8b39f32976a7698a$export$2e2bcd8739ae039).Provider, {
10181
10464
  value: {
10465
+ plan: plan,
10466
+ permissions: permissions,
10182
10467
  selfPeerId: selfPeerId,
10183
10468
  streamUIContainerRef: streamUIContainerRef,
10184
10469
  videosContainerRef: videosContainerRef,
@@ -10195,6 +10480,8 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: options })=>{
10195
10480
  setIsLinksharePopupVisible: setIsLinksharePopupVisible,
10196
10481
  isVirtualBackgroundPopupVisible: isVirtualBackgroundPopupVisible,
10197
10482
  setIsVirtualBackgroundPopupVisible: setIsVirtualBackgroundPopupVisible,
10483
+ isBlockedFeaturePopupOpen: isBlockedFeaturePopupOpen,
10484
+ setBlockedFeaturePopupOpen: setBlockedFeaturePopupOpen,
10198
10485
  theme: theme,
10199
10486
  setTheme: setTheme,
10200
10487
  language: language,
@@ -10700,15 +10987,17 @@ const $e68207026aca356b$export$3f94917203ab7078 = {
10700
10987
  init: ({ element: element , ...options })=>{
10701
10988
  if (element?.nodeType !== window.Node.ELEMENT_NODE) throw new Error('The "element" property must be a valid element!');
10702
10989
  const mergedOptions = (0, $6b4cf4c12c735fdf$export$6969335ea1e4e77c)($e68207026aca356b$var$defaultOptions, options);
10703
- (0, $jQDcL$reactdom.render)(/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $ee8cb448c2c74888$export$2e2bcd8739ae039), {
10990
+ const rootElement = (0, $jQDcL$reactdomclient.createRoot)(element);
10991
+ rootElement.render(/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $ee8cb448c2c74888$export$2e2bcd8739ae039), {
10704
10992
  options: mergedOptions
10705
- }), element);
10993
+ }));
10706
10994
  if (mergedOptions.tracking) (0, ($parcel$interopDefault($jQDcL$hotjarbrowser))).init(3111933, 6);
10707
10995
  },
10708
10996
  initGreeting: (element, onGreetingDone)=>{
10709
- (0, $jQDcL$reactdom.render)(/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $3305ca02e86dabd1$export$2e2bcd8739ae039), {
10997
+ const rootElement = (0, $jQDcL$reactdomclient.createRoot)(element);
10998
+ rootElement.render(/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $3305ca02e86dabd1$export$2e2bcd8739ae039), {
10710
10999
  onGreetingDone: onGreetingDone
10711
- }), element);
11000
+ }));
10712
11001
  },
10713
11002
  setExtraSettingsOptions: (extraOptions)=>{
10714
11003
  const event = new CustomEvent("streamUISetExtraSettingsOptions", {
@@ -10724,11 +11013,13 @@ const $e68207026aca356b$export$3f94917203ab7078 = {
10724
11013
  terminateRoom: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).terminateRoom.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
10725
11014
  generateToken: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).generateToken.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
10726
11015
  addEventListener: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).addEventListener.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
11016
+ removeEventListener: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).removeEventListener.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
10727
11017
  dispatchEvent: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).dispatchEvent.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
10728
11018
  getState: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).getState.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
10729
11019
  setProfile: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).setProfile.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
10730
11020
  /* Should not be documented */ setConfig: (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).setConfig.bind((0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2)),
10731
- setLogLevel: (level)=>(0, $d0c6baf97675ab49$export$2e2bcd8739ae039).setLogLevel(level)
11021
+ setLogLevel: (level)=>(0, $d0c6baf97675ab49$export$2e2bcd8739ae039).setLogLevel(level),
11022
+ getPermissions: ()=>(0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).getPermissions()
10732
11023
  };
10733
11024
  window.streamUI = $e68207026aca356b$export$3f94917203ab7078;
10734
11025
  // Backward compatibility