@cloudflare/realtimekit-ui 1.0.6-staging.2 → 1.0.6-staging.4

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.
Files changed (115) hide show
  1. package/dist/browser.js +1 -1
  2. package/dist/cjs/{floating-ui.dom.esm-90c5a220.js → floating-ui.dom.esm-705e65f3.js} +38 -21
  3. package/dist/cjs/rtk-avatar_54.cjs.entry.js +2 -2
  4. package/dist/cjs/rtk-camera-selector_2.cjs.entry.js +3 -3
  5. package/dist/cjs/rtk-caption-toggle.cjs.entry.js +1 -1
  6. package/dist/cjs/rtk-participant_2.cjs.entry.js +2 -2
  7. package/dist/cjs/rtk-plugin-main_2.cjs.entry.js +1 -1
  8. package/dist/cjs/rtk-plugins_2.cjs.entry.js +8 -5
  9. package/dist/cjs/rtk-sidebar-ui.cjs.entry.js +13 -2
  10. package/dist/collection/components/rtk-caption-toggle/rtk-caption-toggle.js +1 -1
  11. package/dist/collection/components/rtk-dialog-manager/rtk-dialog-manager.js +1 -1
  12. package/dist/collection/components/rtk-participant/rtk-participant.css +0 -2
  13. package/dist/collection/components/rtk-participant-tile/rtk-participant-tile.js +3 -3
  14. package/dist/collection/components/rtk-plugin-main/rtk-plugin-main.js +1 -1
  15. package/dist/collection/components/rtk-polls/rtk-polls.js +8 -5
  16. package/dist/collection/components/rtk-sidebar-ui/rtk-sidebar-ui.js +13 -2
  17. package/dist/components/{p-2a29bcee.js → p-13258097.js} +1 -1
  18. package/dist/components/{p-5cdf3eef.js → p-1c7de86c.js} +2 -2
  19. package/dist/components/{p-21c5daa6.js → p-2e5d41d6.js} +1 -1
  20. package/dist/components/{p-91da496e.js → p-3b34a317.js} +1 -1
  21. package/dist/components/{p-fe7d8bd5.js → p-47fbe920.js} +3 -3
  22. package/dist/components/{p-18be8fba.js → p-4e55295e.js} +3 -3
  23. package/dist/components/{p-3246ca48.js → p-535a38ec.js} +1 -1
  24. package/dist/components/{p-d77cddb6.js → p-53c730fe.js} +1 -1
  25. package/dist/components/{p-81f5a54c.js → p-5493aac4.js} +1 -1
  26. package/dist/components/{p-313d8bb6.js → p-555bbef5.js} +1 -1
  27. package/dist/components/{p-7f1a8e4a.js → p-590b8d1c.js} +1 -1
  28. package/dist/components/{p-336cf0db.js → p-5eb08127.js} +2 -2
  29. package/dist/components/{p-6651bbb0.js → p-63225105.js} +1 -1
  30. package/dist/components/{p-94cc1b33.js → p-769bb885.js} +38 -21
  31. package/dist/components/{p-a707312b.js → p-82bc50f1.js} +13 -2
  32. package/dist/components/{p-2b07a9ed.js → p-8935943a.js} +2 -2
  33. package/dist/components/{p-be9e62b4.js → p-914c0c0d.js} +2 -2
  34. package/dist/components/{p-d009f42a.js → p-a41a2311.js} +1 -1
  35. package/dist/components/{p-942b1cc7.js → p-a5750e39.js} +5 -5
  36. package/dist/components/{p-2817923a.js → p-a922eb37.js} +1 -1
  37. package/dist/components/{p-90efc7c2.js → p-ab3007bd.js} +1 -1
  38. package/dist/components/{p-3e5293ce.js → p-af8be74e.js} +1 -1
  39. package/dist/components/{p-600ba2e1.js → p-b8845b46.js} +1 -1
  40. package/dist/components/{p-3408773e.js → p-daaafd7a.js} +10 -7
  41. package/dist/components/{p-26f082a7.js → p-e5ef089b.js} +1 -1
  42. package/dist/components/{p-26d02e75.js → p-e6cd5276.js} +16 -16
  43. package/dist/components/{p-b54f0841.js → p-ec54a0c7.js} +1 -1
  44. package/dist/components/{p-b788bae4.js → p-ee929898.js} +3 -3
  45. package/dist/components/{p-2d62c12d.js → p-f504adce.js} +4 -4
  46. package/dist/components/{p-895216f5.js → p-fb836f65.js} +1 -1
  47. package/dist/components/rtk-breakout-room-manager.js +1 -1
  48. package/dist/components/rtk-breakout-room-participants.js +1 -1
  49. package/dist/components/rtk-breakout-rooms-manager.js +1 -1
  50. package/dist/components/rtk-camera-toggle.js +1 -1
  51. package/dist/components/rtk-caption-toggle.js +1 -1
  52. package/dist/components/rtk-channel-header.js +1 -1
  53. package/dist/components/rtk-chat-composer-ui.js +1 -1
  54. package/dist/components/rtk-chat-composer-view.js +1 -1
  55. package/dist/components/rtk-chat-message.js +1 -1
  56. package/dist/components/rtk-chat-messages-ui-paginated.js +1 -1
  57. package/dist/components/rtk-chat-messages-ui.js +1 -1
  58. package/dist/components/rtk-chat-search-results.js +1 -1
  59. package/dist/components/rtk-chat.js +1 -1
  60. package/dist/components/rtk-dialog-manager.js +1 -1
  61. package/dist/components/rtk-draft-attachment-view.js +1 -1
  62. package/dist/components/rtk-emoji-picker-button.js +1 -1
  63. package/dist/components/rtk-file-picker-button.js +1 -1
  64. package/dist/components/rtk-grid-pagination.js +1 -1
  65. package/dist/components/rtk-meeting-title.js +1 -1
  66. package/dist/components/rtk-meeting.js +17 -17
  67. package/dist/components/rtk-menu.js +1 -1
  68. package/dist/components/rtk-message-view.js +1 -1
  69. package/dist/components/rtk-mic-toggle.js +1 -1
  70. package/dist/components/rtk-mixed-grid.js +4 -4
  71. package/dist/components/rtk-mute-all-button.js +1 -1
  72. package/dist/components/rtk-participant-tile.js +1 -1
  73. package/dist/components/rtk-participant.js +1 -1
  74. package/dist/components/rtk-participants-stage-queue.js +1 -1
  75. package/dist/components/rtk-participants-viewer-list.js +1 -1
  76. package/dist/components/rtk-participants-waiting-list.js +1 -1
  77. package/dist/components/rtk-participants.js +6 -6
  78. package/dist/components/rtk-plugin-main.js +1 -1
  79. package/dist/components/rtk-poll.js +1 -1
  80. package/dist/components/rtk-polls.js +1 -1
  81. package/dist/components/rtk-screen-share-toggle.js +1 -1
  82. package/dist/components/rtk-screenshare-view.js +1 -1
  83. package/dist/components/rtk-settings-video.js +1 -1
  84. package/dist/components/rtk-settings.js +2 -2
  85. package/dist/components/rtk-sidebar-ui.js +1 -1
  86. package/dist/components/rtk-sidebar.js +4 -4
  87. package/dist/components/rtk-spotlight-indicator.js +1 -1
  88. package/dist/components/rtk-stage-toggle.js +1 -1
  89. package/dist/components/rtk-tab-bar.js +1 -1
  90. package/dist/components/rtk-tooltip.js +1 -1
  91. package/dist/docs/docs-components.json +1 -1
  92. package/dist/esm/{floating-ui.dom.esm-a2dc8eef.js → floating-ui.dom.esm-21c3d54e.js} +38 -21
  93. package/dist/esm/loader.js +54 -23
  94. package/dist/esm/rtk-avatar_54.entry.js +2 -2
  95. package/dist/esm/rtk-camera-selector_2.entry.js +3 -3
  96. package/dist/esm/rtk-caption-toggle.entry.js +1 -1
  97. package/dist/esm/rtk-participant_2.entry.js +2 -2
  98. package/dist/esm/rtk-plugin-main_2.entry.js +1 -1
  99. package/dist/esm/rtk-plugins_2.entry.js +8 -5
  100. package/dist/esm/rtk-sidebar-ui.entry.js +13 -2
  101. package/dist/realtimekit-ui/{p-6271e03b.entry.js → p-1b626699.entry.js} +1 -1
  102. package/dist/realtimekit-ui/p-4d40567d.entry.js +1 -0
  103. package/dist/realtimekit-ui/p-769bb885.js +1 -0
  104. package/dist/realtimekit-ui/p-7839a177.entry.js +1 -0
  105. package/dist/realtimekit-ui/{p-8571130f.entry.js → p-822bf597.entry.js} +1 -1
  106. package/dist/realtimekit-ui/{p-9942a0f1.entry.js → p-82832d02.entry.js} +1 -1
  107. package/dist/realtimekit-ui/p-973b53de.entry.js +1 -0
  108. package/dist/realtimekit-ui/p-9aca7171.entry.js +1 -0
  109. package/dist/realtimekit-ui/realtimekit-ui.esm.js +1 -1
  110. package/package.json +2 -2
  111. package/dist/realtimekit-ui/p-3b5af363.entry.js +0 -1
  112. package/dist/realtimekit-ui/p-783ab8d8.entry.js +0 -1
  113. package/dist/realtimekit-ui/p-801a5918.entry.js +0 -1
  114. package/dist/realtimekit-ui/p-94cc1b33.js +0 -1
  115. package/dist/realtimekit-ui/p-fb948fd1.entry.js +0 -1
@@ -607,7 +607,7 @@ const flip$1 = function (options) {
607
607
  if (!ignoreCrossAxisOverflow ||
608
608
  // We leave the current main axis only if every placement on that axis
609
609
  // overflows the main axis.
610
- overflowsData.every(d => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {
610
+ overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
611
611
  // Try next placement and re-run the lifecycle.
612
612
  return {
613
613
  data: {
@@ -1231,7 +1231,7 @@ function isOverflowElement(element) {
1231
1231
  overflowX,
1232
1232
  overflowY,
1233
1233
  display
1234
- } = getComputedStyle(element);
1234
+ } = getComputedStyle$1(element);
1235
1235
  return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
1236
1236
  }
1237
1237
  const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
@@ -1253,7 +1253,7 @@ const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspect
1253
1253
  const containValues = ['paint', 'layout', 'strict', 'content'];
1254
1254
  function isContainingBlock(elementOrCss) {
1255
1255
  const webkit = isWebKit();
1256
- const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
1256
+ const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
1257
1257
 
1258
1258
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1259
1259
  // https://drafts.csswg.org/css-transforms-2/#individual-transforms
@@ -1279,7 +1279,7 @@ const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#documen
1279
1279
  function isLastTraversableNode(node) {
1280
1280
  return lastTraversableNodeNames.has(getNodeName(node));
1281
1281
  }
1282
- function getComputedStyle(element) {
1282
+ function getComputedStyle$1(element) {
1283
1283
  return getWindow(element).getComputedStyle(element);
1284
1284
  }
1285
1285
  function getNodeScroll(element) {
@@ -1341,7 +1341,7 @@ function getFrameElement(win) {
1341
1341
  }
1342
1342
 
1343
1343
  function getCssDimensions(element) {
1344
- const css = getComputedStyle(element);
1344
+ const css = getComputedStyle$1(element);
1345
1345
  // In testing environments, the `width` and `height` properties are empty
1346
1346
  // strings for SVG elements, returning NaN. Fallback to `0` in this case.
1347
1347
  let width = parseFloat(css.width) || 0;
@@ -1446,7 +1446,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
1446
1446
  while (currentIFrame && offsetParent && offsetWin !== currentWin) {
1447
1447
  const iframeScale = getScale(currentIFrame);
1448
1448
  const iframeRect = currentIFrame.getBoundingClientRect();
1449
- const css = getComputedStyle(currentIFrame);
1449
+ const css = getComputedStyle$1(currentIFrame);
1450
1450
  const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
1451
1451
  const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
1452
1452
  x *= iframeScale.x;
@@ -1477,14 +1477,9 @@ function getWindowScrollBarX(element, rect) {
1477
1477
  return rect.left + leftScroll;
1478
1478
  }
1479
1479
 
1480
- function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
1481
- if (ignoreScrollbarX === void 0) {
1482
- ignoreScrollbarX = false;
1483
- }
1480
+ function getHTMLOffset(documentElement, scroll) {
1484
1481
  const htmlRect = documentElement.getBoundingClientRect();
1485
- const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
1486
- // RTL <body> scrollbar.
1487
- getWindowScrollBarX(documentElement, htmlRect));
1482
+ const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
1488
1483
  const y = htmlRect.top + scroll.scrollTop;
1489
1484
  return {
1490
1485
  x,
@@ -1523,7 +1518,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1523
1518
  offsets.y = offsetRect.y + offsetParent.clientTop;
1524
1519
  }
1525
1520
  }
1526
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
1521
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1527
1522
  return {
1528
1523
  width: rect.width * scale.x,
1529
1524
  height: rect.height * scale.y,
@@ -1546,7 +1541,7 @@ function getDocumentRect(element) {
1546
1541
  const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
1547
1542
  let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1548
1543
  const y = -scroll.scrollTop;
1549
- if (getComputedStyle(body).direction === 'rtl') {
1544
+ if (getComputedStyle$1(body).direction === 'rtl') {
1550
1545
  x += max(html.clientWidth, body.clientWidth) - width;
1551
1546
  }
1552
1547
  return {
@@ -1557,6 +1552,10 @@ function getDocumentRect(element) {
1557
1552
  };
1558
1553
  }
1559
1554
 
1555
+ // Safety check: ensure the scrollbar space is reasonable in case this
1556
+ // calculation is affected by unusual styles.
1557
+ // Most scrollbars leave 15-18px of space.
1558
+ const SCROLLBAR_MAX = 25;
1560
1559
  function getViewportRect(element, strategy) {
1561
1560
  const win = getWindow(element);
1562
1561
  const html = getDocumentElement(element);
@@ -1574,6 +1573,24 @@ function getViewportRect(element, strategy) {
1574
1573
  y = visualViewport.offsetTop;
1575
1574
  }
1576
1575
  }
1576
+ const windowScrollbarX = getWindowScrollBarX(html);
1577
+ // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
1578
+ // visual width of the <html> but this is not considered in the size
1579
+ // of `html.clientWidth`.
1580
+ if (windowScrollbarX <= 0) {
1581
+ const doc = html.ownerDocument;
1582
+ const body = doc.body;
1583
+ const bodyStyles = getComputedStyle(body);
1584
+ const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
1585
+ const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
1586
+ if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
1587
+ width -= clippingStableScrollbarWidth;
1588
+ }
1589
+ } else if (windowScrollbarX <= SCROLLBAR_MAX) {
1590
+ // If the <body> scrollbar is on the left, the width needs to be extended
1591
+ // by the scrollbar amount so there isn't extra space on the right.
1592
+ width += windowScrollbarX;
1593
+ }
1577
1594
  return {
1578
1595
  width,
1579
1596
  height,
@@ -1624,7 +1641,7 @@ function hasFixedPositionAncestor(element, stopNode) {
1624
1641
  if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
1625
1642
  return false;
1626
1643
  }
1627
- return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
1644
+ return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
1628
1645
  }
1629
1646
 
1630
1647
  // A "clipping ancestor" is an `overflow` element with the characteristic of
@@ -1637,12 +1654,12 @@ function getClippingElementAncestors(element, cache) {
1637
1654
  }
1638
1655
  let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
1639
1656
  let currentContainingBlockComputedStyle = null;
1640
- const elementIsFixed = getComputedStyle(element).position === 'fixed';
1657
+ const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
1641
1658
  let currentNode = elementIsFixed ? getParentNode(element) : element;
1642
1659
 
1643
1660
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1644
1661
  while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1645
- const computedStyle = getComputedStyle(currentNode);
1662
+ const computedStyle = getComputedStyle$1(currentNode);
1646
1663
  const currentNodeIsContaining = isContainingBlock(currentNode);
1647
1664
  if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
1648
1665
  currentContainingBlockComputedStyle = null;
@@ -1743,11 +1760,11 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1743
1760
  }
1744
1761
 
1745
1762
  function isStaticPositioned(element) {
1746
- return getComputedStyle(element).position === 'static';
1763
+ return getComputedStyle$1(element).position === 'static';
1747
1764
  }
1748
1765
 
1749
1766
  function getTrueOffsetParent(element, polyfill) {
1750
- if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
1767
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
1751
1768
  return null;
1752
1769
  }
1753
1770
  if (polyfill) {
@@ -1808,7 +1825,7 @@ const getElementRects = async function (data) {
1808
1825
  };
1809
1826
 
1810
1827
  function isRTL(element) {
1811
- return getComputedStyle(element).direction === 'rtl';
1828
+ return getComputedStyle$1(element).direction === 'rtl';
1812
1829
  }
1813
1830
 
1814
1831
  const platform = {
@@ -9557,7 +9557,7 @@ const flip$1 = function (options) {
9557
9557
  if (!ignoreCrossAxisOverflow ||
9558
9558
  // We leave the current main axis only if every placement on that axis
9559
9559
  // overflows the main axis.
9560
- overflowsData.every(d => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {
9560
+ overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
9561
9561
  // Try next placement and re-run the lifecycle.
9562
9562
  return {
9563
9563
  data: {
@@ -10141,14 +10141,9 @@ function getWindowScrollBarX(element, rect) {
10141
10141
  return rect.left + leftScroll;
10142
10142
  }
10143
10143
 
10144
- function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
10145
- if (ignoreScrollbarX === void 0) {
10146
- ignoreScrollbarX = false;
10147
- }
10144
+ function getHTMLOffset(documentElement, scroll) {
10148
10145
  const htmlRect = documentElement.getBoundingClientRect();
10149
- const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
10150
- // RTL <body> scrollbar.
10151
- getWindowScrollBarX(documentElement, htmlRect));
10146
+ const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
10152
10147
  const y = htmlRect.top + scroll.scrollTop;
10153
10148
  return {
10154
10149
  x,
@@ -10187,7 +10182,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
10187
10182
  offsets.y = offsetRect.y + offsetParent.clientTop;
10188
10183
  }
10189
10184
  }
10190
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
10185
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
10191
10186
  return {
10192
10187
  width: rect.width * scale.x,
10193
10188
  height: rect.height * scale.y,
@@ -10221,6 +10216,10 @@ function getDocumentRect(element) {
10221
10216
  };
10222
10217
  }
10223
10218
 
10219
+ // Safety check: ensure the scrollbar space is reasonable in case this
10220
+ // calculation is affected by unusual styles.
10221
+ // Most scrollbars leave 15-18px of space.
10222
+ const SCROLLBAR_MAX = 25;
10224
10223
  function getViewportRect(element, strategy) {
10225
10224
  const win = getWindow(element);
10226
10225
  const html = getDocumentElement(element);
@@ -10238,6 +10237,24 @@ function getViewportRect(element, strategy) {
10238
10237
  y = visualViewport.offsetTop;
10239
10238
  }
10240
10239
  }
10240
+ const windowScrollbarX = getWindowScrollBarX(html);
10241
+ // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
10242
+ // visual width of the <html> but this is not considered in the size
10243
+ // of `html.clientWidth`.
10244
+ if (windowScrollbarX <= 0) {
10245
+ const doc = html.ownerDocument;
10246
+ const body = doc.body;
10247
+ const bodyStyles = getComputedStyle(body);
10248
+ const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
10249
+ const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
10250
+ if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
10251
+ width -= clippingStableScrollbarWidth;
10252
+ }
10253
+ } else if (windowScrollbarX <= SCROLLBAR_MAX) {
10254
+ // If the <body> scrollbar is on the left, the width needs to be extended
10255
+ // by the scrollbar amount so there isn't extra space on the right.
10256
+ width += windowScrollbarX;
10257
+ }
10241
10258
  return {
10242
10259
  width,
10243
10260
  height,
@@ -14117,7 +14134,7 @@ const RtkDialogManager = class {
14117
14134
  (_a = this.meeting.stage) === null || _a === void 0 ? void 0 : _a.removeListener('stageStatusUpdate', this.stageStatusUpdateListener);
14118
14135
  }
14119
14136
  meetingChanged(meeting) {
14120
- if (meeting == undefined)
14137
+ if (!meeting)
14121
14138
  return;
14122
14139
  const { stage } = meeting;
14123
14140
  stage === null || stage === void 0 ? void 0 : stage.addListener('stageStatusUpdate', this.stageStatusUpdateListener);
@@ -17986,7 +18003,7 @@ const RtkCaptionToggle = class {
17986
18003
  this.meetingChanged(this.meeting);
17987
18004
  }
17988
18005
  meetingChanged(meeting) {
17989
- if (meeting === null)
18006
+ if (!meeting)
17990
18007
  return;
17991
18008
  this.permissionsUpdateListener();
17992
18009
  this.meeting.self.permissions.addListener('permissionsUpdate', this.permissionsUpdateListener);
@@ -61396,7 +61413,7 @@ const RtkPluginMain = class {
61396
61413
  this.pluginChanged(this.plugin);
61397
61414
  }
61398
61415
  meetingChanged(meeting) {
61399
- if (meeting == undefined)
61416
+ if (!meeting)
61400
61417
  return;
61401
61418
  const enabled = this.canInteractWithPlugin();
61402
61419
  this.viewModeEnabled = !enabled;
@@ -61626,6 +61643,8 @@ const RtkPolls$1 = class RtkPolls {
61626
61643
  this.t = useLanguage();
61627
61644
  /** Create State */
61628
61645
  this.create = false;
61646
+ /** Polls */
61647
+ this.polls = [];
61629
61648
  this.onPollsUpdate = (data) => {
61630
61649
  this.polls = [...data.polls];
61631
61650
  };
@@ -61644,9 +61663,9 @@ const RtkPolls$1 = class RtkPolls {
61644
61663
  this.meeting.self.permissions.removeListener('pollsUpdate', this.onUpdatePermissions);
61645
61664
  }
61646
61665
  meetingChanged(meeting) {
61647
- if (meeting == undefined)
61666
+ if (!meeting)
61648
61667
  return;
61649
- if (meeting && !meeting.polls)
61668
+ if (!meeting.polls)
61650
61669
  return;
61651
61670
  this.permissions = this.meeting.self.permissions;
61652
61671
  this.polls = [...meeting.polls.items];
@@ -61667,14 +61686,15 @@ const RtkPolls$1 = class RtkPolls {
61667
61686
  smoothScrollToBottom(this.pollEl);
61668
61687
  }
61669
61688
  render() {
61670
- return (h(Host, { key: '32f9a66439b84ad236368f1aa09c2aaa2dad71c0' }, h("div", { key: '0703028114fffd45a29dc4b952588356039f105d', class: "ctr", part: "container" }, h("div", { key: '45aecbd2b846b297add5b267b9798e69da1a1028', class: "polls-view scrollbar", ref: (el) => (this.pollEl = el), part: "polls" }, this.polls.length == 0 && this.create !== true && (h("div", { key: 'c2d3dbf8e58715dd67043fad64b2859a1674754d', class: "empty-polls" }, this.t('polls.empty'))), this.polls.map((item) => {
61689
+ var _a, _b;
61690
+ return (h(Host, { key: 'f259b6fa652fe2e81c18d3a0fb85a15d0c091de3' }, h("div", { key: '6cc127127307bcb1a5482a260fe7ccaf65bb1e3d', class: "ctr", part: "container" }, h("div", { key: 'ef9df557e4a5fb99ea2ce66172b7a889410daeea', class: "polls-view scrollbar", ref: (el) => (this.pollEl = el), part: "polls" }, this.polls.length == 0 && this.create !== true && (h("div", { key: '0eb92f8f60ab00fb849b2d656a9d8bafb26195de', class: "empty-polls" }, this.t('polls.empty'))), this.polls.map((item) => {
61671
61691
  var _a;
61672
61692
  return (h("rtk-poll", { key: item.id, poll: item, onRtkVotePoll: (e) => {
61673
61693
  this.onVote(e.detail.id, e.detail.index);
61674
61694
  }, self: (_a = this.meeting) === null || _a === void 0 ? void 0 : _a.self.userId, iconPack: this.iconPack, t: this.t, permissions: this.permissions }));
61675
- }), this.create && (h("rtk-poll-form", { key: '6ac47131bb1c34b5f00771183c5738759093133b', part: "poll-form", onRtkCreatePoll: (e) => {
61695
+ }), this.create && (h("rtk-poll-form", { key: '71fc9e183684f5cafee5f0885af3d679d099a8ec', part: "poll-form", onRtkCreatePoll: (e) => {
61676
61696
  this.onCreate(e.detail);
61677
- }, iconPack: this.iconPack, t: this.t }))), this.permissions.polls.canCreate && (h("rtk-button", { key: '1e8ec7c85707c1f0db18b89c069190cc43963b11', kind: "wide", onClick: () => this.toggleCreateState(), variant: this.create ? 'secondary' : 'primary', part: "button" }, this.create ? this.t('polls.cancel') : this.t('polls.create'))))));
61697
+ }, iconPack: this.iconPack, t: this.t }))), ((_b = (_a = this.permissions) === null || _a === void 0 ? void 0 : _a.polls) === null || _b === void 0 ? void 0 : _b.canCreate) && (h("rtk-button", { key: '0639577353327ded0d1e7db08cbaadac47ec296c', kind: "wide", onClick: () => this.toggleCreateState(), variant: this.create ? 'secondary' : 'primary', part: "button" }, this.create ? this.t('polls.cancel') : this.t('polls.create'))))));
61678
61698
  }
61679
61699
  static get watchers() { return {
61680
61700
  "meeting": ["meetingChanged"]
@@ -62459,7 +62479,7 @@ var rtkFullscreenToggle_entry = /*#__PURE__*/Object.freeze({
62459
62479
  rtk_fullscreen_toggle: RtkFullscreenToggle
62460
62480
  });
62461
62481
 
62462
- const rtkParticipantCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:flex;height:var(--rtk-space-14, 56px);align-items:center;justify-content:space-between;cursor:pointer;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}:host rtk-avatar{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);font-size:14px}.left{display:flex;align-items:center}.left>*{margin-right:var(--rtk-space-2, 8px)}.left>*:last-child{margin-right:var(--rtk-space-0, 0px)}.right{display:flex;align-items:center;justify-content:flex-end}.right>*{margin-left:var(--rtk-space-2, 8px)}.right>*:first-child{margin-left:var(--rtk-space-0, 0px)}.name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}rtk-icon{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}rtk-icon.red{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}rtk-icon.more{cursor:pointer}.menu{position:relative;display:inline-block;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}#menu-list{position:absolute;top:var(--rtk-space-8, 32px) !important;right:var(--rtk-space-4, 16px) !important;z-index:20}";
62482
+ const rtkParticipantCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:flex;height:var(--rtk-space-14, 56px);align-items:center;justify-content:space-between;cursor:pointer;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}:host rtk-avatar{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);font-size:14px}.left{display:flex;align-items:center}.left>*{margin-right:var(--rtk-space-2, 8px)}.left>*:last-child{margin-right:var(--rtk-space-0, 0px)}.right{display:flex;align-items:center;justify-content:flex-end}.right>*{margin-left:var(--rtk-space-2, 8px)}.right>*:first-child{margin-left:var(--rtk-space-0, 0px)}.name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}rtk-icon{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}rtk-icon.red{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}rtk-icon.more{cursor:pointer}.menu{position:relative;display:inline-block;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}#menu-list{position:absolute;z-index:20}";
62463
62483
  const RtkParticipantStyle0 = rtkParticipantCss;
62464
62484
 
62465
62485
  var __decorate$5 = function (decorators, target, key, desc) {
@@ -63056,14 +63076,14 @@ const RtkParticipantTile = class {
63056
63076
  this.tileUnload.emit(this.participant);
63057
63077
  }
63058
63078
  meetingChanged(meeting) {
63059
- if (meeting == undefined)
63079
+ if (!meeting)
63060
63080
  return;
63061
63081
  this.participantsChanged(this.participant);
63062
63082
  }
63063
63083
  participantsChanged(participant) {
63064
- if (participant == undefined)
63084
+ if (!participant)
63065
63085
  return;
63066
- if (this.meeting === undefined) {
63086
+ if (!this.meeting) {
63067
63087
  if (this.isPreview) {
63068
63088
  this.videoEl && this.participant.registerVideoElement(this.videoEl, this.isPreview);
63069
63089
  }
@@ -63317,7 +63337,18 @@ const RtkSidebarUi = class {
63317
63337
  /** Language */
63318
63338
  this.t = useLanguage();
63319
63339
  this.onClose = () => {
63340
+ var _a;
63320
63341
  this.sidebarClose.emit();
63342
+ /**
63343
+ * NOTE(ravindra-cloudflare):
63344
+ * If the sidebar was opened from a RealtimeKit component, apply a blur (remove focus/active class).
63345
+ * This helps remove the active border from RTK toggles, such as rtk-polls-toggle, rtk-chat-toggle, etc.
63346
+ */
63347
+ if (document.activeElement instanceof HTMLElement &&
63348
+ ((_a = document.activeElement.tagName) === null || _a === void 0 ? void 0 : _a.includes('RTK-')) &&
63349
+ document.activeElement.blur instanceof Function) {
63350
+ document.activeElement.blur();
63351
+ }
63321
63352
  };
63322
63353
  }
63323
63354
  componentDidLoad() {
@@ -63340,11 +63371,11 @@ const RtkSidebarUi = class {
63340
63371
  render() {
63341
63372
  const isFullScreen = this.view === 'full-screen';
63342
63373
  const activeTab = this.tabs.find((tab) => tab.id === this.currentTab);
63343
- return (h(Host, { key: '4afc881e8aeb5f51014817e1287aed7700bb56fb', ref: (el) => (this.hostEl = el), class: this.view }, !this.hideCloseAction && (h("rtk-button", { key: 'e95b2c25d32535630e0ccf30b46f067395c41a7f', ref: (el) => (this.closeButton = el), variant: "ghost", kind: "icon", class: "close", onClick: this.onClose, "aria-label": this.t('close') }, h("rtk-icon", { key: '0d6398171fbebd8d9b0895fc2e9f0b08e7980ab2', icon: this.iconPack.dismiss }))), activeTab && !this.hideHeader && (h("header", { key: 'e92a6c60fa280a36b4643873d48adca3210e3c51', class: "main-header" }, h("h3", { key: '8097b3e815c3005c7750c7076eb54242406034a9' }, activeTab.name), h("slot", { key: 'f91814a6fb62726790ae5c91111be0f6d1ea121c', name: "pinned-state" }))), isFullScreen && (h("header", { key: '5ec434bbc22ffa7acf8a76361e02718080c7a99d', class: "mobile-tabs" }, this.tabs.map((tab) => (h("button", { onClick: () => {
63374
+ return (h(Host, { key: 'bc9969254516bb334f0bbc6216432121d675a83e', ref: (el) => (this.hostEl = el), class: this.view }, !this.hideCloseAction && (h("rtk-button", { key: 'ce9dabf448e0914fa516c717825ee00ad476d412', ref: (el) => (this.closeButton = el), variant: "ghost", kind: "icon", class: "close", onClick: this.onClose, "aria-label": this.t('close') }, h("rtk-icon", { key: '5966e4c6a7bbdea25fa64e197c47fcded0625754', icon: this.iconPack.dismiss }))), activeTab && !this.hideHeader && (h("header", { key: '3b7109ba37e019a3da3a0aeb07b54fcf28e869b4', class: "main-header" }, h("h3", { key: 'c57a8719fe6dca4ed092fbb21733c0d0ac074dc3' }, activeTab.name), h("slot", { key: 'f95589b898e0b4a8001d45d5b4c833576fab4fd8', name: "pinned-state" }))), isFullScreen && (h("header", { key: '72cd52ea2a27caf4dc826d4222738325853281c8', class: "mobile-tabs" }, this.tabs.map((tab) => (h("button", { onClick: () => {
63344
63375
  this.tabChange.emit(tab.id);
63345
63376
  }, class: {
63346
63377
  active: this.currentTab === tab.id,
63347
- } }, tab.name))))), h("slot", { key: '77ee9da399e6991cc7bf3e0d979ffeec47e4b769', name: this.currentTab })));
63378
+ } }, tab.name))))), h("slot", { key: '266ec59a2d04803b2d035f7929394e66e92aa542', name: this.currentTab })));
63348
63379
  }
63349
63380
  static get watchers() { return {
63350
63381
  "currentTab": ["handleFocusCloseButton"]
@@ -11,7 +11,7 @@ import { g as getExtension, a as getFileSize, d as downloadFile } from './file-1
11
11
  import { p as provideRtkDesignSystem, d as deepMerge } from './merge-5ff8860a.js';
12
12
  import { g as generateConfig, R as RTKNotificationsAudio } from './notification-ae21c8fc.js';
13
13
  import { i as index } from './ResizeObserver.es-02979d4e.js';
14
- import { c as computePosition, o as offset, f as flip, s as shift, a as arrow } from './floating-ui.dom.esm-a2dc8eef.js';
14
+ import { c as computePosition, o as offset, f as flip, s as shift, a as arrow } from './floating-ui.dom.esm-21c3d54e.js';
15
15
  import { T as TextMessageView } from './TextMessage-1a4c6c6c.js';
16
16
 
17
17
  const rtkAvatarCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;height:var(--rtk-space-32, 128px);width:var(--rtk-space-32, 128px);align-items:center;justify-content:center;font-size:28px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));overflow:clip;border-radius:9999px;-webkit-user-select:none;-moz-user-select:none;user-select:none}rtk-icon{height:50%;width:50%}.image-ctr{display:flex;height:100%;width:100%;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}img{height:var(--rtk-space-0, 0px);width:var(--rtk-space-0, 0px);-o-object-fit:cover;object-fit:cover}img.loaded{height:100%;width:100%}.initials{display:flex;height:100%;width:100%;align-items:center;justify-content:center;text-transform:uppercase}.image{display:flex;height:100%;width:100%;align-items:center;justify-content:center}.image img{display:none;height:100%;width:100%;-o-object-fit:cover;object-fit:cover}.image img.loaded{display:block}:host([variant='hexagon']){border-radius:var(--rtk-border-radius-none, 0);clip-path:polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%)}:host([variant='square']){border-radius:var(--rtk-border-radius-none, 0);clip-path:polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)}:host([size='sm']){height:var(--rtk-space-14, 56px);width:var(--rtk-space-14, 56px);font-size:12px}:host([size='md']){height:var(--rtk-space-28, 112px);width:var(--rtk-space-28, 112px)}:host([size='lg']){height:var(--rtk-space-32, 128px);width:var(--rtk-space-32, 128px)}";
@@ -3529,7 +3529,7 @@ const RtkDialogManager = class {
3529
3529
  (_a = this.meeting.stage) === null || _a === void 0 ? void 0 : _a.removeListener('stageStatusUpdate', this.stageStatusUpdateListener);
3530
3530
  }
3531
3531
  meetingChanged(meeting) {
3532
- if (meeting == undefined)
3532
+ if (!meeting)
3533
3533
  return;
3534
3534
  const { stage } = meeting;
3535
3535
  stage === null || stage === void 0 ? void 0 : stage.addListener('stageStatusUpdate', this.stageStatusUpdateListener);
@@ -187,14 +187,14 @@ const RtkParticipantTile = class {
187
187
  this.tileUnload.emit(this.participant);
188
188
  }
189
189
  meetingChanged(meeting) {
190
- if (meeting == undefined)
190
+ if (!meeting)
191
191
  return;
192
192
  this.participantsChanged(this.participant);
193
193
  }
194
194
  participantsChanged(participant) {
195
- if (participant == undefined)
195
+ if (!participant)
196
196
  return;
197
- if (this.meeting === undefined) {
197
+ if (!this.meeting) {
198
198
  if (this.isPreview) {
199
199
  this.videoEl && this.participant.registerVideoElement(this.videoEl, this.isPreview);
200
200
  }
@@ -38,7 +38,7 @@ const RtkCaptionToggle = class {
38
38
  this.meetingChanged(this.meeting);
39
39
  }
40
40
  meetingChanged(meeting) {
41
- if (meeting === null)
41
+ if (!meeting)
42
42
  return;
43
43
  this.permissionsUpdateListener();
44
44
  this.meeting.self.permissions.addListener('permissionsUpdate', this.permissionsUpdateListener);
@@ -2,11 +2,11 @@ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement
2
2
  import { e as defaultIconPack, h as useLanguage, c as createDefaultConfig, L as FlagsmithFeatureFlags } from './ui-store-0098d5c6.js';
3
3
  import { l as lenChildren, R as Render } from './index-d31a2e33.js';
4
4
  import { f as formatName, s as shorten } from './string-ed1380fb.js';
5
- import { c as computePosition, b as autoPlacement, o as offset, s as shift, h as hide } from './floating-ui.dom.esm-a2dc8eef.js';
5
+ import { c as computePosition, b as autoPlacement, o as offset, s as shift, h as hide } from './floating-ui.dom.esm-21c3d54e.js';
6
6
  import { S as SyncWithStore } from './index-914449da.js';
7
7
  import { d as debounce } from './debounce-3ef43cb6.js';
8
8
 
9
- const rtkParticipantCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:flex;height:var(--rtk-space-14, 56px);align-items:center;justify-content:space-between;cursor:pointer;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}:host rtk-avatar{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);font-size:14px}.left{display:flex;align-items:center}.left>*{margin-right:var(--rtk-space-2, 8px)}.left>*:last-child{margin-right:var(--rtk-space-0, 0px)}.right{display:flex;align-items:center;justify-content:flex-end}.right>*{margin-left:var(--rtk-space-2, 8px)}.right>*:first-child{margin-left:var(--rtk-space-0, 0px)}.name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}rtk-icon{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}rtk-icon.red{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}rtk-icon.more{cursor:pointer}.menu{position:relative;display:inline-block;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}#menu-list{position:absolute;top:var(--rtk-space-8, 32px) !important;right:var(--rtk-space-4, 16px) !important;z-index:20}";
9
+ const rtkParticipantCss = ":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:flex;height:var(--rtk-space-14, 56px);align-items:center;justify-content:space-between;cursor:pointer;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}:host rtk-avatar{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);font-size:14px}.left{display:flex;align-items:center}.left>*{margin-right:var(--rtk-space-2, 8px)}.left>*:last-child{margin-right:var(--rtk-space-0, 0px)}.right{display:flex;align-items:center;justify-content:flex-end}.right>*{margin-left:var(--rtk-space-2, 8px)}.right>*:first-child{margin-left:var(--rtk-space-0, 0px)}.name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}rtk-icon{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}rtk-icon.red{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}rtk-icon.more{cursor:pointer}.menu{position:relative;display:inline-block;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}#menu-list{position:absolute;z-index:20}";
10
10
  const RtkParticipantStyle0 = rtkParticipantCss;
11
11
 
12
12
  var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -66,7 +66,7 @@ const RtkPluginMain = class {
66
66
  this.pluginChanged(this.plugin);
67
67
  }
68
68
  meetingChanged(meeting) {
69
- if (meeting == undefined)
69
+ if (!meeting)
70
70
  return;
71
71
  const enabled = this.canInteractWithPlugin();
72
72
  this.viewModeEnabled = !enabled;
@@ -105,6 +105,8 @@ const RtkPolls = class {
105
105
  this.t = useLanguage();
106
106
  /** Create State */
107
107
  this.create = false;
108
+ /** Polls */
109
+ this.polls = [];
108
110
  this.onPollsUpdate = (data) => {
109
111
  this.polls = [...data.polls];
110
112
  };
@@ -123,9 +125,9 @@ const RtkPolls = class {
123
125
  this.meeting.self.permissions.removeListener('pollsUpdate', this.onUpdatePermissions);
124
126
  }
125
127
  meetingChanged(meeting) {
126
- if (meeting == undefined)
128
+ if (!meeting)
127
129
  return;
128
- if (meeting && !meeting.polls)
130
+ if (!meeting.polls)
129
131
  return;
130
132
  this.permissions = this.meeting.self.permissions;
131
133
  this.polls = [...meeting.polls.items];
@@ -146,14 +148,15 @@ const RtkPolls = class {
146
148
  smoothScrollToBottom(this.pollEl);
147
149
  }
148
150
  render() {
149
- return (h(Host, { key: '32f9a66439b84ad236368f1aa09c2aaa2dad71c0' }, h("div", { key: '0703028114fffd45a29dc4b952588356039f105d', class: "ctr", part: "container" }, h("div", { key: '45aecbd2b846b297add5b267b9798e69da1a1028', class: "polls-view scrollbar", ref: (el) => (this.pollEl = el), part: "polls" }, this.polls.length == 0 && this.create !== true && (h("div", { key: 'c2d3dbf8e58715dd67043fad64b2859a1674754d', class: "empty-polls" }, this.t('polls.empty'))), this.polls.map((item) => {
151
+ var _a, _b;
152
+ return (h(Host, { key: 'f259b6fa652fe2e81c18d3a0fb85a15d0c091de3' }, h("div", { key: '6cc127127307bcb1a5482a260fe7ccaf65bb1e3d', class: "ctr", part: "container" }, h("div", { key: 'ef9df557e4a5fb99ea2ce66172b7a889410daeea', class: "polls-view scrollbar", ref: (el) => (this.pollEl = el), part: "polls" }, this.polls.length == 0 && this.create !== true && (h("div", { key: '0eb92f8f60ab00fb849b2d656a9d8bafb26195de', class: "empty-polls" }, this.t('polls.empty'))), this.polls.map((item) => {
150
153
  var _a;
151
154
  return (h("rtk-poll", { key: item.id, poll: item, onRtkVotePoll: (e) => {
152
155
  this.onVote(e.detail.id, e.detail.index);
153
156
  }, self: (_a = this.meeting) === null || _a === void 0 ? void 0 : _a.self.userId, iconPack: this.iconPack, t: this.t, permissions: this.permissions }));
154
- }), this.create && (h("rtk-poll-form", { key: '6ac47131bb1c34b5f00771183c5738759093133b', part: "poll-form", onRtkCreatePoll: (e) => {
157
+ }), this.create && (h("rtk-poll-form", { key: '71fc9e183684f5cafee5f0885af3d679d099a8ec', part: "poll-form", onRtkCreatePoll: (e) => {
155
158
  this.onCreate(e.detail);
156
- }, iconPack: this.iconPack, t: this.t }))), this.permissions.polls.canCreate && (h("rtk-button", { key: '1e8ec7c85707c1f0db18b89c069190cc43963b11', kind: "wide", onClick: () => this.toggleCreateState(), variant: this.create ? 'secondary' : 'primary', part: "button" }, this.create ? this.t('polls.cancel') : this.t('polls.create'))))));
159
+ }, iconPack: this.iconPack, t: this.t }))), ((_b = (_a = this.permissions) === null || _a === void 0 ? void 0 : _a.polls) === null || _b === void 0 ? void 0 : _b.canCreate) && (h("rtk-button", { key: '0639577353327ded0d1e7db08cbaadac47ec296c', kind: "wide", onClick: () => this.toggleCreateState(), variant: this.create ? 'secondary' : 'primary', part: "button" }, this.create ? this.t('polls.cancel') : this.t('polls.create'))))));
157
160
  }
158
161
  static get watchers() { return {
159
162
  "meeting": ["meetingChanged"]
@@ -35,7 +35,18 @@ const RtkSidebarUi = class {
35
35
  /** Language */
36
36
  this.t = useLanguage();
37
37
  this.onClose = () => {
38
+ var _a;
38
39
  this.sidebarClose.emit();
40
+ /**
41
+ * NOTE(ravindra-cloudflare):
42
+ * If the sidebar was opened from a RealtimeKit component, apply a blur (remove focus/active class).
43
+ * This helps remove the active border from RTK toggles, such as rtk-polls-toggle, rtk-chat-toggle, etc.
44
+ */
45
+ if (document.activeElement instanceof HTMLElement &&
46
+ ((_a = document.activeElement.tagName) === null || _a === void 0 ? void 0 : _a.includes('RTK-')) &&
47
+ document.activeElement.blur instanceof Function) {
48
+ document.activeElement.blur();
49
+ }
39
50
  };
40
51
  }
41
52
  componentDidLoad() {
@@ -58,11 +69,11 @@ const RtkSidebarUi = class {
58
69
  render() {
59
70
  const isFullScreen = this.view === 'full-screen';
60
71
  const activeTab = this.tabs.find((tab) => tab.id === this.currentTab);
61
- return (h(Host, { key: '4afc881e8aeb5f51014817e1287aed7700bb56fb', ref: (el) => (this.hostEl = el), class: this.view }, !this.hideCloseAction && (h("rtk-button", { key: 'e95b2c25d32535630e0ccf30b46f067395c41a7f', ref: (el) => (this.closeButton = el), variant: "ghost", kind: "icon", class: "close", onClick: this.onClose, "aria-label": this.t('close') }, h("rtk-icon", { key: '0d6398171fbebd8d9b0895fc2e9f0b08e7980ab2', icon: this.iconPack.dismiss }))), activeTab && !this.hideHeader && (h("header", { key: 'e92a6c60fa280a36b4643873d48adca3210e3c51', class: "main-header" }, h("h3", { key: '8097b3e815c3005c7750c7076eb54242406034a9' }, activeTab.name), h("slot", { key: 'f91814a6fb62726790ae5c91111be0f6d1ea121c', name: "pinned-state" }))), isFullScreen && (h("header", { key: '5ec434bbc22ffa7acf8a76361e02718080c7a99d', class: "mobile-tabs" }, this.tabs.map((tab) => (h("button", { onClick: () => {
72
+ return (h(Host, { key: 'bc9969254516bb334f0bbc6216432121d675a83e', ref: (el) => (this.hostEl = el), class: this.view }, !this.hideCloseAction && (h("rtk-button", { key: 'ce9dabf448e0914fa516c717825ee00ad476d412', ref: (el) => (this.closeButton = el), variant: "ghost", kind: "icon", class: "close", onClick: this.onClose, "aria-label": this.t('close') }, h("rtk-icon", { key: '5966e4c6a7bbdea25fa64e197c47fcded0625754', icon: this.iconPack.dismiss }))), activeTab && !this.hideHeader && (h("header", { key: '3b7109ba37e019a3da3a0aeb07b54fcf28e869b4', class: "main-header" }, h("h3", { key: 'c57a8719fe6dca4ed092fbb21733c0d0ac074dc3' }, activeTab.name), h("slot", { key: 'f95589b898e0b4a8001d45d5b4c833576fab4fd8', name: "pinned-state" }))), isFullScreen && (h("header", { key: '72cd52ea2a27caf4dc826d4222738325853281c8', class: "mobile-tabs" }, this.tabs.map((tab) => (h("button", { onClick: () => {
62
73
  this.tabChange.emit(tab.id);
63
74
  }, class: {
64
75
  active: this.currentTab === tab.id,
65
- } }, tab.name))))), h("slot", { key: '77ee9da399e6991cc7bf3e0d979ffeec47e4b769', name: this.currentTab })));
76
+ } }, tab.name))))), h("slot", { key: '266ec59a2d04803b2d035f7929394e66e92aa542', name: this.currentTab })));
66
77
  }
67
78
  static get watchers() { return {
68
79
  "currentTab": ["handleFocusCloseButton"]
@@ -1 +1 @@
1
- import{r as t,c as r,h as a,H as i}from"./p-0ee570cd.js";import{c as s,e,h as o}from"./p-3c9aa206.js";import{S as l}from"./p-e51bb952.js";import{s as n}from"./p-0752f2ba.js";var c=function(t,r,a,i){var s,e=arguments.length,o=e<3?r:null===i?i=Object.getOwnPropertyDescriptor(r,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,r,a,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(e<3?s(o):e>3?s(r,a,o):s(r,a))||o);return e>3&&o&&Object.defineProperty(r,a,o),o};const d=class{constructor(a){t(this,a),this.stateUpdate=r(this,"rtkStateUpdate",7),this.config=s(),this.iconPack=e,this.t=o(),this.plugins=[],this.canStartPlugins=!1,this.canClosePlugins=!1,this.activatedPluginsId=[],this.close=()=>{this.stateUpdate.emit({activeSidebar:!1,sidebar:void 0})}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t;null===(t=this.meeting)||void 0===t||t.plugins.all.removeListener("stateUpdate",this.updateActivePlugins)}meetingChanged(t){null!=t&&(this.canStartPlugins=t.self.permissions.plugins.canStart,this.canClosePlugins=t.self.permissions.plugins.canClose,this.plugins=t.plugins.all.toArray().filter((r=>{var a;return!(null===(a=t.self.config.disabledPlugins)||void 0===a?void 0:a.includes(r.id))})),this.updateActivePlugins=()=>{this.activatedPluginsId=t.plugins.active.toArray().map((t=>t.id))},this.updateActivePlugins(),t.plugins.all.addListener("stateUpdate",this.updateActivePlugins))}render(){return a(i,{key:"4df38ce202b9551b38746e549824ff800ffc9fc1"},a("ul",{key:"19ad38b73ff77459cfda3227a013c2e28823386f",class:"scrollbar"},this.plugins.map((t=>a("li",{key:t.name,class:"plugin"},a("div",{class:"metadata"},a("img",{src:t.picture}),a("div",{class:"name"},t.name)),!this.activatedPluginsId.includes(t.id)&&this.canStartPlugins&&a("div",{class:"buttons"},a("rtk-button",{kind:"icon",size:"lg",onClick:()=>{t.activate(),this.close()},"aria-label":`${this.t("activate")} ${t.name}`},a("rtk-icon",{icon:this.iconPack.rocket,tabIndex:-1,"aria-hidden":!0}))),this.activatedPluginsId.includes(t.id)&&this.canClosePlugins&&a("div",{class:"buttons"},a("rtk-button",{kind:"icon",size:"lg",onClick:()=>{t.deactivate()},"aria-label":`${this.t("close")} ${t.name}`},a("rtk-icon",{icon:this.iconPack.dismiss,tabIndex:-1,"aria-hidden":!0}))))))))}static get watchers(){return{meeting:["meetingChanged"]}}};c([l()],d.prototype,"meeting",void 0),c([l()],d.prototype,"config",void 0),c([l()],d.prototype,"iconPack",void 0),c([l()],d.prototype,"t",void 0),d.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px);display:flex;height:100%;width:100%;flex-direction:column;font-size:14px;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}h3{margin-left:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-0, 0px);margin-top:var(--rtk-space-4, 16px);margin-bottom:var(--rtk-space-4, 16px);display:block;padding:var(--rtk-space-0, 0px);font-size:16px;font-weight:400;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));text-align:center}ul{overflow-y:auto;padding:var(--rtk-space-0, 0px);flex-grow:1;flex-basis:0}.metadata{display:flex;align-items:center}.metadata img{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);border-radius:var(--rtk-border-radius-sm, 4px)}.metadata .name{margin-left:var(--rtk-space-2, 8px);font-weight:500}.plugin{display:flex;align-items:center;justify-content:space-between;padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px);padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px)}.plugin .buttons{display:flex;align-items:center}rtk-button:hover{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-opacity:1;--tw-ring-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-ring-opacity));--tw-ring-offset-width:2px;--tw-ring-offset-color:rgb(var(--rtk-colors-background-1000, 8 8 8))}";var p=function(t,r,a,i){var s,e=arguments.length,o=e<3?r:null===i?i=Object.getOwnPropertyDescriptor(r,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,r,a,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(e<3?s(o):e>3?s(r,a,o):s(r,a))||o);return e>3&&o&&Object.defineProperty(r,a,o),o};const h=class{constructor(r){t(this,r),this.config=s(),this.iconPack=e,this.t=o(),this.create=!1,this.onPollsUpdate=t=>{this.polls=[...t.polls]},this.onUpdatePermissions=()=>{this.permissions=this.meeting.self.permissions}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t;this.meeting&&(null===(t=this.meeting.polls)||void 0===t||t.removeListener("pollsUpdate",this.onPollsUpdate),this.meeting.self.permissions.removeListener("pollsUpdate",this.onUpdatePermissions))}meetingChanged(t){null!=t&&(t&&!t.polls||(this.permissions=this.meeting.self.permissions,this.polls=[...t.polls.items],t.polls.addListener("pollsUpdate",this.onPollsUpdate),this.meeting.self.permissions.addListener("pollsUpdate",this.onUpdatePermissions),this.onCreate=async r=>{this.create=!1,await t.polls.create(r.question,r.options,r.anonymous,r.hideVotes)},this.onVote=async(r,a)=>{await t.polls.vote(r,a)}))}toggleCreateState(){this.create=!this.create}componentDidRender(){n(this.pollEl)}render(){return a(i,{key:"32f9a66439b84ad236368f1aa09c2aaa2dad71c0"},a("div",{key:"0703028114fffd45a29dc4b952588356039f105d",class:"ctr",part:"container"},a("div",{key:"45aecbd2b846b297add5b267b9798e69da1a1028",class:"polls-view scrollbar",ref:t=>this.pollEl=t,part:"polls"},0==this.polls.length&&!0!==this.create&&a("div",{key:"c2d3dbf8e58715dd67043fad64b2859a1674754d",class:"empty-polls"},this.t("polls.empty")),this.polls.map((t=>{var r;return a("rtk-poll",{key:t.id,poll:t,onRtkVotePoll:t=>{this.onVote(t.detail.id,t.detail.index)},self:null===(r=this.meeting)||void 0===r?void 0:r.self.userId,iconPack:this.iconPack,t:this.t,permissions:this.permissions})})),this.create&&a("rtk-poll-form",{key:"6ac47131bb1c34b5f00771183c5738759093133b",part:"poll-form",onRtkCreatePoll:t=>{this.onCreate(t.detail)},iconPack:this.iconPack,t:this.t})),this.permissions.polls.canCreate&&a("rtk-button",{key:"1e8ec7c85707c1f0db18b89c069190cc43963b11",kind:"wide",onClick:()=>this.toggleCreateState(),variant:this.create?"secondary":"primary",part:"button"},this.t(this.create?"polls.cancel":"polls.create"))))}static get watchers(){return{meeting:["meetingChanged"]}}};p([l()],h.prototype,"meeting",void 0),p([l()],h.prototype,"config",void 0),p([l()],h.prototype,"iconPack",void 0),p([l()],h.prototype,"t",void 0),h.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{margin-top:var(--rtk-space-2, 8px);display:flex;height:100%;width:100%;flex-direction:column;font-size:14px}*{box-sizing:border-box}.ctr{box-sizing:border-box;padding:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-0, 0px);display:flex;flex:1 1 0%;flex-direction:column}.polls-view{overflow-y:auto;flex:1 1 0%;flex-basis:0}.empty-polls{display:flex;height:100%;width:100%;align-items:center;justify-content:center}";export{d as rtk_plugins,h as rtk_polls}
1
+ import{r as t,c as r,h as a,H as i}from"./p-0ee570cd.js";import{c as s,e,h as o}from"./p-3c9aa206.js";import{S as l}from"./p-e51bb952.js";import{s as n}from"./p-0752f2ba.js";var c=function(t,r,a,i){var s,e=arguments.length,o=e<3?r:null===i?i=Object.getOwnPropertyDescriptor(r,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,r,a,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(e<3?s(o):e>3?s(r,a,o):s(r,a))||o);return e>3&&o&&Object.defineProperty(r,a,o),o};const d=class{constructor(a){t(this,a),this.stateUpdate=r(this,"rtkStateUpdate",7),this.config=s(),this.iconPack=e,this.t=o(),this.plugins=[],this.canStartPlugins=!1,this.canClosePlugins=!1,this.activatedPluginsId=[],this.close=()=>{this.stateUpdate.emit({activeSidebar:!1,sidebar:void 0})}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t;null===(t=this.meeting)||void 0===t||t.plugins.all.removeListener("stateUpdate",this.updateActivePlugins)}meetingChanged(t){null!=t&&(this.canStartPlugins=t.self.permissions.plugins.canStart,this.canClosePlugins=t.self.permissions.plugins.canClose,this.plugins=t.plugins.all.toArray().filter((r=>{var a;return!(null===(a=t.self.config.disabledPlugins)||void 0===a?void 0:a.includes(r.id))})),this.updateActivePlugins=()=>{this.activatedPluginsId=t.plugins.active.toArray().map((t=>t.id))},this.updateActivePlugins(),t.plugins.all.addListener("stateUpdate",this.updateActivePlugins))}render(){return a(i,{key:"4df38ce202b9551b38746e549824ff800ffc9fc1"},a("ul",{key:"19ad38b73ff77459cfda3227a013c2e28823386f",class:"scrollbar"},this.plugins.map((t=>a("li",{key:t.name,class:"plugin"},a("div",{class:"metadata"},a("img",{src:t.picture}),a("div",{class:"name"},t.name)),!this.activatedPluginsId.includes(t.id)&&this.canStartPlugins&&a("div",{class:"buttons"},a("rtk-button",{kind:"icon",size:"lg",onClick:()=>{t.activate(),this.close()},"aria-label":`${this.t("activate")} ${t.name}`},a("rtk-icon",{icon:this.iconPack.rocket,tabIndex:-1,"aria-hidden":!0}))),this.activatedPluginsId.includes(t.id)&&this.canClosePlugins&&a("div",{class:"buttons"},a("rtk-button",{kind:"icon",size:"lg",onClick:()=>{t.deactivate()},"aria-label":`${this.t("close")} ${t.name}`},a("rtk-icon",{icon:this.iconPack.dismiss,tabIndex:-1,"aria-hidden":!0}))))))))}static get watchers(){return{meeting:["meetingChanged"]}}};c([l()],d.prototype,"meeting",void 0),c([l()],d.prototype,"config",void 0),c([l()],d.prototype,"iconPack",void 0),c([l()],d.prototype,"t",void 0),d.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px);display:flex;height:100%;width:100%;flex-direction:column;font-size:14px;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}h3{margin-left:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-0, 0px);margin-top:var(--rtk-space-4, 16px);margin-bottom:var(--rtk-space-4, 16px);display:block;padding:var(--rtk-space-0, 0px);font-size:16px;font-weight:400;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));text-align:center}ul{overflow-y:auto;padding:var(--rtk-space-0, 0px);flex-grow:1;flex-basis:0}.metadata{display:flex;align-items:center}.metadata img{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);border-radius:var(--rtk-border-radius-sm, 4px)}.metadata .name{margin-left:var(--rtk-space-2, 8px);font-weight:500}.plugin{display:flex;align-items:center;justify-content:space-between;padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px);padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px)}.plugin .buttons{display:flex;align-items:center}rtk-button:hover{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-opacity:1;--tw-ring-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-ring-opacity));--tw-ring-offset-width:2px;--tw-ring-offset-color:rgb(var(--rtk-colors-background-1000, 8 8 8))}";var p=function(t,r,a,i){var s,e=arguments.length,o=e<3?r:null===i?i=Object.getOwnPropertyDescriptor(r,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,r,a,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(e<3?s(o):e>3?s(r,a,o):s(r,a))||o);return e>3&&o&&Object.defineProperty(r,a,o),o};const h=class{constructor(r){t(this,r),this.config=s(),this.iconPack=e,this.t=o(),this.create=!1,this.polls=[],this.onPollsUpdate=t=>{this.polls=[...t.polls]},this.onUpdatePermissions=()=>{this.permissions=this.meeting.self.permissions}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t;this.meeting&&(null===(t=this.meeting.polls)||void 0===t||t.removeListener("pollsUpdate",this.onPollsUpdate),this.meeting.self.permissions.removeListener("pollsUpdate",this.onUpdatePermissions))}meetingChanged(t){t&&t.polls&&(this.permissions=this.meeting.self.permissions,this.polls=[...t.polls.items],t.polls.addListener("pollsUpdate",this.onPollsUpdate),this.meeting.self.permissions.addListener("pollsUpdate",this.onUpdatePermissions),this.onCreate=async r=>{this.create=!1,await t.polls.create(r.question,r.options,r.anonymous,r.hideVotes)},this.onVote=async(r,a)=>{await t.polls.vote(r,a)})}toggleCreateState(){this.create=!this.create}componentDidRender(){n(this.pollEl)}render(){var t,r;return a(i,{key:"f259b6fa652fe2e81c18d3a0fb85a15d0c091de3"},a("div",{key:"6cc127127307bcb1a5482a260fe7ccaf65bb1e3d",class:"ctr",part:"container"},a("div",{key:"ef9df557e4a5fb99ea2ce66172b7a889410daeea",class:"polls-view scrollbar",ref:t=>this.pollEl=t,part:"polls"},0==this.polls.length&&!0!==this.create&&a("div",{key:"0eb92f8f60ab00fb849b2d656a9d8bafb26195de",class:"empty-polls"},this.t("polls.empty")),this.polls.map((t=>{var r;return a("rtk-poll",{key:t.id,poll:t,onRtkVotePoll:t=>{this.onVote(t.detail.id,t.detail.index)},self:null===(r=this.meeting)||void 0===r?void 0:r.self.userId,iconPack:this.iconPack,t:this.t,permissions:this.permissions})})),this.create&&a("rtk-poll-form",{key:"71fc9e183684f5cafee5f0885af3d679d099a8ec",part:"poll-form",onRtkCreatePoll:t=>{this.onCreate(t.detail)},iconPack:this.iconPack,t:this.t})),(null===(r=null===(t=this.permissions)||void 0===t?void 0:t.polls)||void 0===r?void 0:r.canCreate)&&a("rtk-button",{key:"0639577353327ded0d1e7db08cbaadac47ec296c",kind:"wide",onClick:()=>this.toggleCreateState(),variant:this.create?"secondary":"primary",part:"button"},this.t(this.create?"polls.cancel":"polls.create"))))}static get watchers(){return{meeting:["meetingChanged"]}}};p([l()],h.prototype,"meeting",void 0),p([l()],h.prototype,"config",void 0),p([l()],h.prototype,"iconPack",void 0),p([l()],h.prototype,"t",void 0),h.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{margin-top:var(--rtk-space-2, 8px);display:flex;height:100%;width:100%;flex-direction:column;font-size:14px}*{box-sizing:border-box}.ctr{box-sizing:border-box;padding:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-0, 0px);display:flex;flex:1 1 0%;flex-direction:column}.polls-view{overflow-y:auto;flex:1 1 0%;flex-basis:0}.empty-polls{display:flex;height:100%;width:100%;align-items:center;justify-content:center}";export{d as rtk_plugins,h as rtk_polls}
@@ -0,0 +1 @@
1
+ import{r as t,w as n,h as i,H as r,c as a}from"./p-0ee570cd.js";import{e,h as o,c as s,L as p}from"./p-3c9aa206.js";import{S as d}from"./p-e51bb952.js";import{R as c}from"./p-c8eaa707.js";var l=function(t,n,i,r){var a,e=arguments.length,o=e<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,n,i,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(e<3?a(o):e>3?a(n,i,o):a(n,i))||o);return e>3&&o&&Object.defineProperty(n,i,o),o};const h=class{constructor(n){t(this,n),this.iconPack=e,this.variant="full",this.t=o(),this.videoDevices=[],this.canProduceVideo=!0,this.stageStateListener=()=>{this.canProduceVideo="ALLOWED"===this.meeting.self.permissions.canProduceVideo},this.deviceListUpdateListener=({devices:t})=>{this.videoDevices=t.filter((t=>"videoinput"===t.kind))},this.deviceUpdateListener=({device:t})=>{"videoinput"===t.kind&&(this.currentDevice=t)},this.mediaPermissionUpdateListener=async({kind:t,message:n})=>{this.meeting&&"video"===t&&"ACCEPTED"===n&&(this.videoDevices=await this.meeting.self.getVideoDevices())}}meetingChanged(t){var i,r,a;t&&(null===(i=t.self)||void 0===i||i.addListener("deviceListUpdate",this.deviceListUpdateListener),null===(r=t.self)||void 0===r||r.addListener("deviceUpdate",this.deviceUpdateListener),null===(a=t.self)||void 0===a||a.addListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),n((async()=>{var n,i;const r=await t.self.getVideoDevices(),a=null===(n=t.self.getCurrentDevices())||void 0===n?void 0:n.video;this.videoDevices=null!=a?[null!==(i=r.find((t=>t.deviceId===a.deviceId)))&&void 0!==i?i:a,...r.filter((t=>t.deviceId!==a.deviceId))]:r})))}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t,n,i,r,a;null===(n=null===(t=this.meeting)||void 0===t?void 0:t.stage)||void 0===n||n.removeListener("stageStatusUpdate",this.stageStateListener),null===(i=this.meeting)||void 0===i||i.self.removeListener("deviceListUpdate",this.deviceListUpdateListener),null===(r=this.meeting)||void 0===r||r.self.removeListener("deviceUpdate",this.deviceUpdateListener),null===(a=this.meeting)||void 0===a||a.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener)}async setDevice(t){var n;const i=this.videoDevices.find((n=>n.deviceId===t));this.currentDevice=i,null!=i&&await(null===(n=this.meeting)||void 0===n?void 0:n.self.setDevice(i))}render(){if(!this.meeting)return null;let t=0;return i(r,null,this.canProduceVideo&&i("div",{class:"group container "+this.variant,part:"camera-selection"},i("label",null,"inline"!==this.variant&&this.t("camera"),i("rtk-icon",{icon:this.iconPack.video_on,size:"sm"})),i("div",{class:"row"},i("select",{class:"rtk-select",onChange:t=>this.setDevice(t.target.value)},this.videoDevices.map((({deviceId:n,label:r})=>{var a;return i("option",{selected:(null===(a=this.currentDevice)||void 0===a?void 0:a.deviceId)===n,value:n},r||"Camera "+ ++t)}))))))}static get watchers(){return{meeting:["meetingChanged"]}}};l([d()],h.prototype,"meeting",void 0),l([d()],h.prototype,"iconPack",void 0),l([d()],h.prototype,"t",void 0),h.style=".rtk-select{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.rtk-select:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.rtk-select{display:block;border-radius:var(--rtk-border-radius-sm, 4px);border-width:var(--rtk-border-width-none, 0);border-style:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--rtk-space-3, 12px);font-size:16px;--icon-size:var(--rtk-select-chevron-size, var(--rtk-space-6, 24px));--icon-right-position:var(--rtk-select-chevron-right-position, var(--rtk-space-2, 8px));background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-position:right var(--icon-right-position) center;background-repeat:no-repeat;background-size:var(--icon-size) var(--icon-size);padding-right:calc(var(--icon-right-position) * 5);width:100%;max-width:100%;text-overflow:ellipsis}.inline .rtk-select{margin-top:var(--rtk-space-1, 4px);width:100%;padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px);padding-left:var(--rtk-space-1\\.5, 6px);padding-right:var(--rtk-space-1\\.5, 6px);padding-right:var(--rtk-space-8, 32px);font-size:14px}.row{margin-bottom:var(--rtk-space-2, 8px);display:flex;width:100%;align-items:center;justify-content:space-between;gap:var(--rtk-space-3, 12px)}.group{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px)}.group>*{margin-bottom:var(--rtk-space-2, 8px)}.group>*:last-child{margin-bottom:var(--rtk-space-0, 0px)}.group select{flex:1 1 0%}.group{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-0, 0px)}.group>*{margin-bottom:var(--rtk-space-0, 0px)}label{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;gap:var(--rtk-space-1, 4px);font-size:14px}.inline.container{display:flex;align-items:center;justify-content:flex-start;gap:var(--rtk-space-2, 8px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px)}";var v=function(t,n,i,r){var a,e=arguments.length,o=e<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,n,i,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(e<3?a(o):e>3?a(n,i,o):a(n,i))||o);return e>3&&o&&Object.defineProperty(n,i,o),o};const g=class{constructor(n){t(this,n),this.tileLoad=a(this,"tileLoad",7),this.tileUnload=a(this,"tileUnload",7),this.isPinned=!1,this.mediaConnectionError=!1,this.nameTagPosition="bottom-left",this.isPreview=!1,this.config=s(),this.variant="solid",this.iconPack=e,this.t=o(),this.onPinned=({isPinned:t})=>{this.isPinned=t},this.isSelf=()=>{var t;return this.isPreview||this.participant.id===(null===(t=this.meeting)||void 0===t?void 0:t.self.id)},this.onPause=t=>{var n,i;this.isSelf()&&(null===(n=this.meeting)||void 0===n?void 0:n.__internals__.features.hasFeature(p.PLAY_PARTICIPANT_TILE_VIDEO_ON_PAUSE))&&(this.meeting.__internals__.logger.warn(`Video player paused for ${this.participant.id} isSelf: ${this.isSelf()}`),null===(i=null==t?void 0:t.target)||void 0===i||i.play())},this.onPlaying=()=>{this.playTimeout&&clearTimeout(this.playTimeout)}}onVideoRef(t){this.participant&&this.meeting&&t!==this.videoEl&&(this.videoEl=t,this.participant.registerVideoElement(this.videoEl,this.isPreview),this.tileLoad.emit({participant:this.participant,videoElement:this.videoEl}))}connectedCallback(){this.meeting?this.meetingChanged(this.meeting):this.participantsChanged(this.participant)}disconnectedCallback(){this.playTimeout&&clearTimeout(this.playTimeout),null!=this.participant&&(this.participant.deregisterVideoElement(this.videoEl,this.isPreview),this.participant.removeListener("pinned",this.onPinned),this.participant.removeListener("unpinned",this.onPinned),this.meeting.meta.off("mediaConnectionUpdate",this.mediaConnectionUpdateListener),this.tileUnload.emit(this.participant))}meetingChanged(t){t&&this.participantsChanged(this.participant)}participantsChanged(t){t&&(this.meeting?(this.isPinned=t.isPinned,this.videoEl&&this.participant.registerVideoElement(this.videoEl,this.isPreview),t.addListener("pinned",this.onPinned),t.addListener("unpinned",this.onPinned),this.meeting.meta.on("mediaConnectionUpdate",this.mediaConnectionUpdateListener.bind(this))):this.isPreview&&this.videoEl&&this.participant.registerVideoElement(this.videoEl,this.isPreview))}mediaConnectionUpdateListener(){var t,n,i;const{recv:r,send:a}=null!==(i=null===(n=null===(t=this.meeting)||void 0===t?void 0:t.meta)||void 0===n?void 0:n.mediaState)&&void 0!==i?i:{};this.mediaConnectionError="connected"!==(null==r?void 0:r.state)&&!this.isSelf()||!("connected"===(null==a?void 0:a.state)||!this.isSelf())}isMirrored(){var t;if(null!=this.participant&&this.isSelf()){const n=this.states,i=null===(t=null==n?void 0:n.prefs)||void 0===t?void 0:t.mirrorVideo;if("boolean"==typeof i)return i}return!1}render(){var t,n,a;if(!this.meeting)return null;const e={meeting:this.meeting,size:this.size,states:this.states,config:this.config,iconPack:this.iconPack,t:this.t};return i(r,null,i("video",{ref:t=>this.onVideoRef(t),class:{mirror:this.isMirrored(),[null!==(a=null===(n=null===(t=this.config)||void 0===t?void 0:t.config)||void 0===n?void 0:n.videoFit)&&void 0!==a?a:"cover"]:!0},onPlaying:this.onPlaying,onPause:this.onPause,autoPlay:!0,playsInline:!0,muted:!0,part:"video"}),this.isPinned&&i("rtk-icon",{class:"pinned-icon",icon:this.iconPack.pin,"aria-label":this.t("pinned"),part:"pinned-icon"}),this.mediaConnectionError&&i("div",{class:"network-container",part:"network-indicator"},i("rtk-icon",{class:"network-icon",icon:this.iconPack.disconnected,"aria-label":this.t("pinned"),part:"pinned-icon"})),i("slot",null,i(c,{element:"rtk-participant-tile",defaults:e,childProps:{participant:this.participant},deepProps:!0,onlyChildren:!0})))}static get watchers(){return{meeting:["meetingChanged"],participant:["participantsChanged"]}}};v([d()],g.prototype,"meeting",void 0),v([d()],g.prototype,"states",void 0),v([d()],g.prototype,"config",void 0),v([d()],g.prototype,"iconPack",void 0),v([d()],g.prototype,"t",void 0),g.style=":host {\n line-height: initial;\n font-family: var(--rtk-font-family, sans-serif);\n\n font-feature-settings: normal;\n font-variation-settings: normal;\n}\n\np {\n margin: var(--rtk-space-0, 0px);\n padding: var(--rtk-space-0, 0px);\n}\n\n\n:host {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n aspect-ratio: 16 / 9;\n height: var(--rtk-space-56, 224px);\n overflow: hidden;\n border-radius: var(--rtk-border-radius-lg, 12px);\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-video-bg, 24 24 24) / var(--tw-bg-opacity));\n\n transition-property: var(--rtk-transition-property, all);\n transition-duration: 150ms;\n container-type: inline-size;\n container-name: participanttile;\n}\n\n@media (prefers-reduced-motion) {\n /* No transitions when disabled */\n :host {\n --rtk-transition-property: none;\n }\n}\n\nrtk-avatar {\n z-index: -1;\n}\n\n/**\n NOTE: provided :slotted(rtk-name-tag) & rtk-name-tag separately\n because ::slotted isn't applied on default slots.\n*/\n\n::slotted(rtk-name-tag), \nrtk-name-tag {\n position: absolute;\n left: var(--rtk-space-3, 12px);\n bottom: var(--rtk-space-3, 12px);\n}\n\n:host([size='sm'][variant='solid']) ::slotted(rtk-name-tag), \n :host([size='sm'][variant='solid']) rtk-name-tag {\n left: var(--rtk-space-2, 8px);\n bottom: var(--rtk-space-2, 8px);\n height: var(--rtk-space-4, 16px);\n}\n\n::slotted(rtk-network-indicator), \nrtk-network-indicator {\n position: absolute;\n right: var(--rtk-space-3, 12px);\n bottom: var(--rtk-space-3, 12px);\n}\n\n:host([size='sm']) ::slotted(rtk-network-indicator), \n :host([size='sm']) rtk-network-indicator {\n right: var(--rtk-space-2, 8px);\n bottom: var(--rtk-space-2, 8px);\n}\n\nvideo {\n position: absolute;\n height: 100%;\n width: 100%;\n border-radius: var(--rtk-border-radius-lg, 12px);\n}\n\nvideo.contain {\n -o-object-fit: contain;\n object-fit: contain;\n}\n\nvideo.cover {\n -o-object-fit: cover;\n object-fit: cover;\n}\n\nvideo::-webkit-media-controls {\n display: none !important;\n}\n\n.pinned-icon {\n position: absolute;\n left: var(--rtk-space-3, 12px);\n top: var(--rtk-space-3, 12px);\n height: var(--rtk-space-5, 20px);\n width: var(--rtk-space-5, 20px);\n padding: var(--rtk-space-1, 4px);\n border-radius: var(--rtk-border-radius-md, 8px);\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));\n}\n\n.network-container {\n position: absolute;\n right: var(--rtk-space-3, 12px);\n bottom: var(--rtk-space-3, 12px);\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: var(--rtk-space-2, 8px);\n font-size: 12px;\n border-radius: var(--rtk-border-radius-md, 8px);\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));\n}\n.network-icon {\n height: var(--rtk-space-5, 20px);\n width: var(--rtk-space-5, 20px);\n --tw-text-opacity: 1;\n color: rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity));\n}\n\n:host([size='sm']) .pinned-icon {\n top: var(--rtk-space-2, 8px);\n left: var(--rtk-space-2, 8px);\n}\n\n:host([variant='gradient']) ::slotted(rtk-audio-visualizer), \n :host([variant='gradient']) rtk-audio-visualizer {\n position: absolute;\n top: var(--rtk-space-2, 8px);\n right: var(--rtk-space-2, 8px);\n border-radius: 9999px;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n padding: var(--rtk-space-2, 8px);\n}\n\n:host([variant='gradient']) ::slotted(rtk-name-tag), \n :host([variant='gradient']) rtk-name-tag {\n bottom: var(--rtk-space-0, 0px);\n left: var(--rtk-space-0, 0px);\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n text-align: center;\n background-color: transparent;\n background-image: linear-gradient(to top, var(--tw-gradient-stops));\n --tw-gradient-from: rgb(var(--rtk-colors-background-1000, 8 8 8));\n --tw-gradient-to: rgba(var(--rtk-colors-background-1000, 8 8 8) / 0);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n --tw-gradient-to: transparent;\n}\n\nvideo.mirror {\n transform: scaleX(-1);\n}\n\n/** Name tag positions */\n\n:host([name-tag-position='bottom-right']) ::slotted(rtk-name-tag), \n :host([name-tag-position='bottom-right']) rtk-name-tag {\n left: auto;\n right: var(--rtk-space-3, 12px);\n}\n\n:host([name-tag-position='bottom-center']) ::slotted(rtk-name-tag), \n :host([name-tag-position='bottom-center']) rtk-name-tag {\n left: auto;\n right: auto;\n}\n\n:host([name-tag-position='top-left']) ::slotted(rtk-name-tag), \n :host([name-tag-position='top-left']) rtk-name-tag {\n top: var(--rtk-space-3, 12px);\n bottom: auto;\n}\n\n:host([name-tag-position='top-right']) ::slotted(rtk-name-tag), \n :host([name-tag-position='top-right']) rtk-name-tag {\n top: var(--rtk-space-3, 12px);\n right: var(--rtk-space-3, 12px);\n left: auto;\n bottom: auto;\n}\n\n:host([name-tag-position='top-center']) ::slotted(rtk-name-tag), \n :host([name-tag-position='top-center']) rtk-name-tag {\n left: auto;\n right: auto;\n bottom: auto;\n top: var(--rtk-space-3, 12px);\n}\n\n@media only screen and (max-height: 480px) and (orientation: landscape) {\n :host([size='sm']) {\n border-radius: var(--rtk-border-radius-sm, 4px);\n }\n\n :host([size='sm']) > video {\n border-radius: var(--rtk-border-radius-sm, 4px);\n }\n\n ::slotted(rtk-avatar), \n rtk-avatar {\n height: var(--rtk-space-12, 48px);\n width: var(--rtk-space-12, 48px);\n }\n :host([size='sm'][variant='solid']) ::slotted(rtk-name-tag),\n :host([size='sm'][variant='solid']) rtk-name-tag {\n transform-origin: -2% 100%;\n transform: scale(0.6);\n z-index: 10;\n left: var(--rtk-space-0, 0px);\n bottom: var(--rtk-space-0, 0px);\n border-radius: var(--rtk-border-radius-none, 0);\n }\n}\n\n@media only screen and (max-width: 480px) and (orientation: portrait) {\n :host([size='sm']) {\n border-radius: var(--rtk-border-radius-sm, 4px);\n }\n\n :host([size='sm']) > video {\n border-radius: var(--rtk-border-radius-sm, 4px);\n }\n\n ::slotted(rtk-avatar), \n rtk-avatar {\n height: var(--rtk-space-12, 48px);\n width: var(--rtk-space-12, 48px);\n }\n :host([size='sm'][variant='solid']) ::slotted(rtk-name-tag),\n :host([size='sm'][variant='solid']) rtk-name-tag {\n transform-origin: -5% 110%;\n transform: scale(0.6);\n z-index: 10;\n left: var(--rtk-space-0, 0px);\n bottom: var(--rtk-space-0, 0px);\n border-radius: var(--rtk-border-radius-none, 0);\n }\n}\n\n@container participanttile (max-width: 300px) {\n ::slotted(rtk-name-tag),\n rtk-name-tag {\n transform-origin: 0 100%;\n transform: scale(0.8);\n }\n\n ::slotted(rtk-avatar), \n rtk-avatar {\n height: var(--rtk-space-8, 32px) !important;\n width: var(--rtk-space-8, 32px) !important;\n }\n}\n\n@container participanttile (max-width: 150px) {\n ::slotted(rtk-name-tag),\n rtk-name-tag[variant='solid'] {\n transform-origin: -10% 130%;\n transform: scale(0.6);\n z-index: 10;\n border-radius: 9999px;\n }\n\n ::slotted(rtk-avatar), \n rtk-avatar {\n height: 6 !important;\n width: 6 !important;\n }\n}\n";export{h as rtk_camera_selector,g as rtk_participant_tile}