@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,114 +0,0 @@
1
- import {
2
- Dropdown,
3
- useDropdownList,
4
- useLandscapeHLSStream,
5
- useMobileHLSStream
6
- } from "./chunk-DANANDDE.js";
7
- import {
8
- Box,
9
- Flex
10
- } from "./chunk-GOXRTCTY.js";
11
- import {
12
- IconButton_default,
13
- Tooltip,
14
- useRoomLayoutConferencingScreen
15
- } from "./chunk-BGSYLCVD.js";
16
- import {
17
- EMOJI_REACTION_TYPE,
18
- __async,
19
- config,
20
- init_define_process_env,
21
- styled
22
- } from "./chunk-GLAJUP3O.js";
23
-
24
- // src/Prebuilt/components/EmojiReaction.jsx
25
- init_define_process_env();
26
- import React2, { useState } from "react";
27
- import { useMedia } from "react-use";
28
- import data from "@emoji-mart/data/sets/14/apple.json";
29
- import { init } from "emoji-mart";
30
- import {
31
- selectAvailableRoleNames,
32
- selectIsConnectedToRoom,
33
- selectLocalPeerID,
34
- useCustomEvent,
35
- useHMSStore
36
- } from "@100mslive/react-sdk";
37
- import { EmojiIcon } from "@100mslive/react-icons";
38
-
39
- // src/Prebuilt/components/Footer/EmojiCard.jsx
40
- init_define_process_env();
41
- import React from "react";
42
- var emojiReactionList = [
43
- [{ emojiId: "+1" }, { emojiId: "-1" }, { emojiId: "wave" }, { emojiId: "clap" }, { emojiId: "fire" }],
44
- [{ emojiId: "tada" }, { emojiId: "heart_eyes" }, { emojiId: "joy" }, { emojiId: "open_mouth" }, { emojiId: "sob" }]
45
- ];
46
- var EmojiCard = ({ sendReaction }) => {
47
- return emojiReactionList.map((emojiLine, index) => /* @__PURE__ */ React.createElement(Flex, { key: index, justify: "between", css: { mb: "$8" } }, emojiLine.map((emoji) => /* @__PURE__ */ React.createElement(EmojiContainer, { key: emoji.emojiId, onClick: () => sendReaction(emoji.emojiId) }, /* @__PURE__ */ React.createElement("em-emoji", { id: emoji.emojiId, size: "100%", set: "apple" })))));
48
- };
49
- var EmojiContainer = styled("span", {
50
- position: "relative",
51
- cursor: "pointer",
52
- width: "$16",
53
- height: "$16",
54
- p: "$4",
55
- "&:hover": {
56
- p: "7px",
57
- bg: "$surface_brighter",
58
- borderRadius: "$1"
59
- }
60
- });
61
-
62
- // src/Prebuilt/components/EmojiReaction.jsx
63
- init({ data });
64
- var EmojiReaction = ({ showCard = false }) => {
65
- const [open, setOpen] = useState(false);
66
- const isConnected = useHMSStore(selectIsConnectedToRoom);
67
- const { elements } = useRoomLayoutConferencingScreen();
68
- useDropdownList({ open, name: "EmojiReaction" });
69
- const roles = useHMSStore(selectAvailableRoleNames);
70
- const localPeerId = useHMSStore(selectLocalPeerID);
71
- const isMobile = useMedia(config.media.md);
72
- const isLandscape = useMedia(config.media.ls);
73
- const isMobileHLSStream = useMobileHLSStream();
74
- const isLandscapeStream = useLandscapeHLSStream();
75
- const { sendEvent } = useCustomEvent({
76
- type: EMOJI_REACTION_TYPE
77
- });
78
- const sendReaction = (emojiId) => __async(void 0, null, function* () {
79
- var _a;
80
- const data2 = {
81
- type: EMOJI_REACTION_TYPE,
82
- emojiId,
83
- senderId: localPeerId
84
- };
85
- sendEvent(data2, { roleNames: roles });
86
- (_a = window.showFlyingEmoji) == null ? void 0 : _a.call(window, { emojiId, senderId: localPeerId });
87
- });
88
- if (!isConnected || !elements.emoji_reactions) {
89
- return null;
90
- }
91
- if (showCard) {
92
- return /* @__PURE__ */ React2.createElement(EmojiCard, { sendReaction });
93
- }
94
- return /* @__PURE__ */ React2.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React2.createElement(Dropdown.Trigger, { asChild: true, "data-testid": "emoji_reaction_btn" }, /* @__PURE__ */ React2.createElement(
95
- IconButton_default,
96
- {
97
- css: isMobile || isLandscape ? { bg: "$surface_default", r: "$round", border: "1px solid $border_bright" } : {}
98
- },
99
- /* @__PURE__ */ React2.createElement(Tooltip, { title: "Emoji reaction" }, /* @__PURE__ */ React2.createElement(Box, null, /* @__PURE__ */ React2.createElement(EmojiIcon, null)))
100
- )), /* @__PURE__ */ React2.createElement(
101
- Dropdown.Content,
102
- {
103
- sideOffset: 5,
104
- align: isMobileHLSStream || isLandscapeStream ? "end" : "center",
105
- css: { p: "$8", bg: "$surface_default" }
106
- },
107
- /* @__PURE__ */ React2.createElement(EmojiCard, { sendReaction })
108
- ));
109
- };
110
-
111
- export {
112
- EmojiReaction
113
- };
114
- //# sourceMappingURL=chunk-7FD3VT6Q.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/Prebuilt/components/EmojiReaction.jsx", "../src/Prebuilt/components/Footer/EmojiCard.jsx"],
4
- "sourcesContent": ["import React, { useState } from 'react';\nimport { useMedia } from 'react-use';\nimport data from '@emoji-mart/data/sets/14/apple.json';\nimport { init } from 'emoji-mart';\nimport {\n selectAvailableRoleNames,\n selectIsConnectedToRoom,\n selectLocalPeerID,\n useCustomEvent,\n useHMSStore,\n} from '@100mslive/react-sdk';\nimport { EmojiIcon } from '@100mslive/react-icons';\nimport { EmojiCard } from './Footer/EmojiCard';\n// import { ToastManager } from './Toast/ToastManager';\nimport { Dropdown } from '../../Dropdown';\nimport { Box } from '../../Layout';\nimport { config as cssConfig } from '../../Theme';\nimport { Tooltip } from '../../Tooltip';\nimport IconButton from '../IconButton';\nimport { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';\nimport { useDropdownList } from './hooks/useDropdownList';\nimport { useLandscapeHLSStream, useMobileHLSStream } from '../common/hooks';\nimport { EMOJI_REACTION_TYPE } from '../common/constants';\n\ninit({ data });\n\nexport const EmojiReaction = ({ showCard = false }) => {\n const [open, setOpen] = useState(false);\n const isConnected = useHMSStore(selectIsConnectedToRoom);\n const { elements } = useRoomLayoutConferencingScreen();\n useDropdownList({ open: open, name: 'EmojiReaction' });\n // const hmsActions = useHMSActions();\n const roles = useHMSStore(selectAvailableRoleNames);\n const localPeerId = useHMSStore(selectLocalPeerID);\n // const { isStreamingOn } = useRecordingStreaming();\n const isMobile = useMedia(cssConfig.media.md);\n const isLandscape = useMedia(cssConfig.media.ls);\n const isMobileHLSStream = useMobileHLSStream();\n const isLandscapeStream = useLandscapeHLSStream();\n\n const { sendEvent } = useCustomEvent({\n type: EMOJI_REACTION_TYPE,\n });\n\n const sendReaction = async emojiId => {\n const data = {\n type: EMOJI_REACTION_TYPE,\n emojiId: emojiId,\n senderId: localPeerId,\n };\n // TODO: RT find a way to figure out hls-viewer roles\n sendEvent(data, { roleNames: roles });\n window.showFlyingEmoji?.({ emojiId, senderId: localPeerId });\n /* if (isStreamingOn) {\n try {\n await hmsActions.sendHLSTimedMetadata([\n {\n payload: JSON.stringify(data),\n duration: 2,\n },\n ]);\n } catch (error) {\n console.log(error);\n ToastManager.addToast({ title: error.message });\n }\n } */\n };\n\n if (!isConnected || !elements.emoji_reactions) {\n return null;\n }\n\n if (showCard) {\n return <EmojiCard sendReaction={sendReaction} />;\n }\n return (\n <Dropdown.Root open={open} onOpenChange={setOpen}>\n <Dropdown.Trigger asChild data-testid=\"emoji_reaction_btn\">\n <IconButton\n css={\n isMobile || isLandscape ? { bg: '$surface_default', r: '$round', border: '1px solid $border_bright' } : {}\n }\n >\n <Tooltip title=\"Emoji reaction\">\n <Box>\n <EmojiIcon />\n </Box>\n </Tooltip>\n </IconButton>\n </Dropdown.Trigger>\n <Dropdown.Content\n sideOffset={5}\n align={isMobileHLSStream || isLandscapeStream ? 'end' : 'center'}\n css={{ p: '$8', bg: '$surface_default' }}\n >\n <EmojiCard sendReaction={sendReaction} />\n </Dropdown.Content>\n </Dropdown.Root>\n );\n};\n", "import React from 'react';\nimport { Flex } from '../../../Layout';\nimport { styled } from '../../../Theme';\n\n// When changing emojis in the grid, keep in mind that the payload used in sendHLSTimedMetadata has a limit of 100 characters. Using bigger emoji Ids can cause the limit to be exceeded.\nconst emojiReactionList = [\n [{ emojiId: '+1' }, { emojiId: '-1' }, { emojiId: 'wave' }, { emojiId: 'clap' }, { emojiId: 'fire' }],\n [{ emojiId: 'tada' }, { emojiId: 'heart_eyes' }, { emojiId: 'joy' }, { emojiId: 'open_mouth' }, { emojiId: 'sob' }],\n];\n\nexport const EmojiCard = ({ sendReaction }) => {\n return emojiReactionList.map((emojiLine, index) => (\n <Flex key={index} justify=\"between\" css={{ mb: '$8' }}>\n {emojiLine.map(emoji => (\n <EmojiContainer key={emoji.emojiId} onClick={() => sendReaction(emoji.emojiId)}>\n <em-emoji id={emoji.emojiId} size=\"100%\" set=\"apple\"></em-emoji>\n </EmojiContainer>\n ))}\n </Flex>\n ));\n};\n\nconst EmojiContainer = styled('span', {\n position: 'relative',\n cursor: 'pointer',\n width: '$16',\n height: '$16',\n p: '$4',\n '&:hover': {\n p: '7px',\n bg: '$surface_brighter',\n borderRadius: '$1',\n },\n});\n"],
5
- "mappings": "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",
6
- "names": ["React", "data", "React"]
7
- }
@@ -1,62 +0,0 @@
1
- import {
2
- __async,
3
- init_define_process_env
4
- } from "./chunk-GLAJUP3O.js";
5
-
6
- // src/Prebuilt/components/hooks/useMetadata.tsx
7
- init_define_process_env();
8
- import { useCallback } from "react";
9
- import {
10
- selectHasPeerHandRaised,
11
- selectLocalPeerID,
12
- selectPeerMetadata,
13
- useHMSActions,
14
- useHMSStore,
15
- useHMSVanillaStore
16
- } from "@100mslive/react-sdk";
17
- var useMyMetadata = () => {
18
- const hmsActions = useHMSActions();
19
- const localPeerId = useHMSStore(selectLocalPeerID);
20
- const vanillaStore = useHMSVanillaStore();
21
- const metaData = useHMSStore(selectPeerMetadata(localPeerId));
22
- const isHandRaised = useHMSStore(selectHasPeerHandRaised(localPeerId));
23
- const update = (updatedFields) => __async(void 0, null, function* () {
24
- try {
25
- const currentMetadata = vanillaStore.getState(selectPeerMetadata(localPeerId));
26
- yield hmsActions.changeMetadata(Object.assign(currentMetadata, updatedFields));
27
- return true;
28
- } catch (error) {
29
- console.error("failed to update metadata ", updatedFields);
30
- }
31
- return false;
32
- });
33
- const toggleHandRaise = useCallback(() => __async(void 0, null, function* () {
34
- if (isHandRaised) {
35
- yield hmsActions.lowerLocalPeerHand();
36
- yield update({ handRaisedAt: void 0 });
37
- } else {
38
- yield hmsActions.raiseLocalPeerHand();
39
- yield update({ isBRBOn: false, handRaisedAt: Date.now() });
40
- }
41
- }), [isHandRaised]);
42
- const toggleBRB = useCallback(() => __async(void 0, null, function* () {
43
- const newValue = !(metaData == null ? void 0 : metaData.isBRBOn);
44
- yield update({ isBRBOn: newValue });
45
- if (newValue) {
46
- yield hmsActions.lowerLocalPeerHand();
47
- }
48
- }), [metaData == null ? void 0 : metaData.isBRBOn]);
49
- return {
50
- isHandRaised,
51
- isBRBOn: !!(metaData == null ? void 0 : metaData.isBRBOn),
52
- metaData,
53
- updateMetaData: update,
54
- toggleHandRaise,
55
- toggleBRB
56
- };
57
- };
58
-
59
- export {
60
- useMyMetadata
61
- };
62
- //# sourceMappingURL=chunk-AHI4HCY3.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/Prebuilt/components/hooks/useMetadata.tsx"],
4
- "sourcesContent": ["import { useCallback } from 'react';\nimport {\n selectHasPeerHandRaised,\n selectLocalPeerID,\n selectPeerMetadata,\n useHMSActions,\n useHMSStore,\n useHMSVanillaStore,\n} from '@100mslive/react-sdk';\n\nexport const useMyMetadata = () => {\n const hmsActions = useHMSActions();\n const localPeerId = useHMSStore(selectLocalPeerID);\n const vanillaStore = useHMSVanillaStore();\n const metaData = useHMSStore(selectPeerMetadata(localPeerId));\n const isHandRaised = useHMSStore(selectHasPeerHandRaised(localPeerId));\n\n const update = async (updatedFields: Record<string, any>) => {\n try {\n // get current state from store and merge updated fields\n const currentMetadata = vanillaStore.getState(selectPeerMetadata(localPeerId));\n await hmsActions.changeMetadata(Object.assign(currentMetadata, updatedFields));\n return true;\n } catch (error) {\n console.error('failed to update metadata ', updatedFields);\n }\n return false;\n };\n\n const toggleHandRaise = useCallback(async () => {\n if (isHandRaised) {\n await hmsActions.lowerLocalPeerHand();\n await update({ handRaisedAt: undefined });\n } else {\n await hmsActions.raiseLocalPeerHand();\n await update({ isBRBOn: false, handRaisedAt: Date.now() });\n }\n }, [isHandRaised]); //eslint-disable-line\n\n const toggleBRB = useCallback(async () => {\n const newValue = !metaData?.isBRBOn;\n await update({ isBRBOn: newValue });\n if (newValue) {\n await hmsActions.lowerLocalPeerHand();\n }\n }, [metaData?.isBRBOn]); //eslint-disable-line\n\n return {\n isHandRaised,\n isBRBOn: !!metaData?.isBRBOn,\n metaData,\n updateMetaData: update,\n toggleHandRaise,\n toggleBRB,\n };\n};\n"],
5
- "mappings": ";;;;;;AAAA;AAAA,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,IAAM,gBAAgB,MAAM;AACjC,QAAM,aAAa,cAAc;AACjC,QAAM,cAAc,YAAY,iBAAiB;AACjD,QAAM,eAAe,mBAAmB;AACxC,QAAM,WAAW,YAAY,mBAAmB,WAAW,CAAC;AAC5D,QAAM,eAAe,YAAY,wBAAwB,WAAW,CAAC;AAErE,QAAM,SAAS,CAAO,kBAAuC;AAC3D,QAAI;AAEF,YAAM,kBAAkB,aAAa,SAAS,mBAAmB,WAAW,CAAC;AAC7E,YAAM,WAAW,eAAe,OAAO,OAAO,iBAAiB,aAAa,CAAC;AAC7E,aAAO;AAAA,IACT,SAAS,OAAO;AACd,cAAQ,MAAM,8BAA8B,aAAa;AAAA,IAC3D;AACA,WAAO;AAAA,EACT;AAEA,QAAM,kBAAkB,YAAY,MAAY;AAC9C,QAAI,cAAc;AAChB,YAAM,WAAW,mBAAmB;AACpC,YAAM,OAAO,EAAE,cAAc,OAAU,CAAC;AAAA,IAC1C,OAAO;AACL,YAAM,WAAW,mBAAmB;AACpC,YAAM,OAAO,EAAE,SAAS,OAAO,cAAc,KAAK,IAAI,EAAE,CAAC;AAAA,IAC3D;AAAA,EACF,IAAG,CAAC,YAAY,CAAC;AAEjB,QAAM,YAAY,YAAY,MAAY;AACxC,UAAM,WAAW,EAAC,qCAAU;AAC5B,UAAM,OAAO,EAAE,SAAS,SAAS,CAAC;AAClC,QAAI,UAAU;AACZ,YAAM,WAAW,mBAAmB;AAAA,IACtC;AAAA,EACF,IAAG,CAAC,qCAAU,OAAO,CAAC;AAEtB,SAAO;AAAA,IACL;AAAA,IACA,SAAS,CAAC,EAAC,qCAAU;AAAA,IACrB;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,EACF;AACF;",
6
- "names": []
7
- }