@corti/dictation-web 0.0.0-test.562 → 0.0.0-test.571.1
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 +164 -112
- package/dist/bundle.js +1428 -546
- package/dist/components/audio-visualiser.d.ts +3 -2
- package/dist/components/audio-visualiser.js +15 -12
- package/dist/components/audio-visualiser.js.map +1 -1
- package/dist/components/corti-dictation.d.ts +26 -13
- package/dist/components/corti-dictation.js +70 -21
- package/dist/components/corti-dictation.js.map +1 -1
- package/dist/components/device-selector.d.ts +6 -16
- package/dist/components/device-selector.js +27 -58
- package/dist/components/device-selector.js.map +1 -1
- package/dist/components/keybinding-selector.d.ts +14 -0
- package/dist/components/keybinding-selector.js +81 -0
- package/dist/components/keybinding-selector.js.map +1 -0
- package/dist/components/language-selector.d.ts +8 -17
- package/dist/components/language-selector.js +26 -52
- package/dist/components/language-selector.js.map +1 -1
- package/dist/components/mode-selector.d.ts +14 -0
- package/dist/components/mode-selector.js +73 -0
- package/dist/components/mode-selector.js.map +1 -0
- package/dist/components/recording-button.d.ts +8 -14
- package/dist/components/recording-button.js +156 -96
- package/dist/components/recording-button.js.map +1 -1
- package/dist/components/settings-menu.d.ts +4 -2
- package/dist/components/settings-menu.js +34 -14
- package/dist/components/settings-menu.js.map +1 -1
- package/dist/constants.d.ts +5 -0
- package/dist/constants.js +5 -0
- package/dist/constants.js.map +1 -1
- package/dist/contexts/dictation-context.d.ts +24 -14
- package/dist/contexts/dictation-context.js +128 -46
- package/dist/contexts/dictation-context.js.map +1 -1
- package/dist/controllers/devices-controller.d.ts +26 -0
- package/dist/controllers/devices-controller.js +99 -0
- package/dist/controllers/devices-controller.js.map +1 -0
- package/dist/controllers/dictation-controller.d.ts +29 -0
- package/dist/controllers/dictation-controller.js +179 -0
- package/dist/controllers/dictation-controller.js.map +1 -0
- package/dist/controllers/keybinding-controller.d.ts +18 -0
- package/dist/controllers/keybinding-controller.js +83 -0
- package/dist/controllers/keybinding-controller.js.map +1 -0
- package/dist/controllers/languages-controller.d.ts +26 -0
- package/dist/controllers/languages-controller.js +83 -0
- package/dist/controllers/languages-controller.js.map +1 -0
- package/dist/controllers/media-controller.d.ts +24 -0
- package/dist/controllers/media-controller.js +115 -0
- package/dist/controllers/media-controller.js.map +1 -0
- package/dist/index.d.ts +9 -7
- package/dist/index.js +30 -20
- package/dist/index.js.map +1 -1
- package/dist/src/components/audio-visualiser.d.ts +1 -0
- package/dist/src/components/audio-visualiser.js +6 -3
- package/dist/src/components/audio-visualiser.js.map +1 -1
- package/dist/src/components/corti-dictation.d.ts +21 -6
- package/dist/src/components/corti-dictation.js +25 -2
- package/dist/src/components/corti-dictation.js.map +1 -1
- package/dist/src/components/recording-button.d.ts +4 -0
- package/dist/src/components/recording-button.js +34 -10
- package/dist/src/components/recording-button.js.map +1 -1
- package/dist/src/components/settings-menu.js +1 -1
- package/dist/src/components/settings-menu.js.map +1 -1
- package/dist/src/constants.js +24 -6
- package/dist/src/constants.js.map +1 -1
- package/dist/src/contexts/dictation-context.d.ts +19 -5
- package/dist/src/contexts/dictation-context.js +32 -12
- package/dist/src/contexts/dictation-context.js.map +1 -1
- package/dist/src/controllers/DictationController.d.ts +5 -0
- package/dist/src/controllers/DictationController.js +27 -8
- package/dist/src/controllers/DictationController.js.map +1 -1
- package/dist/src/controllers/MediaController.d.ts +6 -0
- package/dist/src/controllers/MediaController.js +17 -1
- package/dist/src/controllers/MediaController.js.map +1 -1
- package/dist/src/styles/ComponentStyles.js +5 -5
- package/dist/src/styles/ComponentStyles.js.map +1 -1
- package/dist/src/styles/audio-visualiser.js +1 -1
- package/dist/src/styles/audio-visualiser.js.map +1 -1
- package/dist/src/styles/buttons.js +12 -12
- package/dist/src/styles/buttons.js.map +1 -1
- package/dist/src/styles/callout.js +7 -7
- package/dist/src/styles/callout.js.map +1 -1
- package/dist/src/styles/select.js +8 -8
- package/dist/src/styles/select.js.map +1 -1
- package/dist/src/styles/settings-menu.js +4 -4
- package/dist/src/styles/settings-menu.js.map +1 -1
- package/dist/src/types.d.ts +5 -0
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/converters.js +4 -1
- package/dist/src/utils/converters.js.map +1 -1
- package/dist/src/utils/events.d.ts +11 -4
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/languages.js +2 -1
- package/dist/src/utils/languages.js.map +1 -1
- package/dist/src/utils/media.d.ts +1 -1
- package/dist/src/utils/media.js +13 -1
- package/dist/src/utils/media.js.map +1 -1
- package/dist/src/utils/token.d.ts +1 -1
- package/dist/src/utils/token.js +12 -11
- package/dist/src/utils/token.js.map +1 -1
- package/dist/styles/buttons.js +1 -2
- package/dist/styles/buttons.js.map +1 -1
- package/dist/styles/component-styles.d.ts +3 -0
- package/dist/styles/component-styles.js +32 -0
- package/dist/styles/component-styles.js.map +1 -0
- package/dist/styles/keybinding-selector.d.ts +2 -0
- package/dist/styles/keybinding-selector.js +72 -0
- package/dist/styles/keybinding-selector.js.map +1 -0
- package/dist/styles/mode-selector.d.ts +2 -0
- package/dist/styles/mode-selector.js +56 -0
- package/dist/styles/mode-selector.js.map +1 -0
- package/dist/styles/select.d.ts +1 -1
- package/dist/styles/select.js +6 -10
- package/dist/styles/select.js.map +1 -1
- package/dist/styles/settings-menu.js +9 -1
- package/dist/styles/settings-menu.js.map +1 -1
- package/dist/tsconfig.stories.tsbuildinfo +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/events.d.ts +16 -3
- package/dist/utils/events.js +22 -0
- package/dist/utils/events.js.map +1 -1
- package/dist/utils/keybinding.d.ts +36 -0
- package/dist/utils/keybinding.js +125 -0
- package/dist/utils/keybinding.js.map +1 -0
- package/dist/utils/languages.d.ts +4 -3
- package/dist/utils/languages.js.map +1 -1
- package/dist/utils/token.d.ts +1 -1
- package/dist/utils/token.js +12 -11
- package/dist/utils/token.js.map +1 -1
- package/package.json +9 -8
package/dist/bundle.js
CHANGED
|
@@ -811,6 +811,7 @@ var DEFAULT_DICTATION_CONFIG = {
|
|
|
811
811
|
primaryLanguage: "en",
|
|
812
812
|
spokenPunctuation: true
|
|
813
813
|
};
|
|
814
|
+
var AUDIO_CHUNK_INTERVAL_MS = 250;
|
|
814
815
|
|
|
815
816
|
// dist/utils/converters.js
|
|
816
817
|
var commaSeparatedConverter = {
|
|
@@ -960,37 +961,37 @@ function c5({ context: c6, subscribe: e10 }) {
|
|
|
960
961
|
};
|
|
961
962
|
}
|
|
962
963
|
|
|
963
|
-
// dist/
|
|
964
|
-
|
|
965
|
-
.
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
display: flex;
|
|
972
|
-
gap: 4px;
|
|
973
|
-
height: 46px;
|
|
974
|
-
width: fit-content;
|
|
975
|
-
box-sizing: border-box;
|
|
976
|
-
overflow: hidden;
|
|
964
|
+
// dist/utils/devices.js
|
|
965
|
+
async function requestMicAccess() {
|
|
966
|
+
if (!navigator.permissions) {
|
|
967
|
+
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
968
|
+
stream.getTracks().forEach((track) => {
|
|
969
|
+
track.stop();
|
|
970
|
+
});
|
|
971
|
+
return;
|
|
977
972
|
}
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
const initialToken = "accessToken" in config ? {
|
|
984
|
-
accessToken: config.accessToken,
|
|
985
|
-
refreshToken: config.refreshToken
|
|
986
|
-
} : await config.refreshAccessToken();
|
|
987
|
-
if (!initialToken?.accessToken || typeof initialToken.accessToken !== "string") {
|
|
988
|
-
throw new Error("Access token is required and must be a string");
|
|
973
|
+
const permissionStatus = await navigator.permissions.query({
|
|
974
|
+
name: "microphone"
|
|
975
|
+
});
|
|
976
|
+
if (permissionStatus.state === "denied") {
|
|
977
|
+
throw new Error("Microphone permission is denied");
|
|
989
978
|
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
979
|
+
if (permissionStatus.state === "prompt") {
|
|
980
|
+
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
981
|
+
stream.getTracks().forEach((track) => {
|
|
982
|
+
track.stop();
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
async function getAudioDevices() {
|
|
987
|
+
if (!navigator.mediaDevices?.enumerateDevices) {
|
|
988
|
+
throw new Error("MediaDevices API is not available");
|
|
989
|
+
}
|
|
990
|
+
await requestMicAccess();
|
|
991
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
992
|
+
const audioDevices = devices.filter((device) => device.kind === "audioinput");
|
|
993
|
+
const defaultDevice = audioDevices.length > 0 ? audioDevices[0] : void 0;
|
|
994
|
+
return { defaultDevice, devices: audioDevices };
|
|
994
995
|
}
|
|
995
996
|
|
|
996
997
|
// dist/utils/events.js
|
|
@@ -1078,6 +1079,331 @@ function networkActivityEvent(direction, data) {
|
|
|
1078
1079
|
detail: { data, direction }
|
|
1079
1080
|
});
|
|
1080
1081
|
}
|
|
1082
|
+
function modeChangedEvent(mode) {
|
|
1083
|
+
return new CustomEvent("mode-changed", {
|
|
1084
|
+
bubbles: true,
|
|
1085
|
+
composed: true,
|
|
1086
|
+
detail: { mode }
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
function keybindingChangedEvent(key, code) {
|
|
1090
|
+
return new CustomEvent("keybinding-changed", {
|
|
1091
|
+
bubbles: true,
|
|
1092
|
+
composed: true,
|
|
1093
|
+
detail: { code, key }
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
function keybindingActivatedEvent(keyboardEvent) {
|
|
1097
|
+
return new CustomEvent("keybinding-activated", {
|
|
1098
|
+
bubbles: true,
|
|
1099
|
+
cancelable: true,
|
|
1100
|
+
composed: true,
|
|
1101
|
+
detail: { keyboardEvent }
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
// dist/controllers/devices-controller.js
|
|
1106
|
+
var __classPrivateFieldSet = function(receiver, state, value, kind, f5) {
|
|
1107
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
1108
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a setter");
|
|
1109
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1110
|
+
return kind === "a" ? f5.call(receiver, value) : f5 ? f5.value = value : state.set(receiver, value), value;
|
|
1111
|
+
};
|
|
1112
|
+
var __classPrivateFieldGet = function(receiver, state, kind, f5) {
|
|
1113
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
1114
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1115
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
1116
|
+
};
|
|
1117
|
+
var _DevicesController_instances;
|
|
1118
|
+
var _DevicesController_autoLoadedDevices;
|
|
1119
|
+
var _DevicesController_loadingDevices;
|
|
1120
|
+
var _DevicesController_deviceChangeHandler;
|
|
1121
|
+
var _DevicesController_initialized;
|
|
1122
|
+
var _DevicesController_setupDeviceChangeListener;
|
|
1123
|
+
var _DevicesController_removeDeviceChangeListener;
|
|
1124
|
+
var _DevicesController_loadDevices;
|
|
1125
|
+
var DevicesController = class {
|
|
1126
|
+
constructor(host) {
|
|
1127
|
+
_DevicesController_instances.add(this);
|
|
1128
|
+
_DevicesController_autoLoadedDevices.set(this, false);
|
|
1129
|
+
_DevicesController_loadingDevices.set(this, false);
|
|
1130
|
+
_DevicesController_deviceChangeHandler.set(this, void 0);
|
|
1131
|
+
_DevicesController_initialized.set(this, false);
|
|
1132
|
+
this.host = host;
|
|
1133
|
+
host.addController(this);
|
|
1134
|
+
}
|
|
1135
|
+
initialize() {
|
|
1136
|
+
__classPrivateFieldSet(this, _DevicesController_initialized, true, "f");
|
|
1137
|
+
if (this.host.devices === void 0) {
|
|
1138
|
+
__classPrivateFieldGet(this, _DevicesController_instances, "m", _DevicesController_loadDevices).call(this);
|
|
1139
|
+
__classPrivateFieldGet(this, _DevicesController_instances, "m", _DevicesController_setupDeviceChangeListener).call(this);
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
hostDisconnected() {
|
|
1143
|
+
__classPrivateFieldGet(this, _DevicesController_instances, "m", _DevicesController_removeDeviceChangeListener).call(this);
|
|
1144
|
+
}
|
|
1145
|
+
hostUpdate() {
|
|
1146
|
+
if (!__classPrivateFieldGet(this, _DevicesController_initialized, "f")) {
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
if (this.host.devices === void 0) {
|
|
1150
|
+
__classPrivateFieldGet(this, _DevicesController_instances, "m", _DevicesController_loadDevices).call(this);
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
/**
|
|
1154
|
+
* Clear the auto-loaded flag (when devices are set externally)
|
|
1155
|
+
*/
|
|
1156
|
+
clearAutoLoadedFlag() {
|
|
1157
|
+
__classPrivateFieldSet(this, _DevicesController_autoLoadedDevices, false, "f");
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
_DevicesController_autoLoadedDevices = /* @__PURE__ */ new WeakMap(), _DevicesController_loadingDevices = /* @__PURE__ */ new WeakMap(), _DevicesController_deviceChangeHandler = /* @__PURE__ */ new WeakMap(), _DevicesController_initialized = /* @__PURE__ */ new WeakMap(), _DevicesController_instances = /* @__PURE__ */ new WeakSet(), _DevicesController_setupDeviceChangeListener = function _DevicesController_setupDeviceChangeListener2() {
|
|
1161
|
+
if (__classPrivateFieldGet(this, _DevicesController_deviceChangeHandler, "f")) {
|
|
1162
|
+
return;
|
|
1163
|
+
}
|
|
1164
|
+
__classPrivateFieldSet(this, _DevicesController_deviceChangeHandler, () => {
|
|
1165
|
+
if (__classPrivateFieldGet(this, _DevicesController_autoLoadedDevices, "f")) {
|
|
1166
|
+
__classPrivateFieldGet(this, _DevicesController_instances, "m", _DevicesController_loadDevices).call(this);
|
|
1167
|
+
}
|
|
1168
|
+
}, "f");
|
|
1169
|
+
navigator.mediaDevices.addEventListener("devicechange", __classPrivateFieldGet(this, _DevicesController_deviceChangeHandler, "f"));
|
|
1170
|
+
}, _DevicesController_removeDeviceChangeListener = function _DevicesController_removeDeviceChangeListener2() {
|
|
1171
|
+
if (!__classPrivateFieldGet(this, _DevicesController_deviceChangeHandler, "f")) {
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1174
|
+
navigator.mediaDevices.removeEventListener("devicechange", __classPrivateFieldGet(this, _DevicesController_deviceChangeHandler, "f"));
|
|
1175
|
+
__classPrivateFieldSet(this, _DevicesController_deviceChangeHandler, void 0, "f");
|
|
1176
|
+
}, _DevicesController_loadDevices = async function _DevicesController_loadDevices2() {
|
|
1177
|
+
if (__classPrivateFieldGet(this, _DevicesController_loadingDevices, "f")) {
|
|
1178
|
+
return;
|
|
1179
|
+
}
|
|
1180
|
+
__classPrivateFieldSet(this, _DevicesController_loadingDevices, true, "f");
|
|
1181
|
+
try {
|
|
1182
|
+
const { devices, defaultDevice } = await getAudioDevices();
|
|
1183
|
+
__classPrivateFieldSet(this, _DevicesController_autoLoadedDevices, true, "f");
|
|
1184
|
+
this.host._devices = devices;
|
|
1185
|
+
const previousDevice = this.host.selectedDevice;
|
|
1186
|
+
const selectedDevice = (previousDevice && devices.find((d3) => d3.deviceId === previousDevice.deviceId)) ?? defaultDevice;
|
|
1187
|
+
this.host.selectedDevice = selectedDevice;
|
|
1188
|
+
this.host.requestUpdate();
|
|
1189
|
+
this.host.dispatchEvent(recordingDevicesChangedEvent(devices, selectedDevice));
|
|
1190
|
+
this.host.dispatchEvent(readyEvent());
|
|
1191
|
+
} catch (error) {
|
|
1192
|
+
this.host.dispatchEvent(errorEvent(error));
|
|
1193
|
+
} finally {
|
|
1194
|
+
__classPrivateFieldSet(this, _DevicesController_loadingDevices, false, "f");
|
|
1195
|
+
}
|
|
1196
|
+
};
|
|
1197
|
+
|
|
1198
|
+
// dist/utils/languages.js
|
|
1199
|
+
var DEFAULT_LANGUAGES_BY_REGION = {
|
|
1200
|
+
default: LANGUAGES_SUPPORTED_EU,
|
|
1201
|
+
eu: LANGUAGES_SUPPORTED_EU,
|
|
1202
|
+
us: LANGUAGES_SUPPORTED_US
|
|
1203
|
+
};
|
|
1204
|
+
function getLanguageName(languageCode) {
|
|
1205
|
+
try {
|
|
1206
|
+
const userLocale = navigator.language || "en";
|
|
1207
|
+
const displayNames = new Intl.DisplayNames([userLocale], {
|
|
1208
|
+
type: "language"
|
|
1209
|
+
});
|
|
1210
|
+
const languageName = displayNames.of(languageCode);
|
|
1211
|
+
return languageName || languageCode;
|
|
1212
|
+
} catch {
|
|
1213
|
+
return languageCode;
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
function getLanguagesByRegion(region) {
|
|
1217
|
+
const languages = DEFAULT_LANGUAGES_BY_REGION[region || "default"] || DEFAULT_LANGUAGES_BY_REGION["default"];
|
|
1218
|
+
const defaultLanguage = languages?.[0];
|
|
1219
|
+
return { defaultLanguage, languages };
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
// dist/controllers/languages-controller.js
|
|
1223
|
+
var __classPrivateFieldSet2 = function(receiver, state, value, kind, f5) {
|
|
1224
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
1225
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a setter");
|
|
1226
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1227
|
+
return kind === "a" ? f5.call(receiver, value) : f5 ? f5.value = value : state.set(receiver, value), value;
|
|
1228
|
+
};
|
|
1229
|
+
var __classPrivateFieldGet2 = function(receiver, state, kind, f5) {
|
|
1230
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
1231
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1232
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
1233
|
+
};
|
|
1234
|
+
var _LanguagesController_instances;
|
|
1235
|
+
var _LanguagesController_autoLoadedLanguages;
|
|
1236
|
+
var _LanguagesController_loadingLanguages;
|
|
1237
|
+
var _LanguagesController_previousRegion;
|
|
1238
|
+
var _LanguagesController_initialized;
|
|
1239
|
+
var _LanguagesController_loadLanguages;
|
|
1240
|
+
var LanguagesController = class {
|
|
1241
|
+
constructor(host) {
|
|
1242
|
+
_LanguagesController_instances.add(this);
|
|
1243
|
+
_LanguagesController_autoLoadedLanguages.set(this, false);
|
|
1244
|
+
_LanguagesController_loadingLanguages.set(this, false);
|
|
1245
|
+
_LanguagesController_previousRegion.set(this, void 0);
|
|
1246
|
+
_LanguagesController_initialized.set(this, false);
|
|
1247
|
+
this.host = host;
|
|
1248
|
+
host.addController(this);
|
|
1249
|
+
}
|
|
1250
|
+
initialize() {
|
|
1251
|
+
__classPrivateFieldSet2(this, _LanguagesController_initialized, true, "f");
|
|
1252
|
+
if (this.host._languages === void 0) {
|
|
1253
|
+
__classPrivateFieldGet2(this, _LanguagesController_instances, "m", _LanguagesController_loadLanguages).call(this);
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
hostUpdate() {
|
|
1257
|
+
if (!__classPrivateFieldGet2(this, _LanguagesController_initialized, "f")) {
|
|
1258
|
+
return;
|
|
1259
|
+
}
|
|
1260
|
+
if (__classPrivateFieldGet2(this, _LanguagesController_previousRegion, "f") !== this.host.region && __classPrivateFieldGet2(this, _LanguagesController_autoLoadedLanguages, "f") || this.host._languages === void 0) {
|
|
1261
|
+
__classPrivateFieldGet2(this, _LanguagesController_instances, "m", _LanguagesController_loadLanguages).call(this);
|
|
1262
|
+
}
|
|
1263
|
+
__classPrivateFieldSet2(this, _LanguagesController_previousRegion, this.host.region, "f");
|
|
1264
|
+
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Clear the auto-loaded flag (when languages are set externally)
|
|
1267
|
+
*/
|
|
1268
|
+
clearAutoLoadedFlag() {
|
|
1269
|
+
__classPrivateFieldSet2(this, _LanguagesController_autoLoadedLanguages, false, "f");
|
|
1270
|
+
}
|
|
1271
|
+
};
|
|
1272
|
+
_LanguagesController_autoLoadedLanguages = /* @__PURE__ */ new WeakMap(), _LanguagesController_loadingLanguages = /* @__PURE__ */ new WeakMap(), _LanguagesController_previousRegion = /* @__PURE__ */ new WeakMap(), _LanguagesController_initialized = /* @__PURE__ */ new WeakMap(), _LanguagesController_instances = /* @__PURE__ */ new WeakSet(), _LanguagesController_loadLanguages = async function _LanguagesController_loadLanguages2() {
|
|
1273
|
+
if (__classPrivateFieldGet2(this, _LanguagesController_loadingLanguages, "f")) {
|
|
1274
|
+
return;
|
|
1275
|
+
}
|
|
1276
|
+
__classPrivateFieldSet2(this, _LanguagesController_loadingLanguages, true, "f");
|
|
1277
|
+
try {
|
|
1278
|
+
const { languages, defaultLanguage } = getLanguagesByRegion(this.host.region);
|
|
1279
|
+
__classPrivateFieldSet2(this, _LanguagesController_autoLoadedLanguages, true, "f");
|
|
1280
|
+
this.host._languages = languages;
|
|
1281
|
+
const previousLanguage = this.host.dictationConfig?.primaryLanguage;
|
|
1282
|
+
const selectedLanguage = previousLanguage && languages.includes(previousLanguage) ? previousLanguage : defaultLanguage;
|
|
1283
|
+
this.host.dictationConfig = {
|
|
1284
|
+
...this.host.dictationConfig,
|
|
1285
|
+
primaryLanguage: selectedLanguage || "en"
|
|
1286
|
+
};
|
|
1287
|
+
this.host.requestUpdate();
|
|
1288
|
+
this.host.dispatchEvent(languagesChangedEvent(languages, selectedLanguage));
|
|
1289
|
+
} catch (error) {
|
|
1290
|
+
this.host.dispatchEvent(errorEvent(error));
|
|
1291
|
+
} finally {
|
|
1292
|
+
__classPrivateFieldSet2(this, _LanguagesController_loadingLanguages, false, "f");
|
|
1293
|
+
}
|
|
1294
|
+
};
|
|
1295
|
+
|
|
1296
|
+
// dist/styles/component-styles.js
|
|
1297
|
+
var ComponentStyles = i`
|
|
1298
|
+
:host {
|
|
1299
|
+
font-family: var(--component-font-family, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif);
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
.wrapper {
|
|
1303
|
+
background-color: var(--card-background, light-dark(#fff, #333));
|
|
1304
|
+
border: 1px solid var(--card-border-color, light-dark(#ddd, #555));
|
|
1305
|
+
border-radius: var(--card-border-radius, 8px);
|
|
1306
|
+
box-shadow: var(--card-box-shadow, 0 2px 5px rgba(0, 0, 0, 0.1));
|
|
1307
|
+
padding: var(--card-padding, 4px);
|
|
1308
|
+
display: flex;
|
|
1309
|
+
gap: 4px;
|
|
1310
|
+
height: 46px;
|
|
1311
|
+
width: fit-content;
|
|
1312
|
+
box-sizing: border-box;
|
|
1313
|
+
overflow: hidden;
|
|
1314
|
+
}
|
|
1315
|
+
`;
|
|
1316
|
+
var LabelStyles = i`
|
|
1317
|
+
label {
|
|
1318
|
+
display: block;
|
|
1319
|
+
font-size: 0.8rem;
|
|
1320
|
+
padding-bottom: 0.5rem;
|
|
1321
|
+
font-weight: 500;
|
|
1322
|
+
color: var(--component-text-color, light-dark(#333, #eee));
|
|
1323
|
+
pointer-events: none;
|
|
1324
|
+
}
|
|
1325
|
+
`;
|
|
1326
|
+
var component_styles_default = ComponentStyles;
|
|
1327
|
+
|
|
1328
|
+
// dist/utils/auth.js
|
|
1329
|
+
async function getInitialToken(config) {
|
|
1330
|
+
const initialToken = "accessToken" in config ? {
|
|
1331
|
+
accessToken: config.accessToken,
|
|
1332
|
+
refreshToken: config.refreshToken
|
|
1333
|
+
} : await config.refreshAccessToken();
|
|
1334
|
+
if (!initialToken?.accessToken || typeof initialToken.accessToken !== "string") {
|
|
1335
|
+
throw new Error("Access token is required and must be a string");
|
|
1336
|
+
}
|
|
1337
|
+
return {
|
|
1338
|
+
accessToken: initialToken.accessToken,
|
|
1339
|
+
refreshToken: initialToken.refreshToken
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
// dist/utils/keybinding.js
|
|
1344
|
+
function isMac() {
|
|
1345
|
+
if (typeof navigator === "undefined") {
|
|
1346
|
+
return false;
|
|
1347
|
+
}
|
|
1348
|
+
return /Mac|iPhone|iPad|iPod/.test(navigator.userAgent);
|
|
1349
|
+
}
|
|
1350
|
+
function capitalize(str) {
|
|
1351
|
+
if (str.length === 0) {
|
|
1352
|
+
return str;
|
|
1353
|
+
}
|
|
1354
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
1355
|
+
}
|
|
1356
|
+
function normalizeKeyForKeybinding(key) {
|
|
1357
|
+
if (key === " ") {
|
|
1358
|
+
return "Space";
|
|
1359
|
+
}
|
|
1360
|
+
const normalized = key.trim().toLowerCase();
|
|
1361
|
+
if (normalized === "control") {
|
|
1362
|
+
return "Ctrl";
|
|
1363
|
+
}
|
|
1364
|
+
if (normalized === "meta" || normalized === "cmd") {
|
|
1365
|
+
return isMac() ? "Cmd" : "Meta";
|
|
1366
|
+
}
|
|
1367
|
+
if (normalized === "alt" || normalized === "opt") {
|
|
1368
|
+
return isMac() ? "Opt" : "Alt";
|
|
1369
|
+
}
|
|
1370
|
+
if (normalized === "space") {
|
|
1371
|
+
return "Space";
|
|
1372
|
+
}
|
|
1373
|
+
return normalized.length > 1 ? capitalize(normalized) : normalized;
|
|
1374
|
+
}
|
|
1375
|
+
function normalizeKeybinding(keybinding) {
|
|
1376
|
+
if (!keybinding) {
|
|
1377
|
+
return null;
|
|
1378
|
+
}
|
|
1379
|
+
const trimmed = keybinding.trim();
|
|
1380
|
+
if (trimmed === "") {
|
|
1381
|
+
return null;
|
|
1382
|
+
}
|
|
1383
|
+
return normalizeKeyForKeybinding(trimmed);
|
|
1384
|
+
}
|
|
1385
|
+
function matchesKeybinding(event, keybinding) {
|
|
1386
|
+
const normalizedKeybinding = normalizeKeybinding(keybinding);
|
|
1387
|
+
if (!normalizedKeybinding) {
|
|
1388
|
+
return false;
|
|
1389
|
+
}
|
|
1390
|
+
const normalizedKey = normalizeKeyForKeybinding(event.key);
|
|
1391
|
+
const normalizedCode = normalizeKeyForKeybinding(event.code);
|
|
1392
|
+
return normalizedKey === normalizedKeybinding || normalizedCode === normalizedKeybinding;
|
|
1393
|
+
}
|
|
1394
|
+
function shouldIgnoreKeybinding(element) {
|
|
1395
|
+
if (!element) {
|
|
1396
|
+
return false;
|
|
1397
|
+
}
|
|
1398
|
+
const tagName = element.tagName.toLowerCase();
|
|
1399
|
+
if (tagName === "input" || tagName === "textarea") {
|
|
1400
|
+
return true;
|
|
1401
|
+
}
|
|
1402
|
+
if (element instanceof HTMLElement && element.contentEditable === "true") {
|
|
1403
|
+
return true;
|
|
1404
|
+
}
|
|
1405
|
+
return false;
|
|
1406
|
+
}
|
|
1081
1407
|
|
|
1082
1408
|
// dist/utils/token.js
|
|
1083
1409
|
function decodeToken(token) {
|
|
@@ -1105,15 +1431,16 @@ function decodeToken(token) {
|
|
|
1105
1431
|
}
|
|
1106
1432
|
const regex = /^https:\/\/(keycloak|auth)\.([^.]+)\.corti\.app\/realms\/([^/]+)/;
|
|
1107
1433
|
const match = issuerUrl.match(regex);
|
|
1108
|
-
if (match) {
|
|
1109
|
-
|
|
1110
|
-
return {
|
|
1111
|
-
accessToken: token,
|
|
1112
|
-
environment: match[2],
|
|
1113
|
-
expiresAt,
|
|
1114
|
-
tenant: match[3]
|
|
1115
|
-
};
|
|
1434
|
+
if (!match) {
|
|
1435
|
+
throw new Error("Access token does not match expected format");
|
|
1116
1436
|
}
|
|
1437
|
+
const expiresAt = tokenDetails.exp && typeof tokenDetails.exp === "number" ? tokenDetails.exp : void 0;
|
|
1438
|
+
return {
|
|
1439
|
+
accessToken: token,
|
|
1440
|
+
environment: match[2],
|
|
1441
|
+
expiresAt,
|
|
1442
|
+
tenant: match[3]
|
|
1443
|
+
};
|
|
1117
1444
|
}
|
|
1118
1445
|
|
|
1119
1446
|
// dist/contexts/dictation-context.js
|
|
@@ -1123,19 +1450,34 @@ var __decorate = function(decorators, target, key, desc) {
|
|
|
1123
1450
|
else for (var i7 = decorators.length - 1; i7 >= 0; i7--) if (d3 = decorators[i7]) r7 = (c6 < 3 ? d3(r7) : c6 > 3 ? d3(target, key, r7) : d3(target, key)) || r7;
|
|
1124
1451
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
1125
1452
|
};
|
|
1126
|
-
var
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
var
|
|
1132
|
-
var
|
|
1133
|
-
var
|
|
1134
|
-
var
|
|
1135
|
-
var
|
|
1136
|
-
var
|
|
1137
|
-
var
|
|
1138
|
-
var
|
|
1453
|
+
var __classPrivateFieldGet3 = function(receiver, state, kind, f5) {
|
|
1454
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
1455
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1456
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
1457
|
+
};
|
|
1458
|
+
var _DictationRoot_languagesController;
|
|
1459
|
+
var _DictationRoot_devicesController;
|
|
1460
|
+
var _DictationRoot_handleLanguageChanged;
|
|
1461
|
+
var _DictationRoot_handleDeviceChanged;
|
|
1462
|
+
var _DictationRoot_handleRecordingStateChanged;
|
|
1463
|
+
var _DictationRoot_handleContextRequest;
|
|
1464
|
+
var _DictationRoot_handleModeChanged;
|
|
1465
|
+
var _DictationRoot_handleKeybindingChanged;
|
|
1466
|
+
var regionContext = n7(Symbol("region"));
|
|
1467
|
+
var tenantNameContext = n7(Symbol("tenantName"));
|
|
1468
|
+
var languagesContext = n7(Symbol("languages"));
|
|
1469
|
+
var devicesContext = n7(Symbol("devices"));
|
|
1470
|
+
var selectedDeviceContext = n7(Symbol("selectedDevice"));
|
|
1471
|
+
var recordingStateContext = n7(Symbol("recordingState"));
|
|
1472
|
+
var accessTokenContext = n7(Symbol("accessToken"));
|
|
1473
|
+
var dictationConfigContext = n7(Symbol("dictationConfig"));
|
|
1474
|
+
var authConfigContext = n7(Symbol("authConfig"));
|
|
1475
|
+
var socketUrlContext = n7(Symbol("socketUrl"));
|
|
1476
|
+
var socketProxyContext = n7(Symbol("socketProxy"));
|
|
1477
|
+
var debugDisplayAudioContext = n7(Symbol("debugDisplayAudio"));
|
|
1478
|
+
var modeContext = n7(Symbol("mode"));
|
|
1479
|
+
var keybindingContext = n7(Symbol("keybinding"));
|
|
1480
|
+
var DictationRoot = class DictationRoot2 extends i4 {
|
|
1139
1481
|
set accessToken(token) {
|
|
1140
1482
|
this.setAccessToken(token);
|
|
1141
1483
|
}
|
|
@@ -1148,33 +1490,76 @@ var DictationContext = class DictationContext2 extends i4 {
|
|
|
1148
1490
|
get authConfig() {
|
|
1149
1491
|
return this._authConfig;
|
|
1150
1492
|
}
|
|
1493
|
+
set languages(value) {
|
|
1494
|
+
this._languages = value;
|
|
1495
|
+
if (value !== void 0) {
|
|
1496
|
+
__classPrivateFieldGet3(this, _DictationRoot_languagesController, "f").clearAutoLoadedFlag();
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
get languages() {
|
|
1500
|
+
return this._languages;
|
|
1501
|
+
}
|
|
1502
|
+
set devices(value) {
|
|
1503
|
+
this._devices = value;
|
|
1504
|
+
if (value !== void 0) {
|
|
1505
|
+
__classPrivateFieldGet3(this, _DictationRoot_devicesController, "f").clearAutoLoadedFlag();
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
get devices() {
|
|
1509
|
+
return this._devices;
|
|
1510
|
+
}
|
|
1151
1511
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
1152
1512
|
// Lifecycle
|
|
1153
1513
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
1154
1514
|
constructor() {
|
|
1155
1515
|
super();
|
|
1156
1516
|
this.recordingState = "stopped";
|
|
1517
|
+
_DictationRoot_languagesController.set(this, new LanguagesController(this));
|
|
1518
|
+
_DictationRoot_devicesController.set(this, new DevicesController(this));
|
|
1519
|
+
this.mode = "toggle-to-talk";
|
|
1157
1520
|
this.noWrapper = false;
|
|
1158
|
-
this
|
|
1521
|
+
_DictationRoot_handleLanguageChanged.set(this, (e10) => {
|
|
1159
1522
|
const event = e10;
|
|
1160
|
-
this.languages = event.detail.languages;
|
|
1161
1523
|
this.dictationConfig = {
|
|
1162
1524
|
...this.dictationConfig,
|
|
1163
1525
|
primaryLanguage: event.detail.selectedLanguage
|
|
1164
1526
|
};
|
|
1165
|
-
};
|
|
1166
|
-
this
|
|
1527
|
+
});
|
|
1528
|
+
_DictationRoot_handleDeviceChanged.set(this, (e10) => {
|
|
1167
1529
|
const event = e10;
|
|
1168
|
-
this.devices = event.detail.devices;
|
|
1169
1530
|
this.selectedDevice = event.detail.selectedDevice;
|
|
1170
|
-
};
|
|
1171
|
-
this
|
|
1531
|
+
});
|
|
1532
|
+
_DictationRoot_handleRecordingStateChanged.set(this, (e10) => {
|
|
1172
1533
|
const event = e10;
|
|
1173
1534
|
this.recordingState = event.detail.state;
|
|
1174
|
-
};
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1535
|
+
});
|
|
1536
|
+
_DictationRoot_handleContextRequest.set(this, (e10) => {
|
|
1537
|
+
if (e10.context === languagesContext) {
|
|
1538
|
+
__classPrivateFieldGet3(this, _DictationRoot_languagesController, "f").initialize();
|
|
1539
|
+
} else if (e10.context === devicesContext) {
|
|
1540
|
+
__classPrivateFieldGet3(this, _DictationRoot_devicesController, "f").initialize();
|
|
1541
|
+
} else if (e10.context === keybindingContext && e10.contextTarget.tagName.toLowerCase() === "dictation-keybinding-selector") {
|
|
1542
|
+
if (this.keybinding === void 0) {
|
|
1543
|
+
this.keybinding = "`";
|
|
1544
|
+
this.dispatchEvent(keybindingChangedEvent("`", "Backquote"));
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
});
|
|
1548
|
+
_DictationRoot_handleModeChanged.set(this, (e10) => {
|
|
1549
|
+
const event = e10;
|
|
1550
|
+
this.mode = event.detail.mode;
|
|
1551
|
+
});
|
|
1552
|
+
_DictationRoot_handleKeybindingChanged.set(this, (e10) => {
|
|
1553
|
+
const event = e10;
|
|
1554
|
+
const normalizedKeybinding = normalizeKeybinding(event.detail.key);
|
|
1555
|
+
this.keybinding = normalizedKeybinding;
|
|
1556
|
+
});
|
|
1557
|
+
this.addEventListener("languages-changed", __classPrivateFieldGet3(this, _DictationRoot_handleLanguageChanged, "f"));
|
|
1558
|
+
this.addEventListener("recording-devices-changed", __classPrivateFieldGet3(this, _DictationRoot_handleDeviceChanged, "f"));
|
|
1559
|
+
this.addEventListener("recording-state-changed", __classPrivateFieldGet3(this, _DictationRoot_handleRecordingStateChanged, "f"));
|
|
1560
|
+
this.addEventListener("context-request", __classPrivateFieldGet3(this, _DictationRoot_handleContextRequest, "f"));
|
|
1561
|
+
this.addEventListener("mode-changed", __classPrivateFieldGet3(this, _DictationRoot_handleModeChanged, "f"));
|
|
1562
|
+
this.addEventListener("keybinding-changed", __classPrivateFieldGet3(this, _DictationRoot_handleKeybindingChanged, "f"));
|
|
1178
1563
|
}
|
|
1179
1564
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
1180
1565
|
// Public methods
|
|
@@ -1243,70 +1628,92 @@ var DictationContext = class DictationContext2 extends i4 {
|
|
|
1243
1628
|
</div>`;
|
|
1244
1629
|
}
|
|
1245
1630
|
};
|
|
1246
|
-
|
|
1631
|
+
_DictationRoot_languagesController = /* @__PURE__ */ new WeakMap();
|
|
1632
|
+
_DictationRoot_devicesController = /* @__PURE__ */ new WeakMap();
|
|
1633
|
+
_DictationRoot_handleLanguageChanged = /* @__PURE__ */ new WeakMap();
|
|
1634
|
+
_DictationRoot_handleDeviceChanged = /* @__PURE__ */ new WeakMap();
|
|
1635
|
+
_DictationRoot_handleRecordingStateChanged = /* @__PURE__ */ new WeakMap();
|
|
1636
|
+
_DictationRoot_handleContextRequest = /* @__PURE__ */ new WeakMap();
|
|
1637
|
+
_DictationRoot_handleModeChanged = /* @__PURE__ */ new WeakMap();
|
|
1638
|
+
_DictationRoot_handleKeybindingChanged = /* @__PURE__ */ new WeakMap();
|
|
1639
|
+
DictationRoot.styles = [component_styles_default];
|
|
1247
1640
|
__decorate([
|
|
1248
1641
|
e9({ context: regionContext }),
|
|
1249
1642
|
r5()
|
|
1250
|
-
],
|
|
1643
|
+
], DictationRoot.prototype, "region", void 0);
|
|
1251
1644
|
__decorate([
|
|
1252
1645
|
e9({ context: tenantNameContext }),
|
|
1253
1646
|
r5()
|
|
1254
|
-
],
|
|
1647
|
+
], DictationRoot.prototype, "tenantName", void 0);
|
|
1255
1648
|
__decorate([
|
|
1256
1649
|
e9({ context: recordingStateContext }),
|
|
1257
1650
|
r5()
|
|
1258
|
-
],
|
|
1651
|
+
], DictationRoot.prototype, "recordingState", void 0);
|
|
1259
1652
|
__decorate([
|
|
1260
1653
|
e9({ context: accessTokenContext }),
|
|
1261
1654
|
r5()
|
|
1262
|
-
],
|
|
1655
|
+
], DictationRoot.prototype, "_accessToken", void 0);
|
|
1263
1656
|
__decorate([
|
|
1264
1657
|
n4({ type: String })
|
|
1265
|
-
],
|
|
1658
|
+
], DictationRoot.prototype, "accessToken", null);
|
|
1266
1659
|
__decorate([
|
|
1267
1660
|
e9({ context: authConfigContext }),
|
|
1268
1661
|
r5()
|
|
1269
|
-
],
|
|
1662
|
+
], DictationRoot.prototype, "_authConfig", void 0);
|
|
1270
1663
|
__decorate([
|
|
1271
1664
|
n4({ attribute: false, type: Object })
|
|
1272
|
-
],
|
|
1665
|
+
], DictationRoot.prototype, "authConfig", null);
|
|
1273
1666
|
__decorate([
|
|
1274
1667
|
e9({ context: socketUrlContext }),
|
|
1275
1668
|
n4({ type: String })
|
|
1276
|
-
],
|
|
1669
|
+
], DictationRoot.prototype, "socketUrl", void 0);
|
|
1277
1670
|
__decorate([
|
|
1278
1671
|
e9({ context: socketProxyContext }),
|
|
1279
1672
|
n4({ attribute: false, type: Object })
|
|
1280
|
-
],
|
|
1673
|
+
], DictationRoot.prototype, "socketProxy", void 0);
|
|
1281
1674
|
__decorate([
|
|
1282
1675
|
e9({ context: dictationConfigContext }),
|
|
1283
1676
|
n4({ attribute: false, type: Object })
|
|
1284
|
-
],
|
|
1677
|
+
], DictationRoot.prototype, "dictationConfig", void 0);
|
|
1285
1678
|
__decorate([
|
|
1286
1679
|
e9({ context: languagesContext }),
|
|
1680
|
+
r5()
|
|
1681
|
+
], DictationRoot.prototype, "_languages", void 0);
|
|
1682
|
+
__decorate([
|
|
1287
1683
|
n4({
|
|
1288
1684
|
converter: commaSeparatedConverter,
|
|
1289
1685
|
type: Array
|
|
1290
1686
|
})
|
|
1291
|
-
],
|
|
1687
|
+
], DictationRoot.prototype, "languages", null);
|
|
1292
1688
|
__decorate([
|
|
1293
1689
|
e9({ context: devicesContext }),
|
|
1690
|
+
r5()
|
|
1691
|
+
], DictationRoot.prototype, "_devices", void 0);
|
|
1692
|
+
__decorate([
|
|
1294
1693
|
n4({ attribute: false, type: Array })
|
|
1295
|
-
],
|
|
1694
|
+
], DictationRoot.prototype, "devices", null);
|
|
1296
1695
|
__decorate([
|
|
1297
1696
|
e9({ context: selectedDeviceContext }),
|
|
1298
1697
|
n4({ attribute: false, type: Object })
|
|
1299
|
-
],
|
|
1698
|
+
], DictationRoot.prototype, "selectedDevice", void 0);
|
|
1300
1699
|
__decorate([
|
|
1301
1700
|
e9({ context: debugDisplayAudioContext }),
|
|
1302
1701
|
n4({ attribute: "debug-display-audio", type: Boolean })
|
|
1303
|
-
],
|
|
1702
|
+
], DictationRoot.prototype, "debug_displayAudio", void 0);
|
|
1703
|
+
__decorate([
|
|
1704
|
+
e9({ context: modeContext }),
|
|
1705
|
+
n4({ type: String })
|
|
1706
|
+
], DictationRoot.prototype, "mode", void 0);
|
|
1707
|
+
__decorate([
|
|
1708
|
+
e9({ context: keybindingContext }),
|
|
1709
|
+
n4({ type: String })
|
|
1710
|
+
], DictationRoot.prototype, "keybinding", void 0);
|
|
1304
1711
|
__decorate([
|
|
1305
1712
|
n4({ type: Boolean })
|
|
1306
|
-
],
|
|
1307
|
-
|
|
1308
|
-
t3("dictation-
|
|
1309
|
-
],
|
|
1713
|
+
], DictationRoot.prototype, "noWrapper", void 0);
|
|
1714
|
+
DictationRoot = __decorate([
|
|
1715
|
+
t3("dictation-root")
|
|
1716
|
+
], DictationRoot);
|
|
1310
1717
|
|
|
1311
1718
|
// node_modules/@corti/sdk/dist/esm/core/json.mjs
|
|
1312
1719
|
var toJson = (value, replacer, space) => {
|
|
@@ -5839,7 +6246,7 @@ var Auth = class {
|
|
|
5839
6246
|
function getEnvironment(environment = "eu") {
|
|
5840
6247
|
return typeof environment === "string" ? {
|
|
5841
6248
|
base: `https://api.${environment}.corti.app/v2`,
|
|
5842
|
-
wss: `wss://api.${environment}.corti.app`,
|
|
6249
|
+
wss: `wss://api.${environment}.corti.app/audio-bridge/v2`,
|
|
5843
6250
|
login: `https://auth.${environment}.corti.app/realms`,
|
|
5844
6251
|
agents: `https://api.${environment}.corti.app`
|
|
5845
6252
|
} : environment;
|
|
@@ -10053,7 +10460,7 @@ var Stream = class {
|
|
|
10053
10460
|
_queryParams["token"] = token;
|
|
10054
10461
|
let _headers = Object.assign({}, headers);
|
|
10055
10462
|
const socket = new ReconnectingWebSocket({
|
|
10056
|
-
url: url_exports.join((_a = yield Supplier.get(this._options["baseUrl"])) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options["environment"])).wss, `/
|
|
10463
|
+
url: url_exports.join((_a = yield Supplier.get(this._options["baseUrl"])) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options["environment"])).wss, `/interactions/${encodeURIComponent(id)}/streams`),
|
|
10057
10464
|
protocols: [],
|
|
10058
10465
|
queryParameters: _queryParams,
|
|
10059
10466
|
headers: _headers,
|
|
@@ -10432,7 +10839,7 @@ var Transcribe = class {
|
|
|
10432
10839
|
_queryParams["token"] = token;
|
|
10433
10840
|
let _headers = Object.assign({}, headers);
|
|
10434
10841
|
const socket = new ReconnectingWebSocket({
|
|
10435
|
-
url: url_exports.join((_a = yield Supplier.get(this._options["baseUrl"])) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options["environment"])).wss, "/
|
|
10842
|
+
url: url_exports.join((_a = yield Supplier.get(this._options["baseUrl"])) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options["environment"])).wss, "/transcribe"),
|
|
10436
10843
|
protocols: [],
|
|
10437
10844
|
queryParameters: _queryParams,
|
|
10438
10845
|
headers: _headers,
|
|
@@ -10595,7 +11002,7 @@ var Transcribe2 = class extends Transcribe {
|
|
|
10595
11002
|
};
|
|
10596
11003
|
|
|
10597
11004
|
// node_modules/@corti/sdk/dist/esm/version.mjs
|
|
10598
|
-
var SDK_VERSION = "0.8.0
|
|
11005
|
+
var SDK_VERSION = "0.8.0";
|
|
10599
11006
|
|
|
10600
11007
|
// node_modules/@corti/sdk/dist/esm/custom/utils/resolveClientOptions.mjs
|
|
10601
11008
|
var __awaiter30 = function(thisArg, _arguments, P2, generator) {
|
|
@@ -10801,13 +11208,13 @@ var CortiClient = class {
|
|
|
10801
11208
|
var CortiEnvironment = {
|
|
10802
11209
|
Eu: {
|
|
10803
11210
|
base: "https://api.eu.corti.app/v2",
|
|
10804
|
-
wss: "wss://api.eu.corti.app",
|
|
11211
|
+
wss: "wss://api.eu.corti.app/audio-bridge/v2",
|
|
10805
11212
|
login: "https://auth.eu.corti.app/realms",
|
|
10806
11213
|
agents: "https://api.eu.corti.app"
|
|
10807
11214
|
},
|
|
10808
11215
|
Us: {
|
|
10809
11216
|
base: "https://api.us.corti.app/v2",
|
|
10810
|
-
wss: "wss://api.us.corti.app",
|
|
11217
|
+
wss: "wss://api.us.corti.app/audio-bridge/v2",
|
|
10811
11218
|
login: "https://auth.us.corti.app/realms",
|
|
10812
11219
|
agents: "https://api.us.corti.app"
|
|
10813
11220
|
}
|
|
@@ -10851,11 +11258,41 @@ var CortiWebSocketProxyClient = class {
|
|
|
10851
11258
|
}
|
|
10852
11259
|
};
|
|
10853
11260
|
|
|
10854
|
-
// dist/controllers/
|
|
11261
|
+
// dist/controllers/dictation-controller.js
|
|
11262
|
+
var __classPrivateFieldGet4 = function(receiver, state, kind, f5) {
|
|
11263
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
11264
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11265
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
11266
|
+
};
|
|
11267
|
+
var __classPrivateFieldSet3 = function(receiver, state, value, kind, f5) {
|
|
11268
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
11269
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a setter");
|
|
11270
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
11271
|
+
return kind === "a" ? f5.call(receiver, value) : f5 ? f5.value = value : state.set(receiver, value), value;
|
|
11272
|
+
};
|
|
11273
|
+
var _DictationController_instances;
|
|
11274
|
+
var _DictationController_cortiClient;
|
|
11275
|
+
var _DictationController_webSocket;
|
|
11276
|
+
var _DictationController_closeTimeout;
|
|
11277
|
+
var _DictationController_callbacks;
|
|
11278
|
+
var _DictationController_lastDictationConfig;
|
|
11279
|
+
var _DictationController_lastSocketUrl;
|
|
11280
|
+
var _DictationController_lastSocketProxy;
|
|
11281
|
+
var _DictationController_configHasChanged;
|
|
11282
|
+
var _DictationController_connectProxy;
|
|
11283
|
+
var _DictationController_connectAuth;
|
|
11284
|
+
var _DictationController_setupWebSocketHandlers;
|
|
11285
|
+
var _DictationController_setupMediaRecorder;
|
|
10855
11286
|
var DictationController = class {
|
|
10856
11287
|
constructor(host) {
|
|
10857
|
-
this
|
|
10858
|
-
this
|
|
11288
|
+
_DictationController_instances.add(this);
|
|
11289
|
+
_DictationController_cortiClient.set(this, null);
|
|
11290
|
+
_DictationController_webSocket.set(this, null);
|
|
11291
|
+
_DictationController_closeTimeout.set(this, void 0);
|
|
11292
|
+
_DictationController_callbacks.set(this, void 0);
|
|
11293
|
+
_DictationController_lastDictationConfig.set(this, null);
|
|
11294
|
+
_DictationController_lastSocketUrl.set(this, void 0);
|
|
11295
|
+
_DictationController_lastSocketProxy.set(this, void 0);
|
|
10859
11296
|
this.host = host;
|
|
10860
11297
|
host.addController(this);
|
|
10861
11298
|
}
|
|
@@ -10866,112 +11303,225 @@ var DictationController = class {
|
|
|
10866
11303
|
if (!mediaRecorder) {
|
|
10867
11304
|
throw new Error("MediaRecorder is required to connect");
|
|
10868
11305
|
}
|
|
10869
|
-
|
|
10870
|
-
|
|
11306
|
+
const newConnection = __classPrivateFieldGet4(this, _DictationController_instances, "m", _DictationController_configHasChanged).call(this) || __classPrivateFieldGet4(this, _DictationController_webSocket, "f")?.readyState !== WebSocket.OPEN;
|
|
11307
|
+
if (newConnection) {
|
|
11308
|
+
this.cleanup();
|
|
11309
|
+
if (__classPrivateFieldGet4(this, _DictationController_webSocket, "f")?.readyState === WebSocket.OPEN) {
|
|
11310
|
+
throw new Error("Already connected. Disconnect before reconnecting.");
|
|
11311
|
+
}
|
|
11312
|
+
__classPrivateFieldSet3(this, _DictationController_webSocket, this.host._socketUrl || this.host._socketProxy ? await __classPrivateFieldGet4(this, _DictationController_instances, "m", _DictationController_connectProxy).call(this, dictationConfig) : await __classPrivateFieldGet4(this, _DictationController_instances, "m", _DictationController_connectAuth).call(this, dictationConfig), "f");
|
|
11313
|
+
__classPrivateFieldGet4(this, _DictationController_callbacks, "f")?.onNetworkActivity?.("sent", {
|
|
11314
|
+
configuration: dictationConfig,
|
|
11315
|
+
type: "config"
|
|
11316
|
+
});
|
|
11317
|
+
__classPrivateFieldSet3(this, _DictationController_lastDictationConfig, this.host._dictationConfig || null, "f");
|
|
11318
|
+
__classPrivateFieldSet3(this, _DictationController_lastSocketUrl, this.host._socketUrl, "f");
|
|
11319
|
+
__classPrivateFieldSet3(this, _DictationController_lastSocketProxy, this.host._socketProxy, "f");
|
|
10871
11320
|
}
|
|
10872
|
-
this
|
|
10873
|
-
this
|
|
10874
|
-
this.
|
|
10875
|
-
|
|
10876
|
-
}
|
|
10877
|
-
async connectProxy(dictationConfig) {
|
|
10878
|
-
const proxyOptions = this.host._socketProxy || {
|
|
10879
|
-
url: this.host._socketUrl || ""
|
|
10880
|
-
};
|
|
10881
|
-
if (!proxyOptions.url) {
|
|
10882
|
-
throw new Error("Proxy URL is required when using proxy client");
|
|
10883
|
-
}
|
|
10884
|
-
return await CortiWebSocketProxyClient.transcribe.connect({
|
|
10885
|
-
configuration: dictationConfig,
|
|
10886
|
-
proxy: proxyOptions
|
|
10887
|
-
});
|
|
10888
|
-
}
|
|
10889
|
-
async connectAuth(dictationConfig) {
|
|
10890
|
-
if (!this.host._authConfig && !this.host._accessToken) {
|
|
10891
|
-
throw new Error("Auth configuration or access token is required to connect");
|
|
10892
|
-
}
|
|
10893
|
-
const auth = this.host._authConfig || {
|
|
10894
|
-
accessToken: this.host._accessToken || "",
|
|
10895
|
-
refreshAccessToken: () => ({
|
|
10896
|
-
accessToken: this.host._accessToken || ""
|
|
10897
|
-
})
|
|
10898
|
-
};
|
|
10899
|
-
this._cortiClient = new CortiClient({
|
|
10900
|
-
auth,
|
|
10901
|
-
environment: this.host._region,
|
|
10902
|
-
tenantName: this.host._tenantName
|
|
10903
|
-
});
|
|
10904
|
-
return await this._cortiClient.transcribe.connect({
|
|
10905
|
-
configuration: dictationConfig
|
|
10906
|
-
});
|
|
10907
|
-
}
|
|
10908
|
-
setupWebSocketHandlers(callbacks) {
|
|
10909
|
-
if (!this._webSocket) {
|
|
10910
|
-
throw new Error("WebSocket not initialized");
|
|
10911
|
-
}
|
|
10912
|
-
this._webSocket.on("message", (message) => {
|
|
10913
|
-
this._onNetworkActivity?.("received", message);
|
|
10914
|
-
if (callbacks.onMessage) {
|
|
10915
|
-
callbacks.onMessage(message);
|
|
10916
|
-
}
|
|
10917
|
-
});
|
|
10918
|
-
this._webSocket.on("error", (event) => {
|
|
10919
|
-
if (callbacks.onError) {
|
|
10920
|
-
callbacks.onError(event);
|
|
10921
|
-
}
|
|
10922
|
-
});
|
|
10923
|
-
this._webSocket.on("close", (event) => {
|
|
10924
|
-
if (callbacks.onClose) {
|
|
10925
|
-
callbacks.onClose(event);
|
|
10926
|
-
}
|
|
10927
|
-
});
|
|
10928
|
-
}
|
|
10929
|
-
setupMediaRecorder(mediaRecorder) {
|
|
10930
|
-
mediaRecorder.ondataavailable = (event) => {
|
|
10931
|
-
this._webSocket?.sendAudio(event.data);
|
|
10932
|
-
this._onNetworkActivity?.("sent", {
|
|
10933
|
-
size: event.data.size,
|
|
10934
|
-
type: "audio"
|
|
10935
|
-
});
|
|
10936
|
-
};
|
|
11321
|
+
__classPrivateFieldSet3(this, _DictationController_callbacks, callbacks, "f");
|
|
11322
|
+
__classPrivateFieldGet4(this, _DictationController_instances, "m", _DictationController_setupMediaRecorder).call(this, mediaRecorder);
|
|
11323
|
+
__classPrivateFieldGet4(this, _DictationController_instances, "m", _DictationController_setupWebSocketHandlers).call(this, callbacks);
|
|
11324
|
+
return newConnection;
|
|
10937
11325
|
}
|
|
10938
11326
|
async disconnect(onClose) {
|
|
10939
11327
|
await new Promise((resolve, reject) => {
|
|
10940
|
-
if (!this
|
|
11328
|
+
if (!__classPrivateFieldGet4(this, _DictationController_webSocket, "f") || __classPrivateFieldGet4(this, _DictationController_webSocket, "f").readyState !== WebSocket.OPEN) {
|
|
10941
11329
|
resolve();
|
|
10942
11330
|
return;
|
|
10943
11331
|
}
|
|
10944
|
-
this.
|
|
10945
|
-
if (this
|
|
10946
|
-
clearTimeout(this
|
|
10947
|
-
this
|
|
11332
|
+
__classPrivateFieldGet4(this, _DictationController_webSocket, "f").on("close", (event) => {
|
|
11333
|
+
if (__classPrivateFieldGet4(this, _DictationController_closeTimeout, "f")) {
|
|
11334
|
+
clearTimeout(__classPrivateFieldGet4(this, _DictationController_closeTimeout, "f"));
|
|
11335
|
+
__classPrivateFieldSet3(this, _DictationController_closeTimeout, void 0, "f");
|
|
10948
11336
|
}
|
|
10949
11337
|
if (onClose) {
|
|
10950
11338
|
onClose(event);
|
|
10951
11339
|
}
|
|
10952
11340
|
resolve();
|
|
10953
11341
|
});
|
|
10954
|
-
this
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
11342
|
+
__classPrivateFieldGet4(this, _DictationController_webSocket, "f").on("message", (message) => {
|
|
11343
|
+
__classPrivateFieldGet4(this, _DictationController_callbacks, "f")?.onNetworkActivity?.("received", message);
|
|
11344
|
+
if (__classPrivateFieldGet4(this, _DictationController_callbacks, "f")?.onMessage) {
|
|
11345
|
+
__classPrivateFieldGet4(this, _DictationController_callbacks, "f")?.onMessage(message);
|
|
11346
|
+
}
|
|
11347
|
+
if (message.type === "flushed") {
|
|
11348
|
+
if (__classPrivateFieldGet4(this, _DictationController_closeTimeout, "f")) {
|
|
11349
|
+
clearTimeout(__classPrivateFieldGet4(this, _DictationController_closeTimeout, "f"));
|
|
11350
|
+
__classPrivateFieldSet3(this, _DictationController_closeTimeout, void 0, "f");
|
|
11351
|
+
}
|
|
11352
|
+
resolve();
|
|
11353
|
+
return;
|
|
11354
|
+
}
|
|
11355
|
+
});
|
|
11356
|
+
__classPrivateFieldGet4(this, _DictationController_webSocket, "f").sendFlush({ type: "flush" });
|
|
11357
|
+
__classPrivateFieldGet4(this, _DictationController_callbacks, "f")?.onNetworkActivity?.("sent", { type: "flush" });
|
|
11358
|
+
__classPrivateFieldSet3(this, _DictationController_closeTimeout, window.setTimeout(() => {
|
|
11359
|
+
reject(new Error("Audio processing timeout"));
|
|
11360
|
+
if (__classPrivateFieldGet4(this, _DictationController_webSocket, "f")?.readyState === WebSocket.OPEN) {
|
|
11361
|
+
__classPrivateFieldGet4(this, _DictationController_webSocket, "f").close();
|
|
10960
11362
|
}
|
|
10961
|
-
}, 1e4);
|
|
11363
|
+
}, 1e4), "f");
|
|
10962
11364
|
});
|
|
10963
|
-
this.cleanup();
|
|
10964
11365
|
}
|
|
10965
11366
|
cleanup() {
|
|
10966
|
-
if (this
|
|
10967
|
-
clearTimeout(this
|
|
10968
|
-
this
|
|
11367
|
+
if (__classPrivateFieldGet4(this, _DictationController_closeTimeout, "f")) {
|
|
11368
|
+
clearTimeout(__classPrivateFieldGet4(this, _DictationController_closeTimeout, "f"));
|
|
11369
|
+
__classPrivateFieldSet3(this, _DictationController_closeTimeout, void 0, "f");
|
|
11370
|
+
}
|
|
11371
|
+
if (__classPrivateFieldGet4(this, _DictationController_webSocket, "f")?.readyState === WebSocket.OPEN) {
|
|
11372
|
+
__classPrivateFieldGet4(this, _DictationController_webSocket, "f").close();
|
|
11373
|
+
}
|
|
11374
|
+
__classPrivateFieldSet3(this, _DictationController_webSocket, null, "f");
|
|
11375
|
+
__classPrivateFieldSet3(this, _DictationController_cortiClient, null, "f");
|
|
11376
|
+
__classPrivateFieldSet3(this, _DictationController_lastDictationConfig, null, "f");
|
|
11377
|
+
__classPrivateFieldSet3(this, _DictationController_lastSocketUrl, void 0, "f");
|
|
11378
|
+
__classPrivateFieldSet3(this, _DictationController_lastSocketProxy, void 0, "f");
|
|
11379
|
+
}
|
|
11380
|
+
};
|
|
11381
|
+
_DictationController_cortiClient = /* @__PURE__ */ new WeakMap(), _DictationController_webSocket = /* @__PURE__ */ new WeakMap(), _DictationController_closeTimeout = /* @__PURE__ */ new WeakMap(), _DictationController_callbacks = /* @__PURE__ */ new WeakMap(), _DictationController_lastDictationConfig = /* @__PURE__ */ new WeakMap(), _DictationController_lastSocketUrl = /* @__PURE__ */ new WeakMap(), _DictationController_lastSocketProxy = /* @__PURE__ */ new WeakMap(), _DictationController_instances = /* @__PURE__ */ new WeakSet(), _DictationController_configHasChanged = function _DictationController_configHasChanged2() {
|
|
11382
|
+
return JSON.stringify(this.host._dictationConfig) !== JSON.stringify(__classPrivateFieldGet4(this, _DictationController_lastDictationConfig, "f")) || this.host._socketUrl !== __classPrivateFieldGet4(this, _DictationController_lastSocketUrl, "f") || JSON.stringify(this.host._socketProxy) !== JSON.stringify(__classPrivateFieldGet4(this, _DictationController_lastSocketProxy, "f"));
|
|
11383
|
+
}, _DictationController_connectProxy = async function _DictationController_connectProxy2(dictationConfig) {
|
|
11384
|
+
const proxyOptions = this.host._socketProxy || {
|
|
11385
|
+
url: this.host._socketUrl || ""
|
|
11386
|
+
};
|
|
11387
|
+
if (!proxyOptions.url) {
|
|
11388
|
+
throw new Error("Proxy URL is required when using proxy client");
|
|
11389
|
+
}
|
|
11390
|
+
return await CortiWebSocketProxyClient.transcribe.connect({
|
|
11391
|
+
configuration: dictationConfig,
|
|
11392
|
+
proxy: proxyOptions
|
|
11393
|
+
});
|
|
11394
|
+
}, _DictationController_connectAuth = async function _DictationController_connectAuth2(dictationConfig) {
|
|
11395
|
+
if (!this.host._authConfig && !this.host._accessToken) {
|
|
11396
|
+
throw new Error("Auth configuration or access token is required to connect");
|
|
11397
|
+
}
|
|
11398
|
+
const auth = this.host._authConfig || {
|
|
11399
|
+
accessToken: this.host._accessToken || "",
|
|
11400
|
+
refreshAccessToken: () => ({
|
|
11401
|
+
accessToken: this.host._accessToken || ""
|
|
11402
|
+
})
|
|
11403
|
+
};
|
|
11404
|
+
__classPrivateFieldSet3(this, _DictationController_cortiClient, new CortiClient({
|
|
11405
|
+
auth,
|
|
11406
|
+
environment: this.host._region,
|
|
11407
|
+
tenantName: this.host._tenantName
|
|
11408
|
+
}), "f");
|
|
11409
|
+
return await __classPrivateFieldGet4(this, _DictationController_cortiClient, "f").transcribe.connect({
|
|
11410
|
+
configuration: dictationConfig
|
|
11411
|
+
});
|
|
11412
|
+
}, _DictationController_setupWebSocketHandlers = function _DictationController_setupWebSocketHandlers2(callbacks) {
|
|
11413
|
+
if (!__classPrivateFieldGet4(this, _DictationController_webSocket, "f")) {
|
|
11414
|
+
throw new Error("WebSocket not initialized");
|
|
11415
|
+
}
|
|
11416
|
+
__classPrivateFieldGet4(this, _DictationController_webSocket, "f").on("message", (message) => {
|
|
11417
|
+
callbacks.onNetworkActivity?.("received", message);
|
|
11418
|
+
if (callbacks.onMessage) {
|
|
11419
|
+
callbacks.onMessage(message);
|
|
11420
|
+
}
|
|
11421
|
+
});
|
|
11422
|
+
__classPrivateFieldGet4(this, _DictationController_webSocket, "f").on("error", (event) => {
|
|
11423
|
+
if (callbacks.onError) {
|
|
11424
|
+
callbacks.onError(event);
|
|
11425
|
+
}
|
|
11426
|
+
});
|
|
11427
|
+
__classPrivateFieldGet4(this, _DictationController_webSocket, "f").on("close", (event) => {
|
|
11428
|
+
if (callbacks.onClose) {
|
|
11429
|
+
callbacks.onClose(event);
|
|
11430
|
+
}
|
|
11431
|
+
});
|
|
11432
|
+
}, _DictationController_setupMediaRecorder = function _DictationController_setupMediaRecorder2(mediaRecorder) {
|
|
11433
|
+
mediaRecorder.ondataavailable = (event) => {
|
|
11434
|
+
__classPrivateFieldGet4(this, _DictationController_webSocket, "f")?.sendAudio(event.data);
|
|
11435
|
+
__classPrivateFieldGet4(this, _DictationController_callbacks, "f")?.onNetworkActivity?.("sent", {
|
|
11436
|
+
size: event.data.size,
|
|
11437
|
+
type: "audio"
|
|
11438
|
+
});
|
|
11439
|
+
};
|
|
11440
|
+
};
|
|
11441
|
+
|
|
11442
|
+
// dist/controllers/keybinding-controller.js
|
|
11443
|
+
var __classPrivateFieldGet5 = function(receiver, state, kind, f5) {
|
|
11444
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
11445
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11446
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
11447
|
+
};
|
|
11448
|
+
var __classPrivateFieldSet4 = function(receiver, state, value, kind, f5) {
|
|
11449
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
11450
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a setter");
|
|
11451
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
11452
|
+
return kind === "a" ? f5.call(receiver, value) : f5 ? f5.value = value : state.set(receiver, value), value;
|
|
11453
|
+
};
|
|
11454
|
+
var _KeybindingController_instances;
|
|
11455
|
+
var _KeybindingController_keydownHandler;
|
|
11456
|
+
var _KeybindingController_keyupHandler;
|
|
11457
|
+
var _KeybindingController_blurHandler;
|
|
11458
|
+
var _KeybindingController_setupListeners;
|
|
11459
|
+
var _KeybindingController_removeListeners;
|
|
11460
|
+
var KeybindingController = class {
|
|
11461
|
+
constructor(host) {
|
|
11462
|
+
_KeybindingController_instances.add(this);
|
|
11463
|
+
_KeybindingController_keydownHandler.set(this, void 0);
|
|
11464
|
+
_KeybindingController_keyupHandler.set(this, void 0);
|
|
11465
|
+
_KeybindingController_blurHandler.set(this, void 0);
|
|
11466
|
+
this.host = host;
|
|
11467
|
+
host.addController(this);
|
|
11468
|
+
}
|
|
11469
|
+
hostConnected() {
|
|
11470
|
+
__classPrivateFieldGet5(this, _KeybindingController_instances, "m", _KeybindingController_setupListeners).call(this);
|
|
11471
|
+
}
|
|
11472
|
+
hostDisconnected() {
|
|
11473
|
+
__classPrivateFieldGet5(this, _KeybindingController_instances, "m", _KeybindingController_removeListeners).call(this);
|
|
11474
|
+
}
|
|
11475
|
+
};
|
|
11476
|
+
_KeybindingController_keydownHandler = /* @__PURE__ */ new WeakMap(), _KeybindingController_keyupHandler = /* @__PURE__ */ new WeakMap(), _KeybindingController_blurHandler = /* @__PURE__ */ new WeakMap(), _KeybindingController_instances = /* @__PURE__ */ new WeakSet(), _KeybindingController_setupListeners = function _KeybindingController_setupListeners2() {
|
|
11477
|
+
__classPrivateFieldGet5(this, _KeybindingController_instances, "m", _KeybindingController_removeListeners).call(this);
|
|
11478
|
+
__classPrivateFieldSet4(this, _KeybindingController_keydownHandler, (event) => {
|
|
11479
|
+
if (!this.host._keybinding) {
|
|
11480
|
+
return;
|
|
10969
11481
|
}
|
|
10970
|
-
if (
|
|
10971
|
-
|
|
11482
|
+
if (shouldIgnoreKeybinding(document.activeElement)) {
|
|
11483
|
+
return;
|
|
11484
|
+
}
|
|
11485
|
+
if (matchesKeybinding(event, this.host._keybinding)) {
|
|
11486
|
+
if (!this.host.dispatchEvent(keybindingActivatedEvent(event))) {
|
|
11487
|
+
return;
|
|
11488
|
+
}
|
|
11489
|
+
if (this.host._mode === "push-to-talk") {
|
|
11490
|
+
this.host.startRecording();
|
|
11491
|
+
}
|
|
11492
|
+
if (this.host._mode === "toggle-to-talk") {
|
|
11493
|
+
this.host.toggleRecording();
|
|
11494
|
+
}
|
|
10972
11495
|
}
|
|
10973
|
-
|
|
10974
|
-
|
|
11496
|
+
}, "f");
|
|
11497
|
+
__classPrivateFieldSet4(this, _KeybindingController_keyupHandler, (event) => {
|
|
11498
|
+
if (!this.host._keybinding) {
|
|
11499
|
+
return;
|
|
11500
|
+
}
|
|
11501
|
+
if (this.host._mode === "push-to-talk" && matchesKeybinding(event, this.host._keybinding)) {
|
|
11502
|
+
this.host.stopRecording();
|
|
11503
|
+
}
|
|
11504
|
+
}, "f");
|
|
11505
|
+
__classPrivateFieldSet4(this, _KeybindingController_blurHandler, () => {
|
|
11506
|
+
if (this.host._mode === "push-to-talk") {
|
|
11507
|
+
this.host.stopRecording();
|
|
11508
|
+
}
|
|
11509
|
+
}, "f");
|
|
11510
|
+
window.addEventListener("keydown", __classPrivateFieldGet5(this, _KeybindingController_keydownHandler, "f"));
|
|
11511
|
+
window.addEventListener("keyup", __classPrivateFieldGet5(this, _KeybindingController_keyupHandler, "f"));
|
|
11512
|
+
window.addEventListener("blur", __classPrivateFieldGet5(this, _KeybindingController_blurHandler, "f"));
|
|
11513
|
+
}, _KeybindingController_removeListeners = function _KeybindingController_removeListeners2() {
|
|
11514
|
+
if (__classPrivateFieldGet5(this, _KeybindingController_keydownHandler, "f")) {
|
|
11515
|
+
window.removeEventListener("keydown", __classPrivateFieldGet5(this, _KeybindingController_keydownHandler, "f"));
|
|
11516
|
+
__classPrivateFieldSet4(this, _KeybindingController_keydownHandler, void 0, "f");
|
|
11517
|
+
}
|
|
11518
|
+
if (__classPrivateFieldGet5(this, _KeybindingController_keyupHandler, "f")) {
|
|
11519
|
+
window.removeEventListener("keyup", __classPrivateFieldGet5(this, _KeybindingController_keyupHandler, "f"));
|
|
11520
|
+
__classPrivateFieldSet4(this, _KeybindingController_keyupHandler, void 0, "f");
|
|
11521
|
+
}
|
|
11522
|
+
if (__classPrivateFieldGet5(this, _KeybindingController_blurHandler, "f")) {
|
|
11523
|
+
window.removeEventListener("blur", __classPrivateFieldGet5(this, _KeybindingController_blurHandler, "f"));
|
|
11524
|
+
__classPrivateFieldSet4(this, _KeybindingController_blurHandler, void 0, "f");
|
|
10975
11525
|
}
|
|
10976
11526
|
};
|
|
10977
11527
|
|
|
@@ -11013,14 +11563,36 @@ function calculateAudioLevel(analyser) {
|
|
|
11013
11563
|
return Math.sqrt(sumSquares / dataArray.length);
|
|
11014
11564
|
}
|
|
11015
11565
|
|
|
11016
|
-
// dist/controllers/
|
|
11566
|
+
// dist/controllers/media-controller.js
|
|
11567
|
+
var __classPrivateFieldSet5 = function(receiver, state, value, kind, f5) {
|
|
11568
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
11569
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a setter");
|
|
11570
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
11571
|
+
return kind === "a" ? f5.call(receiver, value) : f5 ? f5.value = value : state.set(receiver, value), value;
|
|
11572
|
+
};
|
|
11573
|
+
var __classPrivateFieldGet6 = function(receiver, state, kind, f5) {
|
|
11574
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
11575
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11576
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
11577
|
+
};
|
|
11578
|
+
var _MediaController_mediaStream;
|
|
11579
|
+
var _MediaController_audioContext;
|
|
11580
|
+
var _MediaController_analyser;
|
|
11581
|
+
var _MediaController_mediaRecorder;
|
|
11582
|
+
var _MediaController_visualiserInterval;
|
|
11583
|
+
var _MediaController_audioLevel;
|
|
11584
|
+
var _MediaController_onTrackEnded;
|
|
11585
|
+
var _MediaController_onAudioLevelChange;
|
|
11017
11586
|
var MediaController = class {
|
|
11018
11587
|
constructor(host) {
|
|
11019
|
-
this
|
|
11020
|
-
this
|
|
11021
|
-
this
|
|
11022
|
-
this
|
|
11023
|
-
this
|
|
11588
|
+
_MediaController_mediaStream.set(this, null);
|
|
11589
|
+
_MediaController_audioContext.set(this, null);
|
|
11590
|
+
_MediaController_analyser.set(this, null);
|
|
11591
|
+
_MediaController_mediaRecorder.set(this, null);
|
|
11592
|
+
_MediaController_visualiserInterval.set(this, void 0);
|
|
11593
|
+
_MediaController_audioLevel.set(this, 0);
|
|
11594
|
+
_MediaController_onTrackEnded.set(this, void 0);
|
|
11595
|
+
_MediaController_onAudioLevelChange.set(this, void 0);
|
|
11024
11596
|
this.host = host;
|
|
11025
11597
|
host.addController(this);
|
|
11026
11598
|
}
|
|
@@ -11029,64 +11601,64 @@ var MediaController = class {
|
|
|
11029
11601
|
}
|
|
11030
11602
|
async initialize(onTrackEnded) {
|
|
11031
11603
|
await this.cleanup();
|
|
11032
|
-
this
|
|
11033
|
-
this
|
|
11034
|
-
this.
|
|
11604
|
+
__classPrivateFieldSet5(this, _MediaController_onTrackEnded, onTrackEnded, "f");
|
|
11605
|
+
__classPrivateFieldSet5(this, _MediaController_mediaStream, await getMediaStream(this.host._selectedDevice?.deviceId, this.host._debug_displayAudio), "f");
|
|
11606
|
+
__classPrivateFieldGet6(this, _MediaController_mediaStream, "f").getTracks().forEach((track) => {
|
|
11035
11607
|
track.addEventListener("ended", () => {
|
|
11036
|
-
if (this
|
|
11037
|
-
this.
|
|
11608
|
+
if (__classPrivateFieldGet6(this, _MediaController_onTrackEnded, "f")) {
|
|
11609
|
+
__classPrivateFieldGet6(this, _MediaController_onTrackEnded, "f").call(this);
|
|
11038
11610
|
}
|
|
11039
11611
|
});
|
|
11040
11612
|
});
|
|
11041
|
-
const { audioContext, analyser } = createAudioAnalyzer(this
|
|
11042
|
-
this
|
|
11043
|
-
this
|
|
11044
|
-
this
|
|
11613
|
+
const { audioContext, analyser } = createAudioAnalyzer(__classPrivateFieldGet6(this, _MediaController_mediaStream, "f"));
|
|
11614
|
+
__classPrivateFieldSet5(this, _MediaController_audioContext, audioContext, "f");
|
|
11615
|
+
__classPrivateFieldSet5(this, _MediaController_analyser, analyser, "f");
|
|
11616
|
+
__classPrivateFieldSet5(this, _MediaController_mediaRecorder, new MediaRecorder(__classPrivateFieldGet6(this, _MediaController_mediaStream, "f")), "f");
|
|
11045
11617
|
}
|
|
11046
11618
|
getAudioLevel() {
|
|
11047
|
-
return this
|
|
11619
|
+
return __classPrivateFieldGet6(this, _MediaController_analyser, "f") ? calculateAudioLevel(__classPrivateFieldGet6(this, _MediaController_analyser, "f")) : 0;
|
|
11048
11620
|
}
|
|
11049
11621
|
startAudioLevelMonitoring(onAudioLevelChange) {
|
|
11050
11622
|
this.stopAudioLevelMonitoring();
|
|
11051
|
-
this
|
|
11052
|
-
this
|
|
11053
|
-
this
|
|
11623
|
+
__classPrivateFieldSet5(this, _MediaController_onAudioLevelChange, onAudioLevelChange, "f");
|
|
11624
|
+
__classPrivateFieldSet5(this, _MediaController_visualiserInterval, window.setInterval(() => {
|
|
11625
|
+
__classPrivateFieldSet5(this, _MediaController_audioLevel, this.getAudioLevel() * 3, "f");
|
|
11054
11626
|
this.host.requestUpdate();
|
|
11055
|
-
if (this
|
|
11056
|
-
this.
|
|
11627
|
+
if (__classPrivateFieldGet6(this, _MediaController_onAudioLevelChange, "f")) {
|
|
11628
|
+
__classPrivateFieldGet6(this, _MediaController_onAudioLevelChange, "f").call(this, __classPrivateFieldGet6(this, _MediaController_audioLevel, "f"));
|
|
11057
11629
|
}
|
|
11058
|
-
}, 150);
|
|
11630
|
+
}, 150), "f");
|
|
11059
11631
|
}
|
|
11060
11632
|
stopAudioLevelMonitoring() {
|
|
11061
|
-
if (this
|
|
11062
|
-
clearInterval(this
|
|
11063
|
-
this
|
|
11633
|
+
if (__classPrivateFieldGet6(this, _MediaController_visualiserInterval, "f")) {
|
|
11634
|
+
clearInterval(__classPrivateFieldGet6(this, _MediaController_visualiserInterval, "f"));
|
|
11635
|
+
__classPrivateFieldSet5(this, _MediaController_visualiserInterval, void 0, "f");
|
|
11064
11636
|
}
|
|
11065
|
-
this
|
|
11637
|
+
__classPrivateFieldSet5(this, _MediaController_audioLevel, 0, "f");
|
|
11066
11638
|
this.host.requestUpdate();
|
|
11067
|
-
if (this
|
|
11068
|
-
this.
|
|
11639
|
+
if (__classPrivateFieldGet6(this, _MediaController_onAudioLevelChange, "f")) {
|
|
11640
|
+
__classPrivateFieldGet6(this, _MediaController_onAudioLevelChange, "f").call(this, __classPrivateFieldGet6(this, _MediaController_audioLevel, "f"));
|
|
11069
11641
|
}
|
|
11070
11642
|
}
|
|
11071
11643
|
async cleanup() {
|
|
11072
11644
|
this.stopAudioLevelMonitoring();
|
|
11073
|
-
if (this
|
|
11074
|
-
this.
|
|
11645
|
+
if (__classPrivateFieldGet6(this, _MediaController_mediaRecorder, "f")?.state === "recording") {
|
|
11646
|
+
__classPrivateFieldGet6(this, _MediaController_mediaRecorder, "f").stop();
|
|
11075
11647
|
}
|
|
11076
|
-
if (this
|
|
11077
|
-
this.
|
|
11648
|
+
if (__classPrivateFieldGet6(this, _MediaController_mediaStream, "f")) {
|
|
11649
|
+
__classPrivateFieldGet6(this, _MediaController_mediaStream, "f").getTracks().forEach((track) => {
|
|
11078
11650
|
track.stop();
|
|
11079
11651
|
});
|
|
11080
|
-
this
|
|
11652
|
+
__classPrivateFieldSet5(this, _MediaController_mediaStream, null, "f");
|
|
11081
11653
|
}
|
|
11082
|
-
if (this
|
|
11083
|
-
await this.
|
|
11654
|
+
if (__classPrivateFieldGet6(this, _MediaController_audioContext, "f") && __classPrivateFieldGet6(this, _MediaController_audioContext, "f").state !== "closed") {
|
|
11655
|
+
await __classPrivateFieldGet6(this, _MediaController_audioContext, "f").close();
|
|
11084
11656
|
}
|
|
11085
|
-
this
|
|
11086
|
-
this
|
|
11087
|
-
this
|
|
11088
|
-
this
|
|
11089
|
-
this
|
|
11657
|
+
__classPrivateFieldSet5(this, _MediaController_audioContext, null, "f");
|
|
11658
|
+
__classPrivateFieldSet5(this, _MediaController_analyser, null, "f");
|
|
11659
|
+
__classPrivateFieldSet5(this, _MediaController_mediaRecorder, null, "f");
|
|
11660
|
+
__classPrivateFieldSet5(this, _MediaController_onTrackEnded, void 0, "f");
|
|
11661
|
+
__classPrivateFieldSet5(this, _MediaController_onAudioLevelChange, void 0, "f");
|
|
11090
11662
|
}
|
|
11091
11663
|
/**
|
|
11092
11664
|
* Stops the media recorder and waits for all buffered data to be flushed.
|
|
@@ -11094,23 +11666,24 @@ var MediaController = class {
|
|
|
11094
11666
|
*/
|
|
11095
11667
|
async stopRecording() {
|
|
11096
11668
|
return new Promise((resolve) => {
|
|
11097
|
-
if (!this
|
|
11669
|
+
if (!__classPrivateFieldGet6(this, _MediaController_mediaRecorder, "f") || __classPrivateFieldGet6(this, _MediaController_mediaRecorder, "f").state !== "recording") {
|
|
11098
11670
|
resolve();
|
|
11099
11671
|
return;
|
|
11100
11672
|
}
|
|
11101
|
-
this.
|
|
11673
|
+
__classPrivateFieldGet6(this, _MediaController_mediaRecorder, "f").onstop = () => {
|
|
11102
11674
|
resolve();
|
|
11103
11675
|
};
|
|
11104
|
-
this.
|
|
11676
|
+
__classPrivateFieldGet6(this, _MediaController_mediaRecorder, "f").stop();
|
|
11105
11677
|
});
|
|
11106
11678
|
}
|
|
11107
11679
|
get mediaRecorder() {
|
|
11108
|
-
return this
|
|
11680
|
+
return __classPrivateFieldGet6(this, _MediaController_mediaRecorder, "f");
|
|
11109
11681
|
}
|
|
11110
11682
|
get audioLevel() {
|
|
11111
|
-
return this
|
|
11683
|
+
return __classPrivateFieldGet6(this, _MediaController_audioLevel, "f");
|
|
11112
11684
|
}
|
|
11113
11685
|
};
|
|
11686
|
+
_MediaController_mediaStream = /* @__PURE__ */ new WeakMap(), _MediaController_audioContext = /* @__PURE__ */ new WeakMap(), _MediaController_analyser = /* @__PURE__ */ new WeakMap(), _MediaController_mediaRecorder = /* @__PURE__ */ new WeakMap(), _MediaController_visualiserInterval = /* @__PURE__ */ new WeakMap(), _MediaController_audioLevel = /* @__PURE__ */ new WeakMap(), _MediaController_onTrackEnded = /* @__PURE__ */ new WeakMap(), _MediaController_onAudioLevelChange = /* @__PURE__ */ new WeakMap();
|
|
11114
11687
|
|
|
11115
11688
|
// dist/styles/buttons.js
|
|
11116
11689
|
var ButtonStyles = i`
|
|
@@ -11128,7 +11701,6 @@ var ButtonStyles = i`
|
|
|
11128
11701
|
align-items: center;
|
|
11129
11702
|
justify-content: center;
|
|
11130
11703
|
transition: background 0.3s ease;
|
|
11131
|
-
font-family: var(--component-font-family, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif);
|
|
11132
11704
|
}
|
|
11133
11705
|
|
|
11134
11706
|
button:hover {
|
|
@@ -11235,12 +11807,12 @@ var __decorate2 = function(decorators, target, key, desc) {
|
|
|
11235
11807
|
else for (var i7 = decorators.length - 1; i7 >= 0; i7--) if (d3 = decorators[i7]) r7 = (c6 < 3 ? d3(r7) : c6 > 3 ? d3(target, key, r7) : d3(target, key)) || r7;
|
|
11236
11808
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
11237
11809
|
};
|
|
11238
|
-
var
|
|
11239
|
-
var AudioVisualiser = class AudioVisualiser2 extends i4 {
|
|
11810
|
+
var DictationAudioVisualiser = class DictationAudioVisualiser2 extends i4 {
|
|
11240
11811
|
constructor() {
|
|
11241
11812
|
super(...arguments);
|
|
11242
11813
|
this.level = 0;
|
|
11243
11814
|
this.active = false;
|
|
11815
|
+
this.segmentCount = 5;
|
|
11244
11816
|
}
|
|
11245
11817
|
willUpdate(changedProperties) {
|
|
11246
11818
|
if (changedProperties.has("level")) {
|
|
@@ -11248,11 +11820,11 @@ var AudioVisualiser = class AudioVisualiser2 extends i4 {
|
|
|
11248
11820
|
}
|
|
11249
11821
|
}
|
|
11250
11822
|
render() {
|
|
11251
|
-
const activeSegments = Math.round(this.level *
|
|
11252
|
-
const segments = o8(o9(
|
|
11823
|
+
const activeSegments = Math.round(this.level * this.segmentCount);
|
|
11824
|
+
const segments = o8(o9(this.segmentCount), (i7) => x`<div class=${e6({
|
|
11253
11825
|
active: i7 < activeSegments,
|
|
11254
11826
|
segment: true
|
|
11255
|
-
})}
|
|
11827
|
+
})} />`);
|
|
11256
11828
|
return x`
|
|
11257
11829
|
<div class=${e6({
|
|
11258
11830
|
active: this.active,
|
|
@@ -11263,16 +11835,19 @@ var AudioVisualiser = class AudioVisualiser2 extends i4 {
|
|
|
11263
11835
|
`;
|
|
11264
11836
|
}
|
|
11265
11837
|
};
|
|
11266
|
-
|
|
11838
|
+
DictationAudioVisualiser.styles = audio_visualiser_default;
|
|
11267
11839
|
__decorate2([
|
|
11268
11840
|
n4({ type: Number })
|
|
11269
|
-
],
|
|
11841
|
+
], DictationAudioVisualiser.prototype, "level", void 0);
|
|
11270
11842
|
__decorate2([
|
|
11271
11843
|
n4({ type: Boolean })
|
|
11272
|
-
],
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
],
|
|
11844
|
+
], DictationAudioVisualiser.prototype, "active", void 0);
|
|
11845
|
+
__decorate2([
|
|
11846
|
+
n4({ type: Number })
|
|
11847
|
+
], DictationAudioVisualiser.prototype, "segmentCount", void 0);
|
|
11848
|
+
DictationAudioVisualiser = __decorate2([
|
|
11849
|
+
t3("dictation-audio-visualiser")
|
|
11850
|
+
], DictationAudioVisualiser);
|
|
11276
11851
|
|
|
11277
11852
|
// dist/icons/icons.js
|
|
11278
11853
|
var __decorate3 = function(decorators, target, key, desc) {
|
|
@@ -11432,29 +12007,48 @@ var __decorate4 = function(decorators, target, key, desc) {
|
|
|
11432
12007
|
else for (var i7 = decorators.length - 1; i7 >= 0; i7--) if (d3 = decorators[i7]) r7 = (c6 < 3 ? d3(r7) : c6 > 3 ? d3(target, key, r7) : d3(target, key)) || r7;
|
|
11433
12008
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
11434
12009
|
};
|
|
11435
|
-
var
|
|
12010
|
+
var __classPrivateFieldGet7 = function(receiver, state, kind, f5) {
|
|
12011
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
12012
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
12013
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
12014
|
+
};
|
|
12015
|
+
var _DictationRecordingButton_instances;
|
|
12016
|
+
var _DictationRecordingButton_mediaController;
|
|
12017
|
+
var _DictationRecordingButton_dictationController;
|
|
12018
|
+
var _DictationRecordingButton_keybindingController;
|
|
12019
|
+
var _DictationRecordingButton_handleMouseDown;
|
|
12020
|
+
var _DictationRecordingButton_handleMouseUp;
|
|
12021
|
+
var _DictationRecordingButton_handleMouseLeave;
|
|
12022
|
+
var _DictationRecordingButton_handleWebSocketMessage;
|
|
12023
|
+
var _DictationRecordingButton_handleWebSocketError;
|
|
12024
|
+
var _DictationRecordingButton_handleWebSocketClose;
|
|
12025
|
+
var _DictationRecordingButton_handleStart;
|
|
12026
|
+
var _DictationRecordingButton_handleStop;
|
|
12027
|
+
var DictationRecordingButton = class DictationRecordingButton2 extends i4 {
|
|
11436
12028
|
constructor() {
|
|
11437
12029
|
super(...arguments);
|
|
12030
|
+
_DictationRecordingButton_instances.add(this);
|
|
11438
12031
|
this._recordingState = "stopped";
|
|
11439
|
-
this.
|
|
11440
|
-
this
|
|
11441
|
-
this
|
|
11442
|
-
this
|
|
12032
|
+
this.allowButtonFocus = false;
|
|
12033
|
+
_DictationRecordingButton_mediaController.set(this, new MediaController(this));
|
|
12034
|
+
_DictationRecordingButton_dictationController.set(this, new DictationController(this));
|
|
12035
|
+
_DictationRecordingButton_keybindingController.set(this, new KeybindingController(this));
|
|
12036
|
+
_DictationRecordingButton_handleWebSocketMessage.set(this, (message) => {
|
|
11443
12037
|
switch (message.type) {
|
|
11444
12038
|
case "CONFIG_ACCEPTED":
|
|
11445
|
-
this.
|
|
11446
|
-
this.
|
|
12039
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_mediaController, "f").mediaRecorder?.start(AUDIO_CHUNK_INTERVAL_MS);
|
|
12040
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_mediaController, "f").startAudioLevelMonitoring((level) => {
|
|
11447
12041
|
this.dispatchEvent(audioLevelChangedEvent(level));
|
|
11448
12042
|
});
|
|
11449
12043
|
this.dispatchEvent(recordingStateChangedEvent("recording"));
|
|
11450
12044
|
break;
|
|
11451
12045
|
case "CONFIG_DENIED":
|
|
11452
12046
|
this.dispatchEvent(errorEvent(`Config denied: ${message.reason ?? "Unknown reason"}`));
|
|
11453
|
-
this.
|
|
12047
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleStop).call(this);
|
|
11454
12048
|
break;
|
|
11455
12049
|
case "CONFIG_TIMEOUT":
|
|
11456
12050
|
this.dispatchEvent(errorEvent("Config timeout"));
|
|
11457
|
-
this.
|
|
12051
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleStop).call(this);
|
|
11458
12052
|
break;
|
|
11459
12053
|
case "transcript":
|
|
11460
12054
|
this.dispatchEvent(transcriptEvent(message));
|
|
@@ -11467,147 +12061,194 @@ var RecordingButton = class RecordingButton2 extends i4 {
|
|
|
11467
12061
|
break;
|
|
11468
12062
|
case "error":
|
|
11469
12063
|
this.dispatchEvent(errorEvent(message.error));
|
|
11470
|
-
this.
|
|
12064
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleStop).call(this);
|
|
11471
12065
|
break;
|
|
11472
12066
|
}
|
|
11473
|
-
};
|
|
11474
|
-
this
|
|
12067
|
+
});
|
|
12068
|
+
_DictationRecordingButton_handleWebSocketError.set(this, (error) => {
|
|
11475
12069
|
this.dispatchEvent(errorEvent("Socket error: " + error.message));
|
|
11476
|
-
this.
|
|
11477
|
-
};
|
|
11478
|
-
this
|
|
12070
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleStop).call(this);
|
|
12071
|
+
});
|
|
12072
|
+
_DictationRecordingButton_handleWebSocketClose.set(this, (event) => {
|
|
11479
12073
|
this.dispatchEvent(streamClosedEvent(event));
|
|
11480
|
-
};
|
|
11481
|
-
}
|
|
11482
|
-
_handleMouseDown(event) {
|
|
11483
|
-
if (this.preventFocus) {
|
|
11484
|
-
event.preventDefault();
|
|
11485
|
-
}
|
|
11486
|
-
}
|
|
11487
|
-
async _handleStart() {
|
|
11488
|
-
this.dispatchEvent(recordingStateChangedEvent("initializing"));
|
|
11489
|
-
try {
|
|
11490
|
-
await this._mediaController.initialize(() => {
|
|
11491
|
-
if (this._recordingState === "recording") {
|
|
11492
|
-
this.dispatchEvent(errorEvent("Microphone access was lost."));
|
|
11493
|
-
this._handleStop();
|
|
11494
|
-
}
|
|
11495
|
-
});
|
|
11496
|
-
await this._dictationController.connect(this._mediaController.mediaRecorder, this._dictationConfig, {
|
|
11497
|
-
onClose: this._handleWebSocketClose,
|
|
11498
|
-
onError: this._handleWebSocketError,
|
|
11499
|
-
onMessage: this._handleWebSocketMessage,
|
|
11500
|
-
onNetworkActivity: (direction, data) => {
|
|
11501
|
-
this.dispatchEvent(networkActivityEvent(direction, data));
|
|
11502
|
-
}
|
|
11503
|
-
});
|
|
11504
|
-
} catch (error) {
|
|
11505
|
-
this.dispatchEvent(errorEvent(error));
|
|
11506
|
-
await this._handleStop();
|
|
11507
|
-
}
|
|
11508
|
-
}
|
|
11509
|
-
async _handleStop() {
|
|
11510
|
-
this.dispatchEvent(recordingStateChangedEvent("stopping"));
|
|
11511
|
-
try {
|
|
11512
|
-
this._mediaController.stopAudioLevelMonitoring();
|
|
11513
|
-
await this._mediaController.stopRecording();
|
|
11514
|
-
await this._dictationController.disconnect(this._handleWebSocketClose);
|
|
11515
|
-
await this._mediaController.cleanup();
|
|
11516
|
-
} catch (error) {
|
|
11517
|
-
this.dispatchEvent(errorEvent(error));
|
|
11518
|
-
}
|
|
11519
|
-
this.dispatchEvent(recordingStateChangedEvent("stopped"));
|
|
11520
|
-
}
|
|
11521
|
-
_handleClick() {
|
|
11522
|
-
if (this._recordingState === "stopped") {
|
|
11523
|
-
this._handleStart();
|
|
11524
|
-
} else if (this._recordingState === "recording") {
|
|
11525
|
-
this._handleStop();
|
|
11526
|
-
}
|
|
12074
|
+
});
|
|
11527
12075
|
}
|
|
11528
12076
|
startRecording() {
|
|
11529
12077
|
if (this._recordingState !== "stopped") {
|
|
11530
12078
|
return;
|
|
11531
12079
|
}
|
|
11532
|
-
this.
|
|
12080
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleStart).call(this);
|
|
11533
12081
|
}
|
|
11534
12082
|
stopRecording() {
|
|
11535
|
-
if (this._recordingState
|
|
12083
|
+
if (this._recordingState === "stopped" || this._recordingState === "stopping") {
|
|
11536
12084
|
return;
|
|
11537
12085
|
}
|
|
11538
|
-
this.
|
|
12086
|
+
if (this._recordingState === "initializing") {
|
|
12087
|
+
this.addEventListener("recording-state-changed", (event) => {
|
|
12088
|
+
if (event.detail.state === "recording") {
|
|
12089
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleStop).call(this);
|
|
12090
|
+
}
|
|
12091
|
+
}, {
|
|
12092
|
+
once: true
|
|
12093
|
+
});
|
|
12094
|
+
return;
|
|
12095
|
+
}
|
|
12096
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleStop).call(this);
|
|
11539
12097
|
}
|
|
11540
12098
|
toggleRecording() {
|
|
11541
|
-
this.
|
|
12099
|
+
if (this._recordingState === "stopped") {
|
|
12100
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleStart).call(this);
|
|
12101
|
+
} else if (this._recordingState === "recording") {
|
|
12102
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleStop).call(this);
|
|
12103
|
+
}
|
|
11542
12104
|
}
|
|
11543
12105
|
render() {
|
|
11544
12106
|
const isLoading = this._recordingState === "initializing" || this._recordingState === "stopping";
|
|
11545
12107
|
const isRecording = this._recordingState === "recording";
|
|
11546
12108
|
return x`
|
|
11547
12109
|
<button
|
|
11548
|
-
@mousedown=${this
|
|
11549
|
-
@
|
|
12110
|
+
@mousedown=${__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleMouseDown)}
|
|
12111
|
+
@mouseup=${__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleMouseUp)}
|
|
12112
|
+
@mouseleave=${__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleMouseLeave)}
|
|
11550
12113
|
?disabled=${isLoading}
|
|
11551
12114
|
class=${isRecording ? "red" : "accent"}
|
|
11552
12115
|
aria-label=${isRecording ? "Stop recording" : "Start recording"}
|
|
11553
12116
|
aria-pressed=${isRecording}
|
|
11554
12117
|
>
|
|
11555
|
-
${isLoading ? x`<icon-loading-spinner
|
|
11556
|
-
<audio-visualiser
|
|
11557
|
-
.level=${this.
|
|
12118
|
+
${isLoading ? x`<icon-loading-spinner />` : isRecording ? x`<icon-recording />` : x`<icon-mic-on />`}
|
|
12119
|
+
<dictation-audio-visualiser
|
|
12120
|
+
.level=${__classPrivateFieldGet7(this, _DictationRecordingButton_mediaController, "f").audioLevel}
|
|
11558
12121
|
?active=${isRecording}
|
|
11559
|
-
|
|
12122
|
+
/>
|
|
11560
12123
|
</button>
|
|
11561
12124
|
`;
|
|
11562
12125
|
}
|
|
11563
12126
|
};
|
|
11564
|
-
|
|
12127
|
+
_DictationRecordingButton_mediaController = /* @__PURE__ */ new WeakMap();
|
|
12128
|
+
_DictationRecordingButton_dictationController = /* @__PURE__ */ new WeakMap();
|
|
12129
|
+
_DictationRecordingButton_keybindingController = /* @__PURE__ */ new WeakMap();
|
|
12130
|
+
_DictationRecordingButton_handleWebSocketMessage = /* @__PURE__ */ new WeakMap();
|
|
12131
|
+
_DictationRecordingButton_handleWebSocketError = /* @__PURE__ */ new WeakMap();
|
|
12132
|
+
_DictationRecordingButton_handleWebSocketClose = /* @__PURE__ */ new WeakMap();
|
|
12133
|
+
_DictationRecordingButton_instances = /* @__PURE__ */ new WeakSet();
|
|
12134
|
+
_DictationRecordingButton_handleMouseDown = function _DictationRecordingButton_handleMouseDown2(event) {
|
|
12135
|
+
if (!this.allowButtonFocus) {
|
|
12136
|
+
event.preventDefault();
|
|
12137
|
+
}
|
|
12138
|
+
if (this._mode === "push-to-talk") {
|
|
12139
|
+
this.startRecording();
|
|
12140
|
+
}
|
|
12141
|
+
};
|
|
12142
|
+
_DictationRecordingButton_handleMouseUp = function _DictationRecordingButton_handleMouseUp2() {
|
|
12143
|
+
if (this._mode === "push-to-talk") {
|
|
12144
|
+
this.stopRecording();
|
|
12145
|
+
return;
|
|
12146
|
+
}
|
|
12147
|
+
if (this._mode === "toggle-to-talk") {
|
|
12148
|
+
this.toggleRecording();
|
|
12149
|
+
}
|
|
12150
|
+
};
|
|
12151
|
+
_DictationRecordingButton_handleMouseLeave = function _DictationRecordingButton_handleMouseLeave2() {
|
|
12152
|
+
if (this._mode === "push-to-talk") {
|
|
12153
|
+
this.stopRecording();
|
|
12154
|
+
}
|
|
12155
|
+
};
|
|
12156
|
+
_DictationRecordingButton_handleStart = async function _DictationRecordingButton_handleStart2() {
|
|
12157
|
+
this.dispatchEvent(recordingStateChangedEvent("initializing"));
|
|
12158
|
+
try {
|
|
12159
|
+
await __classPrivateFieldGet7(this, _DictationRecordingButton_mediaController, "f").initialize(() => {
|
|
12160
|
+
if (this._recordingState === "recording") {
|
|
12161
|
+
this.dispatchEvent(errorEvent("Recording device access was lost."));
|
|
12162
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleStop).call(this);
|
|
12163
|
+
}
|
|
12164
|
+
});
|
|
12165
|
+
const isNewConnection = await __classPrivateFieldGet7(this, _DictationRecordingButton_dictationController, "f").connect(__classPrivateFieldGet7(this, _DictationRecordingButton_mediaController, "f").mediaRecorder, this._dictationConfig, {
|
|
12166
|
+
onClose: __classPrivateFieldGet7(this, _DictationRecordingButton_handleWebSocketClose, "f"),
|
|
12167
|
+
onError: __classPrivateFieldGet7(this, _DictationRecordingButton_handleWebSocketError, "f"),
|
|
12168
|
+
onMessage: __classPrivateFieldGet7(this, _DictationRecordingButton_handleWebSocketMessage, "f"),
|
|
12169
|
+
onNetworkActivity: (direction, data) => {
|
|
12170
|
+
this.dispatchEvent(networkActivityEvent(direction, data));
|
|
12171
|
+
}
|
|
12172
|
+
});
|
|
12173
|
+
if (!isNewConnection) {
|
|
12174
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_mediaController, "f").mediaRecorder?.start(AUDIO_CHUNK_INTERVAL_MS);
|
|
12175
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_mediaController, "f").startAudioLevelMonitoring((level) => {
|
|
12176
|
+
this.dispatchEvent(audioLevelChangedEvent(level));
|
|
12177
|
+
});
|
|
12178
|
+
this.dispatchEvent(recordingStateChangedEvent("recording"));
|
|
12179
|
+
}
|
|
12180
|
+
} catch (error) {
|
|
12181
|
+
this.dispatchEvent(errorEvent(error));
|
|
12182
|
+
await __classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_handleStop).call(this);
|
|
12183
|
+
}
|
|
12184
|
+
};
|
|
12185
|
+
_DictationRecordingButton_handleStop = async function _DictationRecordingButton_handleStop2() {
|
|
12186
|
+
this.dispatchEvent(recordingStateChangedEvent("stopping"));
|
|
12187
|
+
try {
|
|
12188
|
+
__classPrivateFieldGet7(this, _DictationRecordingButton_mediaController, "f").stopAudioLevelMonitoring();
|
|
12189
|
+
await __classPrivateFieldGet7(this, _DictationRecordingButton_mediaController, "f").stopRecording();
|
|
12190
|
+
await __classPrivateFieldGet7(this, _DictationRecordingButton_dictationController, "f").disconnect(__classPrivateFieldGet7(this, _DictationRecordingButton_handleWebSocketClose, "f"));
|
|
12191
|
+
await __classPrivateFieldGet7(this, _DictationRecordingButton_mediaController, "f").cleanup();
|
|
12192
|
+
} catch (error) {
|
|
12193
|
+
this.dispatchEvent(errorEvent(error));
|
|
12194
|
+
}
|
|
12195
|
+
this.dispatchEvent(recordingStateChangedEvent("stopped"));
|
|
12196
|
+
};
|
|
12197
|
+
DictationRecordingButton.styles = [recording_button_default, buttons_default];
|
|
11565
12198
|
__decorate4([
|
|
11566
12199
|
c5({ context: recordingStateContext, subscribe: true }),
|
|
11567
12200
|
r5()
|
|
11568
|
-
],
|
|
12201
|
+
], DictationRecordingButton.prototype, "_recordingState", void 0);
|
|
11569
12202
|
__decorate4([
|
|
11570
12203
|
c5({ context: selectedDeviceContext, subscribe: true }),
|
|
11571
12204
|
r5()
|
|
11572
|
-
],
|
|
12205
|
+
], DictationRecordingButton.prototype, "_selectedDevice", void 0);
|
|
11573
12206
|
__decorate4([
|
|
11574
12207
|
c5({ context: accessTokenContext, subscribe: true }),
|
|
11575
12208
|
r5()
|
|
11576
|
-
],
|
|
12209
|
+
], DictationRecordingButton.prototype, "_accessToken", void 0);
|
|
11577
12210
|
__decorate4([
|
|
11578
12211
|
c5({ context: authConfigContext, subscribe: true }),
|
|
11579
12212
|
r5()
|
|
11580
|
-
],
|
|
12213
|
+
], DictationRecordingButton.prototype, "_authConfig", void 0);
|
|
11581
12214
|
__decorate4([
|
|
11582
12215
|
c5({ context: regionContext, subscribe: true }),
|
|
11583
12216
|
r5()
|
|
11584
|
-
],
|
|
12217
|
+
], DictationRecordingButton.prototype, "_region", void 0);
|
|
11585
12218
|
__decorate4([
|
|
11586
12219
|
c5({ context: tenantNameContext, subscribe: true }),
|
|
11587
12220
|
r5()
|
|
11588
|
-
],
|
|
12221
|
+
], DictationRecordingButton.prototype, "_tenantName", void 0);
|
|
11589
12222
|
__decorate4([
|
|
11590
12223
|
c5({ context: dictationConfigContext, subscribe: true }),
|
|
11591
12224
|
r5()
|
|
11592
|
-
],
|
|
12225
|
+
], DictationRecordingButton.prototype, "_dictationConfig", void 0);
|
|
11593
12226
|
__decorate4([
|
|
11594
12227
|
c5({ context: socketUrlContext, subscribe: true }),
|
|
11595
12228
|
r5()
|
|
11596
|
-
],
|
|
12229
|
+
], DictationRecordingButton.prototype, "_socketUrl", void 0);
|
|
11597
12230
|
__decorate4([
|
|
11598
12231
|
c5({ context: socketProxyContext, subscribe: true }),
|
|
11599
12232
|
r5()
|
|
11600
|
-
],
|
|
12233
|
+
], DictationRecordingButton.prototype, "_socketProxy", void 0);
|
|
11601
12234
|
__decorate4([
|
|
11602
12235
|
c5({ context: debugDisplayAudioContext, subscribe: true }),
|
|
11603
12236
|
r5()
|
|
11604
|
-
],
|
|
12237
|
+
], DictationRecordingButton.prototype, "_debug_displayAudio", void 0);
|
|
12238
|
+
__decorate4([
|
|
12239
|
+
c5({ context: keybindingContext, subscribe: true }),
|
|
12240
|
+
r5()
|
|
12241
|
+
], DictationRecordingButton.prototype, "_keybinding", void 0);
|
|
12242
|
+
__decorate4([
|
|
12243
|
+
c5({ context: modeContext, subscribe: true }),
|
|
12244
|
+
r5()
|
|
12245
|
+
], DictationRecordingButton.prototype, "_mode", void 0);
|
|
11605
12246
|
__decorate4([
|
|
11606
12247
|
n4({ type: Boolean })
|
|
11607
|
-
],
|
|
11608
|
-
|
|
11609
|
-
t3("recording-button")
|
|
11610
|
-
],
|
|
12248
|
+
], DictationRecordingButton.prototype, "allowButtonFocus", void 0);
|
|
12249
|
+
DictationRecordingButton = __decorate4([
|
|
12250
|
+
t3("dictation-recording-button")
|
|
12251
|
+
], DictationRecordingButton);
|
|
11611
12252
|
|
|
11612
12253
|
// dist/styles/callout.js
|
|
11613
12254
|
var CalloutStyles = i`
|
|
@@ -11661,21 +12302,23 @@ var SettingsMenuStyles = i`
|
|
|
11661
12302
|
.settings-wrapper {
|
|
11662
12303
|
display: flex;
|
|
11663
12304
|
flex-direction: column;
|
|
11664
|
-
gap:
|
|
12305
|
+
gap: 16px;
|
|
12306
|
+
}
|
|
12307
|
+
.settings-group {
|
|
12308
|
+
background: var(--muted-background, light-dark(#fafafa, #2a2a2a));
|
|
12309
|
+
padding: 12px;
|
|
12310
|
+
border-radius: 10px;
|
|
12311
|
+
display: flex;
|
|
12312
|
+
flex-direction: column;
|
|
12313
|
+
gap: 16px;
|
|
11665
12314
|
}
|
|
11666
12315
|
`;
|
|
11667
12316
|
var settings_menu_default = SettingsMenuStyles;
|
|
11668
12317
|
|
|
11669
12318
|
// dist/styles/select.js
|
|
11670
|
-
var SelectStyles =
|
|
11671
|
-
|
|
11672
|
-
|
|
11673
|
-
font-size: 0.8rem;
|
|
11674
|
-
padding-bottom: 0.5rem;
|
|
11675
|
-
font-weight: 500;
|
|
11676
|
-
color: var(--component-text-color, light-dark(#333, #eee));
|
|
11677
|
-
pointer-events: none;
|
|
11678
|
-
}
|
|
12319
|
+
var SelectStyles = [
|
|
12320
|
+
LabelStyles,
|
|
12321
|
+
i`
|
|
11679
12322
|
select {
|
|
11680
12323
|
background: var(--card-background, light-dark(#fff, #333));
|
|
11681
12324
|
color: var(--component-text-color, light-dark(#333, #eee));
|
|
@@ -11699,42 +12342,10 @@ var SelectStyles = i`
|
|
|
11699
12342
|
outline: 2px solid var(--action-accent-background, light-dark(#007bff, #0056b3));
|
|
11700
12343
|
/* outline-offset: 2px; */
|
|
11701
12344
|
}
|
|
11702
|
-
|
|
12345
|
+
`
|
|
12346
|
+
];
|
|
11703
12347
|
var select_default = SelectStyles;
|
|
11704
12348
|
|
|
11705
|
-
// dist/utils/devices.js
|
|
11706
|
-
async function requestMicAccess() {
|
|
11707
|
-
if (!navigator.permissions) {
|
|
11708
|
-
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
11709
|
-
stream.getTracks().forEach((track) => {
|
|
11710
|
-
track.stop();
|
|
11711
|
-
});
|
|
11712
|
-
return;
|
|
11713
|
-
}
|
|
11714
|
-
const permissionStatus = await navigator.permissions.query({
|
|
11715
|
-
name: "microphone"
|
|
11716
|
-
});
|
|
11717
|
-
if (permissionStatus.state === "denied") {
|
|
11718
|
-
throw new Error("Microphone permission is denied");
|
|
11719
|
-
}
|
|
11720
|
-
if (permissionStatus.state === "prompt") {
|
|
11721
|
-
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
11722
|
-
stream.getTracks().forEach((track) => {
|
|
11723
|
-
track.stop();
|
|
11724
|
-
});
|
|
11725
|
-
}
|
|
11726
|
-
}
|
|
11727
|
-
async function getAudioDevices() {
|
|
11728
|
-
if (!navigator.mediaDevices?.enumerateDevices) {
|
|
11729
|
-
throw new Error("MediaDevices API is not available");
|
|
11730
|
-
}
|
|
11731
|
-
await requestMicAccess();
|
|
11732
|
-
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
11733
|
-
const audioDevices = devices.filter((device) => device.kind === "audioinput");
|
|
11734
|
-
const defaultDevice = audioDevices.length > 0 ? audioDevices[0] : void 0;
|
|
11735
|
-
return { defaultDevice, devices: audioDevices };
|
|
11736
|
-
}
|
|
11737
|
-
|
|
11738
12349
|
// dist/components/device-selector.js
|
|
11739
12350
|
var __decorate5 = function(decorators, target, key, desc) {
|
|
11740
12351
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
@@ -11742,49 +12353,18 @@ var __decorate5 = function(decorators, target, key, desc) {
|
|
|
11742
12353
|
else for (var i7 = decorators.length - 1; i7 >= 0; i7--) if (d3 = decorators[i7]) r7 = (c6 < 3 ? d3(r7) : c6 > 3 ? d3(target, key, r7) : d3(target, key)) || r7;
|
|
11743
12354
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
11744
12355
|
};
|
|
11745
|
-
var
|
|
12356
|
+
var __classPrivateFieldGet8 = function(receiver, state, kind, f5) {
|
|
12357
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
12358
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
12359
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
12360
|
+
};
|
|
12361
|
+
var _DictationDeviceSelector_instances;
|
|
12362
|
+
var _DictationDeviceSelector_handleSelectDevice;
|
|
12363
|
+
var DictationDeviceSelector = class DictationDeviceSelector2 extends i4 {
|
|
11746
12364
|
constructor() {
|
|
11747
12365
|
super(...arguments);
|
|
12366
|
+
_DictationDeviceSelector_instances.add(this);
|
|
11748
12367
|
this.disabled = false;
|
|
11749
|
-
this._loadedDevices = [];
|
|
11750
|
-
this._handleDeviceChange = async () => {
|
|
11751
|
-
if (this._devicesAutoLoaded()) {
|
|
11752
|
-
await this._loadDevices();
|
|
11753
|
-
}
|
|
11754
|
-
};
|
|
11755
|
-
}
|
|
11756
|
-
_devicesAutoLoaded() {
|
|
11757
|
-
return this._loadedDevices === this._devices;
|
|
11758
|
-
}
|
|
11759
|
-
async connectedCallback() {
|
|
11760
|
-
super.connectedCallback();
|
|
11761
|
-
if (!this._devices) {
|
|
11762
|
-
await this._loadDevices();
|
|
11763
|
-
navigator.mediaDevices.addEventListener("devicechange", this._handleDeviceChange);
|
|
11764
|
-
}
|
|
11765
|
-
this.dispatchEvent(readyEvent());
|
|
11766
|
-
}
|
|
11767
|
-
disconnectedCallback() {
|
|
11768
|
-
super.disconnectedCallback();
|
|
11769
|
-
navigator.mediaDevices.removeEventListener("devicechange", this._handleDeviceChange);
|
|
11770
|
-
}
|
|
11771
|
-
async _loadDevices() {
|
|
11772
|
-
try {
|
|
11773
|
-
const { devices, defaultDevice } = await getAudioDevices();
|
|
11774
|
-
this._loadedDevices = devices;
|
|
11775
|
-
const selectedDevice = devices.find((d3) => d3.deviceId === this._selectedDevice?.deviceId) ?? defaultDevice;
|
|
11776
|
-
this.dispatchEvent(recordingDevicesChangedEvent(devices, selectedDevice));
|
|
11777
|
-
} catch (error) {
|
|
11778
|
-
this.dispatchEvent(errorEvent(error));
|
|
11779
|
-
}
|
|
11780
|
-
}
|
|
11781
|
-
_handleSelectDevice(e10) {
|
|
11782
|
-
const deviceId = e10.target.value;
|
|
11783
|
-
const device = this._devices?.find((d3) => d3.deviceId === deviceId);
|
|
11784
|
-
if (!device) {
|
|
11785
|
-
return;
|
|
11786
|
-
}
|
|
11787
|
-
this.dispatchEvent(recordingDevicesChangedEvent(this._devices || [], device));
|
|
11788
12368
|
}
|
|
11789
12369
|
render() {
|
|
11790
12370
|
return x`
|
|
@@ -11795,7 +12375,7 @@ var DeviceSelector = class DeviceSelector2 extends i4 {
|
|
|
11795
12375
|
<select
|
|
11796
12376
|
id="device-select"
|
|
11797
12377
|
aria-labelledby="device-select-label"
|
|
11798
|
-
@change=${this
|
|
12378
|
+
@change=${__classPrivateFieldGet8(this, _DictationDeviceSelector_instances, "m", _DictationDeviceSelector_handleSelectDevice)}
|
|
11799
12379
|
?disabled=${this.disabled || !this._devices || this._devices.length === 0}
|
|
11800
12380
|
>
|
|
11801
12381
|
${this._devices?.map((device) => x`
|
|
@@ -11811,87 +12391,199 @@ var DeviceSelector = class DeviceSelector2 extends i4 {
|
|
|
11811
12391
|
`;
|
|
11812
12392
|
}
|
|
11813
12393
|
};
|
|
11814
|
-
|
|
12394
|
+
_DictationDeviceSelector_instances = /* @__PURE__ */ new WeakSet();
|
|
12395
|
+
_DictationDeviceSelector_handleSelectDevice = function _DictationDeviceSelector_handleSelectDevice2(e10) {
|
|
12396
|
+
const deviceId = e10.target.value;
|
|
12397
|
+
const device = this._devices?.find((d3) => d3.deviceId === deviceId);
|
|
12398
|
+
if (!device) {
|
|
12399
|
+
return;
|
|
12400
|
+
}
|
|
12401
|
+
this.dispatchEvent(recordingDevicesChangedEvent(this._devices || [], device));
|
|
12402
|
+
};
|
|
12403
|
+
DictationDeviceSelector.styles = select_default;
|
|
11815
12404
|
__decorate5([
|
|
11816
12405
|
c5({ context: devicesContext, subscribe: true }),
|
|
11817
12406
|
r5()
|
|
11818
|
-
],
|
|
12407
|
+
], DictationDeviceSelector.prototype, "_devices", void 0);
|
|
11819
12408
|
__decorate5([
|
|
11820
12409
|
c5({ context: selectedDeviceContext, subscribe: true }),
|
|
11821
12410
|
r5()
|
|
11822
|
-
],
|
|
12411
|
+
], DictationDeviceSelector.prototype, "_selectedDevice", void 0);
|
|
11823
12412
|
__decorate5([
|
|
11824
12413
|
n4({ type: Boolean })
|
|
11825
|
-
],
|
|
11826
|
-
|
|
11827
|
-
t3("device-selector")
|
|
11828
|
-
],
|
|
11829
|
-
|
|
11830
|
-
// dist/
|
|
11831
|
-
var
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
function getLanguageName(languageCode) {
|
|
11837
|
-
try {
|
|
11838
|
-
const userLocale = navigator.language || "en";
|
|
11839
|
-
const displayNames = new Intl.DisplayNames([userLocale], {
|
|
11840
|
-
type: "language"
|
|
11841
|
-
});
|
|
11842
|
-
const languageName = displayNames.of(languageCode);
|
|
11843
|
-
return languageName || languageCode;
|
|
11844
|
-
} catch {
|
|
11845
|
-
return languageCode;
|
|
12414
|
+
], DictationDeviceSelector.prototype, "disabled", void 0);
|
|
12415
|
+
DictationDeviceSelector = __decorate5([
|
|
12416
|
+
t3("dictation-device-selector")
|
|
12417
|
+
], DictationDeviceSelector);
|
|
12418
|
+
|
|
12419
|
+
// dist/styles/keybinding-selector.js
|
|
12420
|
+
var KeybindingSelectorStyles = [
|
|
12421
|
+
LabelStyles,
|
|
12422
|
+
i`
|
|
12423
|
+
:host {
|
|
12424
|
+
display: block;
|
|
11846
12425
|
}
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
12426
|
+
.keybinding-selector-wrapper {
|
|
12427
|
+
display: flex;
|
|
12428
|
+
align-items: center;
|
|
12429
|
+
gap: 12px;
|
|
12430
|
+
padding: var(--card-padding, 4px) 8px;
|
|
12431
|
+
background: var(--card-background, light-dark(#fff, #333));
|
|
12432
|
+
border: 1px solid var(--card-border-color, light-dark(#ddd, #555));
|
|
12433
|
+
border-radius: var(--card-inner-border-radius, 6px);
|
|
12434
|
+
overflow: hidden;
|
|
12435
|
+
}
|
|
12436
|
+
.keybinding-selector-wrapper:focus-within {
|
|
12437
|
+
border-color: var(--action-accent-background, light-dark(#007bff, #0056b3));
|
|
12438
|
+
outline: 2px solid var(--action-accent-background, light-dark(#007bff, #0056b3));
|
|
12439
|
+
}
|
|
12440
|
+
.keybinding-selector-input {
|
|
12441
|
+
flex: 1;
|
|
12442
|
+
min-width: 0;
|
|
12443
|
+
border: none;
|
|
12444
|
+
background: transparent;
|
|
12445
|
+
font-size: 14px;
|
|
12446
|
+
line-height: 24px;
|
|
12447
|
+
color: var(--component-text-color, light-dark(#333, #eee));
|
|
12448
|
+
outline: none;
|
|
12449
|
+
padding: 0;
|
|
12450
|
+
cursor: text;
|
|
12451
|
+
}
|
|
12452
|
+
.keybinding-selector-input::placeholder {
|
|
12453
|
+
opacity: 0.6;
|
|
12454
|
+
color: var(--component-text-color, light-dark(#333, #eee));
|
|
12455
|
+
}
|
|
12456
|
+
.keybinding-selector-input:disabled {
|
|
12457
|
+
cursor: not-allowed;
|
|
12458
|
+
opacity: 0.5;
|
|
12459
|
+
}
|
|
12460
|
+
.keybinding-key {
|
|
12461
|
+
display: flex;
|
|
12462
|
+
align-items: center;
|
|
12463
|
+
justify-content: center;
|
|
12464
|
+
padding: 0 0.5rem;
|
|
12465
|
+
height: 24px;
|
|
12466
|
+
background: var(--card-background, light-dark(#fff, #333));
|
|
12467
|
+
border: 1px solid var(--card-border-color, light-dark(#ddd, #555));
|
|
12468
|
+
border-radius: var(--card-inner-border-radius, 6px);
|
|
12469
|
+
box-shadow: var(--card-box-shadow, 0 2px 5px rgba(0, 0, 0, 0.1));
|
|
12470
|
+
font-size: 16px;
|
|
12471
|
+
line-height: 28px;
|
|
12472
|
+
color: var(--component-text-color, light-dark(#333, #eee));
|
|
12473
|
+
opacity: 0.6;
|
|
12474
|
+
text-align: center;
|
|
12475
|
+
flex-shrink: 0;
|
|
12476
|
+
}
|
|
12477
|
+
.keybinding-help {
|
|
12478
|
+
font-size: 12px;
|
|
12479
|
+
line-height: 20px;
|
|
12480
|
+
color: var(--component-text-color, light-dark(#333, #eee));
|
|
12481
|
+
opacity: 0.6;
|
|
12482
|
+
margin: 0;
|
|
12483
|
+
letter-spacing: 0.01px;
|
|
12484
|
+
padding-top: 8px;
|
|
12485
|
+
}
|
|
12486
|
+
`
|
|
12487
|
+
];
|
|
12488
|
+
var keybinding_selector_default = KeybindingSelectorStyles;
|
|
11853
12489
|
|
|
11854
|
-
// dist/components/
|
|
12490
|
+
// dist/components/keybinding-selector.js
|
|
11855
12491
|
var __decorate6 = function(decorators, target, key, desc) {
|
|
11856
12492
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
11857
12493
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
11858
12494
|
else for (var i7 = decorators.length - 1; i7 >= 0; i7--) if (d3 = decorators[i7]) r7 = (c6 < 3 ? d3(r7) : c6 > 3 ? d3(target, key, r7) : d3(target, key)) || r7;
|
|
11859
12495
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
11860
12496
|
};
|
|
11861
|
-
var
|
|
12497
|
+
var __classPrivateFieldGet9 = function(receiver, state, kind, f5) {
|
|
12498
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
12499
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
12500
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
12501
|
+
};
|
|
12502
|
+
var _DictationKeybindingSelector_instances;
|
|
12503
|
+
var _DictationKeybindingSelector_handleKeybindingInputFocus;
|
|
12504
|
+
var _DictationKeybindingSelector_handleKeybindingInputBlur;
|
|
12505
|
+
var _DictationKeybindingSelector_handleKeybindingKeyDown;
|
|
12506
|
+
var DictationKeybindingSelector = class DictationKeybindingSelector2 extends i4 {
|
|
11862
12507
|
constructor() {
|
|
11863
12508
|
super(...arguments);
|
|
12509
|
+
_DictationKeybindingSelector_instances.add(this);
|
|
11864
12510
|
this.disabled = false;
|
|
11865
|
-
this.
|
|
12511
|
+
this._isCapturingKeybinding = false;
|
|
11866
12512
|
}
|
|
11867
|
-
|
|
11868
|
-
return
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
|
|
11879
|
-
|
|
11880
|
-
|
|
12513
|
+
render() {
|
|
12514
|
+
return x`
|
|
12515
|
+
<div>
|
|
12516
|
+
<label>Keybinding</label>
|
|
12517
|
+
<div class="keybinding-selector-wrapper">
|
|
12518
|
+
<div class="keybinding-key">${this._keybinding}</div>
|
|
12519
|
+
<input
|
|
12520
|
+
type="text"
|
|
12521
|
+
class="keybinding-selector-input"
|
|
12522
|
+
.value=""
|
|
12523
|
+
placeholder="Click and press a key..."
|
|
12524
|
+
readonly
|
|
12525
|
+
@focusin=${__classPrivateFieldGet9(this, _DictationKeybindingSelector_instances, "m", _DictationKeybindingSelector_handleKeybindingInputFocus)}
|
|
12526
|
+
@focusout=${__classPrivateFieldGet9(this, _DictationKeybindingSelector_instances, "m", _DictationKeybindingSelector_handleKeybindingInputBlur)}
|
|
12527
|
+
@keydown=${__classPrivateFieldGet9(this, _DictationKeybindingSelector_instances, "m", _DictationKeybindingSelector_handleKeybindingKeyDown)}
|
|
12528
|
+
?disabled=${this.disabled}
|
|
12529
|
+
/>
|
|
12530
|
+
</div>
|
|
12531
|
+
<p class="keybinding-help">
|
|
12532
|
+
Press ${this._keybinding} to start/stop recording
|
|
12533
|
+
</p>
|
|
12534
|
+
</div>
|
|
12535
|
+
`;
|
|
11881
12536
|
}
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
12537
|
+
};
|
|
12538
|
+
_DictationKeybindingSelector_instances = /* @__PURE__ */ new WeakSet();
|
|
12539
|
+
_DictationKeybindingSelector_handleKeybindingInputFocus = function _DictationKeybindingSelector_handleKeybindingInputFocus2() {
|
|
12540
|
+
this._isCapturingKeybinding = true;
|
|
12541
|
+
};
|
|
12542
|
+
_DictationKeybindingSelector_handleKeybindingInputBlur = function _DictationKeybindingSelector_handleKeybindingInputBlur2() {
|
|
12543
|
+
this._isCapturingKeybinding = false;
|
|
12544
|
+
};
|
|
12545
|
+
_DictationKeybindingSelector_handleKeybindingKeyDown = function _DictationKeybindingSelector_handleKeybindingKeyDown2(event) {
|
|
12546
|
+
if (!this._isCapturingKeybinding) {
|
|
12547
|
+
return;
|
|
11890
12548
|
}
|
|
11891
|
-
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
12549
|
+
event.preventDefault();
|
|
12550
|
+
event.stopPropagation();
|
|
12551
|
+
this.dispatchEvent(keybindingChangedEvent(event.key, event.code));
|
|
12552
|
+
};
|
|
12553
|
+
DictationKeybindingSelector.styles = keybinding_selector_default;
|
|
12554
|
+
__decorate6([
|
|
12555
|
+
c5({ context: keybindingContext, subscribe: true }),
|
|
12556
|
+
r5()
|
|
12557
|
+
], DictationKeybindingSelector.prototype, "_keybinding", void 0);
|
|
12558
|
+
__decorate6([
|
|
12559
|
+
n4({ type: Boolean })
|
|
12560
|
+
], DictationKeybindingSelector.prototype, "disabled", void 0);
|
|
12561
|
+
__decorate6([
|
|
12562
|
+
r5()
|
|
12563
|
+
], DictationKeybindingSelector.prototype, "_isCapturingKeybinding", void 0);
|
|
12564
|
+
DictationKeybindingSelector = __decorate6([
|
|
12565
|
+
t3("dictation-keybinding-selector")
|
|
12566
|
+
], DictationKeybindingSelector);
|
|
12567
|
+
|
|
12568
|
+
// dist/components/language-selector.js
|
|
12569
|
+
var __decorate7 = function(decorators, target, key, desc) {
|
|
12570
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
12571
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
12572
|
+
else for (var i7 = decorators.length - 1; i7 >= 0; i7--) if (d3 = decorators[i7]) r7 = (c6 < 3 ? d3(r7) : c6 > 3 ? d3(target, key, r7) : d3(target, key)) || r7;
|
|
12573
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
12574
|
+
};
|
|
12575
|
+
var __classPrivateFieldGet10 = function(receiver, state, kind, f5) {
|
|
12576
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
12577
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
12578
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
12579
|
+
};
|
|
12580
|
+
var _DictationLanguageSelector_instances;
|
|
12581
|
+
var _DictationLanguageSelector_handleSelectLanguage;
|
|
12582
|
+
var DictationLanguageSelector = class DictationLanguageSelector2 extends i4 {
|
|
12583
|
+
constructor() {
|
|
12584
|
+
super(...arguments);
|
|
12585
|
+
_DictationLanguageSelector_instances.add(this);
|
|
12586
|
+
this.disabled = false;
|
|
11895
12587
|
}
|
|
11896
12588
|
render() {
|
|
11897
12589
|
return x`
|
|
@@ -11902,7 +12594,7 @@ var LanguageSelector = class LanguageSelector2 extends i4 {
|
|
|
11902
12594
|
<select
|
|
11903
12595
|
id="language-select"
|
|
11904
12596
|
aria-labelledby="language-select-label"
|
|
11905
|
-
@change=${this
|
|
12597
|
+
@change=${__classPrivateFieldGet10(this, _DictationLanguageSelector_instances, "m", _DictationLanguageSelector_handleSelectLanguage)}
|
|
11906
12598
|
?disabled=${this.disabled || !this._languages || this._languages.length === 0}
|
|
11907
12599
|
>
|
|
11908
12600
|
${this._languages?.map((language) => x`
|
|
@@ -11918,50 +12610,176 @@ var LanguageSelector = class LanguageSelector2 extends i4 {
|
|
|
11918
12610
|
`;
|
|
11919
12611
|
}
|
|
11920
12612
|
};
|
|
11921
|
-
|
|
11922
|
-
|
|
12613
|
+
_DictationLanguageSelector_instances = /* @__PURE__ */ new WeakSet();
|
|
12614
|
+
_DictationLanguageSelector_handleSelectLanguage = function _DictationLanguageSelector_handleSelectLanguage2(e10) {
|
|
12615
|
+
const language = e10.target.value;
|
|
12616
|
+
this.dispatchEvent(languagesChangedEvent(this._languages || [], language));
|
|
12617
|
+
this.dispatchEvent(languageChangedEvent(language));
|
|
12618
|
+
};
|
|
12619
|
+
DictationLanguageSelector.styles = select_default;
|
|
12620
|
+
__decorate7([
|
|
11923
12621
|
c5({ context: languagesContext, subscribe: true }),
|
|
11924
12622
|
r5()
|
|
11925
|
-
],
|
|
11926
|
-
|
|
12623
|
+
], DictationLanguageSelector.prototype, "_languages", void 0);
|
|
12624
|
+
__decorate7([
|
|
11927
12625
|
c5({ context: dictationConfigContext, subscribe: true }),
|
|
11928
12626
|
r5()
|
|
11929
|
-
],
|
|
11930
|
-
|
|
12627
|
+
], DictationLanguageSelector.prototype, "_dictationConfig", void 0);
|
|
12628
|
+
__decorate7([
|
|
11931
12629
|
n4({ type: Boolean })
|
|
11932
|
-
],
|
|
11933
|
-
|
|
11934
|
-
|
|
12630
|
+
], DictationLanguageSelector.prototype, "disabled", void 0);
|
|
12631
|
+
DictationLanguageSelector = __decorate7([
|
|
12632
|
+
t3("dictation-language-selector")
|
|
12633
|
+
], DictationLanguageSelector);
|
|
12634
|
+
|
|
12635
|
+
// dist/styles/mode-selector.js
|
|
12636
|
+
var ModeSelectorStyles = [
|
|
12637
|
+
LabelStyles,
|
|
12638
|
+
i`
|
|
12639
|
+
:host {
|
|
12640
|
+
display: block;
|
|
12641
|
+
}
|
|
12642
|
+
.mode-selector-tabs {
|
|
12643
|
+
display: flex;
|
|
12644
|
+
background: var(--muted-background, light-dark(#fafafa, #2a2a2a));
|
|
12645
|
+
border: 1px solid var(--card-border-color, light-dark(#ddd, #555));
|
|
12646
|
+
border-radius: var(--card-inner-border-radius, 6px);
|
|
12647
|
+
padding: 0;
|
|
12648
|
+
overflow: hidden;
|
|
12649
|
+
align-items: center;
|
|
12650
|
+
justify-content: center;
|
|
12651
|
+
text-wrap: nowrap;
|
|
12652
|
+
gap: 2px;
|
|
12653
|
+
}
|
|
12654
|
+
.mode-selector-tab {
|
|
12655
|
+
flex: 1;
|
|
12656
|
+
padding: 4px 8px;
|
|
12657
|
+
border: 1px solid transparent;
|
|
12658
|
+
background: transparent;
|
|
12659
|
+
font-size: 14px;
|
|
12660
|
+
font-weight: 500;
|
|
12661
|
+
line-height: 24px;
|
|
12662
|
+
color: var(--component-text-color, light-dark(#333, #eee));
|
|
12663
|
+
opacity: 0.6;
|
|
12664
|
+
cursor: pointer;
|
|
12665
|
+
transition: all 0.2s;
|
|
12666
|
+
height: 32px;
|
|
12667
|
+
display: flex;
|
|
12668
|
+
align-items: center;
|
|
12669
|
+
justify-content: center;
|
|
12670
|
+
border-radius: var(--card-inner-border-radius, 6px);
|
|
12671
|
+
margin: -1px;
|
|
12672
|
+
}
|
|
12673
|
+
.mode-selector-tab:hover:not(:disabled) {
|
|
12674
|
+
opacity: 1;
|
|
12675
|
+
}
|
|
12676
|
+
.mode-selector-tab.active {
|
|
12677
|
+
background: var(--card-background, light-dark(#fff, #333));
|
|
12678
|
+
border-color: var(--card-border-color, light-dark(#ddd, #555));
|
|
12679
|
+
box-shadow: var(--card-box-shadow, 0 2px 5px rgba(0, 0, 0, 0.1));
|
|
12680
|
+
opacity: 1;
|
|
12681
|
+
}
|
|
12682
|
+
.mode-selector-tab:disabled {
|
|
12683
|
+
opacity: 0.5;
|
|
12684
|
+
cursor: not-allowed;
|
|
12685
|
+
}
|
|
12686
|
+
`
|
|
12687
|
+
];
|
|
12688
|
+
var mode_selector_default = ModeSelectorStyles;
|
|
12689
|
+
|
|
12690
|
+
// dist/components/mode-selector.js
|
|
12691
|
+
var __decorate8 = function(decorators, target, key, desc) {
|
|
12692
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
12693
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
12694
|
+
else for (var i7 = decorators.length - 1; i7 >= 0; i7--) if (d3 = decorators[i7]) r7 = (c6 < 3 ? d3(r7) : c6 > 3 ? d3(target, key, r7) : d3(target, key)) || r7;
|
|
12695
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
12696
|
+
};
|
|
12697
|
+
var __classPrivateFieldGet11 = function(receiver, state, kind, f5) {
|
|
12698
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
12699
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
12700
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
12701
|
+
};
|
|
12702
|
+
var _DictationModeSelector_instances;
|
|
12703
|
+
var _DictationModeSelector_handleModeChange;
|
|
12704
|
+
var DictationModeSelector = class DictationModeSelector2 extends i4 {
|
|
12705
|
+
constructor() {
|
|
12706
|
+
super(...arguments);
|
|
12707
|
+
_DictationModeSelector_instances.add(this);
|
|
12708
|
+
this._mode = "toggle-to-talk";
|
|
12709
|
+
this.disabled = false;
|
|
12710
|
+
}
|
|
12711
|
+
render() {
|
|
12712
|
+
return x`
|
|
12713
|
+
<div>
|
|
12714
|
+
<label>Dictation Mode</label>
|
|
12715
|
+
<div class="mode-selector-tabs">
|
|
12716
|
+
<button
|
|
12717
|
+
class=${e6({
|
|
12718
|
+
active: this._mode === "toggle-to-talk",
|
|
12719
|
+
"mode-selector-tab": true
|
|
12720
|
+
})}
|
|
12721
|
+
@click=${() => __classPrivateFieldGet11(this, _DictationModeSelector_instances, "m", _DictationModeSelector_handleModeChange).call(this, "toggle-to-talk")}
|
|
12722
|
+
?disabled=${this.disabled}
|
|
12723
|
+
>
|
|
12724
|
+
Toggle-to-Talk
|
|
12725
|
+
</button>
|
|
12726
|
+
<button
|
|
12727
|
+
class=${e6({
|
|
12728
|
+
active: this._mode === "push-to-talk",
|
|
12729
|
+
"mode-selector-tab": true
|
|
12730
|
+
})}
|
|
12731
|
+
@click=${() => __classPrivateFieldGet11(this, _DictationModeSelector_instances, "m", _DictationModeSelector_handleModeChange).call(this, "push-to-talk")}
|
|
12732
|
+
?disabled=${this.disabled}
|
|
12733
|
+
>
|
|
12734
|
+
Push-to-Talk
|
|
12735
|
+
</button>
|
|
12736
|
+
</div>
|
|
12737
|
+
</div>
|
|
12738
|
+
`;
|
|
12739
|
+
}
|
|
12740
|
+
};
|
|
12741
|
+
_DictationModeSelector_instances = /* @__PURE__ */ new WeakSet();
|
|
12742
|
+
_DictationModeSelector_handleModeChange = function _DictationModeSelector_handleModeChange2(mode) {
|
|
12743
|
+
this.dispatchEvent(modeChangedEvent(mode));
|
|
12744
|
+
};
|
|
12745
|
+
DictationModeSelector.styles = mode_selector_default;
|
|
12746
|
+
__decorate8([
|
|
12747
|
+
c5({ context: modeContext, subscribe: true }),
|
|
11935
12748
|
r5()
|
|
11936
|
-
],
|
|
11937
|
-
|
|
11938
|
-
|
|
11939
|
-
],
|
|
12749
|
+
], DictationModeSelector.prototype, "_mode", void 0);
|
|
12750
|
+
__decorate8([
|
|
12751
|
+
n4({ type: Boolean })
|
|
12752
|
+
], DictationModeSelector.prototype, "disabled", void 0);
|
|
12753
|
+
DictationModeSelector = __decorate8([
|
|
12754
|
+
t3("dictation-mode-selector")
|
|
12755
|
+
], DictationModeSelector);
|
|
11940
12756
|
|
|
11941
12757
|
// dist/components/settings-menu.js
|
|
11942
|
-
var
|
|
12758
|
+
var __decorate9 = function(decorators, target, key, desc) {
|
|
11943
12759
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
11944
12760
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
11945
12761
|
else for (var i7 = decorators.length - 1; i7 >= 0; i7--) if (d3 = decorators[i7]) r7 = (c6 < 3 ? d3(r7) : c6 > 3 ? d3(target, key, r7) : d3(target, key)) || r7;
|
|
11946
12762
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
11947
12763
|
};
|
|
11948
|
-
var
|
|
12764
|
+
var DictationSettingsMenu = class DictationSettingsMenu2 extends i4 {
|
|
11949
12765
|
constructor() {
|
|
11950
12766
|
super(...arguments);
|
|
11951
12767
|
this._recordingState = "stopped";
|
|
11952
12768
|
this.settingsEnabled = ["device", "language"];
|
|
11953
12769
|
}
|
|
11954
12770
|
render() {
|
|
11955
|
-
if (
|
|
12771
|
+
if (this.settingsEnabled?.length === 0) {
|
|
11956
12772
|
return E;
|
|
11957
12773
|
}
|
|
11958
12774
|
const isRecording = this._recordingState === "recording";
|
|
11959
12775
|
const showDeviceSelector = this.settingsEnabled.includes("device");
|
|
11960
12776
|
const showLanguageSelector = this.settingsEnabled.includes("language");
|
|
12777
|
+
const showModeSelector = this.settingsEnabled.includes("mode");
|
|
12778
|
+
const showKeybinding = this.settingsEnabled.includes("keybinding");
|
|
11961
12779
|
return x`
|
|
11962
12780
|
<div class="mic-selector">
|
|
11963
12781
|
<button id="settings-popover-button" popovertarget="settings-popover">
|
|
11964
|
-
<icon-settings
|
|
12782
|
+
<icon-settings />
|
|
11965
12783
|
</button>
|
|
11966
12784
|
<div id="settings-popover" popover>
|
|
11967
12785
|
<div class="settings-wrapper">
|
|
@@ -11970,53 +12788,71 @@ var SettingsMenu = class SettingsMenu2 extends i4 {
|
|
|
11970
12788
|
Recording is in progress. Stop recording to change settings.
|
|
11971
12789
|
</div>
|
|
11972
12790
|
` : E}
|
|
11973
|
-
${showDeviceSelector ? x`<device-selector
|
|
12791
|
+
${showDeviceSelector ? x`<dictation-device-selector
|
|
11974
12792
|
?disabled=${isRecording}
|
|
11975
|
-
|
|
11976
|
-
${showLanguageSelector ? x`<language-selector
|
|
12793
|
+
/>` : E}
|
|
12794
|
+
${showLanguageSelector ? x`<dictation-language-selector
|
|
11977
12795
|
?disabled=${isRecording}
|
|
11978
|
-
|
|
12796
|
+
/>` : E}
|
|
12797
|
+
${showModeSelector || showKeybinding ? x`
|
|
12798
|
+
<div class="settings-group">
|
|
12799
|
+
${showModeSelector ? x`<dictation-mode-selector
|
|
12800
|
+
?disabled=${isRecording}
|
|
12801
|
+
/>` : E}
|
|
12802
|
+
${showKeybinding ? x`<dictation-keybinding-selector
|
|
12803
|
+
?disabled=${isRecording}
|
|
12804
|
+
/>` : E}
|
|
12805
|
+
</div>
|
|
12806
|
+
` : E}
|
|
11979
12807
|
</div>
|
|
11980
12808
|
</div>
|
|
11981
12809
|
</div>
|
|
11982
12810
|
`;
|
|
11983
12811
|
}
|
|
11984
12812
|
};
|
|
11985
|
-
|
|
12813
|
+
DictationSettingsMenu.styles = [
|
|
11986
12814
|
settings_menu_default,
|
|
11987
12815
|
buttons_default,
|
|
11988
12816
|
callout_default
|
|
11989
12817
|
];
|
|
11990
|
-
|
|
12818
|
+
__decorate9([
|
|
11991
12819
|
c5({ context: recordingStateContext, subscribe: true }),
|
|
11992
12820
|
r5()
|
|
11993
|
-
],
|
|
11994
|
-
|
|
12821
|
+
], DictationSettingsMenu.prototype, "_recordingState", void 0);
|
|
12822
|
+
__decorate9([
|
|
11995
12823
|
n4({
|
|
11996
12824
|
converter: commaSeparatedConverter,
|
|
11997
12825
|
type: Array
|
|
11998
12826
|
})
|
|
11999
|
-
],
|
|
12000
|
-
|
|
12001
|
-
t3("settings-menu")
|
|
12002
|
-
],
|
|
12827
|
+
], DictationSettingsMenu.prototype, "settingsEnabled", void 0);
|
|
12828
|
+
DictationSettingsMenu = __decorate9([
|
|
12829
|
+
t3("dictation-settings-menu")
|
|
12830
|
+
], DictationSettingsMenu);
|
|
12003
12831
|
|
|
12004
12832
|
// dist/components/corti-dictation.js
|
|
12005
|
-
var
|
|
12833
|
+
var __decorate10 = function(decorators, target, key, desc) {
|
|
12006
12834
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
12007
12835
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
12008
12836
|
else for (var i7 = decorators.length - 1; i7 >= 0; i7--) if (d3 = decorators[i7]) r7 = (c6 < 3 ? d3(r7) : c6 > 3 ? d3(target, key, r7) : d3(target, key)) || r7;
|
|
12009
12837
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
12010
12838
|
};
|
|
12839
|
+
var __classPrivateFieldGet12 = function(receiver, state, kind, f5) {
|
|
12840
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
12841
|
+
if (typeof state === "function" ? receiver !== state || !f5 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
12842
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
12843
|
+
};
|
|
12844
|
+
var _CortiDictation_recordingButtonRef;
|
|
12845
|
+
var _CortiDictation_contextProviderRef;
|
|
12011
12846
|
var CortiDictation = class CortiDictation2 extends i4 {
|
|
12012
12847
|
constructor() {
|
|
12013
12848
|
super(...arguments);
|
|
12014
|
-
this
|
|
12015
|
-
this
|
|
12849
|
+
_CortiDictation_recordingButtonRef.set(this, e7());
|
|
12850
|
+
_CortiDictation_contextProviderRef.set(this, e7());
|
|
12016
12851
|
this.settingsEnabled = ["device", "language"];
|
|
12017
12852
|
this.allowButtonFocus = false;
|
|
12018
12853
|
this.debug_displayAudio = false;
|
|
12019
12854
|
this._dictationConfig = DEFAULT_DICTATION_CONFIG;
|
|
12855
|
+
this._mode = "toggle-to-talk";
|
|
12020
12856
|
}
|
|
12021
12857
|
/**
|
|
12022
12858
|
* List of all language codes available for use with the Web Component.
|
|
@@ -12026,7 +12862,7 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
12026
12862
|
this._languagesSupported = value;
|
|
12027
12863
|
}
|
|
12028
12864
|
get languagesSupported() {
|
|
12029
|
-
return this.
|
|
12865
|
+
return __classPrivateFieldGet12(this, _CortiDictation_contextProviderRef, "f").value?.languages || this._languagesSupported || [];
|
|
12030
12866
|
}
|
|
12031
12867
|
/**
|
|
12032
12868
|
* Configuration settings for dictation
|
|
@@ -12035,7 +12871,7 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
12035
12871
|
this._dictationConfig = value;
|
|
12036
12872
|
}
|
|
12037
12873
|
get dictationConfig() {
|
|
12038
|
-
return this.
|
|
12874
|
+
return __classPrivateFieldGet12(this, _CortiDictation_contextProviderRef, "f").value?.dictationConfig || this._dictationConfig;
|
|
12039
12875
|
}
|
|
12040
12876
|
/**
|
|
12041
12877
|
* List of available recording devices
|
|
@@ -12044,7 +12880,7 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
12044
12880
|
this._devices = value;
|
|
12045
12881
|
}
|
|
12046
12882
|
get devices() {
|
|
12047
|
-
return this.
|
|
12883
|
+
return __classPrivateFieldGet12(this, _CortiDictation_contextProviderRef, "f").value?.devices || this._devices || [];
|
|
12048
12884
|
}
|
|
12049
12885
|
/**
|
|
12050
12886
|
* The selected device used for recording (MediaDeviceInfo).
|
|
@@ -12053,13 +12889,33 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
12053
12889
|
this._selectedDevice = value;
|
|
12054
12890
|
}
|
|
12055
12891
|
get selectedDevice() {
|
|
12056
|
-
return this.
|
|
12892
|
+
return __classPrivateFieldGet12(this, _CortiDictation_contextProviderRef, "f").value?.selectedDevice || this._selectedDevice;
|
|
12057
12893
|
}
|
|
12058
12894
|
/**
|
|
12059
12895
|
* Current state of recording (stopped, recording, initializing and stopping, ).
|
|
12060
12896
|
*/
|
|
12061
12897
|
get recordingState() {
|
|
12062
|
-
return this.
|
|
12898
|
+
return __classPrivateFieldGet12(this, _CortiDictation_contextProviderRef, "f").value?.recordingState || "stopped";
|
|
12899
|
+
}
|
|
12900
|
+
/**
|
|
12901
|
+
* Dictation mode: "toggle-to-talk" or "push-to-talk"
|
|
12902
|
+
*/
|
|
12903
|
+
set mode(value) {
|
|
12904
|
+
this._mode = value;
|
|
12905
|
+
}
|
|
12906
|
+
get mode() {
|
|
12907
|
+
return __classPrivateFieldGet12(this, _CortiDictation_contextProviderRef, "f").value?.mode || this._mode || "toggle-to-talk";
|
|
12908
|
+
}
|
|
12909
|
+
/**
|
|
12910
|
+
* Keybinding for keyboard shortcut. Single key only (e.g., "`", "k", "meta", "ctrl").
|
|
12911
|
+
* Combinations with "+" are not supported.
|
|
12912
|
+
* Defaults to "`" if keybinding is in settingsEnabled, otherwise undefined
|
|
12913
|
+
*/
|
|
12914
|
+
set keybinding(value) {
|
|
12915
|
+
this._keybinding = value;
|
|
12916
|
+
}
|
|
12917
|
+
get keybinding() {
|
|
12918
|
+
return __classPrivateFieldGet12(this, _CortiDictation_contextProviderRef, "f").value?.keybinding || this._keybinding;
|
|
12063
12919
|
}
|
|
12064
12920
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
12065
12921
|
// Public methods
|
|
@@ -12071,7 +12927,7 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
12071
12927
|
*/
|
|
12072
12928
|
setAccessToken(token) {
|
|
12073
12929
|
this.accessToken = token;
|
|
12074
|
-
return this.
|
|
12930
|
+
return __classPrivateFieldGet12(this, _CortiDictation_contextProviderRef, "f").value?.setAccessToken(token) ?? {
|
|
12075
12931
|
accessToken: token,
|
|
12076
12932
|
environment: void 0,
|
|
12077
12933
|
tenant: void 0
|
|
@@ -12084,7 +12940,7 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
12084
12940
|
*/
|
|
12085
12941
|
async setAuthConfig(config) {
|
|
12086
12942
|
this.authConfig = config;
|
|
12087
|
-
return this.
|
|
12943
|
+
return __classPrivateFieldGet12(this, _CortiDictation_contextProviderRef, "f").value?.setAuthConfig(config) ?? {
|
|
12088
12944
|
accessToken: void 0,
|
|
12089
12945
|
environment: void 0,
|
|
12090
12946
|
tenant: void 0
|
|
@@ -12094,19 +12950,19 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
12094
12950
|
* Starts a recording.
|
|
12095
12951
|
*/
|
|
12096
12952
|
startRecording() {
|
|
12097
|
-
this.
|
|
12953
|
+
__classPrivateFieldGet12(this, _CortiDictation_recordingButtonRef, "f").value?.startRecording();
|
|
12098
12954
|
}
|
|
12099
12955
|
/**
|
|
12100
12956
|
* Stops a recording.
|
|
12101
12957
|
*/
|
|
12102
12958
|
stopRecording() {
|
|
12103
|
-
this.
|
|
12959
|
+
__classPrivateFieldGet12(this, _CortiDictation_recordingButtonRef, "f").value?.stopRecording();
|
|
12104
12960
|
}
|
|
12105
12961
|
/**
|
|
12106
12962
|
* Starts or stops recording. Convenience layer on top of the start/stop methods.
|
|
12107
12963
|
*/
|
|
12108
12964
|
toggleRecording() {
|
|
12109
|
-
this.
|
|
12965
|
+
__classPrivateFieldGet12(this, _CortiDictation_recordingButtonRef, "f").value?.toggleRecording();
|
|
12110
12966
|
}
|
|
12111
12967
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
12112
12968
|
// Render
|
|
@@ -12114,8 +12970,8 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
12114
12970
|
render() {
|
|
12115
12971
|
const isHidden = !this.accessToken && !this.authConfig && !this.socketUrl && !this.socketProxy;
|
|
12116
12972
|
return x`
|
|
12117
|
-
<dictation-
|
|
12118
|
-
${n6(this
|
|
12973
|
+
<dictation-root
|
|
12974
|
+
${n6(__classPrivateFieldGet12(this, _CortiDictation_contextProviderRef, "f"))}
|
|
12119
12975
|
class=${e6({ hidden: isHidden })}
|
|
12120
12976
|
.accessToken=${this.accessToken}
|
|
12121
12977
|
.authConfig=${this.authConfig}
|
|
@@ -12126,73 +12982,91 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
12126
12982
|
.devices=${this._devices}
|
|
12127
12983
|
.selectedDevice=${this._selectedDevice}
|
|
12128
12984
|
.debug_displayAudio=${this.debug_displayAudio}
|
|
12985
|
+
.mode=${this._mode}
|
|
12986
|
+
.keybinding=${this._keybinding}
|
|
12129
12987
|
>
|
|
12130
|
-
<recording-button
|
|
12131
|
-
${n6(this
|
|
12132
|
-
|
|
12133
|
-
></recording-button>
|
|
12134
|
-
|
|
12135
|
-
|
|
12988
|
+
<dictation-recording-button
|
|
12989
|
+
${n6(__classPrivateFieldGet12(this, _CortiDictation_recordingButtonRef, "f"))}
|
|
12990
|
+
?allowButtonFocus=${this.allowButtonFocus}
|
|
12991
|
+
></dictation-recording-button>
|
|
12992
|
+
${this.settingsEnabled?.length > 0 ? x`<dictation-settings-menu
|
|
12993
|
+
.settingsEnabled=${this.settingsEnabled}
|
|
12994
|
+
></dictation-settings-menu>` : E}
|
|
12995
|
+
</dictation-root>
|
|
12136
12996
|
`;
|
|
12137
12997
|
}
|
|
12138
12998
|
};
|
|
12999
|
+
_CortiDictation_recordingButtonRef = /* @__PURE__ */ new WeakMap();
|
|
13000
|
+
_CortiDictation_contextProviderRef = /* @__PURE__ */ new WeakMap();
|
|
12139
13001
|
CortiDictation.styles = i`
|
|
12140
13002
|
.hidden {
|
|
12141
13003
|
display: none;
|
|
12142
13004
|
}
|
|
12143
13005
|
`;
|
|
12144
|
-
|
|
13006
|
+
__decorate10([
|
|
12145
13007
|
n4({ type: String })
|
|
12146
13008
|
], CortiDictation.prototype, "accessToken", void 0);
|
|
12147
|
-
|
|
13009
|
+
__decorate10([
|
|
12148
13010
|
n4({ attribute: false, type: Object })
|
|
12149
13011
|
], CortiDictation.prototype, "authConfig", void 0);
|
|
12150
|
-
|
|
13012
|
+
__decorate10([
|
|
12151
13013
|
n4({ type: String })
|
|
12152
13014
|
], CortiDictation.prototype, "socketUrl", void 0);
|
|
12153
|
-
|
|
13015
|
+
__decorate10([
|
|
12154
13016
|
n4({ attribute: false, type: Object })
|
|
12155
13017
|
], CortiDictation.prototype, "socketProxy", void 0);
|
|
12156
|
-
|
|
13018
|
+
__decorate10([
|
|
12157
13019
|
n4({
|
|
12158
13020
|
converter: commaSeparatedConverter,
|
|
12159
13021
|
type: Array
|
|
12160
13022
|
})
|
|
12161
13023
|
], CortiDictation.prototype, "languagesSupported", null);
|
|
12162
|
-
|
|
13024
|
+
__decorate10([
|
|
12163
13025
|
r5()
|
|
12164
13026
|
], CortiDictation.prototype, "_languagesSupported", void 0);
|
|
12165
|
-
|
|
13027
|
+
__decorate10([
|
|
12166
13028
|
n4({
|
|
12167
13029
|
converter: commaSeparatedConverter,
|
|
12168
13030
|
type: Array
|
|
12169
13031
|
})
|
|
12170
13032
|
], CortiDictation.prototype, "settingsEnabled", void 0);
|
|
12171
|
-
|
|
13033
|
+
__decorate10([
|
|
12172
13034
|
n4({ type: Boolean })
|
|
12173
13035
|
], CortiDictation.prototype, "allowButtonFocus", void 0);
|
|
12174
|
-
|
|
13036
|
+
__decorate10([
|
|
12175
13037
|
n4({ attribute: "debug-display-audio", type: Boolean })
|
|
12176
13038
|
], CortiDictation.prototype, "debug_displayAudio", void 0);
|
|
12177
|
-
|
|
13039
|
+
__decorate10([
|
|
12178
13040
|
n4({ attribute: false, type: Object })
|
|
12179
13041
|
], CortiDictation.prototype, "dictationConfig", null);
|
|
12180
|
-
|
|
13042
|
+
__decorate10([
|
|
12181
13043
|
r5()
|
|
12182
13044
|
], CortiDictation.prototype, "_dictationConfig", void 0);
|
|
12183
|
-
|
|
13045
|
+
__decorate10([
|
|
12184
13046
|
n4({ attribute: false, type: Array })
|
|
12185
13047
|
], CortiDictation.prototype, "devices", null);
|
|
12186
|
-
|
|
13048
|
+
__decorate10([
|
|
12187
13049
|
r5()
|
|
12188
13050
|
], CortiDictation.prototype, "_devices", void 0);
|
|
12189
|
-
|
|
13051
|
+
__decorate10([
|
|
12190
13052
|
n4({ attribute: false, type: Object })
|
|
12191
13053
|
], CortiDictation.prototype, "selectedDevice", null);
|
|
12192
|
-
|
|
13054
|
+
__decorate10([
|
|
12193
13055
|
r5()
|
|
12194
13056
|
], CortiDictation.prototype, "_selectedDevice", void 0);
|
|
12195
|
-
|
|
13057
|
+
__decorate10([
|
|
13058
|
+
n4({ type: String })
|
|
13059
|
+
], CortiDictation.prototype, "mode", null);
|
|
13060
|
+
__decorate10([
|
|
13061
|
+
r5()
|
|
13062
|
+
], CortiDictation.prototype, "_mode", void 0);
|
|
13063
|
+
__decorate10([
|
|
13064
|
+
n4({ type: String })
|
|
13065
|
+
], CortiDictation.prototype, "keybinding", null);
|
|
13066
|
+
__decorate10([
|
|
13067
|
+
r5()
|
|
13068
|
+
], CortiDictation.prototype, "_keybinding", void 0);
|
|
13069
|
+
CortiDictation = __decorate10([
|
|
12196
13070
|
t3("corti-dictation")
|
|
12197
13071
|
], CortiDictation);
|
|
12198
13072
|
|
|
@@ -12200,29 +13074,37 @@ CortiDictation = __decorate8([
|
|
|
12200
13074
|
if (!customElements.get("corti-dictation")) {
|
|
12201
13075
|
customElements.define("corti-dictation", CortiDictation);
|
|
12202
13076
|
}
|
|
12203
|
-
if (!customElements.get("recording-button")) {
|
|
12204
|
-
customElements.define("recording-button",
|
|
13077
|
+
if (!customElements.get("dictation-recording-button")) {
|
|
13078
|
+
customElements.define("dictation-recording-button", DictationRecordingButton);
|
|
13079
|
+
}
|
|
13080
|
+
if (!customElements.get("dictation-device-selector")) {
|
|
13081
|
+
customElements.define("dictation-device-selector", DictationDeviceSelector);
|
|
13082
|
+
}
|
|
13083
|
+
if (!customElements.get("dictation-language-selector")) {
|
|
13084
|
+
customElements.define("dictation-language-selector", DictationLanguageSelector);
|
|
12205
13085
|
}
|
|
12206
|
-
if (!customElements.get("
|
|
12207
|
-
customElements.define("
|
|
13086
|
+
if (!customElements.get("dictation-mode-selector")) {
|
|
13087
|
+
customElements.define("dictation-mode-selector", DictationModeSelector);
|
|
12208
13088
|
}
|
|
12209
|
-
if (!customElements.get("
|
|
12210
|
-
customElements.define("
|
|
13089
|
+
if (!customElements.get("dictation-keybinding-selector")) {
|
|
13090
|
+
customElements.define("dictation-keybinding-selector", DictationKeybindingSelector);
|
|
12211
13091
|
}
|
|
12212
|
-
if (!customElements.get("settings-menu")) {
|
|
12213
|
-
customElements.define("settings-menu",
|
|
13092
|
+
if (!customElements.get("dictation-settings-menu")) {
|
|
13093
|
+
customElements.define("dictation-settings-menu", DictationSettingsMenu);
|
|
12214
13094
|
}
|
|
12215
|
-
if (!customElements.get("dictation-
|
|
12216
|
-
customElements.define("dictation-
|
|
13095
|
+
if (!customElements.get("dictation-root")) {
|
|
13096
|
+
customElements.define("dictation-root", DictationRoot);
|
|
12217
13097
|
}
|
|
12218
13098
|
var index_default = CortiDictation;
|
|
12219
13099
|
export {
|
|
12220
13100
|
CortiDictation,
|
|
12221
|
-
|
|
12222
|
-
|
|
12223
|
-
|
|
12224
|
-
|
|
12225
|
-
|
|
13101
|
+
DictationDeviceSelector,
|
|
13102
|
+
DictationKeybindingSelector,
|
|
13103
|
+
DictationLanguageSelector,
|
|
13104
|
+
DictationModeSelector,
|
|
13105
|
+
DictationRecordingButton,
|
|
13106
|
+
DictationRoot,
|
|
13107
|
+
DictationSettingsMenu,
|
|
12226
13108
|
index_default as default
|
|
12227
13109
|
};
|
|
12228
13110
|
/*! Bundled license information:
|