livevoice-sdk-react-native 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/README.md +158 -7
  2. package/android/build.gradle +18 -6
  3. package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +121 -221
  4. package/android/src/main/java/io/livevoice/react/__SDK.kt +17 -3
  5. package/ios/LiveVoiceRNBridge.swift +362 -0
  6. package/ios/LiveVoiceSdkReactNative.mm +247 -145
  7. package/ios/__SDK.h +16 -2
  8. package/ios/livevoice_spm_backport.rb +202 -0
  9. package/lib/module/components/BrandingView.js +71 -50
  10. package/lib/module/components/BrandingView.js.map +1 -1
  11. package/lib/module/components/ChannelView.js +368 -54
  12. package/lib/module/components/ChannelView.js.map +1 -1
  13. package/lib/module/components/ErrorView.js +17 -16
  14. package/lib/module/components/ErrorView.js.map +1 -1
  15. package/lib/module/components/LiveVoiceSpinner.js +81 -0
  16. package/lib/module/components/LiveVoiceSpinner.js.map +1 -0
  17. package/lib/module/components/LiveVoiceView.js +351 -104
  18. package/lib/module/components/LiveVoiceView.js.map +1 -1
  19. package/lib/module/components/PasswordPrompt.js +165 -0
  20. package/lib/module/components/PasswordPrompt.js.map +1 -0
  21. package/lib/module/components/PlayButtonView.js +192 -254
  22. package/lib/module/components/PlayButtonView.js.map +1 -1
  23. package/lib/module/components/ReconnectingView.js +43 -62
  24. package/lib/module/components/ReconnectingView.js.map +1 -1
  25. package/lib/module/components/WarningView.js +12 -10
  26. package/lib/module/components/WarningView.js.map +1 -1
  27. package/lib/module/icons/branding-ios.png +0 -0
  28. package/lib/module/icons/camera-off-android.png +0 -0
  29. package/lib/module/icons/camera-off-android@2x.png +0 -0
  30. package/lib/module/icons/camera-off-android@3x.png +0 -0
  31. package/lib/module/icons/cpu-android.png +0 -0
  32. package/lib/module/icons/cpu-android@2x.png +0 -0
  33. package/lib/module/icons/cpu-android@3x.png +0 -0
  34. package/lib/module/icons/cpu-ios.png +0 -0
  35. package/lib/module/icons/cpu-ios@2x.png +0 -0
  36. package/lib/module/icons/cpu-ios@3x.png +0 -0
  37. package/lib/module/icons/lock-android.png +0 -0
  38. package/lib/module/icons/lock-android@2x.png +0 -0
  39. package/lib/module/icons/lock-android@3x.png +0 -0
  40. package/lib/module/icons/lock-ios.png +0 -0
  41. package/lib/module/icons/lock-ios@2x.png +0 -0
  42. package/lib/module/icons/lock-ios@3x.png +0 -0
  43. package/lib/module/icons/mic-off-android.png +0 -0
  44. package/lib/module/icons/mic-off-android@2x.png +0 -0
  45. package/lib/module/icons/mic-off-android@3x.png +0 -0
  46. package/lib/module/icons/mic-slash-ios.png +0 -0
  47. package/lib/module/icons/mic-slash-ios@2x.png +0 -0
  48. package/lib/module/icons/mic-slash-ios@3x.png +0 -0
  49. package/lib/module/icons/video-slash-ios.png +0 -0
  50. package/lib/module/icons/video-slash-ios@2x.png +0 -0
  51. package/lib/module/icons/video-slash-ios@3x.png +0 -0
  52. package/lib/module/index.js +24 -225
  53. package/lib/module/index.js.map +1 -1
  54. package/lib/module/sdk/Bridge.js +236 -0
  55. package/lib/module/sdk/Bridge.js.map +1 -0
  56. package/lib/module/sdk/Event.js +160 -0
  57. package/lib/module/sdk/Event.js.map +1 -0
  58. package/lib/module/sdk/Lifecycle.js +331 -0
  59. package/lib/module/sdk/Lifecycle.js.map +1 -0
  60. package/lib/module/sdk/LiveVoiceSdk.js +365 -0
  61. package/lib/module/sdk/LiveVoiceSdk.js.map +1 -0
  62. package/lib/module/sdk/LiveVoiceState.js +234 -0
  63. package/lib/module/sdk/LiveVoiceState.js.map +1 -0
  64. package/lib/module/sdk/LogEntries.js +99 -0
  65. package/lib/module/sdk/LogEntries.js.map +1 -0
  66. package/lib/module/sdk/Models.js +2 -0
  67. package/lib/module/{util/UIState.js.map → sdk/Models.js.map} +1 -1
  68. package/lib/module/sdk/NativeSdkVersions.js +24 -0
  69. package/lib/module/sdk/NativeSdkVersions.js.map +1 -0
  70. package/lib/module/sdk/Observables.js +391 -0
  71. package/lib/module/sdk/Observables.js.map +1 -0
  72. package/lib/module/sdk/Passwords.js +298 -0
  73. package/lib/module/sdk/Passwords.js.map +1 -0
  74. package/lib/module/sdk/Playback.js +35 -0
  75. package/lib/module/sdk/Playback.js.map +1 -0
  76. package/lib/module/specs/NativeLiveVoiceSdk.js +12 -10
  77. package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
  78. package/lib/module/util/Colors.js +14 -11
  79. package/lib/module/util/Colors.js.map +1 -1
  80. package/lib/module/util/Translations.js +46 -21
  81. package/lib/module/util/Translations.js.map +1 -1
  82. package/lib/module/util/freeze.js +26 -0
  83. package/lib/module/util/freeze.js.map +1 -0
  84. package/lib/module/util/logger.js +114 -0
  85. package/lib/module/util/logger.js.map +1 -0
  86. package/lib/typescript/src/components/BrandingView.d.ts +4 -0
  87. package/lib/typescript/src/components/BrandingView.d.ts.map +1 -1
  88. package/lib/typescript/src/components/ChannelView.d.ts +29 -3
  89. package/lib/typescript/src/components/ChannelView.d.ts.map +1 -1
  90. package/lib/typescript/src/components/ErrorView.d.ts +5 -3
  91. package/lib/typescript/src/components/ErrorView.d.ts.map +1 -1
  92. package/lib/typescript/src/components/LiveVoiceSpinner.d.ts +16 -0
  93. package/lib/typescript/src/components/LiveVoiceSpinner.d.ts.map +1 -0
  94. package/lib/typescript/src/components/LiveVoiceView.d.ts +85 -3
  95. package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -1
  96. package/lib/typescript/src/components/PasswordPrompt.d.ts +13 -0
  97. package/lib/typescript/src/components/PasswordPrompt.d.ts.map +1 -0
  98. package/lib/typescript/src/components/PlayButtonView.d.ts +12 -329
  99. package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -1
  100. package/lib/typescript/src/components/ReconnectingView.d.ts +6 -3
  101. package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -1
  102. package/lib/typescript/src/components/WarningView.d.ts.map +1 -1
  103. package/lib/typescript/src/index.d.ts +15 -144
  104. package/lib/typescript/src/index.d.ts.map +1 -1
  105. package/lib/typescript/src/sdk/Bridge.d.ts +36 -0
  106. package/lib/typescript/src/sdk/Bridge.d.ts.map +1 -0
  107. package/lib/typescript/src/sdk/Event.d.ts +97 -0
  108. package/lib/typescript/src/sdk/Event.d.ts.map +1 -0
  109. package/lib/typescript/src/sdk/Lifecycle.d.ts +191 -0
  110. package/lib/typescript/src/sdk/Lifecycle.d.ts.map +1 -0
  111. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts +215 -0
  112. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts.map +1 -0
  113. package/lib/typescript/src/sdk/LiveVoiceState.d.ts +80 -0
  114. package/lib/typescript/src/sdk/LiveVoiceState.d.ts.map +1 -0
  115. package/lib/typescript/src/sdk/LogEntries.d.ts +28 -0
  116. package/lib/typescript/src/sdk/LogEntries.d.ts.map +1 -0
  117. package/lib/typescript/src/sdk/Models.d.ts +114 -0
  118. package/lib/typescript/src/sdk/Models.d.ts.map +1 -0
  119. package/lib/typescript/src/sdk/NativeSdkVersions.d.ts +6 -0
  120. package/lib/typescript/src/sdk/NativeSdkVersions.d.ts.map +1 -0
  121. package/lib/typescript/src/sdk/Observables.d.ts +123 -0
  122. package/lib/typescript/src/sdk/Observables.d.ts.map +1 -0
  123. package/lib/typescript/src/sdk/Passwords.d.ts +72 -0
  124. package/lib/typescript/src/sdk/Passwords.d.ts.map +1 -0
  125. package/lib/typescript/src/sdk/Playback.d.ts +9 -0
  126. package/lib/typescript/src/sdk/Playback.d.ts.map +1 -0
  127. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts +35 -29
  128. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -1
  129. package/lib/typescript/src/util/Colors.d.ts.map +1 -1
  130. package/lib/typescript/src/util/Translations.d.ts +30 -8
  131. package/lib/typescript/src/util/Translations.d.ts.map +1 -1
  132. package/lib/typescript/src/util/freeze.d.ts +6 -0
  133. package/lib/typescript/src/util/freeze.d.ts.map +1 -0
  134. package/lib/typescript/src/util/logger.d.ts +33 -0
  135. package/lib/typescript/src/util/logger.d.ts.map +1 -0
  136. package/livevoice-sdk-react-native.podspec +41 -16
  137. package/package.json +26 -14
  138. package/src/components/BrandingView.tsx +55 -66
  139. package/src/components/ChannelView.tsx +342 -48
  140. package/src/components/ErrorView.tsx +21 -22
  141. package/src/components/LiveVoiceSpinner.tsx +87 -0
  142. package/src/components/LiveVoiceView.tsx +360 -151
  143. package/src/components/PasswordPrompt.tsx +144 -0
  144. package/src/components/PlayButtonView.tsx +177 -279
  145. package/src/components/ReconnectingView.tsx +40 -86
  146. package/src/components/WarningView.tsx +12 -10
  147. package/src/icons/branding-ios.png +0 -0
  148. package/src/icons/camera-off-android.png +0 -0
  149. package/src/icons/camera-off-android@2x.png +0 -0
  150. package/src/icons/camera-off-android@3x.png +0 -0
  151. package/src/icons/cpu-android.png +0 -0
  152. package/src/icons/cpu-android@2x.png +0 -0
  153. package/src/icons/cpu-android@3x.png +0 -0
  154. package/src/icons/cpu-ios.png +0 -0
  155. package/src/icons/cpu-ios@2x.png +0 -0
  156. package/src/icons/cpu-ios@3x.png +0 -0
  157. package/src/icons/lock-android.png +0 -0
  158. package/src/icons/lock-android@2x.png +0 -0
  159. package/src/icons/lock-android@3x.png +0 -0
  160. package/src/icons/lock-ios.png +0 -0
  161. package/src/icons/lock-ios@2x.png +0 -0
  162. package/src/icons/lock-ios@3x.png +0 -0
  163. package/src/icons/mic-off-android.png +0 -0
  164. package/src/icons/mic-off-android@2x.png +0 -0
  165. package/src/icons/mic-off-android@3x.png +0 -0
  166. package/src/icons/mic-slash-ios.png +0 -0
  167. package/src/icons/mic-slash-ios@2x.png +0 -0
  168. package/src/icons/mic-slash-ios@3x.png +0 -0
  169. package/src/icons/video-slash-ios.png +0 -0
  170. package/src/icons/video-slash-ios@2x.png +0 -0
  171. package/src/icons/video-slash-ios@3x.png +0 -0
  172. package/src/index.tsx +105 -252
  173. package/src/sdk/Bridge.ts +259 -0
  174. package/src/sdk/Event.ts +187 -0
  175. package/src/sdk/Lifecycle.ts +366 -0
  176. package/src/sdk/LiveVoiceSdk.ts +384 -0
  177. package/src/sdk/LiveVoiceState.ts +259 -0
  178. package/src/sdk/LogEntries.ts +88 -0
  179. package/src/sdk/Models.ts +129 -0
  180. package/src/sdk/NativeSdkVersions.ts +21 -0
  181. package/src/sdk/Observables.ts +414 -0
  182. package/src/sdk/Passwords.ts +286 -0
  183. package/src/sdk/Playback.ts +30 -0
  184. package/src/specs/NativeLiveVoiceSdk.ts +56 -46
  185. package/src/util/Colors.ts +14 -11
  186. package/src/util/Translations.ts +46 -22
  187. package/src/util/freeze.ts +23 -0
  188. package/src/util/logger.ts +119 -0
  189. package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeLiveVoiceSdkSpec.java +0 -186
  190. package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
  191. package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec-generated.cpp +0 -235
  192. package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec.h +0 -31
  193. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +0 -341
  194. package/android/src/main/java/io/livevoice/react/Mappings.kt +0 -85
  195. package/android/src/main/java/io/livevoice/react/NativeModels.kt +0 -79
  196. package/lib/module/components/AudioOutputSwitchView.js +0 -138
  197. package/lib/module/components/AudioOutputSwitchView.js.map +0 -1
  198. package/lib/module/components/index.js +0 -22
  199. package/lib/module/components/index.js.map +0 -1
  200. package/lib/module/icons/mic.png +0 -0
  201. package/lib/module/util/ForegroundServiceConfig.js +0 -28
  202. package/lib/module/util/ForegroundServiceConfig.js.map +0 -1
  203. package/lib/module/util/PlayingState.js +0 -21
  204. package/lib/module/util/PlayingState.js.map +0 -1
  205. package/lib/module/util/UIState.js +0 -4
  206. package/lib/typescript/src/components/AudioOutputSwitchView.d.ts +0 -6
  207. package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +0 -1
  208. package/lib/typescript/src/components/index.d.ts +0 -9
  209. package/lib/typescript/src/components/index.d.ts.map +0 -1
  210. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts +0 -12
  211. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +0 -1
  212. package/lib/typescript/src/util/PlayingState.d.ts +0 -7
  213. package/lib/typescript/src/util/PlayingState.d.ts.map +0 -1
  214. package/lib/typescript/src/util/UIState.d.ts +0 -66
  215. package/lib/typescript/src/util/UIState.d.ts.map +0 -1
  216. package/src/components/AudioOutputSwitchView.tsx +0 -146
  217. package/src/components/index.tsx +0 -19
  218. package/src/icons/mic.png +0 -0
  219. package/src/util/ForegroundServiceConfig.tsx +0 -32
  220. package/src/util/PlayingState.ts +0 -18
  221. package/src/util/UIState.ts +0 -89
@@ -1,6 +1,6 @@
1
- import { PlayingState } from "../util/PlayingState";
1
+ import { type LiveVoicePlayingState } from "../sdk/Models";
2
2
  export interface PlayButtonProps {
3
- playingState: PlayingState;
3
+ playingState: LiveVoicePlayingState;
4
4
  isChannelOnline: boolean;
5
5
  hasAudio?: boolean;
6
6
  hasSubtitles?: boolean;
@@ -8,334 +8,17 @@ export interface PlayButtonProps {
8
8
  onAudioPress?: () => void;
9
9
  onSubtitlesPress?: () => void;
10
10
  onPress?: () => void;
11
+ /** The event's brand colour for this appearance; LiveVoice orange when `null`. */
12
+ brandColor?: string | null;
13
+ /** Whether this channel's subtitles are the open ones: the subtitle half is marked. */
14
+ subtitlesOpen?: boolean;
11
15
  }
16
+ /**
17
+ * The default cell's play button, drawn as the native SDK of the platform draws it: iOS
18
+ * `ChannelPlayButton` in its `.sdk` style, Android `PlayButton` in the SDK cell's Listener style.
19
+ * Change them together. Geometry is the same on both; the colours are each platform's own
20
+ * (`buttonColors`).
21
+ */
12
22
  declare const PlayButtonView: React.FC<PlayButtonProps>;
13
- type ButtonStyleType = "paused" | "playing" | "offline";
14
- export declare const getButtonStyle: (type: ButtonStyleType, isDarkMode: boolean, isSplit?: boolean) => {
15
- backgroundColor: string;
16
- borderColor: string;
17
- width: number;
18
- height: number;
19
- borderRadius: number;
20
- borderWidth: number;
21
- alignItems: "center";
22
- justifyContent: "center";
23
- };
24
- export declare const getSplitButtonContainerStyle: (type: ButtonStyleType, isDarkMode: boolean) => {
25
- backgroundColor: string;
26
- borderColor: string;
27
- width: number;
28
- height: number;
29
- borderRadius: number;
30
- borderWidth: number;
31
- flexDirection: "row";
32
- alignItems: "center";
33
- justifyContent: "center";
34
- overflow: "hidden";
35
- } | {
36
- backgroundColor: string;
37
- borderColor: string;
38
- width: number;
39
- height: number;
40
- borderRadius: number;
41
- borderWidth: number;
42
- flexDirection: "row";
43
- alignItems: "center";
44
- justifyContent: "center";
45
- overflow: "hidden";
46
- } | {
47
- backgroundColor: string;
48
- borderColor: string;
49
- width: number;
50
- height: number;
51
- borderRadius: number;
52
- borderWidth: number;
53
- flexDirection: "row";
54
- alignItems: "center";
55
- justifyContent: "center";
56
- overflow: "hidden";
57
- } | {
58
- backgroundColor: string;
59
- borderColor: string;
60
- width: number;
61
- height: number;
62
- borderRadius: number;
63
- borderWidth: number;
64
- flexDirection: "row";
65
- alignItems: "center";
66
- justifyContent: "center";
67
- overflow: "hidden";
68
- } | {
69
- backgroundColor: string;
70
- borderColor: string;
71
- width: number;
72
- height: number;
73
- borderRadius: number;
74
- borderWidth: number;
75
- flexDirection: "row";
76
- alignItems: "center";
77
- justifyContent: "center";
78
- overflow: "hidden";
79
- } | {
80
- backgroundColor: string;
81
- borderColor: string;
82
- width: number;
83
- height: number;
84
- borderRadius: number;
85
- borderWidth: number;
86
- flexDirection: "row";
87
- alignItems: "center";
88
- justifyContent: "center";
89
- overflow: "hidden";
90
- };
91
- export declare const getSplitButtonAudioStyle: (type: ButtonStyleType, isDarkMode: boolean) => {
92
- flex: number;
93
- height: number;
94
- alignItems: "center";
95
- justifyContent: "center";
96
- };
97
- export declare const getSplitButtonSubtitlesStyle: (type: ButtonStyleType, isDarkMode: boolean) => {
98
- flex: number;
99
- height: number;
100
- alignItems: "center";
101
- justifyContent: "center";
102
- };
103
- export declare const getDividerStyle: (type: ButtonStyleType, isDarkMode: boolean) => {
104
- width: number;
105
- height: number;
106
- backgroundColor: string;
107
- };
108
- export declare const ButtonStyles: {
109
- paused: {
110
- light: {
111
- backgroundColor: string;
112
- borderColor: string;
113
- width: number;
114
- height: number;
115
- borderRadius: number;
116
- borderWidth: number;
117
- alignItems: "center";
118
- justifyContent: "center";
119
- };
120
- dark: {
121
- backgroundColor: string;
122
- borderColor: string;
123
- width: number;
124
- height: number;
125
- borderRadius: number;
126
- borderWidth: number;
127
- alignItems: "center";
128
- justifyContent: "center";
129
- };
130
- };
131
- playing: {
132
- light: {
133
- backgroundColor: string;
134
- borderColor: string;
135
- width: number;
136
- height: number;
137
- borderRadius: number;
138
- borderWidth: number;
139
- alignItems: "center";
140
- justifyContent: "center";
141
- };
142
- dark: {
143
- backgroundColor: string;
144
- borderColor: string;
145
- width: number;
146
- height: number;
147
- borderRadius: number;
148
- borderWidth: number;
149
- alignItems: "center";
150
- justifyContent: "center";
151
- };
152
- };
153
- offline: {
154
- light: {
155
- backgroundColor: string;
156
- borderColor: string;
157
- width: number;
158
- height: number;
159
- borderRadius: number;
160
- borderWidth: number;
161
- alignItems: "center";
162
- justifyContent: "center";
163
- };
164
- dark: {
165
- backgroundColor: string;
166
- borderColor: string;
167
- width: number;
168
- height: number;
169
- borderRadius: number;
170
- borderWidth: number;
171
- alignItems: "center";
172
- justifyContent: "center";
173
- };
174
- };
175
- };
176
- export declare const SplitButtonStyles: {
177
- paused: {
178
- light: {
179
- container: {
180
- backgroundColor: string;
181
- borderColor: string;
182
- width: number;
183
- height: number;
184
- borderRadius: number;
185
- borderWidth: number;
186
- flexDirection: "row";
187
- alignItems: "center";
188
- justifyContent: "center";
189
- overflow: "hidden";
190
- };
191
- audio: {
192
- flex: number;
193
- height: number;
194
- alignItems: "center";
195
- justifyContent: "center";
196
- };
197
- subtitles: {
198
- flex: number;
199
- height: number;
200
- alignItems: "center";
201
- justifyContent: "center";
202
- };
203
- };
204
- dark: {
205
- container: {
206
- backgroundColor: string;
207
- borderColor: string;
208
- width: number;
209
- height: number;
210
- borderRadius: number;
211
- borderWidth: number;
212
- flexDirection: "row";
213
- alignItems: "center";
214
- justifyContent: "center";
215
- overflow: "hidden";
216
- };
217
- audio: {
218
- flex: number;
219
- height: number;
220
- alignItems: "center";
221
- justifyContent: "center";
222
- };
223
- subtitles: {
224
- flex: number;
225
- height: number;
226
- alignItems: "center";
227
- justifyContent: "center";
228
- };
229
- };
230
- };
231
- playing: {
232
- light: {
233
- container: {
234
- backgroundColor: string;
235
- borderColor: string;
236
- width: number;
237
- height: number;
238
- borderRadius: number;
239
- borderWidth: number;
240
- flexDirection: "row";
241
- alignItems: "center";
242
- justifyContent: "center";
243
- overflow: "hidden";
244
- };
245
- audio: {
246
- flex: number;
247
- height: number;
248
- alignItems: "center";
249
- justifyContent: "center";
250
- };
251
- subtitles: {
252
- flex: number;
253
- height: number;
254
- alignItems: "center";
255
- justifyContent: "center";
256
- };
257
- };
258
- dark: {
259
- container: {
260
- backgroundColor: string;
261
- borderColor: string;
262
- width: number;
263
- height: number;
264
- borderRadius: number;
265
- borderWidth: number;
266
- flexDirection: "row";
267
- alignItems: "center";
268
- justifyContent: "center";
269
- overflow: "hidden";
270
- };
271
- audio: {
272
- flex: number;
273
- height: number;
274
- alignItems: "center";
275
- justifyContent: "center";
276
- };
277
- subtitles: {
278
- flex: number;
279
- height: number;
280
- alignItems: "center";
281
- justifyContent: "center";
282
- };
283
- };
284
- };
285
- offline: {
286
- light: {
287
- container: {
288
- backgroundColor: string;
289
- borderColor: string;
290
- width: number;
291
- height: number;
292
- borderRadius: number;
293
- borderWidth: number;
294
- flexDirection: "row";
295
- alignItems: "center";
296
- justifyContent: "center";
297
- overflow: "hidden";
298
- };
299
- audio: {
300
- flex: number;
301
- height: number;
302
- alignItems: "center";
303
- justifyContent: "center";
304
- };
305
- subtitles: {
306
- flex: number;
307
- height: number;
308
- alignItems: "center";
309
- justifyContent: "center";
310
- };
311
- };
312
- dark: {
313
- container: {
314
- backgroundColor: string;
315
- borderColor: string;
316
- width: number;
317
- height: number;
318
- borderRadius: number;
319
- borderWidth: number;
320
- flexDirection: "row";
321
- alignItems: "center";
322
- justifyContent: "center";
323
- overflow: "hidden";
324
- };
325
- audio: {
326
- flex: number;
327
- height: number;
328
- alignItems: "center";
329
- justifyContent: "center";
330
- };
331
- subtitles: {
332
- flex: number;
333
- height: number;
334
- alignItems: "center";
335
- justifyContent: "center";
336
- };
337
- };
338
- };
339
- };
340
23
  export default PlayButtonView;
341
24
  //# sourceMappingURL=PlayButtonView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlayButtonView.d.ts","sourceRoot":"","sources":["../../../../src/components/PlayButtonView.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAiI7C,CAAC;AAEF,KAAK,eAAe,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAExD,eAAO,MAAM,cAAc,GACzB,MAAM,eAAe,EACrB,YAAY,OAAO,EACnB,UAAS,OAAe;;;;;;;;;CAMzB,CAAC;AAEF,eAAO,MAAM,4BAA4B,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AkF;IAClF,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,uFAAuF;IACvF,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;GAKG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA2G7C,CAAC;AAwHF,eAAe,cAAc,CAAC"}
@@ -1,9 +1,12 @@
1
1
  import React from 'react';
2
- import { type Reconnecting } from '../util/UIState';
2
+ import { type RetryValue } from '../sdk/Lifecycle';
3
3
  export interface ReconnectingProps {
4
4
  isDarkMode?: boolean;
5
- state: Reconnecting;
6
- onPress: () => void;
5
+ retry: RetryValue;
7
6
  }
7
+ /**
8
+ * The default reconnecting part. The reconnect runs by itself, so it has no retry-now button; the
9
+ * error part has the retry.
10
+ */
8
11
  export declare const ReconnectingView: React.FC<ReconnectingProps>;
9
12
  //# sourceMappingURL=ReconnectingView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReconnectingView.d.ts","sourceRoot":"","sources":["../../../../src/components/ReconnectingView.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,EAAE,YAAY,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAmExD,CAAC"}
1
+ {"version":3,"file":"ReconnectingView.d.ts","sourceRoot":"","sources":["../../../../src/components/ReconnectingView.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAInD,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,EAAE,UAAU,CAAA;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA8BxD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"WarningView.d.ts","sourceRoot":"","sources":["../../../../src/components/WarningView.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAiB9C,CAAC"}
1
+ {"version":3,"file":"WarningView.d.ts","sourceRoot":"","sources":["../../../../src/components/WarningView.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAiB9C,CAAC"}
@@ -1,145 +1,16 @@
1
- import { type UiState, type AvailableSubtitle } from "./util/UIState";
2
- import { type ForegroundServiceConfig } from "./util/ForegroundServiceConfig";
3
- export type Claims = {
4
- hideBranding: boolean;
5
- customUiAllowed: boolean;
6
- };
7
- export * from "./components";
8
- export * from "./util/Translations";
9
- export * from "./util/ForegroundServiceConfig";
10
- export * from "./util/UIState";
11
- export * from "./util/PlayingState";
12
- /**
13
- * Initialize the LiveVoice SDK.
14
- *
15
- * @param {ForegroundServiceConfig} [androidServiceConfig=serviceDisabled] - Pass the service config on Android.
16
- */
17
- export declare function initialize(androidServiceConfig?: ForegroundServiceConfig): void;
18
- /**
19
- * Join an event.
20
- *
21
- * @abstract By joining an event you can display the event's channels.
22
- *
23
- * @param {string} joinCode - The listener code of your event. You can find it on the event page of the admin web-interface by clicking on 'Share with your audience'.
24
- * @param {string | null} password - The optional password to join the event. If a password has been set for listeners in your event, it can be found in the 'Access' tab of the event page of the admin web-interface.
25
- * @param {string} apiKey - Your API key. You can find your API key in the account page when logged in on the website.
26
- */
27
- export declare function joinEvent(joinCode: string, password: string | null, apiKey: string): void;
28
- /**
29
- * Leave the current event.
30
- *
31
- * @abstract You can explicitly leave an event to tear down any network connections the SDK uses when you no longer display any channels.
32
- */
33
- export declare function leaveEvent(): void;
34
- /**
35
- * Reconnect when a connection error occurred.
36
- *
37
- * @abstract Call this method to try to reconnect when a connection error has occurred.
38
- */
39
- export declare function reconnect(): void;
40
- /**
41
- * Get the claims for the current event.
42
- *
43
- * @abstract The claims determine the authorized features for an API key. Claims are available, once an event has been joined.
44
- * @returns {Claims | null} The authorization claims, or `nil` if not yet joined
45
- */
46
- export declare function getCurrentClaims(): Claims | null;
47
- /**
48
- * Get the current state of the LiveVoice SDK.
49
- *
50
- * @abstract You should only need to call this method to get an initial value. Use {@link onUiStateChanged}
51
- ` to be updated about the view state.
52
- * @returns {UiState} The current view state
53
- */
54
- export declare function getCurrentUiState(): UiState;
55
- /**
56
- * Get the current available subtitle configurations LiveVoice SDK.
57
- *
58
- * @abstract You should only need to call this method to get an initial value. Use {@link onAvailableSubtitleConfigsChanged}
59
- ` to be updated when the available subtitle configurations change.
60
- * @returns {[AvailableSubtitle]} The current available subtitles
61
- */
62
- export declare function getCurrentSubtitleConfiguration(): [AvailableSubtitle];
63
- /**
64
- * Get the current subtitle elemens LiveVoice SDK.
65
- *
66
- * @abstract You should only need to call this method to get an initial value. Use {@link onSubtitlesChanged}
67
- ` to be updated when the new subtitles are added.
68
- * @returns {[String]} The current subtitles
69
- */
70
- export declare function getCurrentSubtitles(): [String];
71
- /**
72
- * Get the current state of the audio output.
73
- *
74
- * @abstract You should only need to call this method to get an initial value. Use {@link onAudioOutputChanged}
75
- ` to be updated about the audio state.
76
- * @returns {boolean} `true` for the speaker and `false` for the receiver.
77
- */
78
- export declare function getCurrentAudioState(): boolean;
79
- /**
80
- * Set the audio output.
81
- * @param {boolean} value - Set to `true` to use the speaker, and `false` to use the receiver.
82
- */
83
- export declare function setLiveVoiceUseSpeaker(value: boolean): void;
84
- /**
85
- * Start playing a channel.
86
- * @abstract You can find the channel ID for a channel in the admin web-interface at the bottom when tapping *Edit Channel*.
87
- * @param {number} [id] - The channel ID.
88
- */
89
- export declare function startChannel(id: number): void;
90
- /**
91
- * Stop playing the currently playing channel.
92
- */
93
- export declare function stopChannel(): void;
94
- /**
95
- * Start receiving subtitles.
96
- * @abstract The SDK can receive a single stream of subtitle fragments at a time.
97
- * You can stop receiving subtitles using {@link stopSubtitles()}.
98
- * Whenever you call this method, any previous subtitle streams are stopped automatically and you receive the subtitles for the requested channel and language instead.
99
- *
100
- * Note: You have to make sure that subtitles for the given channel and language are enabled in the web-interface. You can use the {@link onAvailableSubtitleConfigsChanged} handler to check if subtitles are available for a given channel in a given language.
101
- *
102
- * @param {number | null} channelId - The channel to receive subtitles for. Set to `null` to always receive subtitles for the currently playing channel.
103
- */
104
- export declare function startSubtitles(channelId: number | null): void;
105
- /**
106
- * Stop receiving subtitles.
107
- */
108
- export declare function stopSubtitles(): void;
109
- /**
110
- * Handle changes of the audio output.
111
- *
112
- * @returns {object} - An object with a `remove` method to unsubscribe from the event.
113
- */
114
- export declare function onAudioOutputChanged(handler: (useSpeaker: boolean) => void): {
115
- remove: () => void;
116
- };
117
- /**
118
- * Handle changes of the UI state.
119
- *
120
- * @returns {object} - An object with a `remove` method to unsubscribe from the event.
121
- */
122
- export declare function onUiStateChanged(handler: (arg: UiState) => void): {
123
- remove: () => void;
124
- };
125
- /**
126
- * Handle changes of the available subtitles.
127
- *
128
- * @returns { object } - An object with a`remove` method to unsubscribe from the event.
129
- */
130
- export declare function onAvailableSubtitleConfigsChanged(handler: (arg: [AvailableSubtitle]) => void): {
131
- remove: () => void;
132
- };
133
- /**
134
- * Handle changes of the available subtitles.
135
- *
136
- * @returns {object} - An object with a `remove` method to unsubscribe from the event.
137
- */
138
- export declare function onSubtitlesChanged(handler: (arg: [String]) => void): {
139
- remove: () => void;
140
- };
141
- /**
142
- * Open the LiveVoice website in the device's default browser.
143
- */
144
- export declare function openLiveVoiceWebsite(): void;
1
+ export { initialize, joinEvent, leaveEvent, reconnect, stopChannel, startSubtitles, stopSubtitles, setAudioOutput, setNowPlayingArtwork, openLiveVoiceWebsite, getSdkVersion, getNativeSdkVersion, } from './sdk/LiveVoiceSdk';
2
+ export type { LiveVoiceAudioFocus, LiveVoiceForegroundServiceConfig, LiveVoiceInitializeOptions, } from './sdk/LiveVoiceSdk';
3
+ export { getCurrentConnection, addConnectionListener, useLiveVoiceConnection, getCurrentSubtitles, addSubtitlesListener, useLiveVoiceSubtitles, getCurrentAvailableSubtitles, addAvailableSubtitlesListener, useLiveVoiceAvailableSubtitles, getCurrentAudioOutput, addAudioOutputListener, useLiveVoiceAudioOutput, getCurrentFeatures, addFeaturesListener, useLiveVoiceFeatures, getCurrentEvent, addCurrentEventListener, useLiveVoiceCurrentEvent, getCurrentRequestableLanguages, addRequestableLanguagesListener, useLiveVoiceRequestableLanguages, getCurrentLinkedEvents, addLinkedEventsListener, useLiveVoiceLinkedEvents, } from './sdk/Observables';
4
+ export { LiveVoiceError, liveVoiceErrorCodes } from './sdk/Lifecycle';
5
+ export type { LiveVoiceConnection, LiveVoiceErrorCode, LiveVoiceErrorDetail, LiveVoiceJoinedEvent, LiveVoiceJoinRequest, LiveVoiceRetry, } from './sdk/Lifecycle';
6
+ export type { LiveVoiceAiTranslationInfo, LiveVoiceAudioOutput, LiveVoiceAvailableSubtitle, LiveVoiceChannel, LiveVoiceDependentChannel, LiveVoiceFeatures, LiveVoicePlayingState, LiveVoiceSubscription, LiveVoiceSubtitleState, } from './sdk/Models';
7
+ export { requestLanguage, cancelLanguageRequest, switchToLinkedEvent } from './sdk/Event';
8
+ export type { LiveVoiceBrandColors, LiveVoiceEvent, LiveVoiceLanguageRequestState, LiveVoiceLinkedEvent, LiveVoiceRequestableLanguage, } from './sdk/Event';
9
+ export { setPasswordProvider, setPasswordStore } from './sdk/Passwords';
10
+ export type { LiveVoicePasswordProvider, LiveVoicePasswordRequest, LiveVoicePasswordStore, LiveVoicePasswordSubject, } from './sdk/Passwords';
11
+ export { addLogListener } from './sdk/LogEntries';
12
+ export type { LiveVoiceLogEntry, LiveVoiceLogLevel, LiveVoiceLogListener } from './sdk/LogEntries';
13
+ export { LiveVoiceView } from './components/LiveVoiceView';
14
+ export { Translations } from './util/Translations';
15
+ export type { LiveVoiceChannelCell, LiveVoiceEmptyReason, LiveVoiceViewProps, } from './components/LiveVoiceView';
145
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,gCAAgC,CAAC;AAExC,MAAM,MAAM,MAAM,GAAG;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzE,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AAEpC;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,oBAAoB,GAAE,uBAAyC,GAC9D,IAAI,CAeN;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,EAAE,MAAM,GACb,IAAI,CAEN;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI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AAE,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,IAAI,GAAG;IACpE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAKA;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,WAAW,EACX,cAAc,EACd,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,mBAAmB,EACnB,gCAAgC,EAChC,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,EAC5B,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAC/B,gCAAgC,EAChC,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtE,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,EAChB,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC1F,YAAY,EACV,oBAAoB,EACpB,cAAc,EACd,6BAA6B,EAC7B,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxE,YAAY,EACV,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,36 @@
1
+ /** The states on the wire (bridge.md 2.1). */
2
+ export type StateName = 'connection' | 'defaultView' | 'features' | 'audioOutput' | 'subtitles' | 'availableSubtitles' | 'currentEvent' | 'requestableLanguages' | 'linkedEvents';
3
+ /** Created once per JavaScript runtime; a different one tells native that the runtime is new. */
4
+ export declare const runtimeId: string;
5
+ /** Whether `initialize` has hydrated the cache. */
6
+ export declare function isInitialized(): boolean;
7
+ /** The latest value of `name` as JSON, which changes exactly when the value does. */
8
+ export declare function currentEncoded(name: StateName): string | undefined;
9
+ /** How long a command's reply waits for its states before resolving anyway (18 item 133). */
10
+ export declare const revisionWaitMillis = 5000;
11
+ /**
12
+ * Resolves once every state named in a reply's `revisions` (bridge.md 3.3) has applied that
13
+ * revision or a newer one, so `getCurrent…()` shows the command's result right after `await`. Only
14
+ * a value its decoder read counts; a state without a decoder counts on arrival. A state that never
15
+ * applies, for example after an undecodable delivery, stops the wait after five seconds: the
16
+ * command succeeded, so it never fails because of it.
17
+ */
18
+ export declare function awaitRevisions(revisions: unknown): Promise<void>;
19
+ /**
20
+ * Makes `decoder` the one decoder of `name`, and runs it on the value already held. The bridge
21
+ * calls it with every changed value before any observer; it returns whether it decoded and applied
22
+ * the value, and only then may that value's revision, or a newer one of the same value, satisfy a
23
+ * command's revisions.
24
+ */
25
+ export declare function decodeState(name: StateName, decoder: (value: unknown) => boolean): void;
26
+ /** Calls `observer` with every new value of `name`, from now on. */
27
+ export declare function observeState(name: StateName, observer: (value: unknown) => void): () => void;
28
+ /**
29
+ * Initialises the native SDK with `configuration` (bridge.md 3.2) and applies the snapshot it
30
+ * replies with before resolving. A native failure rejects with the native error as is.
31
+ */
32
+ export declare function initializeBridge(configuration: Record<string, unknown>): Promise<void>;
33
+ /** The localised text of an error code, from the native table (works before `initialize`). */
34
+ export declare function errorMessage(code: string): string;
35
+ export declare function record(value: unknown): value is Record<string, unknown>;
36
+ //# sourceMappingURL=Bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bridge.d.ts","sourceRoot":"","sources":["../../../../src/sdk/Bridge.ts"],"names":[],"mappings":"AA2BA,8CAA8C;AAC9C,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,aAAa,GACb,UAAU,GACV,aAAa,GACb,WAAW,GACX,oBAAoB,GACpB,cAAc,GACd,sBAAsB,GACtB,cAAc,CAAC;AA2BnB,iGAAiG;AACjG,eAAO,MAAM,SAAS,QAA0E,CAAC;AAEjG,mDAAmD;AACnD,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAElE;AAKD,6FAA6F;AAC7F,eAAO,MAAM,kBAAkB,OAAQ,CAAC;AAExC;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,I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