livevoice-sdk-react-native 2.0.1 → 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.
- package/README.md +105 -66
- package/android/build.gradle +5 -4
- package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +122 -188
- package/android/src/main/java/io/livevoice/react/__SDK.kt +2 -2
- package/ios/LiveVoiceRNBridge.swift +362 -0
- package/ios/LiveVoiceSdkReactNative.mm +187 -158
- package/ios/__SDK.h +1 -1
- package/ios/livevoice_spm_backport.rb +202 -0
- package/lib/module/components/BrandingView.js +58 -39
- package/lib/module/components/BrandingView.js.map +1 -1
- package/lib/module/components/ChannelView.js +355 -44
- package/lib/module/components/ChannelView.js.map +1 -1
- package/lib/module/components/ErrorView.js +5 -6
- package/lib/module/components/ErrorView.js.map +1 -1
- package/lib/module/components/LiveVoiceSpinner.js +81 -0
- package/lib/module/components/LiveVoiceSpinner.js.map +1 -0
- package/lib/module/components/LiveVoiceView.js +311 -133
- package/lib/module/components/LiveVoiceView.js.map +1 -1
- package/lib/module/components/PasswordPrompt.js +165 -0
- package/lib/module/components/PasswordPrompt.js.map +1 -0
- package/lib/module/components/PlayButtonView.js +180 -244
- package/lib/module/components/PlayButtonView.js.map +1 -1
- package/lib/module/components/ReconnectingView.js +31 -53
- package/lib/module/components/ReconnectingView.js.map +1 -1
- package/lib/module/icons/branding-ios.png +0 -0
- package/lib/module/icons/camera-off-android.png +0 -0
- package/lib/module/icons/camera-off-android@2x.png +0 -0
- package/lib/module/icons/camera-off-android@3x.png +0 -0
- package/lib/module/icons/cpu-android.png +0 -0
- package/lib/module/icons/cpu-android@2x.png +0 -0
- package/lib/module/icons/cpu-android@3x.png +0 -0
- package/lib/module/icons/cpu-ios.png +0 -0
- package/lib/module/icons/cpu-ios@2x.png +0 -0
- package/lib/module/icons/cpu-ios@3x.png +0 -0
- package/lib/module/icons/lock-android.png +0 -0
- package/lib/module/icons/lock-android@2x.png +0 -0
- package/lib/module/icons/lock-android@3x.png +0 -0
- package/lib/module/icons/lock-ios.png +0 -0
- package/lib/module/icons/lock-ios@2x.png +0 -0
- package/lib/module/icons/lock-ios@3x.png +0 -0
- package/lib/module/icons/mic-off-android.png +0 -0
- package/lib/module/icons/mic-off-android@2x.png +0 -0
- package/lib/module/icons/mic-off-android@3x.png +0 -0
- package/lib/module/icons/mic-slash-ios.png +0 -0
- package/lib/module/icons/mic-slash-ios@2x.png +0 -0
- package/lib/module/icons/mic-slash-ios@3x.png +0 -0
- package/lib/module/icons/video-slash-ios.png +0 -0
- package/lib/module/icons/video-slash-ios@2x.png +0 -0
- package/lib/module/icons/video-slash-ios@3x.png +0 -0
- package/lib/module/index.js +11 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/sdk/Bridge.js +236 -0
- package/lib/module/sdk/Bridge.js.map +1 -0
- package/lib/module/sdk/Event.js +160 -0
- package/lib/module/sdk/Event.js.map +1 -0
- package/lib/module/sdk/Lifecycle.js +331 -0
- package/lib/module/sdk/Lifecycle.js.map +1 -0
- package/lib/module/sdk/LiveVoiceSdk.js +262 -268
- package/lib/module/sdk/LiveVoiceSdk.js.map +1 -1
- package/lib/module/sdk/LiveVoiceState.js +208 -40
- package/lib/module/sdk/LiveVoiceState.js.map +1 -1
- package/lib/module/sdk/LogEntries.js +99 -0
- package/lib/module/sdk/LogEntries.js.map +1 -0
- package/lib/module/sdk/Models.js +2 -0
- package/lib/module/{util/UIState.js.map → sdk/Models.js.map} +1 -1
- package/lib/module/{util/PlayingState.js → sdk/NativeSdkVersions.js} +9 -8
- package/lib/module/sdk/NativeSdkVersions.js.map +1 -0
- package/lib/module/sdk/Observables.js +391 -0
- package/lib/module/sdk/Observables.js.map +1 -0
- package/lib/module/sdk/Passwords.js +298 -0
- package/lib/module/sdk/Passwords.js.map +1 -0
- package/lib/module/sdk/Playback.js +35 -0
- package/lib/module/sdk/Playback.js.map +1 -0
- package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
- package/lib/module/util/Colors.js +2 -1
- package/lib/module/util/Colors.js.map +1 -1
- package/lib/module/util/Translations.js +34 -11
- package/lib/module/util/Translations.js.map +1 -1
- package/lib/module/util/freeze.js +26 -0
- package/lib/module/util/freeze.js.map +1 -0
- package/lib/module/util/logger.js +79 -41
- package/lib/module/util/logger.js.map +1 -1
- package/lib/typescript/src/components/BrandingView.d.ts +4 -0
- package/lib/typescript/src/components/BrandingView.d.ts.map +1 -1
- package/lib/typescript/src/components/ChannelView.d.ts +29 -3
- package/lib/typescript/src/components/ChannelView.d.ts.map +1 -1
- package/lib/typescript/src/components/ErrorView.d.ts +5 -3
- package/lib/typescript/src/components/ErrorView.d.ts.map +1 -1
- package/lib/typescript/src/components/LiveVoiceSpinner.d.ts +16 -0
- package/lib/typescript/src/components/LiveVoiceSpinner.d.ts.map +1 -0
- package/lib/typescript/src/components/LiveVoiceView.d.ts +81 -21
- package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -1
- package/lib/typescript/src/components/PasswordPrompt.d.ts +13 -0
- package/lib/typescript/src/components/PasswordPrompt.d.ts.map +1 -0
- package/lib/typescript/src/components/PlayButtonView.d.ts +12 -329
- package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -1
- package/lib/typescript/src/components/ReconnectingView.d.ts +6 -3
- package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +15 -6
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/sdk/Bridge.d.ts +36 -0
- package/lib/typescript/src/sdk/Bridge.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Event.d.ts +97 -0
- package/lib/typescript/src/sdk/Event.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Lifecycle.d.ts +191 -0
- package/lib/typescript/src/sdk/Lifecycle.d.ts.map +1 -0
- package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts +195 -190
- package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts.map +1 -1
- package/lib/typescript/src/sdk/LiveVoiceState.d.ts +77 -9
- package/lib/typescript/src/sdk/LiveVoiceState.d.ts.map +1 -1
- package/lib/typescript/src/sdk/LogEntries.d.ts +28 -0
- package/lib/typescript/src/sdk/LogEntries.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Models.d.ts +114 -0
- package/lib/typescript/src/sdk/Models.d.ts.map +1 -0
- package/lib/typescript/src/sdk/NativeSdkVersions.d.ts +6 -0
- package/lib/typescript/src/sdk/NativeSdkVersions.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Observables.d.ts +123 -0
- package/lib/typescript/src/sdk/Observables.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Passwords.d.ts +72 -0
- package/lib/typescript/src/sdk/Passwords.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Playback.d.ts +9 -0
- package/lib/typescript/src/sdk/Playback.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts +34 -31
- package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -1
- package/lib/typescript/src/util/Colors.d.ts.map +1 -1
- package/lib/typescript/src/util/Translations.d.ts +30 -8
- package/lib/typescript/src/util/Translations.d.ts.map +1 -1
- package/lib/typescript/src/util/freeze.d.ts +6 -0
- package/lib/typescript/src/util/freeze.d.ts.map +1 -0
- package/lib/typescript/src/util/logger.d.ts +17 -7
- package/lib/typescript/src/util/logger.d.ts.map +1 -1
- package/livevoice-sdk-react-native.podspec +29 -4
- package/package.json +12 -9
- package/src/components/BrandingView.tsx +42 -55
- package/src/components/ChannelView.tsx +329 -38
- package/src/components/ErrorView.tsx +9 -12
- package/src/components/LiveVoiceSpinner.tsx +87 -0
- package/src/components/LiveVoiceView.tsx +319 -201
- package/src/components/PasswordPrompt.tsx +144 -0
- package/src/components/PlayButtonView.tsx +165 -269
- package/src/components/ReconnectingView.tsx +28 -81
- package/src/icons/branding-ios.png +0 -0
- package/src/icons/camera-off-android.png +0 -0
- package/src/icons/camera-off-android@2x.png +0 -0
- package/src/icons/camera-off-android@3x.png +0 -0
- package/src/icons/cpu-android.png +0 -0
- package/src/icons/cpu-android@2x.png +0 -0
- package/src/icons/cpu-android@3x.png +0 -0
- package/src/icons/cpu-ios.png +0 -0
- package/src/icons/cpu-ios@2x.png +0 -0
- package/src/icons/cpu-ios@3x.png +0 -0
- package/src/icons/lock-android.png +0 -0
- package/src/icons/lock-android@2x.png +0 -0
- package/src/icons/lock-android@3x.png +0 -0
- package/src/icons/lock-ios.png +0 -0
- package/src/icons/lock-ios@2x.png +0 -0
- package/src/icons/lock-ios@3x.png +0 -0
- package/src/icons/mic-off-android.png +0 -0
- package/src/icons/mic-off-android@2x.png +0 -0
- package/src/icons/mic-off-android@3x.png +0 -0
- package/src/icons/mic-slash-ios.png +0 -0
- package/src/icons/mic-slash-ios@2x.png +0 -0
- package/src/icons/mic-slash-ios@3x.png +0 -0
- package/src/icons/video-slash-ios.png +0 -0
- package/src/icons/video-slash-ios@2x.png +0 -0
- package/src/icons/video-slash-ios@3x.png +0 -0
- package/src/index.tsx +92 -6
- package/src/sdk/Bridge.ts +259 -0
- package/src/sdk/Event.ts +187 -0
- package/src/sdk/Lifecycle.ts +366 -0
- package/src/sdk/LiveVoiceSdk.ts +285 -309
- package/src/sdk/LiveVoiceState.ts +230 -60
- package/src/sdk/LogEntries.ts +88 -0
- package/src/sdk/Models.ts +129 -0
- package/src/{util/PlayingState.ts → sdk/NativeSdkVersions.ts} +7 -6
- package/src/sdk/Observables.ts +414 -0
- package/src/sdk/Passwords.ts +286 -0
- package/src/sdk/Playback.ts +30 -0
- package/src/specs/NativeLiveVoiceSdk.ts +42 -38
- package/src/util/Colors.ts +2 -1
- package/src/util/Translations.ts +34 -12
- package/src/util/freeze.ts +23 -0
- package/src/util/logger.ts +79 -52
- package/lib/module/components/AudioOutputSwitchView.js +0 -138
- package/lib/module/components/AudioOutputSwitchView.js.map +0 -1
- package/lib/module/components/index.js +0 -24
- package/lib/module/components/index.js.map +0 -1
- package/lib/module/icons/mic.png +0 -0
- package/lib/module/util/ForegroundServiceConfig.js +0 -38
- package/lib/module/util/ForegroundServiceConfig.js.map +0 -1
- package/lib/module/util/PlayingState.js.map +0 -1
- package/lib/module/util/UIState.js +0 -4
- package/lib/typescript/src/components/AudioOutputSwitchView.d.ts +0 -6
- package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +0 -1
- package/lib/typescript/src/components/index.d.ts +0 -9
- package/lib/typescript/src/components/index.d.ts.map +0 -1
- package/lib/typescript/src/util/ForegroundServiceConfig.d.ts +0 -19
- package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +0 -1
- package/lib/typescript/src/util/PlayingState.d.ts +0 -7
- package/lib/typescript/src/util/PlayingState.d.ts.map +0 -1
- package/lib/typescript/src/util/UIState.d.ts +0 -86
- package/lib/typescript/src/util/UIState.d.ts.map +0 -1
- package/src/components/AudioOutputSwitchView.tsx +0 -146
- package/src/components/index.tsx +0 -21
- package/src/icons/mic.png +0 -0
- package/src/util/ForegroundServiceConfig.tsx +0 -42
- package/src/util/UIState.ts +0 -106
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,7 +1,16 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
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';
|
|
7
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"
|
|
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,IAAI,CAAC,CAuBhE;AAYD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GAAG,IAAI,CAQvF;AAiBD,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAS5F;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB5F;AAED,8FAA8F;AAC9F,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWjD;AAoDD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEvE"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** An event's colours, `'#RRGGBB'`, for the light and the dark appearance. */
|
|
2
|
+
export type LiveVoiceBrandColors = {
|
|
3
|
+
light: string;
|
|
4
|
+
dark: string;
|
|
5
|
+
};
|
|
6
|
+
/** The joined event. */
|
|
7
|
+
export type LiveVoiceEvent = {
|
|
8
|
+
eventId: number;
|
|
9
|
+
name: string;
|
|
10
|
+
/** `null` for an event without branding. */
|
|
11
|
+
brandColors: LiveVoiceBrandColors | null;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Where a requestable language stands:
|
|
15
|
+
* - `requestable`: it can be requested.
|
|
16
|
+
* - `requested`: a request is on its way, or the server confirmed or accepted it and its channel
|
|
17
|
+
* has not arrived yet. Requests of other listeners count.
|
|
18
|
+
* - `available`: an AI translation of the channel the requests translate exists in that
|
|
19
|
+
* language. A channel translating another channel does not count.
|
|
20
|
+
* - `unavailable`: the event excludes it, because it is spoken on the channel the requests
|
|
21
|
+
* translate.
|
|
22
|
+
*/
|
|
23
|
+
export type LiveVoiceLanguageRequestState = 'requestable' | 'requested' | 'available' | 'unavailable';
|
|
24
|
+
/** A language listeners can ask the event to add. */
|
|
25
|
+
export type LiveVoiceRequestableLanguage = {
|
|
26
|
+
languageCode: string;
|
|
27
|
+
/** The language's name in the device's language. */
|
|
28
|
+
localizedName: string;
|
|
29
|
+
/** The language's name in itself. */
|
|
30
|
+
autonym: string;
|
|
31
|
+
state: LiveVoiceLanguageRequestState;
|
|
32
|
+
};
|
|
33
|
+
/** An event linked to the joined one, to switch to with {@link switchToLinkedEvent}. */
|
|
34
|
+
export type LiveVoiceLinkedEvent = {
|
|
35
|
+
eventId: number;
|
|
36
|
+
name: string;
|
|
37
|
+
/** The event's join code; it is not secret. */
|
|
38
|
+
joinCode: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Asks the event to add a language and resolves once the server confirmed the request.
|
|
42
|
+
*
|
|
43
|
+
* The language shows `requested` in {@link getCurrentRequestableLanguages} shortly after, and
|
|
44
|
+
* what happens next shows there too. It never starts playback. Needs a `ready` connection and an
|
|
45
|
+
* API key that permits custom UI.
|
|
46
|
+
*
|
|
47
|
+
* @param languageCode - The `languageCode` of a language in state `requestable`.
|
|
48
|
+
* @throws {LiveVoiceError} `not_joined` unless the connection is `ready`; `api_key_invalid`
|
|
49
|
+
* without the custom-UI permission; `invalid_argument` for a code that is unknown or not
|
|
50
|
+
* requestable (also one already requested); `timed_out` when the server does not confirm within
|
|
51
|
+
* 10 seconds (the request may still exist); `network_failed`; `cancelled` when a leave, a new
|
|
52
|
+
* join or a switch ended it; `generic` with `detail.reason` `language_request_declined` or
|
|
53
|
+
* `language_request_failed`. See {@link LiveVoiceErrorCode}.
|
|
54
|
+
*/
|
|
55
|
+
export declare function requestLanguage(languageCode: string): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Withdraws the request for a language and resolves once the server confirmed the cancellation.
|
|
58
|
+
*
|
|
59
|
+
* The language shows `requestable` in {@link getCurrentRequestableLanguages} shortly after. A
|
|
60
|
+
* second cancellation of the same language waits for the first. Needs a `ready` connection and
|
|
61
|
+
* an API key that permits custom UI.
|
|
62
|
+
*
|
|
63
|
+
* @param languageCode - The `languageCode` of a language in state `requested`.
|
|
64
|
+
* @throws {LiveVoiceError} `not_joined` unless the connection is `ready`; `api_key_invalid`
|
|
65
|
+
* without the custom-UI permission; `invalid_argument` for a code that is unknown or not
|
|
66
|
+
* requested; `command_in_progress` while your own request for it is still being sent; `generic`
|
|
67
|
+
* with `detail.reason` `language_request_resolved` when the server decided first; `timed_out`
|
|
68
|
+
* when the server does not confirm within 10 seconds; `network_failed`; `cancelled` when a leave,
|
|
69
|
+
* a new join or a switch ended it; otherwise as {@link requestLanguage}. See
|
|
70
|
+
* {@link LiveVoiceErrorCode}.
|
|
71
|
+
*/
|
|
72
|
+
export declare function cancelLanguageRequest(languageCode: string): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Switches to a linked event and resolves once it is ready, with the same guarantees as
|
|
75
|
+
* `joinEvent`. Needs a `ready` connection and an API key that permits custom UI.
|
|
76
|
+
*
|
|
77
|
+
* When the promise resolves, the observed values already show the linked event, or the result of
|
|
78
|
+
* a newer call. Until then the connection is `joining` and the current event and its lists are
|
|
79
|
+
* `null`. After a completed switch the joined event stays valid: its `leave()` leaves the linked
|
|
80
|
+
* event. A leave while the switch is pending ends it with `cancelled` and leaves the event.
|
|
81
|
+
*
|
|
82
|
+
* A failed switch does not return to the previous event: the connection is `failed`, and
|
|
83
|
+
* `reconnect()` tries the linked event again if the error is retryable. The event is not checked
|
|
84
|
+
* against the linked events, so any event you have a join code for works.
|
|
85
|
+
*
|
|
86
|
+
* @param event - The event to switch to, usually one of {@link getCurrentLinkedEvents}.
|
|
87
|
+
* @throws {LiveVoiceError} `not_joined` when no event is ready and no switch is pending, also
|
|
88
|
+
* while reconnecting (the reconnect continues); `api_key_invalid` without the custom-UI
|
|
89
|
+
* permission; `superseded` when a newer switch or join replaced it; `cancelled` when a leave
|
|
90
|
+
* ended it; `timed_out` when the linked event was not ready within 30 seconds; otherwise why the
|
|
91
|
+
* join failed, such as `event_not_found`. See {@link LiveVoiceErrorCode}.
|
|
92
|
+
*/
|
|
93
|
+
export declare function switchToLinkedEvent(event: LiveVoiceLinkedEvent): Promise<void>;
|
|
94
|
+
export declare function decodeEvent(wire: unknown): LiveVoiceEvent | null;
|
|
95
|
+
export declare function decodeLanguages(wire: unknown): LiveVoiceRequestableLanguage[] | null;
|
|
96
|
+
export declare function decodeLinkedEvents(wire: unknown): LiveVoiceLinkedEvent[] | null;
|
|
97
|
+
//# sourceMappingURL=Event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["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B,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,4BAA4B,EAAE,GAAG,IAAI,CAapF;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,oBAAoB,EAAE,GAAG,IAAI,CAO/E"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/** Every {@link LiveVoiceErrorCode}, for example to check a value at runtime. */
|
|
2
|
+
export declare const liveVoiceErrorCodes: readonly ["not_initialized", "not_joined", "invalid_argument", "superseded", "cancelled", "timed_out", "leave_incomplete", "command_in_progress", "api_key_invalid", "event_not_found", "event_inactive", "wrong_password", "listener_limit_reached", "network_failed", "no_network", "generic", "password_required", "unsupported_sdk", "channel_password_required", "channel_wrong_password", "channel_limit_reached", "channel_unavailable", "channel_forbidden", "channel_offline"];
|
|
3
|
+
/**
|
|
4
|
+
* What went wrong, the same codes on every platform. Each call names the codes specific to it.
|
|
5
|
+
*
|
|
6
|
+
* Commands:
|
|
7
|
+
* - `not_initialized`: a call that needs `initialize()` was made before it resolved. Reading
|
|
8
|
+
* values, adding listeners and some setters work before it.
|
|
9
|
+
* - `invalid_argument`: an argument is malformed, or not allowed in the current state.
|
|
10
|
+
* - `not_joined`: the connection is not in a state the call allows; most calls need `ready`.
|
|
11
|
+
* - `superseded`: a newer call replaced a `joinEvent`, `reconnect` or `switchToLinkedEvent`. No
|
|
12
|
+
* other call fails with it.
|
|
13
|
+
* - `cancelled`: a leave, a newer command or a new join ended the call. Like `superseded` it
|
|
14
|
+
* needs no message to the user.
|
|
15
|
+
* - `timed_out`: no result within 30 seconds (join, switch, reconnect) or 10 seconds (a start or
|
|
16
|
+
* stop of playback, a subtitle start, the language calls).
|
|
17
|
+
* - `leave_incomplete`: local cleanup or an earlier stop has not finished within its deadline of
|
|
18
|
+
* 5 seconds. It comes from a leave (the event is left all the same), from a stop of playback
|
|
19
|
+
* while joining or failed, and from a start waiting behind an unfinished stop, which can be a
|
|
20
|
+
* stop in the current event. The cleanup is never abandoned; it continues.
|
|
21
|
+
* - `command_in_progress`: the same command is still running: an identical subtitle start, or
|
|
22
|
+
* the request a cancellation is meant to withdraw.
|
|
23
|
+
*
|
|
24
|
+
* Joining: `api_key_invalid` (also when the key does not permit custom UI, for a custom cell,
|
|
25
|
+
* `switchToLinkedEvent` and the language calls), `event_not_found`, `event_inactive`,
|
|
26
|
+
* `password_required` (no password was given), `wrong_password` (one was given and rejected),
|
|
27
|
+
* `listener_limit_reached`, `network_failed` (the connection failed or was lost, also before a
|
|
28
|
+
* call could reach the server), `no_network`, `unsupported_sdk` (the server requires a newer SDK,
|
|
29
|
+
* or the installed native SDK is not the version this package was built for), `generic` (see
|
|
30
|
+
* `detail.reason`).
|
|
31
|
+
*
|
|
32
|
+
* Channels and subtitles: `channel_password_required`, `channel_wrong_password`,
|
|
33
|
+
* `channel_limit_reached` (`detail.limitReason` is `participant` or `viewer`), `channel_offline`
|
|
34
|
+
* (a start of playback only; an offline channel's subtitles can be started),
|
|
35
|
+
* `channel_unavailable` (not part of the event, without audio, or a start of playback while
|
|
36
|
+
* reconnecting), `channel_forbidden`.
|
|
37
|
+
*/
|
|
38
|
+
export type LiveVoiceErrorCode = typeof liveVoiceErrorCodes[number];
|
|
39
|
+
/** Optional details of an error. */
|
|
40
|
+
export type LiveVoiceErrorDetail = {
|
|
41
|
+
/** The HTTP status of a failed request. */
|
|
42
|
+
httpStatus?: number;
|
|
43
|
+
/** The platform's own error code. */
|
|
44
|
+
platformCode?: number;
|
|
45
|
+
/** Which limit was reached. */
|
|
46
|
+
limitReason?: string;
|
|
47
|
+
/** A finer reason within the code, such as `stop_failed`. */
|
|
48
|
+
reason?: string;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* The error every LiveVoice call rejects with, and the one a `failed` connection carries. Its
|
|
52
|
+
* `message` is localised text to show as is. Codes only a developer can fix (`invalid_argument`,
|
|
53
|
+
* `not_initialized`, `api_key_invalid`, `unsupported_sdk`) share a generic text; the SDK log
|
|
54
|
+
* explains them.
|
|
55
|
+
*/
|
|
56
|
+
export declare class LiveVoiceError extends Error {
|
|
57
|
+
/** What went wrong; stable, for your own handling. */
|
|
58
|
+
readonly code: LiveVoiceErrorCode;
|
|
59
|
+
/** Whether trying again can succeed; it follows from the code. */
|
|
60
|
+
readonly isRetryable: boolean;
|
|
61
|
+
/** Optional details, `{}` when there are none. */
|
|
62
|
+
readonly detail: LiveVoiceErrorDetail;
|
|
63
|
+
/**
|
|
64
|
+
* Creates an error, for tests and previews.
|
|
65
|
+
*
|
|
66
|
+
* @param code - What went wrong; `isRetryable` follows from it.
|
|
67
|
+
* @param options - `detail`: extra information for some codes. `message`: the text to show;
|
|
68
|
+
* leave it out or pass `null` for the code's localised text.
|
|
69
|
+
*/
|
|
70
|
+
constructor(code: LiveVoiceErrorCode, options?: {
|
|
71
|
+
detail?: LiveVoiceErrorDetail;
|
|
72
|
+
message?: string | null;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/** When the next reconnect attempt runs. */
|
|
76
|
+
export type LiveVoiceRetry = {
|
|
77
|
+
kind: 'inProgress';
|
|
78
|
+
} | {
|
|
79
|
+
kind: 'scheduled';
|
|
80
|
+
at: Date;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* The connection to the event:
|
|
84
|
+
* - `idle`: nothing is joined or joining; also before `initialize()`.
|
|
85
|
+
* - `joining`: a join, a switch to a linked event, or the retry of a failed join is in progress.
|
|
86
|
+
* - `ready`: the event `eventId` is joined.
|
|
87
|
+
* - `reconnecting`: the connection was lost and is recovering; see `retry`. A `reconnect()` that
|
|
88
|
+
* times out leaves it here, and recovery continues.
|
|
89
|
+
* - `leaving`: a leave is running.
|
|
90
|
+
* - `failed`: a join, a switch or the retry of a join failed, or the joined event ended, with
|
|
91
|
+
* `error`. The join is kept: `reconnect()` retries it if the error is retryable, and
|
|
92
|
+
* `stopChannel` and `stopSubtitles` still work. It stays until that retry, a new join or a
|
|
93
|
+
* leave.
|
|
94
|
+
*
|
|
95
|
+
* Use it for display. To know that a call completed, await the call.
|
|
96
|
+
*/
|
|
97
|
+
export type LiveVoiceConnection = {
|
|
98
|
+
status: 'idle' | 'joining' | 'leaving';
|
|
99
|
+
} | {
|
|
100
|
+
status: 'ready';
|
|
101
|
+
eventId: number;
|
|
102
|
+
} | {
|
|
103
|
+
status: 'reconnecting';
|
|
104
|
+
eventId: number;
|
|
105
|
+
retry: LiveVoiceRetry;
|
|
106
|
+
} | {
|
|
107
|
+
status: 'failed';
|
|
108
|
+
error: LiveVoiceError;
|
|
109
|
+
};
|
|
110
|
+
/** What `joinEvent` joins with. */
|
|
111
|
+
export type LiveVoiceJoinRequest = {
|
|
112
|
+
/**
|
|
113
|
+
* The code listeners join the event with: six characters, digits and the letters
|
|
114
|
+
* `ABCDEFGHJKLMNPQRST`, in either case.
|
|
115
|
+
*/
|
|
116
|
+
joinCode: string;
|
|
117
|
+
/**
|
|
118
|
+
* The event's password, if it has one. A password you pass is final: a wrong one fails with
|
|
119
|
+
* `wrong_password` without a prompt. Without one, a protected event's password comes from the
|
|
120
|
+
* SDK's memory, the password store, then the password provider or the built-in prompt.
|
|
121
|
+
*/
|
|
122
|
+
password?: string | null;
|
|
123
|
+
/** Your API key, from your LiveVoice account page. */
|
|
124
|
+
apiKey: string;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* The joined event `joinEvent` returns. It follows a completed switch to a linked event.
|
|
128
|
+
*
|
|
129
|
+
* Its `leave()` leaves only the join this came from, including a linked event it switched to; it
|
|
130
|
+
* can never leave a newer join. If a newer join replaced its join, it does nothing and resolves at
|
|
131
|
+
* once. Otherwise it resolves as `leaveEvent` does: the event's local cleanup has ended, and the
|
|
132
|
+
* observed connection is `idle` unless a newer join exists. If its join was already left, it
|
|
133
|
+
* waits for that leave's cleanup.
|
|
134
|
+
*
|
|
135
|
+
* `leave()` rejects with a {@link LiveVoiceError} `leave_incomplete` when the cleanup has not
|
|
136
|
+
* finished within 5 seconds; the event is left all the same and the cleanup continues. Another
|
|
137
|
+
* leave then waits for the same cleanup and can fail with `leave_incomplete` again.
|
|
138
|
+
*/
|
|
139
|
+
export type LiveVoiceJoinedEvent = {
|
|
140
|
+
leave(): Promise<void>;
|
|
141
|
+
};
|
|
142
|
+
export declare function normalizeError(error: unknown): LiveVoiceError;
|
|
143
|
+
/**
|
|
144
|
+
* A developer-only error the wrapper throws itself (bridge.md 3.6): its message is the generic
|
|
145
|
+
* text, and its explanation, a fixed sentence without argument values, goes to the SDK log as
|
|
146
|
+
* `LV_USAGE_ERROR`.
|
|
147
|
+
*/
|
|
148
|
+
export declare function usageError(code: 'invalid_argument' | 'not_initialized', operation: string, explanation: string): LiveVoiceError;
|
|
149
|
+
/**
|
|
150
|
+
* Runs `command` natively. Before `initialize()` it fails with `not_initialized` without reaching
|
|
151
|
+
* native, the only error the wrapper owns (bridge.md 3.1). A reply that is not JSON resolves as
|
|
152
|
+
* `undefined`: native succeeded, so the call does too.
|
|
153
|
+
*/
|
|
154
|
+
export declare function invoke(command: string, args?: Record<string, unknown>): Promise<unknown>;
|
|
155
|
+
export declare function join(request: LiveVoiceJoinRequest): Promise<LiveVoiceJoinedEvent>;
|
|
156
|
+
export declare function channelId(id: number, operation: string): number;
|
|
157
|
+
/** A retry as the cache keeps it: the time in milliseconds, so every delivery gets its own `Date`. */
|
|
158
|
+
export type RetryValue = {
|
|
159
|
+
kind: 'inProgress';
|
|
160
|
+
} | {
|
|
161
|
+
kind: 'scheduled';
|
|
162
|
+
at: number;
|
|
163
|
+
};
|
|
164
|
+
/** The connection as the cache keeps it, with the retry time in milliseconds. */
|
|
165
|
+
export type ConnectionValue = {
|
|
166
|
+
status: 'idle' | 'joining' | 'leaving';
|
|
167
|
+
} | {
|
|
168
|
+
status: 'ready';
|
|
169
|
+
eventId: number;
|
|
170
|
+
} | {
|
|
171
|
+
status: 'reconnecting';
|
|
172
|
+
eventId: number;
|
|
173
|
+
retry: RetryValue;
|
|
174
|
+
} | {
|
|
175
|
+
status: 'failed';
|
|
176
|
+
error: LiveVoiceError;
|
|
177
|
+
};
|
|
178
|
+
/** The wire's retry, or `undefined` when it is malformed. */
|
|
179
|
+
export declare function decodeRetry(wire: unknown): RetryValue | undefined;
|
|
180
|
+
/** A public retry, with a `Date` of its own. */
|
|
181
|
+
export declare function publicRetry(retry: RetryValue): LiveVoiceRetry;
|
|
182
|
+
/** The wire's error as a `LiveVoiceError`; anything else becomes `generic`. */
|
|
183
|
+
export declare function decodeError(wire: unknown): LiveVoiceError;
|
|
184
|
+
/** The wire's connection (bridge.md 2.3); throws for one it cannot read. */
|
|
185
|
+
export declare function decodeConnection(wire: unknown): ConnectionValue;
|
|
186
|
+
/**
|
|
187
|
+
* The public connection. A scheduled retry gets a `Date` of its own on every call, so changing one
|
|
188
|
+
* changes no other; every other connection is the cached value itself.
|
|
189
|
+
*/
|
|
190
|
+
export declare function publicConnection(value: ConnectionValue): LiveVoiceConnection;
|
|
191
|
+
//# sourceMappingURL=Lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/sdk/Lifecycle.ts"],"names":[],"mappings":"AAiBA,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,ydAyBtB,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAEpE,oCAAoC;AACpC,MAAM,MAAM,oBAAoB,GAAG;IACjC,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAyCF;;;;;GAKG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC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