@100mslive/roomkit-react 0.3.24-alpha.0 → 0.3.24-alpha.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. package/dist/Theme/ThemeProvider.d.ts +1 -0
  2. package/dist/index.cjs.css +2 -2
  3. package/dist/index.cjs.css.map +1 -1
  4. package/dist/index.cjs.js +34109 -37488
  5. package/dist/index.cjs.js.map +4 -4
  6. package/dist/index.css +2 -2
  7. package/dist/index.css.map +1 -1
  8. package/dist/index.js +36389 -73
  9. package/dist/index.js.map +4 -4
  10. package/dist/meta.cjs.json +5568 -5617
  11. package/dist/meta.esbuild.json +6032 -8744
  12. package/package.json +7 -7
  13. package/src/Prebuilt/App.tsx +3 -6
  14. package/src/Prebuilt/components/Chat/Chat.tsx +8 -12
  15. package/src/Prebuilt/components/Footer/WhiteboardToggle.tsx +11 -4
  16. package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +3 -3
  17. package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +3 -0
  18. package/src/Prebuilt/components/Preview/PreviewJoin.tsx +3 -2
  19. package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +30 -43
  20. package/src/Prebuilt/layouts/HLSView.jsx +2 -3
  21. package/src/Prebuilt/layouts/SidePane.tsx +6 -12
  22. package/src/Prebuilt/layouts/VideoStreamingSection.tsx +64 -69
  23. package/src/Theme/ThemeProvider.tsx +9 -3
  24. package/dist/ConferenceScreen-CLPW3BGP.css +0 -2780
  25. package/dist/ConferenceScreen-CLPW3BGP.css.map +0 -7
  26. package/dist/ConferenceScreen-M6RBPTAJ.js +0 -1774
  27. package/dist/ConferenceScreen-M6RBPTAJ.js.map +0 -7
  28. package/dist/EmbedView-DDSO7ZCV.js +0 -17
  29. package/dist/EmbedView-DDSO7ZCV.js.map +0 -7
  30. package/dist/EmbedView-HGIUZHKA.css +0 -2780
  31. package/dist/EmbedView-HGIUZHKA.css.map +0 -7
  32. package/dist/EmojiReaction-23JDKJD4.js +0 -11
  33. package/dist/EmojiReaction-23JDKJD4.js.map +0 -7
  34. package/dist/HLSView-OW77EAAO.css +0 -2780
  35. package/dist/HLSView-OW77EAAO.css.map +0 -7
  36. package/dist/HLSView-Q6GEB3UM.js +0 -1666
  37. package/dist/HLSView-Q6GEB3UM.js.map +0 -7
  38. package/dist/LeaveScreen-BYTE73MT.js +0 -556
  39. package/dist/LeaveScreen-BYTE73MT.js.map +0 -7
  40. package/dist/LeaveScreen-P7AATEIF.css +0 -2780
  41. package/dist/LeaveScreen-P7AATEIF.css.map +0 -7
  42. package/dist/MoreSettings-LV5X2U6K.css +0 -2780
  43. package/dist/MoreSettings-LV5X2U6K.css.map +0 -7
  44. package/dist/MoreSettings-WSHMMNOC.js +0 -16
  45. package/dist/MoreSettings-WSHMMNOC.js.map +0 -7
  46. package/dist/PDFView-RIPRIIH6.css +0 -2780
  47. package/dist/PDFView-RIPRIIH6.css.map +0 -7
  48. package/dist/PDFView-ZFSG2ESE.js +0 -84
  49. package/dist/PDFView-ZFSG2ESE.js.map +0 -7
  50. package/dist/Polls-QWW5LTTB.js +0 -1584
  51. package/dist/Polls-QWW5LTTB.js.map +0 -7
  52. package/dist/Polls-ULYGUPPF.css +0 -2780
  53. package/dist/Polls-ULYGUPPF.css.map +0 -7
  54. package/dist/RaiseHand-K7NFLH7H.js +0 -10
  55. package/dist/RaiseHand-K7NFLH7H.js.map +0 -7
  56. package/dist/RoleProminence-235AFT7F.js +0 -116
  57. package/dist/RoleProminence-235AFT7F.js.map +0 -7
  58. package/dist/RoleProminence-6XN3POS5.css +0 -2780
  59. package/dist/RoleProminence-6XN3POS5.css.map +0 -7
  60. package/dist/RoomDetailsPane-O5TFMTPI.css +0 -2780
  61. package/dist/RoomDetailsPane-O5TFMTPI.css.map +0 -7
  62. package/dist/RoomDetailsPane-RF3D3TDR.js +0 -53
  63. package/dist/RoomDetailsPane-RF3D3TDR.js.map +0 -7
  64. package/dist/ScreenshareLayout-KNEB3AJJ.css +0 -2780
  65. package/dist/ScreenshareLayout-KNEB3AJJ.css.map +0 -7
  66. package/dist/ScreenshareLayout-PSQMS3NC.js +0 -358
  67. package/dist/ScreenshareLayout-PSQMS3NC.js.map +0 -7
  68. package/dist/SidePaneTabs-I6DECE5R.css +0 -2780
  69. package/dist/SidePaneTabs-I6DECE5R.css.map +0 -7
  70. package/dist/SidePaneTabs-NXHBI2JB.js +0 -1354
  71. package/dist/SidePaneTabs-NXHBI2JB.js.map +0 -7
  72. package/dist/VBPicker-2CQ3IIO7.js +0 -322
  73. package/dist/VBPicker-2CQ3IIO7.js.map +0 -7
  74. package/dist/VBPicker-DCNYGO23.css +0 -2780
  75. package/dist/VBPicker-DCNYGO23.css.map +0 -7
  76. package/dist/WaitingView-NZIUOXBI.js +0 -10
  77. package/dist/WaitingView-NZIUOXBI.js.map +0 -7
  78. package/dist/WhiteboardLayout-4YLFM3EY.js +0 -96
  79. package/dist/WhiteboardLayout-4YLFM3EY.js.map +0 -7
  80. package/dist/WhiteboardLayout-JUOBDFKY.css +0 -2780
  81. package/dist/WhiteboardLayout-JUOBDFKY.css.map +0 -7
  82. package/dist/chunk-3C7IESSI.js +0 -254
  83. package/dist/chunk-3C7IESSI.js.map +0 -7
  84. package/dist/chunk-7FD3VT6Q.js +0 -114
  85. package/dist/chunk-7FD3VT6Q.js.map +0 -7
  86. package/dist/chunk-AHI4HCY3.js +0 -62
  87. package/dist/chunk-AHI4HCY3.js.map +0 -7
  88. package/dist/chunk-BGSYLCVD.js +0 -6337
  89. package/dist/chunk-BGSYLCVD.js.map +0 -7
  90. package/dist/chunk-DANANDDE.js +0 -418
  91. package/dist/chunk-DANANDDE.js.map +0 -7
  92. package/dist/chunk-ETRNLEWQ.js +0 -2658
  93. package/dist/chunk-ETRNLEWQ.js.map +0 -7
  94. package/dist/chunk-EWPHJFZJ.js +0 -487
  95. package/dist/chunk-EWPHJFZJ.js.map +0 -7
  96. package/dist/chunk-F63YJBI4.js +0 -98
  97. package/dist/chunk-F63YJBI4.js.map +0 -7
  98. package/dist/chunk-GLAJUP3O.js +0 -576
  99. package/dist/chunk-GLAJUP3O.js.map +0 -7
  100. package/dist/chunk-GOXRTCTY.js +0 -90
  101. package/dist/chunk-GOXRTCTY.js.map +0 -7
  102. package/dist/chunk-HMCBZI3A.js +0 -59
  103. package/dist/chunk-HMCBZI3A.js.map +0 -7
  104. package/dist/chunk-HVYTC3PX.js +0 -171
  105. package/dist/chunk-HVYTC3PX.js.map +0 -7
  106. package/dist/chunk-LJVP6AWF.js +0 -262
  107. package/dist/chunk-LJVP6AWF.js.map +0 -7
  108. package/dist/chunk-LXJGCRKM.js +0 -30
  109. package/dist/chunk-LXJGCRKM.js.map +0 -7
  110. package/dist/chunk-MG3UGW66.js +0 -16800
  111. package/dist/chunk-MG3UGW66.js.map +0 -7
  112. package/dist/chunk-MUKUP7JU.js +0 -161
  113. package/dist/chunk-MUKUP7JU.js.map +0 -7
  114. package/dist/chunk-OV6MVDCL.js +0 -41
  115. package/dist/chunk-OV6MVDCL.js.map +0 -7
  116. package/dist/chunk-P6NV2XO4.js +0 -178
  117. package/dist/chunk-P6NV2XO4.js.map +0 -7
  118. package/dist/chunk-REL3HBSD.js +0 -71
  119. package/dist/chunk-REL3HBSD.js.map +0 -7
  120. package/dist/chunk-U4SQBXPZ.js +0 -830
  121. package/dist/chunk-U4SQBXPZ.js.map +0 -7
  122. package/dist/chunk-YEL5ZTFU.js +0 -136
  123. package/dist/chunk-YEL5ZTFU.js.map +0 -7
@@ -1,1774 +0,0 @@
1
- import {
2
- Header
3
- } from "./chunk-LJVP6AWF.js";
4
- import {
5
- Grid
6
- } from "./chunk-HMCBZI3A.js";
7
- import {
8
- InsetTile
9
- } from "./chunk-YEL5ZTFU.js";
10
- import {
11
- ChatToggle,
12
- LeaveRoom
13
- } from "./chunk-EWPHJFZJ.js";
14
- import {
15
- WaitingView
16
- } from "./chunk-REL3HBSD.js";
17
- import {
18
- Pagination,
19
- VideoTileContext,
20
- usePagesWithTiles,
21
- useTileLayout
22
- } from "./chunk-P6NV2XO4.js";
23
- import {
24
- ParticipantCount
25
- } from "./chunk-U4SQBXPZ.js";
26
- import {
27
- ActivatedPIP,
28
- MoreSettings,
29
- useUnreadPollQuizPresent
30
- } from "./chunk-ETRNLEWQ.js";
31
- import "./chunk-3C7IESSI.js";
32
- import {
33
- EmojiReaction
34
- } from "./chunk-7FD3VT6Q.js";
35
- import {
36
- RaiseHand
37
- } from "./chunk-OV6MVDCL.js";
38
- import {
39
- useMyMetadata
40
- } from "./chunk-AHI4HCY3.js";
41
- import "./chunk-LXJGCRKM.js";
42
- import {
43
- AudioVideoToggle,
44
- Button,
45
- Dialog,
46
- DialogCol,
47
- DialogInputFile,
48
- DialogRow,
49
- Footer,
50
- FullPageProgress_default,
51
- PictureInPicture,
52
- PreviewControls,
53
- PreviewTile,
54
- Sheet,
55
- SidePane_default,
56
- VBToggle,
57
- useHMSPrebuiltContext,
58
- useIsSidepaneTypeOpen,
59
- usePollViewToggle,
60
- useSidepaneToggle
61
- } from "./chunk-MG3UGW66.js";
62
- import {
63
- Text
64
- } from "./chunk-MUKUP7JU.js";
65
- import {
66
- Dropdown,
67
- ToastManager,
68
- useLandscapeHLSStream,
69
- useMobileHLSStream,
70
- useWaitingRoomInfo
71
- } from "./chunk-DANANDDE.js";
72
- import {
73
- Box,
74
- Flex
75
- } from "./chunk-GOXRTCTY.js";
76
- import {
77
- IconButton,
78
- IconButton_default,
79
- Tooltip,
80
- isScreenshareSupported,
81
- useAuthToken,
82
- useIsCaptionEnabled,
83
- usePDFConfig,
84
- usePinnedTrack,
85
- useRoomLayoutConferencingScreen,
86
- useRoomLayoutPreviewScreen,
87
- useSetAppDataByKey,
88
- useSetIsCaptionEnabled,
89
- useShowPolls,
90
- useUISettings,
91
- useUrlToEmbed
92
- } from "./chunk-BGSYLCVD.js";
93
- import {
94
- APP_DATA,
95
- ROLE_CHANGE_DECLINED,
96
- SIDE_PANE_OPTIONS,
97
- UI_SETTINGS,
98
- __async,
99
- __spreadProps,
100
- __spreadValues,
101
- config,
102
- init_define_process_env,
103
- isAndroid,
104
- isIOS,
105
- isIPadOS,
106
- styled
107
- } from "./chunk-GLAJUP3O.js";
108
-
109
- // src/Prebuilt/components/ConferenceScreen.tsx
110
- init_define_process_env();
111
- import React19, { useEffect as useEffect10, useRef as useRef2, useState as useState8 } from "react";
112
- import { v4 as uuid } from "uuid";
113
- import {
114
- HMSRoomState,
115
- selectAppData,
116
- selectIsConnectedToRoom as selectIsConnectedToRoom2,
117
- selectRoomState,
118
- useAwayNotifications as useAwayNotifications2,
119
- useHMSActions as useHMSActions4,
120
- useHMSStore as useHMSStore10
121
- } from "@100mslive/react-sdk";
122
-
123
- // src/Prebuilt/components/Footer/Footer.tsx
124
- init_define_process_env();
125
- import React11, { useEffect as useEffect2 } from "react";
126
- import { useMedia } from "react-use";
127
- import { Chat_ChatState } from "@100mslive/types-prebuilt/elements/chat";
128
-
129
- // src/Prebuilt/components/CaptionIcon.tsx
130
- init_define_process_env();
131
- import React from "react";
132
- import { selectIsTranscriptionEnabled, useHMSStore } from "@100mslive/react-sdk";
133
- import { ClosedCaptionIcon, OpenCaptionIcon } from "@100mslive/react-icons";
134
- var CaptionIcon = () => {
135
- const isCaptionPresent = useHMSStore(selectIsTranscriptionEnabled);
136
- const [isCaption, setIsCaption] = useSetIsCaptionEnabled();
137
- const onClick = () => {
138
- setIsCaption(!isCaption);
139
- };
140
- if (!isCaptionPresent) {
141
- return null;
142
- }
143
- return /* @__PURE__ */ React.createElement(Tooltip, { title: isCaption ? "Hide closed captions" : "Show closed captions" }, /* @__PURE__ */ React.createElement(IconButton_default, { "data-testid": "caption_btn", onClick }, isCaption ? /* @__PURE__ */ React.createElement(ClosedCaptionIcon, { width: "20", height: "20px" }) : /* @__PURE__ */ React.createElement(OpenCaptionIcon, { width: "20", height: "20px" })));
144
- };
145
-
146
- // src/Prebuilt/components/ScreenShareToggle.jsx
147
- init_define_process_env();
148
- import React8, { Fragment as Fragment2 } from "react";
149
- import { selectIsAllowedToPublish, useAwayNotifications, useHMSStore as useHMSStore2, useScreenShare as useScreenShare2 } from "@100mslive/react-sdk";
150
- import { ShareScreenIcon } from "@100mslive/react-icons";
151
-
152
- // src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx
153
- init_define_process_env();
154
- import React7, { Fragment, useState as useState2 } from "react";
155
- import { useScreenShare } from "@100mslive/react-sdk";
156
- import { StarIcon, VerticalMenuIcon } from "@100mslive/react-icons";
157
- import PDFShareImg from "./pdf-share.png";
158
- import ScreenShareImg from "./screen-share.png";
159
-
160
- // src/Prebuilt/components/ShareMenuIcon.jsx
161
- init_define_process_env();
162
- var ScreenShareButton = styled(IconButton_default, {
163
- h: "$14",
164
- px: "$8",
165
- r: "$1",
166
- borderTopRightRadius: 0,
167
- borderBottomRightRadius: 0,
168
- "@md": {
169
- px: "$4",
170
- mx: 0
171
- }
172
- });
173
- var ShareMenuIcon = styled(ScreenShareButton, {
174
- borderTopLeftRadius: 0,
175
- borderBottomLeftRadius: 0,
176
- borderTopRightRadius: "$1",
177
- borderBottomRightRadius: "$1",
178
- borderLeftWidth: 0,
179
- w: "$4",
180
- "@md": {
181
- w: "unset",
182
- px: "$2"
183
- }
184
- });
185
-
186
- // src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx
187
- init_define_process_env();
188
- import React6, { useState } from "react";
189
-
190
- // src/Prebuilt/components/pdfAnnotator/pdfHeader.jsx
191
- init_define_process_env();
192
- import React2 from "react";
193
- var PDFHeader = () => {
194
- return /* @__PURE__ */ React2.createElement(
195
- DialogCol,
196
- {
197
- align: "start",
198
- css: {
199
- mt: 0,
200
- mb: "$6"
201
- }
202
- },
203
- /* @__PURE__ */ React2.createElement(Dialog.Title, { asChild: true }, /* @__PURE__ */ React2.createElement(Text, { as: "h6", variant: "h6" }, "Share PDF")),
204
- /* @__PURE__ */ React2.createElement(Dialog.Description, { asChild: true }, /* @__PURE__ */ React2.createElement(
205
- Text,
206
- {
207
- variant: "sm",
208
- css: {
209
- c: "$on_surface_medium"
210
- }
211
- },
212
- "Choose PDF you want to annotate and share"
213
- ))
214
- );
215
- };
216
-
217
- // src/Prebuilt/components/pdfAnnotator/submitPdf.jsx
218
- init_define_process_env();
219
- import React3 from "react";
220
- var SubmitPDF = ({ pdfFile, onOpenChange }) => {
221
- const [, setPDFConfig] = useSetAppDataByKey(APP_DATA.pdfConfig);
222
- return /* @__PURE__ */ React3.createElement(
223
- Flex,
224
- {
225
- direction: "row",
226
- css: {
227
- mb: "0",
228
- mt: "auto",
229
- gap: "$8"
230
- }
231
- },
232
- /* @__PURE__ */ React3.createElement(
233
- Button,
234
- {
235
- variant: "standard",
236
- outlined: true,
237
- type: "submit",
238
- onClick: () => {
239
- onOpenChange(false);
240
- },
241
- css: { w: "50%" }
242
- },
243
- "Cancel"
244
- ),
245
- /* @__PURE__ */ React3.createElement(
246
- Button,
247
- {
248
- variant: "primary",
249
- type: "submit",
250
- onClick: () => {
251
- if (pdfFile) {
252
- setPDFConfig(pdfFile);
253
- onOpenChange(false);
254
- }
255
- },
256
- disabled: !pdfFile,
257
- "data-testid": "share_pdf_btn",
258
- css: {
259
- w: "50%"
260
- }
261
- },
262
- "Start Sharing"
263
- )
264
- );
265
- };
266
-
267
- // src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx
268
- init_define_process_env();
269
- import React5 from "react";
270
- import { TrashIcon } from "@100mslive/react-icons";
271
-
272
- // src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx
273
- init_define_process_env();
274
- import React4 from "react";
275
- import { InfoIcon } from "@100mslive/react-icons";
276
- var PDFInfo = () => {
277
- return /* @__PURE__ */ React4.createElement(
278
- DialogRow,
279
- {
280
- css: {
281
- px: "$8",
282
- py: "$3",
283
- bg: "$surface_default",
284
- r: "$1",
285
- outline: "none",
286
- border: "1px solid $border_bright",
287
- minHeight: "$11"
288
- }
289
- },
290
- /* @__PURE__ */ React4.createElement(
291
- InfoIcon,
292
- {
293
- width: "64px",
294
- height: "64px",
295
- style: {
296
- paddingRight: "16px"
297
- }
298
- }
299
- ),
300
- /* @__PURE__ */ React4.createElement(Text, { variant: "caption" }, "On the next screen, ensure you select \u201CThis Tab\u201D and click on share. Only the PDF viewer will be seen by other participants")
301
- );
302
- };
303
-
304
- // src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx
305
- var UploadedFile = ({ pdfFile, setPDFFile, onOpenChange }) => {
306
- const [fileName, ext] = pdfFile.name.split(".");
307
- return /* @__PURE__ */ React5.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React5.createElement(Dialog.Portal, null, /* @__PURE__ */ React5.createElement(Dialog.Overlay, null), /* @__PURE__ */ React5.createElement(
308
- Dialog.Content,
309
- {
310
- css: {
311
- w: "min(420px,80%)",
312
- overflow: "auto",
313
- p: "$10",
314
- bg: "$surface_dim"
315
- }
316
- },
317
- /* @__PURE__ */ React5.createElement(Flex, { direction: "column" }, /* @__PURE__ */ React5.createElement(PDFHeader, null), /* @__PURE__ */ React5.createElement(
318
- DialogRow,
319
- {
320
- css: {
321
- fontFamily: "$sans",
322
- bg: "$surface_bright",
323
- r: "$1",
324
- outline: "none",
325
- border: "1px solid $border_bright",
326
- p: "$4 $6",
327
- minHeight: "$11",
328
- c: "$on_primary_high",
329
- fs: "$md",
330
- w: "100%",
331
- "&:focus": {
332
- boxShadow: "0 0 0 1px $colors$primary_default",
333
- border: "1px solid transparent"
334
- },
335
- mb: 0,
336
- mt: "$6"
337
- }
338
- },
339
- /* @__PURE__ */ React5.createElement(Flex, { direction: "row", css: { flexGrow: "1", maxWidth: "88%" } }, /* @__PURE__ */ React5.createElement(
340
- Text,
341
- {
342
- css: {
343
- textOverflow: "ellipsis",
344
- overflow: "hidden",
345
- whiteSpace: "nowrap"
346
- }
347
- },
348
- fileName
349
- ), /* @__PURE__ */ React5.createElement(Text, { css: { whiteSpace: "nowrap" } }, ".", ext)),
350
- /* @__PURE__ */ React5.createElement(
351
- TrashIcon,
352
- {
353
- onClick: () => setPDFFile(null),
354
- style: {
355
- cursor: "pointer"
356
- }
357
- }
358
- )
359
- ), /* @__PURE__ */ React5.createElement(PDFInfo, null), /* @__PURE__ */ React5.createElement(SubmitPDF, { pdfFile, onOpenChange }))
360
- )));
361
- };
362
-
363
- // src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx
364
- function PDFFileOptions({ onOpenChange }) {
365
- const [pdfFile, setPDFFile] = useState(null);
366
- return !pdfFile ? /* @__PURE__ */ React6.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React6.createElement(Dialog.Portal, null, /* @__PURE__ */ React6.createElement(Dialog.Overlay, null), /* @__PURE__ */ React6.createElement(
367
- Dialog.Content,
368
- {
369
- css: {
370
- w: "min(420px,80%)",
371
- overflow: "auto",
372
- p: "$10",
373
- bg: "$surface_dim"
374
- }
375
- },
376
- /* @__PURE__ */ React6.createElement(Flex, { direction: "column" }, /* @__PURE__ */ React6.createElement(PDFHeader, null), /* @__PURE__ */ React6.createElement(
377
- DialogInputFile,
378
- {
379
- onChange: (target) => {
380
- setPDFFile(target.files[0]);
381
- },
382
- placeholder: "Click to upload",
383
- type: "file",
384
- accept: ".pdf"
385
- }
386
- ), /* @__PURE__ */ React6.createElement(SubmitPDF, { pdfFile, onOpenChange }))
387
- ))) : /* @__PURE__ */ React6.createElement(UploadedFile, { pdfFile, setPDFFile, onOpenChange });
388
- }
389
-
390
- // src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx
391
- var MODALS = {
392
- SHARE: "share",
393
- SCREEN_SHARE: "screenShare",
394
- PDF_SHARE: "pdfShare"
395
- };
396
- function ShareScreenOptions() {
397
- const [openModals, setOpenModals] = useState2(/* @__PURE__ */ new Set());
398
- const { amIScreenSharing } = useScreenShare();
399
- const updateState = (modalName, value) => {
400
- setOpenModals((modals) => {
401
- const copy = new Set(modals);
402
- if (value) {
403
- copy.add(modalName);
404
- } else {
405
- copy.delete(modalName);
406
- }
407
- return copy;
408
- });
409
- };
410
- const { toggleScreenShare } = useScreenShare();
411
- return /* @__PURE__ */ React7.createElement(Fragment, null, /* @__PURE__ */ React7.createElement(
412
- Dropdown.Root,
413
- {
414
- open: openModals.has(MODALS.SHARE),
415
- onOpenChange: (value) => updateState(MODALS.SHARE, value),
416
- modal: false
417
- },
418
- /* @__PURE__ */ React7.createElement(Dropdown.Trigger, { asChild: true, "data-testid": "sharing_btn", disabled: amIScreenSharing }, /* @__PURE__ */ React7.createElement(ShareMenuIcon, { disabled: amIScreenSharing }, /* @__PURE__ */ React7.createElement(Tooltip, { title: "Share" }, /* @__PURE__ */ React7.createElement(Box, null, /* @__PURE__ */ React7.createElement(VerticalMenuIcon, null))))),
419
- /* @__PURE__ */ React7.createElement(
420
- Dropdown.Content,
421
- {
422
- sideOffset: 5,
423
- css: {
424
- w: "$96",
425
- maxHeight: "$96",
426
- p: 0,
427
- bg: "$surface_dim"
428
- }
429
- },
430
- /* @__PURE__ */ React7.createElement(
431
- Dropdown.Item,
432
- {
433
- css: {
434
- flexDirection: "column",
435
- alignItems: "flex-start",
436
- px: "$10",
437
- pt: "$10",
438
- pb: "$6",
439
- "&:hover": {
440
- bg: "transparent",
441
- cursor: "default"
442
- }
443
- }
444
- },
445
- /* @__PURE__ */ React7.createElement(Text, { variant: "h6" }, "Start Sharing"),
446
- /* @__PURE__ */ React7.createElement(Text, { variant: "sm" }, "Choose what you want to share")
447
- ),
448
- /* @__PURE__ */ React7.createElement(
449
- Dropdown.Item,
450
- {
451
- css: {
452
- flexDirection: "row",
453
- alignItems: "flex-start",
454
- gap: "$8",
455
- px: "$10",
456
- pt: "$6",
457
- pb: "$10",
458
- "&:hover": {
459
- bg: "transparent",
460
- cursor: "default"
461
- }
462
- }
463
- },
464
- /* @__PURE__ */ React7.createElement(
465
- Flex,
466
- {
467
- direction: "column",
468
- align: "center",
469
- css: {
470
- gap: "$6"
471
- }
472
- },
473
- /* @__PURE__ */ React7.createElement(
474
- IconButton,
475
- {
476
- as: "div",
477
- onClick: toggleScreenShare,
478
- css: {
479
- p: "$6",
480
- display: "flex",
481
- justifyContent: "center",
482
- border: "1px solid $border_bright",
483
- r: "$2",
484
- bg: "$surface_brighter",
485
- pb: "0"
486
- }
487
- },
488
- /* @__PURE__ */ React7.createElement(
489
- "img",
490
- {
491
- src: ScreenShareImg,
492
- alt: "screen-share",
493
- width: "100%",
494
- height: "100%",
495
- style: {
496
- borderTopLeftRadius: "0.5rem",
497
- // TODO: create image component to solve for style hardcoding
498
- borderTopRightRadius: "0.5rem"
499
- }
500
- }
501
- )
502
- ),
503
- /* @__PURE__ */ React7.createElement(Flex, { direction: "column", align: "center" }, /* @__PURE__ */ React7.createElement(Text, { variant: "body2" }, "Share Screen"), /* @__PURE__ */ React7.createElement(
504
- Text,
505
- {
506
- variant: "caption",
507
- css: {
508
- c: "$on_surface_low",
509
- textAlign: "center"
510
- }
511
- },
512
- "Share your tab, window or your entire screen"
513
- ))
514
- ),
515
- /* @__PURE__ */ React7.createElement(
516
- Flex,
517
- {
518
- direction: "column",
519
- align: "center",
520
- css: {
521
- gap: "$6"
522
- }
523
- },
524
- /* @__PURE__ */ React7.createElement(
525
- IconButton,
526
- {
527
- onClick: () => {
528
- updateState(MODALS.PDF_SHARE, true);
529
- },
530
- disabled: amIScreenSharing,
531
- css: {
532
- p: "$6",
533
- display: "flex",
534
- justifyContent: "center",
535
- border: "$border_bright 1px solid",
536
- r: "$2",
537
- bg: "$surface_bright",
538
- pb: "0"
539
- }
540
- },
541
- /* @__PURE__ */ React7.createElement(
542
- "img",
543
- {
544
- src: PDFShareImg,
545
- alt: "pdf-share",
546
- width: "100%",
547
- height: "100%",
548
- style: {
549
- borderTopLeftRadius: "0.5rem",
550
- // TODO: create image component to solve for style hardcoding
551
- borderTopRightRadius: "0.5rem"
552
- }
553
- }
554
- ),
555
- /* @__PURE__ */ React7.createElement(
556
- Flex,
557
- {
558
- direction: "row",
559
- align: "center",
560
- css: {
561
- position: "absolute",
562
- top: "35%",
563
- left: "54%",
564
- padding: "$2 $4",
565
- r: "$2",
566
- bg: "$primary_bright",
567
- zIndex: "2",
568
- gap: "$2"
569
- }
570
- },
571
- /* @__PURE__ */ React7.createElement(StarIcon, { height: 14, width: 14 }),
572
- /* @__PURE__ */ React7.createElement(
573
- Text,
574
- {
575
- variant: "xs",
576
- css: {
577
- fontWeight: "$semiBold",
578
- c: "$on_primary_high",
579
- pr: "$4"
580
- }
581
- },
582
- "New"
583
- )
584
- )
585
- ),
586
- /* @__PURE__ */ React7.createElement(Flex, { direction: "column", align: "center" }, /* @__PURE__ */ React7.createElement(Text, { variant: "body2" }, "Share PDF"), /* @__PURE__ */ React7.createElement(
587
- Text,
588
- {
589
- variant: "caption",
590
- css: {
591
- c: "$on_surface_low",
592
- textAlign: "center"
593
- }
594
- },
595
- "Annotate, draw shapes, and more over PDFs"
596
- ))
597
- )
598
- )
599
- )
600
- ), openModals.has(MODALS.PDF_SHARE) && /* @__PURE__ */ React7.createElement(PDFFileOptions, { onOpenChange: (value) => updateState(MODALS.PDF_SHARE, value) }));
601
- }
602
-
603
- // src/Prebuilt/components/ScreenShareToggle.jsx
604
- var ScreenshareToggle = ({ css = {} }) => {
605
- const isAllowedToPublish = useHMSStore2(selectIsAllowedToPublish);
606
- const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
607
- const {
608
- amIScreenSharing,
609
- screenShareVideoTrackId: video,
610
- toggleScreenShare
611
- } = useScreenShare2((error) => {
612
- ToastManager.addToast({
613
- title: error.message,
614
- variant: "error",
615
- duration: 2e3
616
- });
617
- });
618
- const { requestPermission } = useAwayNotifications();
619
- const isVideoScreenshare = amIScreenSharing && !!video;
620
- if (!isAllowedToPublish.screen || !isScreenshareSupported()) {
621
- return null;
622
- }
623
- return /* @__PURE__ */ React8.createElement(Fragment2, null, /* @__PURE__ */ React8.createElement(Flex, { direction: "row" }, /* @__PURE__ */ React8.createElement(
624
- ScreenShareButton,
625
- {
626
- variant: "standard",
627
- key: "ShareScreen",
628
- active: !isVideoScreenshare,
629
- css,
630
- disabled: isAudioOnly,
631
- onClick: () => __async(void 0, null, function* () {
632
- yield toggleScreenShare();
633
- yield requestPermission();
634
- })
635
- },
636
- /* @__PURE__ */ React8.createElement(Tooltip, { title: `${!isVideoScreenshare ? "Start" : "Stop"} screen sharing` }, /* @__PURE__ */ React8.createElement(Box, null, /* @__PURE__ */ React8.createElement(ShareScreenIcon, null)))
637
- ), /* @__PURE__ */ React8.createElement(ShareScreenOptions, null)));
638
- };
639
-
640
- // src/Prebuilt/components/Footer/PollsToggle.tsx
641
- init_define_process_env();
642
- import React9, { useEffect } from "react";
643
- import { QuizActiveIcon, QuizIcon } from "@100mslive/react-icons";
644
- var PollsToggle = () => {
645
- const isPollsOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.POLLS);
646
- const togglePollView = usePollViewToggle();
647
- const { unreadPollQuiz, setUnreadPollQuiz } = useUnreadPollQuizPresent();
648
- useEffect(() => {
649
- if (unreadPollQuiz && isPollsOpen) {
650
- setUnreadPollQuiz(false);
651
- }
652
- }, [isPollsOpen, unreadPollQuiz, setUnreadPollQuiz]);
653
- return /* @__PURE__ */ React9.createElement(Tooltip, { key: "polls", title: `${isPollsOpen ? "Close" : "Open"} polls and quizzes` }, /* @__PURE__ */ React9.createElement(
654
- IconButton_default,
655
- {
656
- onClick: () => {
657
- togglePollView();
658
- setUnreadPollQuiz(false);
659
- },
660
- css: { bg: isPollsOpen ? "$surface_brighter" : "" },
661
- "data-testid": "polls_btn"
662
- },
663
- unreadPollQuiz ? /* @__PURE__ */ React9.createElement(QuizActiveIcon, null) : /* @__PURE__ */ React9.createElement(QuizIcon, null)
664
- ));
665
- };
666
-
667
- // src/Prebuilt/components/Footer/WhiteboardToggle.tsx
668
- init_define_process_env();
669
- import React10 from "react";
670
- import { selectPeerScreenSharing, useHMSStore as useHMSStore3, useWhiteboard } from "@100mslive/react-sdk";
671
- import { PencilDrawIcon } from "@100mslive/react-icons";
672
- var WhiteboardToggle = () => {
673
- const { toggle, open, isOwner } = useWhiteboard();
674
- const peerSharing = useHMSStore3(selectPeerScreenSharing);
675
- const disabled = !!peerSharing || open && !isOwner;
676
- if (!toggle) {
677
- return null;
678
- }
679
- return /* @__PURE__ */ React10.createElement(
680
- Tooltip,
681
- {
682
- key: "whiteboard",
683
- title: peerSharing ? "Cannot open whiteboard when viewing a shared screen" : `${open ? "Close" : "Open"} Whiteboard`
684
- },
685
- /* @__PURE__ */ React10.createElement(
686
- IconButton_default,
687
- {
688
- onClick: () => __async(void 0, null, function* () {
689
- if (disabled) {
690
- return;
691
- }
692
- try {
693
- yield toggle();
694
- } catch (error) {
695
- ToastManager.addToast({ title: error.message, variant: "error" });
696
- }
697
- }),
698
- active: !open,
699
- disabled,
700
- "data-testid": "whiteboard_btn"
701
- },
702
- /* @__PURE__ */ React10.createElement(PencilDrawIcon, null)
703
- )
704
- );
705
- };
706
-
707
- // src/Prebuilt/components/Footer/Footer.tsx
708
- var Footer2 = ({
709
- screenType,
710
- elements
711
- }) => {
712
- var _a, _b;
713
- const isMobile = useMedia(config.media.md);
714
- const isOverlayChat = !!((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay);
715
- const openByDefault = ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.initial_state) === Chat_ChatState.CHAT_STATE_OPEN;
716
- const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
717
- const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
718
- const { showPolls } = useShowPolls();
719
- useEffect2(() => {
720
- if (!isChatOpen && openByDefault) {
721
- toggleChat();
722
- }
723
- }, [toggleChat, openByDefault]);
724
- return /* @__PURE__ */ React11.createElement(
725
- Footer.Root,
726
- {
727
- css: {
728
- flexWrap: "nowrap",
729
- "@md": {
730
- justifyContent: "center",
731
- gap: "$10",
732
- position: "relative",
733
- // To prevent it from showing over the sidepane if chat type is not overlay
734
- zIndex: isOverlayChat && isChatOpen ? 20 : 1
735
- }
736
- }
737
- },
738
- /* @__PURE__ */ React11.createElement(
739
- Footer.Left,
740
- {
741
- css: {
742
- "@md": {
743
- w: "unset",
744
- p: "0",
745
- gap: "$10"
746
- }
747
- }
748
- },
749
- isMobile ? /* @__PURE__ */ React11.createElement(LeaveRoom, { screenType }) : null,
750
- /* @__PURE__ */ React11.createElement(AudioVideoToggle, null),
751
- !isMobile && elements.virtual_background ? /* @__PURE__ */ React11.createElement(VBToggle, null) : null
752
- ),
753
- /* @__PURE__ */ React11.createElement(
754
- Footer.Center,
755
- {
756
- css: {
757
- "@md": {
758
- w: "unset",
759
- gap: "$10"
760
- }
761
- }
762
- },
763
- isMobile ? /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(ScreenshareToggle, null), /* @__PURE__ */ React11.createElement(RaiseHand, null), (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React11.createElement(ChatToggle, null), /* @__PURE__ */ React11.createElement(MoreSettings, { elements, screenType })) : /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(ScreenshareToggle, null), /* @__PURE__ */ React11.createElement(RaiseHand, null), screenType !== "hls_live_streaming" && /* @__PURE__ */ React11.createElement(CaptionIcon, null), (elements == null ? void 0 : elements.emoji_reactions) && /* @__PURE__ */ React11.createElement(EmojiReaction, null), /* @__PURE__ */ React11.createElement(LeaveRoom, { screenType }))
764
- ),
765
- /* @__PURE__ */ React11.createElement(Footer.Right, null, /* @__PURE__ */ React11.createElement(WhiteboardToggle, null), showPolls && /* @__PURE__ */ React11.createElement(PollsToggle, null), !isMobile && (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React11.createElement(ChatToggle, null), (elements == null ? void 0 : elements.participant_list) && /* @__PURE__ */ React11.createElement(ParticipantCount, null), /* @__PURE__ */ React11.createElement(MoreSettings, { elements, screenType }))
766
- );
767
- };
768
-
769
- // src/Prebuilt/components/Notifications/HLSFailureModal.tsx
770
- init_define_process_env();
771
- import React12, { useCallback, useState as useState3 } from "react";
772
- import { selectHLSState, useHMSActions, useHMSStore as useHMSStore4, useRecordingStreaming } from "@100mslive/react-sdk";
773
- function HLSFailureModal() {
774
- const hlsError = useHMSStore4(selectHLSState).error || false;
775
- const [openModal, setOpenModal] = useState3(!!hlsError);
776
- const hmsActions = useHMSActions();
777
- const { isRTMPRunning } = useRecordingStreaming();
778
- const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
779
- const startHLS = useCallback(() => __async(this, null, function* () {
780
- try {
781
- if (isHLSStarted || isRTMPRunning) {
782
- return;
783
- }
784
- setHLSStarted(true);
785
- yield hmsActions.startHLSStreaming({});
786
- } catch (error) {
787
- console.error(error);
788
- setHLSStarted(false);
789
- }
790
- }), [hmsActions, isHLSStarted, setHLSStarted, isRTMPRunning]);
791
- return hlsError ? /* @__PURE__ */ React12.createElement(
792
- Dialog.Root,
793
- {
794
- open: openModal,
795
- onOpenChange: (value) => {
796
- if (!value) {
797
- setOpenModal(false);
798
- }
799
- }
800
- },
801
- /* @__PURE__ */ React12.createElement(Dialog.Portal, null, /* @__PURE__ */ React12.createElement(Dialog.Overlay, null), /* @__PURE__ */ React12.createElement(Dialog.Content, { css: { w: "min(360px, 90%)" } }, /* @__PURE__ */ React12.createElement(
802
- Dialog.Title,
803
- {
804
- css: {
805
- display: "flex",
806
- alignItems: "center",
807
- justifyContent: "space-between",
808
- borderBottom: "1px solid $border_default",
809
- mt: "$4"
810
- }
811
- },
812
- /* @__PURE__ */ React12.createElement(Text, { variant: "h6", css: { fontWeight: "$semiBold" } }, "Failed to Go Live")
813
- ), /* @__PURE__ */ React12.createElement(Text, { variant: "sm", css: { mb: "$10", color: "$on_surface_medium" } }, "Something went wrong and your live broadcast failed. Please try again."), /* @__PURE__ */ React12.createElement(Flex, { align: "center", justify: "between", css: { w: "100%", gap: "$8" } }, /* @__PURE__ */ React12.createElement(Button, { outlined: true, variant: "standard", css: { w: "100%" }, onClick: () => setOpenModal(false) }, "Dismiss"), /* @__PURE__ */ React12.createElement(Button, { css: { w: "100%" }, onClick: startHLS }, "Go Live"))))
814
- ) : null;
815
- }
816
-
817
- // src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx
818
- init_define_process_env();
819
- import React14, { useEffect as useEffect3 } from "react";
820
- import {
821
- selectIsInPreview,
822
- selectLocalPeerName,
823
- selectLocalPeerRoleName,
824
- selectRoleChangeRequest,
825
- useCustomEvent,
826
- useHMSActions as useHMSActions2,
827
- useHMSStore as useHMSStore5
828
- } from "@100mslive/react-sdk";
829
-
830
- // src/Prebuilt/components/RoleChangeRequest/RequestPrompt.tsx
831
- init_define_process_env();
832
- import React13 from "react";
833
- import { useMedia as useMedia2 } from "react-use";
834
- var RequestPrompt = ({
835
- open = true,
836
- onOpenChange,
837
- title,
838
- body,
839
- actionText = "Accept",
840
- onAction,
841
- disableActions = false
842
- }) => {
843
- const isMobile = useMedia2(config.media.md);
844
- if (isMobile) {
845
- return /* @__PURE__ */ React13.createElement(Sheet.Root, { open, onOpenChange }, /* @__PURE__ */ React13.createElement(Sheet.Content, { css: { py: "$8" } }, /* @__PURE__ */ React13.createElement(Text, { css: { fontWeight: "$semiBold", c: "$on_surface_high", "@md": { px: "$8" } } }, title), body, /* @__PURE__ */ React13.createElement(RequestActions, { actionText, onAction, disabled: disableActions })));
846
- }
847
- return /* @__PURE__ */ React13.createElement(Dialog.Root, { open, modal: false, onOpenChange }, /* @__PURE__ */ React13.createElement(Dialog.Portal, null, /* @__PURE__ */ React13.createElement(Dialog.Content, { css: { p: "$10" }, onInteractOutside: (e) => e.preventDefault() }, /* @__PURE__ */ React13.createElement(Dialog.Title, { css: { p: 0, display: "flex", flexDirection: "row", gap: "$md", justifyContent: "center" } }, /* @__PURE__ */ React13.createElement(Text, { variant: "h6" }, title)), /* @__PURE__ */ React13.createElement(Box, { css: { mt: "$4", mb: "$10" } }, body), /* @__PURE__ */ React13.createElement(RequestActions, { actionText, onAction, disabled: disableActions }))));
848
- };
849
- var RequestActions = ({
850
- onAction,
851
- actionText,
852
- disabled = false
853
- }) => /* @__PURE__ */ React13.createElement(Flex, { justify: "center", align: "center", css: { width: "100%", gap: "$md", "@md": { mt: "$8", px: "$8" } } }, /* @__PURE__ */ React13.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React13.createElement(Dialog.Close, { css: { width: "100%", height: "100%" }, asChild: true }, /* @__PURE__ */ React13.createElement(Button, { variant: "standard", outlined: true, css: { width: "100%", p: "$4 $8" }, disabled }, "Decline"))), /* @__PURE__ */ React13.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React13.createElement(Button, { variant: "primary", css: { width: "100%" }, onClick: onAction, disabled }, actionText)));
854
-
855
- // src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx
856
- var RoleChangeRequestModal = () => {
857
- const hmsActions = useHMSActions2();
858
- const { updateMetaData } = useMyMetadata();
859
- const isPreview = useHMSStore5(selectIsInPreview);
860
- const currentRole = useHMSStore5(selectLocalPeerRoleName);
861
- const roleChangeRequest = useHMSStore5(selectRoleChangeRequest);
862
- const name = useHMSStore5(selectLocalPeerName);
863
- const { sendEvent } = useCustomEvent({ type: ROLE_CHANGE_DECLINED });
864
- const { elements = {} } = useRoomLayoutPreviewScreen();
865
- const { virtual_background } = elements || {};
866
- useEffect3(() => {
867
- if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
868
- return;
869
- }
870
- (() => __async(void 0, null, function* () {
871
- yield hmsActions.preview({ asRole: roleChangeRequest.role.name });
872
- }))();
873
- }, [hmsActions, roleChangeRequest, currentRole, updateMetaData]);
874
- if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
875
- return null;
876
- }
877
- const body = /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(
878
- Text,
879
- {
880
- variant: "xs",
881
- css: {
882
- c: "$on_surface_medium",
883
- textAlign: "center",
884
- "@md": { textAlign: "left", borderBottom: "1px solid $border_bright", pb: "$4", px: "$8" }
885
- }
886
- },
887
- "Setup your audio and video before joining"
888
- ), /* @__PURE__ */ React14.createElement(
889
- Flex,
890
- {
891
- align: "center",
892
- justify: "center",
893
- css: {
894
- "@sm": { width: "100%" },
895
- flexDirection: "column",
896
- mt: "$6",
897
- "@md": { px: "$8" }
898
- }
899
- },
900
- /* @__PURE__ */ React14.createElement(PreviewTile, { name: name || "" }),
901
- /* @__PURE__ */ React14.createElement(PreviewControls, { hideSettings: true, vbEnabled: !!virtual_background })
902
- ));
903
- return /* @__PURE__ */ React14.createElement(
904
- RequestPrompt,
905
- {
906
- title: "You're invited to join the stage",
907
- onOpenChange: (value) => __async(void 0, null, function* () {
908
- var _a;
909
- if (!value) {
910
- hmsActions.rejectChangeRole(roleChangeRequest);
911
- sendEvent(__spreadProps(__spreadValues({}, roleChangeRequest), { peerName: name }), { peerId: (_a = roleChangeRequest.requestedBy) == null ? void 0 : _a.id });
912
- yield hmsActions.cancelMidCallPreview();
913
- yield hmsActions.lowerLocalPeerHand();
914
- }
915
- }),
916
- body,
917
- onAction: () => __async(void 0, null, function* () {
918
- yield hmsActions.acceptChangeRole(roleChangeRequest);
919
- yield updateMetaData({ prevRole: currentRole });
920
- yield hmsActions.lowerLocalPeerHand();
921
- }),
922
- actionText: "Accept",
923
- disableActions: !isPreview
924
- }
925
- );
926
- };
927
-
928
- // src/Prebuilt/layouts/VideoStreamingSection.tsx
929
- init_define_process_env();
930
- import React18, { Suspense as Suspense2, useEffect as useEffect8, useState as useState7 } from "react";
931
- import { useMedia as useMedia5 } from "react-use";
932
- import { match } from "ts-pattern";
933
- import {
934
- selectIsConnectedToRoom,
935
- selectIsLocalScreenShared,
936
- selectLocalPeerRoleName as selectLocalPeerRoleName3,
937
- useHMSActions as useHMSActions3,
938
- useHMSStore as useHMSStore9
939
- } from "@100mslive/react-sdk";
940
- import { PeopleAddIcon as PeopleAddIcon2, ShareScreenIcon as ShareScreenIcon2 } from "@100mslive/react-icons";
941
-
942
- // src/Prebuilt/components/VideoLayouts/GridLayout.tsx
943
- init_define_process_env();
944
- import React16, { Suspense, useEffect as useEffect5, useMemo, useState as useState5 } from "react";
945
- import {
946
- selectLocalPeerID,
947
- selectLocalPeerRoleName as selectLocalPeerRoleName2,
948
- selectPeers,
949
- selectPeerScreenSharing as selectPeerScreenSharing2,
950
- selectWhiteboard,
951
- useHMSStore as useHMSStore6,
952
- useHMSVanillaStore
953
- } from "@100mslive/react-sdk";
954
-
955
- // src/Prebuilt/components/VideoLayouts/EqualProminence.tsx
956
- init_define_process_env();
957
- import React15, { useEffect as useEffect4, useState as useState4 } from "react";
958
- import { useMedia as useMedia3 } from "react-use";
959
- import { PeopleAddIcon } from "@100mslive/react-icons";
960
- function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSize, edgeToEdge }) {
961
- var _a;
962
- const isMobile = useMedia3(config.media.md);
963
- let maxTileCount = useUISettings(UI_SETTINGS.maxTileCount);
964
- maxTileCount = isMobile ? Math.min(maxTileCount, 6) : maxTileCount;
965
- const pageList = usePagesWithTiles({
966
- peers,
967
- maxTileCount
968
- });
969
- const { ref, pagesWithTiles } = useTileLayout({
970
- pageList,
971
- maxTileCount,
972
- edgeToEdge
973
- });
974
- const [page, setPage] = useState4(0);
975
- const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
976
- useEffect4(() => {
977
- if (pageSize > 0) {
978
- onPageSize == null ? void 0 : onPageSize(pageSize);
979
- }
980
- }, [pageSize, onPageSize]);
981
- return /* @__PURE__ */ React15.createElement(Flex, { direction: "column", css: { flex: "1 1 0", h: "100%", position: "relative", minWidth: 0 } }, /* @__PURE__ */ React15.createElement(Grid, { tiles: pagesWithTiles[page], ref, edgeToEdge }), !edgeToEdge && /* @__PURE__ */ React15.createElement(
982
- Pagination,
983
- {
984
- page,
985
- onPageChange: (page2) => {
986
- setPage(page2);
987
- onPageChange == null ? void 0 : onPageChange(page2);
988
- },
989
- numPages: pagesWithTiles.length
990
- }
991
- ), pageList.length === 0 ? /* @__PURE__ */ React15.createElement(
992
- WaitingView,
993
- {
994
- title: "You're the only one here",
995
- subtitle: "Sit back and relax till others join",
996
- icon: /* @__PURE__ */ React15.createElement(PeopleAddIcon, { width: "56px", height: "56px", style: { color: "white" } })
997
- }
998
- ) : null, isInsetEnabled && /* @__PURE__ */ React15.createElement(InsetTile, null));
999
- }
1000
-
1001
- // src/Prebuilt/common/PeersSorter.ts
1002
- init_define_process_env();
1003
- import { selectDominantSpeaker } from "@100mslive/react-sdk";
1004
- var PeersSorter = class {
1005
- constructor(store) {
1006
- this.storeUnsubscribe = void 0;
1007
- this.setPeersAndTilesPerPage = ({ peers, tilesPerPage }) => {
1008
- this.speaker = void 0;
1009
- this.tilesPerPage = tilesPerPage;
1010
- const peerIds = new Set(peers.map((peer) => peer.id));
1011
- this.peers.forEach((_, key) => {
1012
- if (!peerIds.has(key)) {
1013
- this.peers.delete(key);
1014
- }
1015
- });
1016
- this.lruPeers = new Set([...this.lruPeers].filter((peerId) => peerIds.has(peerId)));
1017
- peers.forEach((peer) => {
1018
- this.peers.set(peer.id, peer);
1019
- if (this.lruPeers.size < tilesPerPage) {
1020
- this.lruPeers.add(peer.id);
1021
- }
1022
- });
1023
- if (!this.storeUnsubscribe) {
1024
- this.storeUnsubscribe = this.store.subscribe(this.onDominantSpeakerChange, selectDominantSpeaker);
1025
- }
1026
- this.moveSpeakerToFront(this.speaker);
1027
- };
1028
- this.onUpdate = (cb) => {
1029
- this.listeners.add(cb);
1030
- };
1031
- this.stop = () => {
1032
- var _a;
1033
- this.updateListeners();
1034
- this.listeners.clear();
1035
- (_a = this.storeUnsubscribe) == null ? void 0 : _a.call(this);
1036
- this.storeUnsubscribe = void 0;
1037
- this.speaker = void 0;
1038
- };
1039
- this.moveSpeakerToFront = (speaker) => {
1040
- if (!speaker) {
1041
- this.maintainLruSize(this.tilesPerPage);
1042
- this.updateListeners();
1043
- return;
1044
- }
1045
- if (this.lruPeers.has(speaker.id) && this.lruPeers.size <= this.tilesPerPage) {
1046
- this.updateListeners();
1047
- return;
1048
- }
1049
- this.lruPeers.delete(speaker.id);
1050
- this.maintainLruSize(this.tilesPerPage - 1);
1051
- this.lruPeers = /* @__PURE__ */ new Set([speaker.id, ...this.lruPeers]);
1052
- this.updateListeners();
1053
- };
1054
- this.onDominantSpeakerChange = (speaker) => {
1055
- var _a;
1056
- if (!speaker || speaker.id === ((_a = this.speaker) == null ? void 0 : _a.id)) {
1057
- return;
1058
- }
1059
- if (!this.peers.has(speaker.id)) {
1060
- return;
1061
- }
1062
- this.speaker = speaker;
1063
- this.moveSpeakerToFront(speaker);
1064
- };
1065
- this.updateListeners = () => {
1066
- const orderedPeers = [];
1067
- this.lruPeers.forEach((key) => {
1068
- const peer = this.peers.get(key);
1069
- if (peer) {
1070
- orderedPeers.push(peer);
1071
- }
1072
- });
1073
- this.peers.forEach((peer) => {
1074
- if (!this.lruPeers.has(peer.id) && peer) {
1075
- orderedPeers.push(peer);
1076
- }
1077
- });
1078
- this.listeners.forEach((listener) => listener == null ? void 0 : listener(orderedPeers));
1079
- };
1080
- this.maintainLruSize = (size) => {
1081
- const lruPeerArray = Array.from(this.lruPeers);
1082
- while (lruPeerArray.length > size && lruPeerArray.length) {
1083
- lruPeerArray.pop();
1084
- }
1085
- this.lruPeers = new Set(lruPeerArray);
1086
- };
1087
- this.store = store;
1088
- this.peers = /* @__PURE__ */ new Map();
1089
- this.lruPeers = /* @__PURE__ */ new Set();
1090
- this.speaker = void 0;
1091
- this.listeners = /* @__PURE__ */ new Set();
1092
- }
1093
- };
1094
- var PeersSorter_default = PeersSorter;
1095
-
1096
- // src/Prebuilt/components/VideoLayouts/GridLayout.tsx
1097
- var RoleProminence = React16.lazy(
1098
- () => import("./RoleProminence-235AFT7F.js").then((module) => ({ default: module.RoleProminence }))
1099
- );
1100
- var ScreenshareLayout = React16.lazy(
1101
- () => import("./ScreenshareLayout-PSQMS3NC.js").then((module) => ({ default: module.ScreenshareLayout }))
1102
- );
1103
- var WhiteboardLayout = React16.lazy(
1104
- () => import("./WhiteboardLayout-4YLFM3EY.js").then((module) => ({ default: module.WhiteboardLayout }))
1105
- );
1106
- var GridLayout = ({
1107
- enable_local_tile_inset: isInsetEnabled = false,
1108
- prominent_roles: prominentRoles = [],
1109
- enable_spotlighting_peer = false,
1110
- hide_participant_name_on_tile = false,
1111
- rounded_video_tile = true,
1112
- hide_audio_mute_on_tile = false,
1113
- video_object_fit = "contain",
1114
- edge_to_edge = false,
1115
- hide_metadata_on_tile = false
1116
- }) => {
1117
- const peerSharing = useHMSStore6(selectPeerScreenSharing2);
1118
- const whiteboard = useHMSStore6(selectWhiteboard);
1119
- const pinnedTrack = usePinnedTrack();
1120
- const peers = useHMSStore6(selectPeers);
1121
- const localPeerRole = useHMSStore6(selectLocalPeerRoleName2);
1122
- const localPeerID = useHMSStore6(selectLocalPeerID);
1123
- const [activeScreensharePeerId] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
1124
- const isRoleProminence = prominentRoles.length && peers.some(
1125
- (peer) => peer.roleName && prominentRoles.includes(peer.roleName) && (peer.videoTrack || peer.audioTrack)
1126
- ) || pinnedTrack;
1127
- const updatedPeers = useMemo(() => {
1128
- if (activeScreensharePeerId || (whiteboard == null ? void 0 : whiteboard.open)) {
1129
- return peers.filter((peer) => peer.id !== activeScreensharePeerId || peer.customerUserId !== (whiteboard == null ? void 0 : whiteboard.owner));
1130
- }
1131
- if (isInsetEnabled) {
1132
- const isLocalPeerPinned = localPeerID === (pinnedTrack == null ? void 0 : pinnedTrack.peerId);
1133
- if (localPeerRole && prominentRoles.includes(localPeerRole) || isLocalPeerPinned) {
1134
- return peers;
1135
- } else {
1136
- return peers.filter((peer) => !peer.isLocal);
1137
- }
1138
- }
1139
- return peers;
1140
- }, [
1141
- isInsetEnabled,
1142
- whiteboard,
1143
- activeScreensharePeerId,
1144
- localPeerRole,
1145
- localPeerID,
1146
- prominentRoles,
1147
- peers,
1148
- pinnedTrack
1149
- ]);
1150
- const vanillaStore = useHMSVanillaStore();
1151
- const [sortedPeers, setSortedPeers] = useState5(updatedPeers);
1152
- const peersSorter = useMemo(() => new PeersSorter_default(vanillaStore), [vanillaStore]);
1153
- const [pageSize, setPageSize] = useState5(0);
1154
- const [mainPage, setMainPage] = useState5(0);
1155
- const tileLayout = {
1156
- enableSpotlightingPeer: enable_spotlighting_peer,
1157
- hideParticipantNameOnTile: hide_participant_name_on_tile,
1158
- roundedVideoTile: rounded_video_tile,
1159
- hideAudioMuteOnTile: hide_audio_mute_on_tile,
1160
- hideMetadataOnTile: hide_metadata_on_tile,
1161
- objectFit: video_object_fit
1162
- };
1163
- useEffect5(() => {
1164
- if (mainPage !== 0) {
1165
- return;
1166
- }
1167
- peersSorter.setPeersAndTilesPerPage({
1168
- peers: updatedPeers,
1169
- tilesPerPage: pageSize
1170
- });
1171
- peersSorter.onUpdate(setSortedPeers);
1172
- }, [mainPage, peersSorter, updatedPeers, pageSize]);
1173
- if (peerSharing) {
1174
- return /* @__PURE__ */ React16.createElement(Suspense, { fallback: /* @__PURE__ */ React16.createElement(FullPageProgress_default, null) }, /* @__PURE__ */ React16.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React16.createElement(
1175
- ScreenshareLayout,
1176
- {
1177
- peers: sortedPeers,
1178
- onPageSize: setPageSize,
1179
- onPageChange: setMainPage,
1180
- edgeToEdge: edge_to_edge
1181
- }
1182
- )));
1183
- } else if (whiteboard == null ? void 0 : whiteboard.open) {
1184
- return /* @__PURE__ */ React16.createElement(Suspense, { fallback: /* @__PURE__ */ React16.createElement(FullPageProgress_default, null) }, /* @__PURE__ */ React16.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React16.createElement(
1185
- WhiteboardLayout,
1186
- {
1187
- peers: sortedPeers,
1188
- onPageSize: setPageSize,
1189
- onPageChange: setMainPage,
1190
- edgeToEdge: edge_to_edge
1191
- }
1192
- )));
1193
- } else if (isRoleProminence) {
1194
- return /* @__PURE__ */ React16.createElement(Suspense, { fallback: /* @__PURE__ */ React16.createElement(FullPageProgress_default, null) }, /* @__PURE__ */ React16.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React16.createElement(
1195
- RoleProminence,
1196
- {
1197
- peers: sortedPeers,
1198
- onPageSize: setPageSize,
1199
- onPageChange: setMainPage,
1200
- prominentRoles,
1201
- isInsetEnabled,
1202
- edgeToEdge: edge_to_edge
1203
- }
1204
- )));
1205
- }
1206
- return /* @__PURE__ */ React16.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React16.createElement(
1207
- EqualProminence,
1208
- {
1209
- peers: sortedPeers,
1210
- onPageSize: setPageSize,
1211
- onPageChange: setMainPage,
1212
- isInsetEnabled,
1213
- edgeToEdge: edge_to_edge
1214
- }
1215
- ));
1216
- };
1217
-
1218
- // src/Prebuilt/plugins/CaptionsViewer.tsx
1219
- init_define_process_env();
1220
- import React17, { useEffect as useEffect6, useRef, useState as useState6 } from "react";
1221
- import Draggable from "react-draggable";
1222
- import { useMedia as useMedia4 } from "react-use";
1223
- import {
1224
- selectIsTranscriptionEnabled as selectIsTranscriptionEnabled2,
1225
- selectPeerNameByID,
1226
- useHMSStore as useHMSStore7,
1227
- useTranscript
1228
- } from "@100mslive/react-sdk";
1229
- var SimpleQueue = class {
1230
- constructor(capacity = 3, MAX_STORAGE_TIME = 5e3) {
1231
- this.capacity = capacity;
1232
- this.MAX_STORAGE_TIME = MAX_STORAGE_TIME;
1233
- this.storage = [];
1234
- }
1235
- enqueue(data) {
1236
- var _a;
1237
- if (!data.transcript.trim()) {
1238
- return;
1239
- }
1240
- if (this.size() === this.capacity && this.storage[this.size() - 1].final) {
1241
- this.dequeue(this.storage[this.size() - 1]);
1242
- }
1243
- if (this.size() === 0) {
1244
- this.storage.push(data);
1245
- this.addTimeout(this.storage[this.size() - 1], data.final);
1246
- return;
1247
- }
1248
- if (this.size() > 0 && ((_a = this.storage[this.size() - 1]) == null ? void 0 : _a.final) === true) {
1249
- this.storage.push(data);
1250
- this.addTimeout(this.storage[this.size() - 1], data.final);
1251
- return;
1252
- }
1253
- this.storage[this.size() - 1].transcript = data.transcript;
1254
- this.storage[this.size() - 1].final = data.final;
1255
- this.storage[this.size() - 1].end = data.end;
1256
- this.addTimeout(this.storage[this.size() - 1], data.final);
1257
- }
1258
- addTimeout(item, isFinal) {
1259
- if (!isFinal) {
1260
- return;
1261
- }
1262
- item.timeout = setTimeout(() => {
1263
- this.dequeue(item);
1264
- }, this.MAX_STORAGE_TIME);
1265
- }
1266
- dequeue(item) {
1267
- const index = this.storage.indexOf(item);
1268
- if (index === -1) {
1269
- return void 0;
1270
- }
1271
- const removedItem = this.storage.splice(index, 1);
1272
- if (removedItem.length <= 0) {
1273
- return void 0;
1274
- }
1275
- this.clearTimeout(removedItem[0]);
1276
- return item;
1277
- }
1278
- clearTimeout(item) {
1279
- if (!item.timeout) {
1280
- return;
1281
- }
1282
- clearTimeout(item.timeout);
1283
- }
1284
- peek() {
1285
- if (this.size() <= 0) {
1286
- return void 0;
1287
- }
1288
- return this.storage[0];
1289
- }
1290
- getTranscription() {
1291
- let script = "";
1292
- this.storage.forEach((value) => script += value.transcript + " ");
1293
- return script;
1294
- }
1295
- reset() {
1296
- this.storage.length = 0;
1297
- }
1298
- size() {
1299
- return this.storage.length;
1300
- }
1301
- };
1302
- var Queue = class {
1303
- constructor(capacity = 3) {
1304
- this.capacity = capacity;
1305
- this.storage = {};
1306
- }
1307
- enqueue(data) {
1308
- if (this.size() === this.capacity) {
1309
- this.dequeue();
1310
- }
1311
- if (!this.storage[data.peer_id]) {
1312
- this.storage[data.peer_id] = {
1313
- peer_id: data.peer_id,
1314
- transcript: data.transcript,
1315
- final: data.final,
1316
- transcriptQueue: new SimpleQueue(),
1317
- start: data.start,
1318
- end: data.end
1319
- };
1320
- this.storage[data.peer_id].transcriptQueue.enqueue(data);
1321
- return;
1322
- }
1323
- this.storage[data.peer_id].transcriptQueue.enqueue(data);
1324
- }
1325
- dequeue() {
1326
- const key = Object.keys(this.storage).shift() || "";
1327
- const captionData = this.storage[key];
1328
- captionData.transcriptQueue.reset();
1329
- delete this.storage[key];
1330
- return captionData;
1331
- }
1332
- peek() {
1333
- if (this.size() <= 0)
1334
- return void 0;
1335
- const key = Object.keys(this.storage).shift() || "";
1336
- return this.storage[key];
1337
- }
1338
- findPeerData() {
1339
- const keys = Object.keys(this.storage);
1340
- const data = keys.map((key) => {
1341
- const data2 = this.storage[key];
1342
- const word = data2.transcriptQueue.getTranscription();
1343
- return { [key]: word };
1344
- });
1345
- return data;
1346
- }
1347
- size() {
1348
- return Object.keys(this.storage).length;
1349
- }
1350
- };
1351
- var CaptionMaintainerQueue = class {
1352
- constructor() {
1353
- this.captionData = new Queue();
1354
- }
1355
- push(data = []) {
1356
- data.forEach((value) => {
1357
- this.captionData.enqueue(value);
1358
- });
1359
- }
1360
- };
1361
- var TranscriptView = ({ peer_id, data }) => {
1362
- const peerName = useHMSStore7(selectPeerNameByID(peer_id)) || "Participant";
1363
- data = data.trim();
1364
- if (!data)
1365
- return null;
1366
- return /* @__PURE__ */ React17.createElement(
1367
- Text,
1368
- {
1369
- variant: "body2",
1370
- css: {
1371
- fontWeight: "$normal"
1372
- }
1373
- },
1374
- /* @__PURE__ */ React17.createElement("b", null, peerName, ": "),
1375
- data
1376
- );
1377
- };
1378
- var CaptionsViewer = ({
1379
- defaultPosition,
1380
- setDefaultPosition
1381
- }) => {
1382
- var _a;
1383
- const { elements, screenType } = useRoomLayoutConferencingScreen();
1384
- const isMobile = useMedia4(config.media.md);
1385
- const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
1386
- const showCaptionAtTop = ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) && isChatOpen && isMobile;
1387
- const [captionQueue] = useState6(new CaptionMaintainerQueue());
1388
- const [currentData, setCurrentData] = useState6([]);
1389
- const isCaptionEnabled = useIsCaptionEnabled();
1390
- const isTranscriptionEnabled = useHMSStore7(selectIsTranscriptionEnabled2);
1391
- const nodeRef = useRef(null);
1392
- useEffect6(() => {
1393
- const timeInterval = setInterval(() => {
1394
- var _a2;
1395
- if (!captionQueue) {
1396
- return;
1397
- }
1398
- const data = (_a2 = captionQueue.captionData) == null ? void 0 : _a2.findPeerData();
1399
- setCurrentData(data);
1400
- }, 1e3);
1401
- return () => clearInterval(timeInterval);
1402
- }, [captionQueue]);
1403
- useTranscript({
1404
- onTranscript: (data) => {
1405
- captionQueue && captionQueue.push(data);
1406
- }
1407
- });
1408
- const dataToShow = currentData.filter((data) => {
1409
- const key = Object.keys(data)[0];
1410
- if (data[key]) {
1411
- return true;
1412
- }
1413
- return false;
1414
- });
1415
- if (dataToShow.length <= 0 || screenType === "hls_live_streaming" || !isCaptionEnabled || !isTranscriptionEnabled) {
1416
- return null;
1417
- }
1418
- return /* @__PURE__ */ React17.createElement(
1419
- Draggable,
1420
- {
1421
- bounds: "parent",
1422
- nodeRef,
1423
- defaultPosition,
1424
- onStop: (_, data) => {
1425
- setDefaultPosition({ x: data.lastX, y: data.lastY });
1426
- }
1427
- },
1428
- /* @__PURE__ */ React17.createElement(
1429
- Box,
1430
- {
1431
- ref: nodeRef,
1432
- css: {
1433
- position: "absolute",
1434
- w: isMobile ? "100%" : "40%",
1435
- bottom: showCaptionAtTop ? "" : "0",
1436
- top: showCaptionAtTop ? "0" : "",
1437
- left: isMobile ? 0 : "50%",
1438
- transform: isMobile ? "" : "translateX(-50%)",
1439
- background: "#000000A3",
1440
- overflow: "clip",
1441
- zIndex: 10,
1442
- height: "fit-content",
1443
- r: "$1",
1444
- p: "$6",
1445
- transition: "bottom 0.3s ease-in-out",
1446
- "&:empty": { display: "none" }
1447
- }
1448
- },
1449
- /* @__PURE__ */ React17.createElement(Flex, { direction: "column" }, dataToShow.map((data, index) => {
1450
- const key = Object.keys(data)[0];
1451
- return /* @__PURE__ */ React17.createElement(TranscriptView, { key: index, peer_id: key, data: data[key] });
1452
- }))
1453
- )
1454
- );
1455
- };
1456
-
1457
- // src/Prebuilt/components/hooks/useCloseScreenshareWhiteboard.tsx
1458
- init_define_process_env();
1459
- import { useEffect as useEffect7 } from "react";
1460
- import { selectPeerScreenSharing as selectPeerScreenSharing3, useHMSStore as useHMSStore8, useWhiteboard as useWhiteboard2 } from "@100mslive/react-sdk";
1461
- var useCloseScreenshareWhiteboard = () => {
1462
- const peerSharing = useHMSStore8(selectPeerScreenSharing3);
1463
- const { isOwner: isWhiteboardOwner, toggle: toggleWhiteboard } = useWhiteboard2();
1464
- useEffect7(() => {
1465
- if (isWhiteboardOwner && peerSharing) {
1466
- toggleWhiteboard == null ? void 0 : toggleWhiteboard();
1467
- }
1468
- }, [isWhiteboardOwner, toggleWhiteboard, peerSharing]);
1469
- };
1470
-
1471
- // src/Prebuilt/layouts/VideoStreamingSection.tsx
1472
- var HLSView = React18.lazy(() => import("./HLSView-Q6GEB3UM.js"));
1473
- var EmbedView = React18.lazy(() => import("./EmbedView-DDSO7ZCV.js").then((module) => ({ default: module.EmbedView })));
1474
- var PDFView = React18.lazy(() => import("./PDFView-ZFSG2ESE.js").then((module) => ({ default: module.PDFView })));
1475
- var WaitingView2 = React18.lazy(() => import("./WaitingView-NZIUOXBI.js").then((module) => ({ default: module.WaitingView })));
1476
- var VideoStreamingSection = ({
1477
- screenType,
1478
- elements,
1479
- hideControls = false
1480
- }) => {
1481
- var _a;
1482
- const localPeerRoleName = useHMSStore9(selectLocalPeerRoleName3);
1483
- const isConnected = useHMSStore9(selectIsConnectedToRoom);
1484
- const isSharingScreen = useHMSStore9(selectIsLocalScreenShared);
1485
- const hmsActions = useHMSActions3();
1486
- const urlToIframe = useUrlToEmbed();
1487
- const pdfAnnotatorActive = usePDFConfig();
1488
- const isMobileHLSStream = useMobileHLSStream();
1489
- const isLandscapeHLSStream = useLandscapeHLSStream();
1490
- const isMobile = useMedia5(config.media.md);
1491
- const [captionPosition, setCaptionPosition] = useState7({ x: isMobile ? 0 : -200, y: 0 });
1492
- useCloseScreenshareWhiteboard();
1493
- const { isNotAllowedToPublish, isScreenOnlyPublishParams, hasSubscribedRolePublishing } = useWaitingRoomInfo();
1494
- useEffect8(() => {
1495
- if (!isConnected) {
1496
- return;
1497
- }
1498
- hmsActions.sessionStore.observe([
1499
- "pinnedMessages" /* PINNED_MESSAGES */,
1500
- "spotlight" /* SPOTLIGHT */,
1501
- "chatState" /* CHAT_STATE */,
1502
- "chatMessageBlacklist" /* CHAT_MESSAGE_BLACKLIST */,
1503
- "chatPeerBlacklist" /* CHAT_PEER_BLACKLIST */
1504
- ]);
1505
- }, [isConnected, hmsActions]);
1506
- if (!localPeerRoleName) {
1507
- return null;
1508
- }
1509
- return /* @__PURE__ */ React18.createElement(
1510
- Flex,
1511
- {
1512
- css: {
1513
- size: "100%",
1514
- position: "relative",
1515
- gap: isMobileHLSStream || isLandscapeHLSStream ? "0" : "$4"
1516
- },
1517
- direction: match({ isLandscapeHLSStream, isMobileHLSStream }).with({ isLandscapeHLSStream: true }, () => "row").with({ isMobileHLSStream: true }, () => "column").otherwise(() => "row")
1518
- },
1519
- /* @__PURE__ */ React18.createElement(Suspense2, { fallback: /* @__PURE__ */ React18.createElement(FullPageProgress_default, null) }, match({
1520
- screenType,
1521
- isNotAllowedToPublish,
1522
- isScreenOnlyPublishParams,
1523
- hasSubscribedRolePublishing,
1524
- isSharingScreen,
1525
- pdfAnnotatorActive,
1526
- urlToIframe
1527
- }).with(
1528
- {
1529
- screenType: "hls_live_streaming"
1530
- },
1531
- () => /* @__PURE__ */ React18.createElement(HLSView, null)
1532
- ).when(
1533
- ({ isNotAllowedToPublish: isNotAllowedToPublish2, hasSubscribedRolePublishing: hasSubscribedRolePublishing2 }) => isNotAllowedToPublish2 && !hasSubscribedRolePublishing2,
1534
- () => /* @__PURE__ */ React18.createElement(
1535
- WaitingView2,
1536
- {
1537
- title: "Waiting for Host to join",
1538
- subtitle: "Sit back and relax",
1539
- icon: /* @__PURE__ */ React18.createElement(PeopleAddIcon2, { width: "56px", height: "56px", style: { color: "white" } })
1540
- }
1541
- )
1542
- ).when(
1543
- ({ isScreenOnlyPublishParams: isScreenOnlyPublishParams2, isSharingScreen: isSharingScreen2, hasSubscribedRolePublishing: hasSubscribedRolePublishing2 }) => isScreenOnlyPublishParams2 && !isSharingScreen2 && !hasSubscribedRolePublishing2,
1544
- () => /* @__PURE__ */ React18.createElement(
1545
- WaitingView2,
1546
- {
1547
- title: "Ready to present",
1548
- subtitle: "Select the Screenshare button to start presenting",
1549
- icon: /* @__PURE__ */ React18.createElement(ShareScreenIcon2, { width: "56px", height: "56px", style: { color: "white" } })
1550
- }
1551
- )
1552
- ).when(
1553
- ({ pdfAnnotatorActive: pdfAnnotatorActive2 }) => !!pdfAnnotatorActive2,
1554
- () => /* @__PURE__ */ React18.createElement(PDFView, null)
1555
- ).when(
1556
- ({ urlToIframe: urlToIframe2 }) => !!urlToIframe2,
1557
- () => /* @__PURE__ */ React18.createElement(EmbedView, null)
1558
- ).otherwise(() => {
1559
- var _a2;
1560
- return /* @__PURE__ */ React18.createElement(GridLayout, __spreadValues({}, (_a2 = elements == null ? void 0 : elements.video_tile_layout) == null ? void 0 : _a2.grid));
1561
- }), /* @__PURE__ */ React18.createElement(CaptionsViewer, { setDefaultPosition: setCaptionPosition, defaultPosition: captionPosition })),
1562
- /* @__PURE__ */ React18.createElement(
1563
- Box,
1564
- {
1565
- css: {
1566
- flex: match({ isLandscapeHLSStream, isMobileHLSStream }).with({ isLandscapeHLSStream: true }, () => "1 1 0").with({ isMobileHLSStream: true }, () => "2 1 0").otherwise(() => void 0),
1567
- position: "relative",
1568
- height: !isMobileHLSStream ? "100%" : void 0,
1569
- maxHeight: "100%",
1570
- "&:empty": { display: "none" },
1571
- overflowY: "clip"
1572
- }
1573
- },
1574
- /* @__PURE__ */ React18.createElement(Suspense2, { fallback: /* @__PURE__ */ React18.createElement(React18.Fragment, null) }, /* @__PURE__ */ React18.createElement(
1575
- SidePane_default,
1576
- {
1577
- screenType,
1578
- tileProps: (_a = elements == null ? void 0 : elements.video_tile_layout) == null ? void 0 : _a.grid,
1579
- hideControls
1580
- }
1581
- ))
1582
- )
1583
- );
1584
- };
1585
-
1586
- // src/Prebuilt/components/PreviousRoleInMetadata.tsx
1587
- init_define_process_env();
1588
- import { useEffect as useEffect9 } from "react";
1589
- import { selectLocalPeerRoleName as selectLocalPeerRoleName4, useHMSVanillaStore as useHMSVanillaStore2 } from "@100mslive/react-sdk";
1590
- var PreviousRoleInMetadata = () => {
1591
- const vanillaStore = useHMSVanillaStore2();
1592
- const { updateMetaData } = useMyMetadata();
1593
- useEffect9(() => {
1594
- let previousRole = vanillaStore.getState(selectLocalPeerRoleName4);
1595
- const unsubscribe = vanillaStore.subscribe((currentRole) => {
1596
- if (previousRole !== currentRole && currentRole) {
1597
- updateMetaData({ prevRole: previousRole });
1598
- previousRole = currentRole;
1599
- }
1600
- }, selectLocalPeerRoleName4);
1601
- return unsubscribe;
1602
- }, [vanillaStore]);
1603
- return null;
1604
- };
1605
-
1606
- // src/Prebuilt/components/ConferenceScreen.tsx
1607
- var ConferenceScreen = () => {
1608
- var _a, _b, _c, _d, _e, _f;
1609
- const { userName, endpoints, onJoin: onJoinFunc } = useHMSPrebuiltContext();
1610
- const screenProps = useRoomLayoutConferencingScreen();
1611
- const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
1612
- const roomState = useHMSStore10(selectRoomState);
1613
- const isConnectedToRoom = useHMSStore10(selectIsConnectedToRoom2);
1614
- const hmsActions = useHMSActions4();
1615
- const [hideControls, setHideControls] = useState8(false);
1616
- const dropdownList = useHMSStore10(selectAppData(APP_DATA.dropdownList));
1617
- const authTokenInAppData = useAuthToken();
1618
- const headerRef = useRef2(null);
1619
- const footerRef = useRef2(null);
1620
- const isMobileDevice = isAndroid || isIOS || isIPadOS;
1621
- const dropdownListRef = useRef2();
1622
- const [isHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
1623
- const { requestPermission } = useAwayNotifications2();
1624
- const showChat = !!((_a = screenProps.elements) == null ? void 0 : _a.chat);
1625
- const autoRoomJoined = useRef2(isPreviewScreenEnabled);
1626
- const isMobileHLSStream = useMobileHLSStream();
1627
- const isLandscapeHLSStream = useLandscapeHLSStream();
1628
- const isMwebHLSStream = isMobileHLSStream || isLandscapeHLSStream;
1629
- const toggleControls = () => {
1630
- var _a2;
1631
- if (((_a2 = dropdownListRef.current) == null ? void 0 : _a2.length) === 0 && isMobileDevice && !isMwebHLSStream) {
1632
- setHideControls((value) => !value);
1633
- }
1634
- };
1635
- useEffect10(() => {
1636
- let timeout;
1637
- dropdownListRef.current = dropdownList || [];
1638
- if (dropdownListRef.current && dropdownListRef.current.length === 0) {
1639
- clearTimeout(timeout);
1640
- timeout = setTimeout(() => {
1641
- if (dropdownListRef.current && dropdownListRef.current.length === 0) {
1642
- setHideControls(isMobileDevice);
1643
- }
1644
- }, 5e3);
1645
- }
1646
- return () => {
1647
- clearTimeout(timeout);
1648
- };
1649
- }, [dropdownList, hideControls, isMobileDevice]);
1650
- useEffect10(() => {
1651
- if (authTokenInAppData && !isConnectedToRoom && !isPreviewScreenEnabled && roomState !== HMSRoomState.Connecting && !autoRoomJoined.current) {
1652
- hmsActions.join({
1653
- userName: userName || uuid(),
1654
- authToken: authTokenInAppData,
1655
- initEndpoint: endpoints == null ? void 0 : endpoints.init,
1656
- settings: {
1657
- isAudioMuted: !isPreviewScreenEnabled,
1658
- isVideoMuted: !isPreviewScreenEnabled,
1659
- speakerAutoSelectionBlacklist: ["Yeti Stereo Microphone"]
1660
- }
1661
- }).then(() => requestPermission()).catch(console.error);
1662
- autoRoomJoined.current = true;
1663
- }
1664
- }, [
1665
- authTokenInAppData,
1666
- endpoints == null ? void 0 : endpoints.init,
1667
- hmsActions,
1668
- isConnectedToRoom,
1669
- isPreviewScreenEnabled,
1670
- roomState,
1671
- userName,
1672
- requestPermission
1673
- ]);
1674
- useEffect10(() => {
1675
- onJoinFunc == null ? void 0 : onJoinFunc();
1676
- return () => {
1677
- PictureInPicture.stop().catch((error) => console.error("stopping pip", error.message));
1678
- };
1679
- }, [onJoinFunc]);
1680
- if (!isConnectedToRoom && ![HMSRoomState.Reconnecting, HMSRoomState.Disconnected].includes(roomState)) {
1681
- return /* @__PURE__ */ React19.createElement(FullPageProgress_default, { text: roomState === HMSRoomState.Connecting ? "Joining..." : "" });
1682
- }
1683
- const hideControlsForStreaming = isMwebHLSStream ? true : hideControls;
1684
- return /* @__PURE__ */ React19.createElement(React19.Fragment, null, isHLSStarted ? /* @__PURE__ */ React19.createElement(Box, { css: { position: "fixed", zIndex: 100, w: "100%", h: "100%", left: 0, top: 0 } }, /* @__PURE__ */ React19.createElement(FullPageProgress_default, { text: "Starting live stream...", css: { opacity: 0.8, bg: "$background_dim" } })) : null, /* @__PURE__ */ React19.createElement(Flex, { css: { size: "100%", overflow: "hidden" }, direction: "column" }, !(screenProps.hideSections.includes("header") || isMwebHLSStream) && /* @__PURE__ */ React19.createElement(
1685
- Box,
1686
- {
1687
- ref: headerRef,
1688
- css: {
1689
- h: "$18",
1690
- transition: "margin 0.3s ease-in-out",
1691
- marginTop: hideControlsForStreaming ? `-${(_b = headerRef.current) == null ? void 0 : _b.clientHeight}px` : "none",
1692
- "@md": {
1693
- h: "$17"
1694
- }
1695
- },
1696
- "data-testid": "header"
1697
- },
1698
- /* @__PURE__ */ React19.createElement(Header, null)
1699
- ), /* @__PURE__ */ React19.createElement(
1700
- Box,
1701
- {
1702
- css: {
1703
- w: "100%",
1704
- flex: "1 1 0",
1705
- minHeight: 0,
1706
- // @ts-ignore
1707
- px: ((_e = (_d = (_c = screenProps == null ? void 0 : screenProps.elements) == null ? void 0 : _c.video_tile_layout) == null ? void 0 : _d.grid) == null ? void 0 : _e.edge_to_edge) ? 0 : "$10",
1708
- // TODO: padding to be controlled by section/element
1709
- paddingBottom: "env(safe-area-inset-bottom)",
1710
- "@lg": {
1711
- px: 0
1712
- }
1713
- },
1714
- id: "conferencing",
1715
- "data-testid": "conferencing",
1716
- onClick: toggleControls
1717
- },
1718
- screenProps.elements ? /* @__PURE__ */ React19.createElement(
1719
- VideoStreamingSection,
1720
- {
1721
- screenType: screenProps.screenType,
1722
- elements: screenProps.elements,
1723
- hideControls: hideControlsForStreaming
1724
- }
1725
- ) : null
1726
- ), !screenProps.hideSections.includes("footer") && screenProps.elements && !isMwebHLSStream && /* @__PURE__ */ React19.createElement(
1727
- Box,
1728
- {
1729
- ref: footerRef,
1730
- css: {
1731
- flexShrink: 0,
1732
- maxHeight: "$24",
1733
- transition: "margin 0.3s ease-in-out",
1734
- bg: "$background_dim",
1735
- marginBottom: hideControlsForStreaming ? `-${(_f = footerRef.current) == null ? void 0 : _f.clientHeight}px` : void 0,
1736
- "@md": {
1737
- maxHeight: "unset",
1738
- bg: screenProps.screenType === "hls_live_streaming" ? "transparent" : "$background_dim"
1739
- }
1740
- },
1741
- "data-testid": "footer"
1742
- },
1743
- /* @__PURE__ */ React19.createElement(Footer2, { elements: screenProps.elements, screenType: screenProps.screenType })
1744
- ), isMwebHLSStream && !showChat && /* @__PURE__ */ React19.createElement(
1745
- Flex,
1746
- {
1747
- css: {
1748
- alignItems: "center",
1749
- pr: "$4",
1750
- pb: "$4",
1751
- position: "relative"
1752
- },
1753
- justify: "end",
1754
- gap: "2"
1755
- },
1756
- /* @__PURE__ */ React19.createElement(RaiseHand, null),
1757
- /* @__PURE__ */ React19.createElement(MoreSettings, { elements: screenProps.elements, screenType: screenProps.screenType }),
1758
- /* @__PURE__ */ React19.createElement(
1759
- Box,
1760
- {
1761
- css: {
1762
- position: "absolute",
1763
- bottom: "100%",
1764
- mb: "$4"
1765
- }
1766
- },
1767
- /* @__PURE__ */ React19.createElement(EmojiReaction, null)
1768
- )
1769
- ), /* @__PURE__ */ React19.createElement(RoleChangeRequestModal, null), /* @__PURE__ */ React19.createElement(HLSFailureModal, null), /* @__PURE__ */ React19.createElement(ActivatedPIP, null), /* @__PURE__ */ React19.createElement(PreviousRoleInMetadata, null)));
1770
- };
1771
- export {
1772
- ConferenceScreen
1773
- };
1774
- //# sourceMappingURL=ConferenceScreen-M6RBPTAJ.js.map