@corti/dictation-web 0.6.0 → 0.7.0-ambient
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/dist/bundle.js +1838 -1455
- package/dist/components/ambient-recording-button.d.ts +16 -0
- package/dist/components/ambient-recording-button.js +68 -0
- package/dist/components/ambient-recording-button.js.map +1 -0
- package/dist/components/corti-ambient.d.ts +27 -0
- package/dist/components/corti-ambient.js +97 -0
- package/dist/components/corti-ambient.js.map +1 -0
- package/dist/components/corti-dictation.d.ts +9 -109
- package/dist/components/corti-dictation.js +12 -187
- package/dist/components/corti-dictation.js.map +1 -1
- package/dist/components/corti-root.d.ts +121 -0
- package/dist/components/corti-root.js +196 -0
- package/dist/components/corti-root.js.map +1 -0
- package/dist/components/device-selector.js +1 -1
- package/dist/components/device-selector.js.map +1 -1
- package/dist/components/dictation-recording-button.d.ts +13 -0
- package/dist/components/dictation-recording-button.js +30 -0
- package/dist/components/dictation-recording-button.js.map +1 -0
- package/dist/components/keybinding-input.js +1 -1
- package/dist/components/keybinding-input.js.map +1 -1
- package/dist/components/keybinding-selector.js +1 -1
- package/dist/components/keybinding-selector.js.map +1 -1
- package/dist/components/language-selector.js +2 -1
- package/dist/components/language-selector.js.map +1 -1
- package/dist/components/{recording-button.d.ts → recording-button-base.d.ts} +7 -9
- package/dist/components/recording-button-base.js +321 -0
- package/dist/components/recording-button-base.js.map +1 -0
- package/dist/components/settings-menu.js +1 -1
- package/dist/components/settings-menu.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +9 -0
- package/dist/constants.js.map +1 -1
- package/dist/contexts/ambient-context.d.ts +18 -0
- package/dist/contexts/ambient-context.js +48 -0
- package/dist/contexts/ambient-context.js.map +1 -0
- package/dist/contexts/dictation-context.d.ts +3 -92
- package/dist/contexts/dictation-context.js +5 -257
- package/dist/contexts/dictation-context.js.map +1 -1
- package/dist/contexts/mixins/auth-context.d.ts +32 -0
- package/dist/contexts/mixins/auth-context.js +116 -0
- package/dist/contexts/mixins/auth-context.js.map +1 -0
- package/dist/contexts/mixins/devices-context.d.ts +14 -0
- package/dist/contexts/mixins/devices-context.js +58 -0
- package/dist/contexts/mixins/devices-context.js.map +1 -0
- package/dist/contexts/mixins/keybindings-context.d.ts +13 -0
- package/dist/contexts/mixins/keybindings-context.js +62 -0
- package/dist/contexts/mixins/keybindings-context.js.map +1 -0
- package/dist/contexts/mixins/languages-context.d.ts +11 -0
- package/dist/contexts/mixins/languages-context.js +54 -0
- package/dist/contexts/mixins/languages-context.js.map +1 -0
- package/dist/contexts/mixins/proxy-context.d.ts +14 -0
- package/dist/contexts/mixins/proxy-context.js +24 -0
- package/dist/contexts/mixins/proxy-context.js.map +1 -0
- package/dist/contexts/mixins/recording-state-context.d.ts +13 -0
- package/dist/contexts/mixins/recording-state-context.js +30 -0
- package/dist/contexts/mixins/recording-state-context.js.map +1 -0
- package/dist/contexts/mixins/types.d.ts +5 -0
- package/dist/contexts/mixins/types.js +2 -0
- package/dist/contexts/mixins/types.js.map +1 -0
- package/dist/contexts/root-context.d.ts +8 -0
- package/dist/contexts/root-context.js +34 -0
- package/dist/contexts/root-context.js.map +1 -0
- package/dist/controllers/ambient-controller.d.ts +16 -0
- package/dist/controllers/ambient-controller.js +24 -0
- package/dist/controllers/ambient-controller.js.map +1 -0
- package/dist/controllers/dictation-controller.d.ts +8 -31
- package/dist/controllers/dictation-controller.js +17 -283
- package/dist/controllers/dictation-controller.js.map +1 -1
- package/dist/controllers/languages-controller.js +0 -4
- package/dist/controllers/languages-controller.js.map +1 -1
- package/dist/controllers/socket-controller.d.ts +51 -0
- package/dist/controllers/socket-controller.js +281 -0
- package/dist/controllers/socket-controller.js.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/devices.d.ts +12 -8
- package/dist/utils/devices.js +39 -28
- package/dist/utils/devices.js.map +1 -1
- package/dist/utils/events.d.ts +5 -3
- package/dist/utils/events.js +7 -0
- package/dist/utils/events.js.map +1 -1
- package/dist/utils/keybinding.d.ts +2 -1
- package/dist/utils/keybinding.js +12 -6
- package/dist/utils/keybinding.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/recording-button.js +0 -331
- package/dist/components/recording-button.js.map +0 -1
package/dist/bundle.js
CHANGED
|
@@ -46,20 +46,169 @@ var require_browser = __commonJS({
|
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
+
// node_modules/@lit/context/lib/context-request-event.js
|
|
50
|
+
var s = class extends Event {
|
|
51
|
+
constructor(s8, t7, e10, o10) {
|
|
52
|
+
super("context-request", { bubbles: true, composed: true }), this.context = s8, this.contextTarget = t7, this.callback = e10, this.subscribe = o10 ?? false;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// node_modules/@lit/context/lib/create-context.js
|
|
57
|
+
function n(n8) {
|
|
58
|
+
return n8;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// node_modules/@lit/context/lib/controllers/context-consumer.js
|
|
62
|
+
var s2 = class {
|
|
63
|
+
constructor(t7, s8, i7, h5) {
|
|
64
|
+
if (this.subscribe = false, this.provided = false, this.value = void 0, this.t = (t8, s9) => {
|
|
65
|
+
this.unsubscribe && (this.unsubscribe !== s9 && (this.provided = false, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = t8, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = true, this.callback && this.callback(t8, s9)), this.unsubscribe = s9;
|
|
66
|
+
}, this.host = t7, void 0 !== s8.context) {
|
|
67
|
+
const t8 = s8;
|
|
68
|
+
this.context = t8.context, this.callback = t8.callback, this.subscribe = t8.subscribe ?? false;
|
|
69
|
+
} else this.context = s8, this.callback = i7, this.subscribe = h5 ?? false;
|
|
70
|
+
this.host.addController(this);
|
|
71
|
+
}
|
|
72
|
+
hostConnected() {
|
|
73
|
+
this.dispatchRequest();
|
|
74
|
+
}
|
|
75
|
+
hostDisconnected() {
|
|
76
|
+
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
|
|
77
|
+
}
|
|
78
|
+
dispatchRequest() {
|
|
79
|
+
this.host.dispatchEvent(new s(this.context, this.host, this.t, this.subscribe));
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// node_modules/@lit/context/lib/value-notifier.js
|
|
84
|
+
var s3 = class {
|
|
85
|
+
get value() {
|
|
86
|
+
return this.o;
|
|
87
|
+
}
|
|
88
|
+
set value(s8) {
|
|
89
|
+
this.setValue(s8);
|
|
90
|
+
}
|
|
91
|
+
setValue(s8, t7 = false) {
|
|
92
|
+
const i7 = t7 || !Object.is(s8, this.o);
|
|
93
|
+
this.o = s8, i7 && this.updateObservers();
|
|
94
|
+
}
|
|
95
|
+
constructor(s8) {
|
|
96
|
+
this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
|
|
97
|
+
for (const [s9, { disposer: t7 }] of this.subscriptions) s9(this.o, t7);
|
|
98
|
+
}, void 0 !== s8 && (this.value = s8);
|
|
99
|
+
}
|
|
100
|
+
addCallback(s8, t7, i7) {
|
|
101
|
+
if (!i7) return void s8(this.value);
|
|
102
|
+
this.subscriptions.has(s8) || this.subscriptions.set(s8, { disposer: () => {
|
|
103
|
+
this.subscriptions.delete(s8);
|
|
104
|
+
}, consumerHost: t7 });
|
|
105
|
+
const { disposer: h5 } = this.subscriptions.get(s8);
|
|
106
|
+
s8(this.value, h5);
|
|
107
|
+
}
|
|
108
|
+
clearCallbacks() {
|
|
109
|
+
this.subscriptions.clear();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// node_modules/@lit/context/lib/controllers/context-provider.js
|
|
114
|
+
var e = class extends Event {
|
|
115
|
+
constructor(t7, s8) {
|
|
116
|
+
super("context-provider", { bubbles: true, composed: true }), this.context = t7, this.contextTarget = s8;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
var i = class extends s3 {
|
|
120
|
+
constructor(s8, e10, i7) {
|
|
121
|
+
super(void 0 !== e10.context ? e10.initialValue : i7), this.onContextRequest = (t7) => {
|
|
122
|
+
if (t7.context !== this.context) return;
|
|
123
|
+
const s9 = t7.contextTarget ?? t7.composedPath()[0];
|
|
124
|
+
s9 !== this.host && (t7.stopPropagation(), this.addCallback(t7.callback, s9, t7.subscribe));
|
|
125
|
+
}, this.onProviderRequest = (s9) => {
|
|
126
|
+
if (s9.context !== this.context) return;
|
|
127
|
+
if ((s9.contextTarget ?? s9.composedPath()[0]) === this.host) return;
|
|
128
|
+
const e11 = /* @__PURE__ */ new Set();
|
|
129
|
+
for (const [s10, { consumerHost: i8 }] of this.subscriptions) e11.has(s10) || (e11.add(s10), i8.dispatchEvent(new s(this.context, i8, s10, true)));
|
|
130
|
+
s9.stopPropagation();
|
|
131
|
+
}, this.host = s8, void 0 !== e10.context ? this.context = e10.context : this.context = e10, this.attachListeners(), this.host.addController?.(this);
|
|
132
|
+
}
|
|
133
|
+
attachListeners() {
|
|
134
|
+
this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
|
|
135
|
+
}
|
|
136
|
+
hostConnected() {
|
|
137
|
+
this.host.dispatchEvent(new e(this.context, this.host));
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// node_modules/@lit/context/lib/decorators/provide.js
|
|
142
|
+
function e2({ context: e10 }) {
|
|
143
|
+
return (n8, i7) => {
|
|
144
|
+
const r7 = /* @__PURE__ */ new WeakMap();
|
|
145
|
+
if ("object" == typeof i7) return { get() {
|
|
146
|
+
return n8.get.call(this);
|
|
147
|
+
}, set(t7) {
|
|
148
|
+
return r7.get(this).setValue(t7), n8.set.call(this, t7);
|
|
149
|
+
}, init(n9) {
|
|
150
|
+
return r7.set(this, new i(this, { context: e10, initialValue: n9 })), n9;
|
|
151
|
+
} };
|
|
152
|
+
{
|
|
153
|
+
n8.constructor.addInitializer((n9) => {
|
|
154
|
+
r7.set(n9, new i(n9, { context: e10 }));
|
|
155
|
+
});
|
|
156
|
+
const o10 = Object.getOwnPropertyDescriptor(n8, i7);
|
|
157
|
+
let s8;
|
|
158
|
+
if (void 0 === o10) {
|
|
159
|
+
const t7 = /* @__PURE__ */ new WeakMap();
|
|
160
|
+
s8 = { get() {
|
|
161
|
+
return t7.get(this);
|
|
162
|
+
}, set(e11) {
|
|
163
|
+
r7.get(this).setValue(e11), t7.set(this, e11);
|
|
164
|
+
}, configurable: true, enumerable: true };
|
|
165
|
+
} else {
|
|
166
|
+
const t7 = o10.set;
|
|
167
|
+
s8 = { ...o10, set(e11) {
|
|
168
|
+
r7.get(this).setValue(e11), t7?.call(this, e11);
|
|
169
|
+
} };
|
|
170
|
+
}
|
|
171
|
+
return void Object.defineProperty(n8, i7, s8);
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// node_modules/@lit/context/lib/decorators/consume.js
|
|
177
|
+
function c({ context: c6, subscribe: e10 }) {
|
|
178
|
+
return (o10, n8) => {
|
|
179
|
+
"object" == typeof n8 ? n8.addInitializer(function() {
|
|
180
|
+
new s2(this, { context: c6, callback: (t7) => {
|
|
181
|
+
o10.set.call(this, t7);
|
|
182
|
+
}, subscribe: e10 });
|
|
183
|
+
}) : o10.constructor.addInitializer((o11) => {
|
|
184
|
+
new s2(o11, { context: c6, callback: (t7) => {
|
|
185
|
+
o11[n8] = t7;
|
|
186
|
+
}, subscribe: e10 });
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// node_modules/@lit/reactive-element/decorators/custom-element.js
|
|
192
|
+
var t2 = (t7) => (e10, o10) => {
|
|
193
|
+
void 0 !== o10 ? o10.addInitializer(() => {
|
|
194
|
+
customElements.define(t7, e10);
|
|
195
|
+
}) : customElements.define(t7, e10);
|
|
196
|
+
};
|
|
197
|
+
|
|
49
198
|
// node_modules/@lit/reactive-element/css-tag.js
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
199
|
+
var t3 = globalThis;
|
|
200
|
+
var e3 = t3.ShadowRoot && (void 0 === t3.ShadyCSS || t3.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
|
|
201
|
+
var s4 = Symbol();
|
|
53
202
|
var o = /* @__PURE__ */ new WeakMap();
|
|
54
|
-
var
|
|
203
|
+
var n2 = class {
|
|
55
204
|
constructor(t7, e10, o10) {
|
|
56
|
-
if (this._$cssResult$ = true, o10 !==
|
|
205
|
+
if (this._$cssResult$ = true, o10 !== s4) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
57
206
|
this.cssText = t7, this.t = e10;
|
|
58
207
|
}
|
|
59
208
|
get styleSheet() {
|
|
60
209
|
let t7 = this.o;
|
|
61
210
|
const s8 = this.t;
|
|
62
|
-
if (
|
|
211
|
+
if (e3 && void 0 === t7) {
|
|
63
212
|
const e10 = void 0 !== s8 && 1 === s8.length;
|
|
64
213
|
e10 && (t7 = o.get(s8)), void 0 === t7 && ((this.o = t7 = new CSSStyleSheet()).replaceSync(this.cssText), e10 && o.set(s8, t7));
|
|
65
214
|
}
|
|
@@ -69,33 +218,33 @@ var n = class {
|
|
|
69
218
|
return this.cssText;
|
|
70
219
|
}
|
|
71
220
|
};
|
|
72
|
-
var r = (t7) => new
|
|
73
|
-
var
|
|
221
|
+
var r = (t7) => new n2("string" == typeof t7 ? t7 : t7 + "", void 0, s4);
|
|
222
|
+
var i2 = (t7, ...e10) => {
|
|
74
223
|
const o10 = 1 === t7.length ? t7[0] : e10.reduce((e11, s8, o11) => e11 + ((t8) => {
|
|
75
224
|
if (true === t8._$cssResult$) return t8.cssText;
|
|
76
225
|
if ("number" == typeof t8) return t8;
|
|
77
226
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + t8 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
78
227
|
})(s8) + t7[o11 + 1], t7[0]);
|
|
79
|
-
return new
|
|
228
|
+
return new n2(o10, t7, s4);
|
|
80
229
|
};
|
|
81
230
|
var S = (s8, o10) => {
|
|
82
|
-
if (
|
|
231
|
+
if (e3) s8.adoptedStyleSheets = o10.map((t7) => t7 instanceof CSSStyleSheet ? t7 : t7.styleSheet);
|
|
83
232
|
else for (const e10 of o10) {
|
|
84
|
-
const o11 = document.createElement("style"), n8 =
|
|
233
|
+
const o11 = document.createElement("style"), n8 = t3.litNonce;
|
|
85
234
|
void 0 !== n8 && o11.setAttribute("nonce", n8), o11.textContent = e10.cssText, s8.appendChild(o11);
|
|
86
235
|
}
|
|
87
236
|
};
|
|
88
|
-
var
|
|
237
|
+
var c2 = e3 ? (t7) => t7 : (t7) => t7 instanceof CSSStyleSheet ? ((t8) => {
|
|
89
238
|
let e10 = "";
|
|
90
239
|
for (const s8 of t8.cssRules) e10 += s8.cssText;
|
|
91
240
|
return r(e10);
|
|
92
241
|
})(t7) : t7;
|
|
93
242
|
|
|
94
243
|
// node_modules/@lit/reactive-element/reactive-element.js
|
|
95
|
-
var { is:
|
|
244
|
+
var { is: i3, defineProperty: e4, getOwnPropertyDescriptor: h, getOwnPropertyNames: r2, getOwnPropertySymbols: o2, getPrototypeOf: n3 } = Object;
|
|
96
245
|
var a = globalThis;
|
|
97
|
-
var
|
|
98
|
-
var l =
|
|
246
|
+
var c3 = a.trustedTypes;
|
|
247
|
+
var l = c3 ? c3.emptyScript : "";
|
|
99
248
|
var p = a.reactiveElementPolyfillSupport;
|
|
100
249
|
var d = (t7, s8) => t7;
|
|
101
250
|
var u = { toAttribute(t7, s8) {
|
|
@@ -127,7 +276,7 @@ var u = { toAttribute(t7, s8) {
|
|
|
127
276
|
}
|
|
128
277
|
return i7;
|
|
129
278
|
} };
|
|
130
|
-
var f = (t7, s8) => !
|
|
279
|
+
var f = (t7, s8) => !i3(t7, s8);
|
|
131
280
|
var b = { attribute: true, type: String, converter: u, reflect: false, useDefault: false, hasChanged: f };
|
|
132
281
|
Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
133
282
|
var y = class extends HTMLElement {
|
|
@@ -140,7 +289,7 @@ var y = class extends HTMLElement {
|
|
|
140
289
|
static createProperty(t7, s8 = b) {
|
|
141
290
|
if (s8.state && (s8.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t7) && ((s8 = Object.create(s8)).wrapped = true), this.elementProperties.set(t7, s8), !s8.noAccessor) {
|
|
142
291
|
const i7 = Symbol(), h5 = this.getPropertyDescriptor(t7, i7, s8);
|
|
143
|
-
void 0 !== h5 &&
|
|
292
|
+
void 0 !== h5 && e4(this.prototype, t7, h5);
|
|
144
293
|
}
|
|
145
294
|
}
|
|
146
295
|
static getPropertyDescriptor(t7, s8, i7) {
|
|
@@ -159,7 +308,7 @@ var y = class extends HTMLElement {
|
|
|
159
308
|
}
|
|
160
309
|
static _$Ei() {
|
|
161
310
|
if (this.hasOwnProperty(d("elementProperties"))) return;
|
|
162
|
-
const t7 =
|
|
311
|
+
const t7 = n3(this);
|
|
163
312
|
t7.finalize(), void 0 !== t7.l && (this.l = [...t7.l]), this.elementProperties = new Map(t7.elementProperties);
|
|
164
313
|
}
|
|
165
314
|
static finalize() {
|
|
@@ -184,8 +333,8 @@ var y = class extends HTMLElement {
|
|
|
184
333
|
const i7 = [];
|
|
185
334
|
if (Array.isArray(s8)) {
|
|
186
335
|
const e10 = new Set(s8.flat(1 / 0).reverse());
|
|
187
|
-
for (const s9 of e10) i7.unshift(
|
|
188
|
-
} else void 0 !== s8 && i7.push(
|
|
336
|
+
for (const s9 of e10) i7.unshift(c2(s9));
|
|
337
|
+
} else void 0 !== s8 && i7.push(c2(s8));
|
|
189
338
|
return i7;
|
|
190
339
|
}
|
|
191
340
|
static _$Eu(t7, s8) {
|
|
@@ -313,17 +462,100 @@ var y = class extends HTMLElement {
|
|
|
313
462
|
};
|
|
314
463
|
y.elementStyles = [], y.shadowRootOptions = { mode: "open" }, y[d("elementProperties")] = /* @__PURE__ */ new Map(), y[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: y }), (a.reactiveElementVersions ??= []).push("2.1.1");
|
|
315
464
|
|
|
465
|
+
// node_modules/@lit/reactive-element/decorators/property.js
|
|
466
|
+
var o3 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f };
|
|
467
|
+
var r3 = (t7 = o3, e10, r7) => {
|
|
468
|
+
const { kind: n8, metadata: i7 } = r7;
|
|
469
|
+
let s8 = globalThis.litPropertyMetadata.get(i7);
|
|
470
|
+
if (void 0 === s8 && globalThis.litPropertyMetadata.set(i7, s8 = /* @__PURE__ */ new Map()), "setter" === n8 && ((t7 = Object.create(t7)).wrapped = true), s8.set(r7.name, t7), "accessor" === n8) {
|
|
471
|
+
const { name: o10 } = r7;
|
|
472
|
+
return { set(r8) {
|
|
473
|
+
const n9 = e10.get.call(this);
|
|
474
|
+
e10.set.call(this, r8), this.requestUpdate(o10, n9, t7);
|
|
475
|
+
}, init(e11) {
|
|
476
|
+
return void 0 !== e11 && this.C(o10, void 0, t7, e11), e11;
|
|
477
|
+
} };
|
|
478
|
+
}
|
|
479
|
+
if ("setter" === n8) {
|
|
480
|
+
const { name: o10 } = r7;
|
|
481
|
+
return function(r8) {
|
|
482
|
+
const n9 = this[o10];
|
|
483
|
+
e10.call(this, r8), this.requestUpdate(o10, n9, t7);
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
throw Error("Unsupported decorator location: " + n8);
|
|
487
|
+
};
|
|
488
|
+
function n4(t7) {
|
|
489
|
+
return (e10, o10) => "object" == typeof o10 ? r3(t7, e10, o10) : ((t8, e11, o11) => {
|
|
490
|
+
const r7 = e11.hasOwnProperty(o11);
|
|
491
|
+
return e11.constructor.createProperty(o11, t8), r7 ? Object.getOwnPropertyDescriptor(e11, o11) : void 0;
|
|
492
|
+
})(t7, e10, o10);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// node_modules/@lit/reactive-element/decorators/state.js
|
|
496
|
+
function r4(r7) {
|
|
497
|
+
return n4({ ...r7, state: true, attribute: false });
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
// dist/constants.js
|
|
501
|
+
var LANGUAGES_SUPPORTED_EU = [
|
|
502
|
+
"da",
|
|
503
|
+
"de",
|
|
504
|
+
"de-CH",
|
|
505
|
+
"en",
|
|
506
|
+
"en-GB",
|
|
507
|
+
"es",
|
|
508
|
+
"fr",
|
|
509
|
+
"hu",
|
|
510
|
+
"it",
|
|
511
|
+
"nl",
|
|
512
|
+
"no",
|
|
513
|
+
"pt",
|
|
514
|
+
"sv",
|
|
515
|
+
"gsw-CH"
|
|
516
|
+
].sort();
|
|
517
|
+
var LANGUAGES_SUPPORTED_US = [
|
|
518
|
+
"da",
|
|
519
|
+
"de",
|
|
520
|
+
"de-CH",
|
|
521
|
+
"en",
|
|
522
|
+
"en-GB",
|
|
523
|
+
"es",
|
|
524
|
+
"fr",
|
|
525
|
+
"hu",
|
|
526
|
+
"it",
|
|
527
|
+
"nl",
|
|
528
|
+
"no",
|
|
529
|
+
"pt",
|
|
530
|
+
"sv"
|
|
531
|
+
].sort();
|
|
532
|
+
var DEFAULT_DICTATION_CONFIG = {
|
|
533
|
+
automaticPunctuation: false,
|
|
534
|
+
primaryLanguage: "en",
|
|
535
|
+
spokenPunctuation: true
|
|
536
|
+
};
|
|
537
|
+
var DEFAULT_STREAM_CONFIG = {
|
|
538
|
+
mode: { outputLocale: "en", type: "facts" },
|
|
539
|
+
transcription: {
|
|
540
|
+
isDiarization: true,
|
|
541
|
+
isMultichannel: false,
|
|
542
|
+
participants: [],
|
|
543
|
+
primaryLanguage: "en"
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
var AUDIO_CHUNK_INTERVAL_MS = 250;
|
|
547
|
+
|
|
316
548
|
// node_modules/lit-html/lit-html.js
|
|
317
|
-
var
|
|
318
|
-
var
|
|
319
|
-
var
|
|
320
|
-
var
|
|
549
|
+
var t4 = globalThis;
|
|
550
|
+
var i4 = t4.trustedTypes;
|
|
551
|
+
var s5 = i4 ? i4.createPolicy("lit-html", { createHTML: (t7) => t7 }) : void 0;
|
|
552
|
+
var e6 = "$lit$";
|
|
321
553
|
var h2 = `lit$${Math.random().toFixed(9).slice(2)}$`;
|
|
322
|
-
var
|
|
323
|
-
var
|
|
324
|
-
var
|
|
325
|
-
var l2 = () =>
|
|
326
|
-
var
|
|
554
|
+
var o4 = "?" + h2;
|
|
555
|
+
var n5 = `<${o4}>`;
|
|
556
|
+
var r5 = document;
|
|
557
|
+
var l2 = () => r5.createComment("");
|
|
558
|
+
var c4 = (t7) => null === t7 || "object" != typeof t7 && "function" != typeof t7;
|
|
327
559
|
var a2 = Array.isArray;
|
|
328
560
|
var u2 = (t7) => a2(t7) || "function" == typeof t7?.[Symbol.iterator];
|
|
329
561
|
var d2 = "[ \n\f\r]";
|
|
@@ -342,10 +574,10 @@ var w = y2(3);
|
|
|
342
574
|
var T = Symbol.for("lit-noChange");
|
|
343
575
|
var E = Symbol.for("lit-nothing");
|
|
344
576
|
var A = /* @__PURE__ */ new WeakMap();
|
|
345
|
-
var C =
|
|
577
|
+
var C = r5.createTreeWalker(r5, 129);
|
|
346
578
|
function P(t7, i7) {
|
|
347
579
|
if (!a2(t7) || !t7.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
348
|
-
return void 0 !==
|
|
580
|
+
return void 0 !== s5 ? s5.createHTML(i7) : i7;
|
|
349
581
|
}
|
|
350
582
|
var V = (t7, i7) => {
|
|
351
583
|
const s8 = t7.length - 1, o10 = [];
|
|
@@ -355,7 +587,7 @@ var V = (t7, i7) => {
|
|
|
355
587
|
let a3, u3, d3 = -1, y3 = 0;
|
|
356
588
|
for (; y3 < s9.length && (c6.lastIndex = y3, u3 = c6.exec(s9), null !== u3); ) y3 = c6.lastIndex, c6 === f2 ? "!--" === u3[1] ? c6 = v : void 0 !== u3[1] ? c6 = _ : void 0 !== u3[2] ? ($.test(u3[2]) && (r7 = RegExp("</" + u3[2], "g")), c6 = m) : void 0 !== u3[3] && (c6 = m) : c6 === m ? ">" === u3[0] ? (c6 = r7 ?? f2, d3 = -1) : void 0 === u3[1] ? d3 = -2 : (d3 = c6.lastIndex - u3[2].length, a3 = u3[1], c6 = void 0 === u3[3] ? m : '"' === u3[3] ? g : p2) : c6 === g || c6 === p2 ? c6 = m : c6 === v || c6 === _ ? c6 = f2 : (c6 = m, r7 = void 0);
|
|
357
589
|
const x2 = c6 === m && t7[i8 + 1].startsWith("/>") ? " " : "";
|
|
358
|
-
l3 += c6 === f2 ? s9 +
|
|
590
|
+
l3 += c6 === f2 ? s9 + n5 : d3 >= 0 ? (o10.push(a3), s9.slice(0, d3) + e6 + s9.slice(d3) + h2 + x2) : s9 + h2 + (-2 === d3 ? i8 : x2);
|
|
359
591
|
}
|
|
360
592
|
return [P(t7, l3 + (t7[s8] || "<?>") + (2 === i7 ? "</svg>" : 3 === i7 ? "</math>" : "")), o10];
|
|
361
593
|
};
|
|
@@ -371,19 +603,19 @@ var N = class _N {
|
|
|
371
603
|
}
|
|
372
604
|
for (; null !== (r7 = C.nextNode()) && d3.length < u3; ) {
|
|
373
605
|
if (1 === r7.nodeType) {
|
|
374
|
-
if (r7.hasAttributes()) for (const t8 of r7.getAttributeNames()) if (t8.endsWith(
|
|
606
|
+
if (r7.hasAttributes()) for (const t8 of r7.getAttributeNames()) if (t8.endsWith(e6)) {
|
|
375
607
|
const i7 = v2[a3++], s9 = r7.getAttribute(t8).split(h2), e10 = /([.?@])?(.*)/.exec(i7);
|
|
376
608
|
d3.push({ type: 1, index: c6, name: e10[2], strings: s9, ctor: "." === e10[1] ? H : "?" === e10[1] ? I : "@" === e10[1] ? L : k }), r7.removeAttribute(t8);
|
|
377
609
|
} else t8.startsWith(h2) && (d3.push({ type: 6, index: c6 }), r7.removeAttribute(t8));
|
|
378
610
|
if ($.test(r7.tagName)) {
|
|
379
611
|
const t8 = r7.textContent.split(h2), s9 = t8.length - 1;
|
|
380
612
|
if (s9 > 0) {
|
|
381
|
-
r7.textContent =
|
|
613
|
+
r7.textContent = i4 ? i4.emptyScript : "";
|
|
382
614
|
for (let i7 = 0; i7 < s9; i7++) r7.append(t8[i7], l2()), C.nextNode(), d3.push({ type: 2, index: ++c6 });
|
|
383
615
|
r7.append(t8[s9], l2());
|
|
384
616
|
}
|
|
385
617
|
}
|
|
386
|
-
} else if (8 === r7.nodeType) if (r7.data ===
|
|
618
|
+
} else if (8 === r7.nodeType) if (r7.data === o4) d3.push({ type: 2, index: c6 });
|
|
387
619
|
else {
|
|
388
620
|
let t8 = -1;
|
|
389
621
|
for (; -1 !== (t8 = r7.data.indexOf(h2, t8 + 1)); ) d3.push({ type: 7, index: c6 }), t8 += h2.length - 1;
|
|
@@ -392,14 +624,14 @@ var N = class _N {
|
|
|
392
624
|
}
|
|
393
625
|
}
|
|
394
626
|
static createElement(t7, i7) {
|
|
395
|
-
const s8 =
|
|
627
|
+
const s8 = r5.createElement("template");
|
|
396
628
|
return s8.innerHTML = t7, s8;
|
|
397
629
|
}
|
|
398
630
|
};
|
|
399
631
|
function S2(t7, i7, s8 = t7, e10) {
|
|
400
632
|
if (i7 === T) return i7;
|
|
401
633
|
let h5 = void 0 !== e10 ? s8._$Co?.[e10] : s8._$Cl;
|
|
402
|
-
const o10 =
|
|
634
|
+
const o10 = c4(i7) ? void 0 : i7._$litDirective$;
|
|
403
635
|
return h5?.constructor !== o10 && (h5?._$AO?.(false), void 0 === o10 ? h5 = void 0 : (h5 = new o10(t7), h5._$AT(t7, s8, e10)), void 0 !== e10 ? (s8._$Co ??= [])[e10] = h5 : s8._$Cl = h5), void 0 !== h5 && (i7 = S2(t7, h5._$AS(t7, i7.values), h5, e10)), i7;
|
|
404
636
|
}
|
|
405
637
|
var M = class {
|
|
@@ -413,7 +645,7 @@ var M = class {
|
|
|
413
645
|
return this._$AM._$AU;
|
|
414
646
|
}
|
|
415
647
|
u(t7) {
|
|
416
|
-
const { el: { content: i7 }, parts: s8 } = this._$AD, e10 = (t7?.creationScope ??
|
|
648
|
+
const { el: { content: i7 }, parts: s8 } = this._$AD, e10 = (t7?.creationScope ?? r5).importNode(i7, true);
|
|
417
649
|
C.currentNode = e10;
|
|
418
650
|
let h5 = C.nextNode(), o10 = 0, n8 = 0, l3 = s8[0];
|
|
419
651
|
for (; void 0 !== l3; ) {
|
|
@@ -423,7 +655,7 @@ var M = class {
|
|
|
423
655
|
}
|
|
424
656
|
o10 !== l3?.index && (h5 = C.nextNode(), o10++);
|
|
425
657
|
}
|
|
426
|
-
return C.currentNode =
|
|
658
|
+
return C.currentNode = r5, e10;
|
|
427
659
|
}
|
|
428
660
|
p(t7) {
|
|
429
661
|
let i7 = 0;
|
|
@@ -449,7 +681,7 @@ var R = class _R {
|
|
|
449
681
|
return this._$AB;
|
|
450
682
|
}
|
|
451
683
|
_$AI(t7, i7 = this) {
|
|
452
|
-
t7 = S2(this, t7, i7),
|
|
684
|
+
t7 = S2(this, t7, i7), c4(t7) ? t7 === E || null == t7 || "" === t7 ? (this._$AH !== E && this._$AR(), this._$AH = E) : t7 !== this._$AH && t7 !== T && this._(t7) : void 0 !== t7._$litType$ ? this.$(t7) : void 0 !== t7.nodeType ? this.T(t7) : u2(t7) ? this.k(t7) : this._(t7);
|
|
453
685
|
}
|
|
454
686
|
O(t7) {
|
|
455
687
|
return this._$AA.parentNode.insertBefore(t7, this._$AB);
|
|
@@ -458,7 +690,7 @@ var R = class _R {
|
|
|
458
690
|
this._$AH !== t7 && (this._$AR(), this._$AH = this.O(t7));
|
|
459
691
|
}
|
|
460
692
|
_(t7) {
|
|
461
|
-
this._$AH !== E &&
|
|
693
|
+
this._$AH !== E && c4(this._$AH) ? this._$AA.nextSibling.data = t7 : this.T(r5.createTextNode(t7)), this._$AH = t7;
|
|
462
694
|
}
|
|
463
695
|
$(t7) {
|
|
464
696
|
const { values: i7, _$litType$: s8 } = t7, e10 = "number" == typeof s8 ? this._$AC(t7) : (void 0 === s8.el && (s8.el = N.createElement(P(s8.h, s8.h[0]), this.options)), s8);
|
|
@@ -502,11 +734,11 @@ var k = class {
|
|
|
502
734
|
_$AI(t7, i7 = this, s8, e10) {
|
|
503
735
|
const h5 = this.strings;
|
|
504
736
|
let o10 = false;
|
|
505
|
-
if (void 0 === h5) t7 = S2(this, t7, i7, 0), o10 = !
|
|
737
|
+
if (void 0 === h5) t7 = S2(this, t7, i7, 0), o10 = !c4(t7) || t7 !== this._$AH && t7 !== T, o10 && (this._$AH = t7);
|
|
506
738
|
else {
|
|
507
739
|
const e11 = t7;
|
|
508
740
|
let n8, r7;
|
|
509
|
-
for (t7 = h5[0], n8 = 0; n8 < h5.length - 1; n8++) r7 = S2(this, e11[s8 + n8], i7, n8), r7 === T && (r7 = this._$AH[n8]), o10 ||= !
|
|
741
|
+
for (t7 = h5[0], n8 = 0; n8 < h5.length - 1; n8++) r7 = S2(this, e11[s8 + n8], i7, n8), r7 === T && (r7 = this._$AH[n8]), o10 ||= !c4(r7) || r7 !== this._$AH[n8], r7 === E ? t7 = E : t7 !== E && (t7 += (r7 ?? "") + h5[n8 + 1]), this._$AH[n8] = r7;
|
|
510
742
|
}
|
|
511
743
|
o10 && !e10 && this.j(t7);
|
|
512
744
|
}
|
|
@@ -554,9 +786,9 @@ var z = class {
|
|
|
554
786
|
S2(this, t7);
|
|
555
787
|
}
|
|
556
788
|
};
|
|
557
|
-
var Z = { M:
|
|
558
|
-
var j =
|
|
559
|
-
j?.(N, R), (
|
|
789
|
+
var Z = { M: e6, P: h2, A: o4, C: 1, L: V, R: M, D: u2, V: S2, I: R, H: k, N: I, U: L, B: H, F: z };
|
|
790
|
+
var j = t4.litHtmlPolyfillSupport;
|
|
791
|
+
j?.(N, R), (t4.litHtmlVersions ??= []).push("3.3.1");
|
|
560
792
|
var B = (t7, i7, s8) => {
|
|
561
793
|
const e10 = s8?.renderBefore ?? i7;
|
|
562
794
|
let h5 = e10._$litPart$;
|
|
@@ -568,8 +800,8 @@ var B = (t7, i7, s8) => {
|
|
|
568
800
|
};
|
|
569
801
|
|
|
570
802
|
// node_modules/lit-element/lit-element.js
|
|
571
|
-
var
|
|
572
|
-
var
|
|
803
|
+
var s6 = globalThis;
|
|
804
|
+
var i5 = class extends y {
|
|
573
805
|
constructor() {
|
|
574
806
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
575
807
|
}
|
|
@@ -591,407 +823,56 @@ var i4 = class extends y {
|
|
|
591
823
|
return T;
|
|
592
824
|
}
|
|
593
825
|
};
|
|
594
|
-
|
|
595
|
-
var
|
|
596
|
-
|
|
597
|
-
(
|
|
826
|
+
i5._$litElement$ = true, i5["finalized"] = true, s6.litElementHydrateSupport?.({ LitElement: i5 });
|
|
827
|
+
var o5 = s6.litElementPolyfillSupport;
|
|
828
|
+
o5?.({ LitElement: i5 });
|
|
829
|
+
(s6.litElementVersions ??= []).push("4.2.1");
|
|
598
830
|
|
|
599
|
-
//
|
|
600
|
-
var
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
}
|
|
604
|
-
};
|
|
831
|
+
// dist/styles/component-styles.js
|
|
832
|
+
var ComponentStyles = i2`
|
|
833
|
+
:host {
|
|
834
|
+
font-family: var(--component-font-family, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif);
|
|
835
|
+
}
|
|
605
836
|
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
} };
|
|
837
|
+
.wrapper {
|
|
838
|
+
background-color: var(--card-background, light-dark(#fff, #333));
|
|
839
|
+
border: 1px solid var(--card-border-color, light-dark(#ddd, #555));
|
|
840
|
+
border-radius: var(--card-border-radius, 8px);
|
|
841
|
+
box-shadow: var(--card-box-shadow, 0 2px 5px rgba(0, 0, 0, 0.1));
|
|
842
|
+
padding: var(--card-padding, 4px);
|
|
843
|
+
display: flex;
|
|
844
|
+
gap: 4px;
|
|
845
|
+
height: 46px;
|
|
846
|
+
width: fit-content;
|
|
847
|
+
box-sizing: border-box;
|
|
848
|
+
overflow: hidden;
|
|
619
849
|
}
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
850
|
+
`;
|
|
851
|
+
var LabelStyles = i2`
|
|
852
|
+
label {
|
|
853
|
+
display: block;
|
|
854
|
+
font-size: 0.8rem;
|
|
855
|
+
padding-bottom: 0.5rem;
|
|
856
|
+
font-weight: 500;
|
|
857
|
+
color: var(--component-text-color, light-dark(#333, #eee));
|
|
858
|
+
pointer-events: none;
|
|
626
859
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
function n4(t7) {
|
|
630
|
-
return (e10, o10) => "object" == typeof o10 ? r4(t7, e10, o10) : ((t8, e11, o11) => {
|
|
631
|
-
const r7 = e11.hasOwnProperty(o11);
|
|
632
|
-
return e11.constructor.createProperty(o11, t8), r7 ? Object.getOwnPropertyDescriptor(e11, o11) : void 0;
|
|
633
|
-
})(t7, e10, o10);
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
// node_modules/@lit/reactive-element/decorators/state.js
|
|
637
|
-
function r5(r7) {
|
|
638
|
-
return n4({ ...r7, state: true, attribute: false });
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
// node_modules/lit-html/directive.js
|
|
642
|
-
var t4 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
|
|
643
|
-
var e5 = (t7) => (...e10) => ({ _$litDirective$: t7, values: e10 });
|
|
644
|
-
var i5 = class {
|
|
645
|
-
constructor(t7) {
|
|
646
|
-
}
|
|
647
|
-
get _$AU() {
|
|
648
|
-
return this._$AM._$AU;
|
|
649
|
-
}
|
|
650
|
-
_$AT(t7, e10, i7) {
|
|
651
|
-
this._$Ct = t7, this._$AM = e10, this._$Ci = i7;
|
|
652
|
-
}
|
|
653
|
-
_$AS(t7, e10) {
|
|
654
|
-
return this.update(t7, e10);
|
|
655
|
-
}
|
|
656
|
-
update(t7, e10) {
|
|
657
|
-
return this.render(...e10);
|
|
658
|
-
}
|
|
659
|
-
};
|
|
660
|
-
|
|
661
|
-
// node_modules/lit-html/directives/class-map.js
|
|
662
|
-
var e6 = e5(class extends i5 {
|
|
663
|
-
constructor(t7) {
|
|
664
|
-
if (super(t7), t7.type !== t4.ATTRIBUTE || "class" !== t7.name || t7.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
665
|
-
}
|
|
666
|
-
render(t7) {
|
|
667
|
-
return " " + Object.keys(t7).filter((s8) => t7[s8]).join(" ") + " ";
|
|
668
|
-
}
|
|
669
|
-
update(s8, [i7]) {
|
|
670
|
-
if (void 0 === this.st) {
|
|
671
|
-
this.st = /* @__PURE__ */ new Set(), void 0 !== s8.strings && (this.nt = new Set(s8.strings.join(" ").split(/\s/).filter((t7) => "" !== t7)));
|
|
672
|
-
for (const t7 in i7) i7[t7] && !this.nt?.has(t7) && this.st.add(t7);
|
|
673
|
-
return this.render(i7);
|
|
674
|
-
}
|
|
675
|
-
const r7 = s8.element.classList;
|
|
676
|
-
for (const t7 of this.st) t7 in i7 || (r7.remove(t7), this.st.delete(t7));
|
|
677
|
-
for (const t7 in i7) {
|
|
678
|
-
const s9 = !!i7[t7];
|
|
679
|
-
s9 === this.st.has(t7) || this.nt?.has(t7) || (s9 ? (r7.add(t7), this.st.add(t7)) : (r7.remove(t7), this.st.delete(t7)));
|
|
680
|
-
}
|
|
681
|
-
return T;
|
|
682
|
-
}
|
|
683
|
-
});
|
|
684
|
-
|
|
685
|
-
// node_modules/lit-html/directive-helpers.js
|
|
686
|
-
var { I: t5 } = Z;
|
|
687
|
-
var f3 = (o10) => void 0 === o10.strings;
|
|
688
|
-
|
|
689
|
-
// node_modules/lit-html/async-directive.js
|
|
690
|
-
var s4 = (i7, t7) => {
|
|
691
|
-
const e10 = i7._$AN;
|
|
692
|
-
if (void 0 === e10) return false;
|
|
693
|
-
for (const i8 of e10) i8._$AO?.(t7, false), s4(i8, t7);
|
|
694
|
-
return true;
|
|
695
|
-
};
|
|
696
|
-
var o6 = (i7) => {
|
|
697
|
-
let t7, e10;
|
|
698
|
-
do {
|
|
699
|
-
if (void 0 === (t7 = i7._$AM)) break;
|
|
700
|
-
e10 = t7._$AN, e10.delete(i7), i7 = t7;
|
|
701
|
-
} while (0 === e10?.size);
|
|
702
|
-
};
|
|
703
|
-
var r6 = (i7) => {
|
|
704
|
-
for (let t7; t7 = i7._$AM; i7 = t7) {
|
|
705
|
-
let e10 = t7._$AN;
|
|
706
|
-
if (void 0 === e10) t7._$AN = e10 = /* @__PURE__ */ new Set();
|
|
707
|
-
else if (e10.has(i7)) break;
|
|
708
|
-
e10.add(i7), c4(t7);
|
|
709
|
-
}
|
|
710
|
-
};
|
|
711
|
-
function h3(i7) {
|
|
712
|
-
void 0 !== this._$AN ? (o6(this), this._$AM = i7, r6(this)) : this._$AM = i7;
|
|
713
|
-
}
|
|
714
|
-
function n5(i7, t7 = false, e10 = 0) {
|
|
715
|
-
const r7 = this._$AH, h5 = this._$AN;
|
|
716
|
-
if (void 0 !== h5 && 0 !== h5.size) if (t7) if (Array.isArray(r7)) for (let i8 = e10; i8 < r7.length; i8++) s4(r7[i8], false), o6(r7[i8]);
|
|
717
|
-
else null != r7 && (s4(r7, false), o6(r7));
|
|
718
|
-
else s4(this, i7);
|
|
719
|
-
}
|
|
720
|
-
var c4 = (i7) => {
|
|
721
|
-
i7.type == t4.CHILD && (i7._$AP ??= n5, i7._$AQ ??= h3);
|
|
722
|
-
};
|
|
723
|
-
var f4 = class extends i5 {
|
|
724
|
-
constructor() {
|
|
725
|
-
super(...arguments), this._$AN = void 0;
|
|
726
|
-
}
|
|
727
|
-
_$AT(i7, t7, e10) {
|
|
728
|
-
super._$AT(i7, t7, e10), r6(this), this.isConnected = i7._$AU;
|
|
729
|
-
}
|
|
730
|
-
_$AO(i7, t7 = true) {
|
|
731
|
-
i7 !== this.isConnected && (this.isConnected = i7, i7 ? this.reconnected?.() : this.disconnected?.()), t7 && (s4(this, i7), o6(this));
|
|
732
|
-
}
|
|
733
|
-
setValue(t7) {
|
|
734
|
-
if (f3(this._$Ct)) this._$Ct._$AI(t7, this);
|
|
735
|
-
else {
|
|
736
|
-
const i7 = [...this._$Ct._$AH];
|
|
737
|
-
i7[this._$Ci] = t7, this._$Ct._$AI(i7, this, 0);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
disconnected() {
|
|
741
|
-
}
|
|
742
|
-
reconnected() {
|
|
743
|
-
}
|
|
744
|
-
};
|
|
745
|
-
|
|
746
|
-
// node_modules/lit-html/directives/ref.js
|
|
747
|
-
var e7 = () => new h4();
|
|
748
|
-
var h4 = class {
|
|
749
|
-
};
|
|
750
|
-
var o7 = /* @__PURE__ */ new WeakMap();
|
|
751
|
-
var n6 = e5(class extends f4 {
|
|
752
|
-
render(i7) {
|
|
753
|
-
return E;
|
|
754
|
-
}
|
|
755
|
-
update(i7, [s8]) {
|
|
756
|
-
const e10 = s8 !== this.G;
|
|
757
|
-
return e10 && void 0 !== this.G && this.rt(void 0), (e10 || this.lt !== this.ct) && (this.G = s8, this.ht = i7.options?.host, this.rt(this.ct = i7.element)), E;
|
|
758
|
-
}
|
|
759
|
-
rt(t7) {
|
|
760
|
-
if (this.isConnected || (t7 = void 0), "function" == typeof this.G) {
|
|
761
|
-
const i7 = this.ht ?? globalThis;
|
|
762
|
-
let s8 = o7.get(i7);
|
|
763
|
-
void 0 === s8 && (s8 = /* @__PURE__ */ new WeakMap(), o7.set(i7, s8)), void 0 !== s8.get(this.G) && this.G.call(this.ht, void 0), s8.set(this.G, t7), void 0 !== t7 && this.G.call(this.ht, t7);
|
|
764
|
-
} else this.G.value = t7;
|
|
765
|
-
}
|
|
766
|
-
get lt() {
|
|
767
|
-
return "function" == typeof this.G ? o7.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
|
|
768
|
-
}
|
|
769
|
-
disconnected() {
|
|
770
|
-
this.lt === this.ct && this.rt(void 0);
|
|
771
|
-
}
|
|
772
|
-
reconnected() {
|
|
773
|
-
this.rt(this.ct);
|
|
774
|
-
}
|
|
775
|
-
});
|
|
776
|
-
|
|
777
|
-
// dist/constants.js
|
|
778
|
-
var LANGUAGES_SUPPORTED_EU = [
|
|
779
|
-
"da",
|
|
780
|
-
"de",
|
|
781
|
-
"de-CH",
|
|
782
|
-
"en",
|
|
783
|
-
"en-GB",
|
|
784
|
-
"es",
|
|
785
|
-
"fr",
|
|
786
|
-
"hu",
|
|
787
|
-
"it",
|
|
788
|
-
"nl",
|
|
789
|
-
"no",
|
|
790
|
-
"pt",
|
|
791
|
-
"sv",
|
|
792
|
-
"gsw-CH"
|
|
793
|
-
].sort();
|
|
794
|
-
var LANGUAGES_SUPPORTED_US = [
|
|
795
|
-
"da",
|
|
796
|
-
"de",
|
|
797
|
-
"de-CH",
|
|
798
|
-
"en",
|
|
799
|
-
"en-GB",
|
|
800
|
-
"es",
|
|
801
|
-
"fr",
|
|
802
|
-
"hu",
|
|
803
|
-
"it",
|
|
804
|
-
"nl",
|
|
805
|
-
"no",
|
|
806
|
-
"pt",
|
|
807
|
-
"sv"
|
|
808
|
-
].sort();
|
|
809
|
-
var DEFAULT_DICTATION_CONFIG = {
|
|
810
|
-
automaticPunctuation: false,
|
|
811
|
-
primaryLanguage: "en",
|
|
812
|
-
spokenPunctuation: true
|
|
813
|
-
};
|
|
814
|
-
var AUDIO_CHUNK_INTERVAL_MS = 250;
|
|
815
|
-
|
|
816
|
-
// dist/utils/converters.js
|
|
817
|
-
var commaSeparatedConverter = {
|
|
818
|
-
fromAttribute: (value) => value?.split(",").map((s8) => s8.trim()).filter(Boolean),
|
|
819
|
-
toAttribute: (value) => value?.join(",")
|
|
820
|
-
};
|
|
821
|
-
|
|
822
|
-
// node_modules/@lit/context/lib/context-request-event.js
|
|
823
|
-
var s5 = class extends Event {
|
|
824
|
-
constructor(s8, t7, e10, o10) {
|
|
825
|
-
super("context-request", { bubbles: true, composed: true }), this.context = s8, this.contextTarget = t7, this.callback = e10, this.subscribe = o10 ?? false;
|
|
826
|
-
}
|
|
827
|
-
};
|
|
828
|
-
|
|
829
|
-
// node_modules/@lit/context/lib/create-context.js
|
|
830
|
-
function n7(n8) {
|
|
831
|
-
return n8;
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
// node_modules/@lit/context/lib/controllers/context-consumer.js
|
|
835
|
-
var s6 = class {
|
|
836
|
-
constructor(t7, s8, i7, h5) {
|
|
837
|
-
if (this.subscribe = false, this.provided = false, this.value = void 0, this.t = (t8, s9) => {
|
|
838
|
-
this.unsubscribe && (this.unsubscribe !== s9 && (this.provided = false, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = t8, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = true, this.callback && this.callback(t8, s9)), this.unsubscribe = s9;
|
|
839
|
-
}, this.host = t7, void 0 !== s8.context) {
|
|
840
|
-
const t8 = s8;
|
|
841
|
-
this.context = t8.context, this.callback = t8.callback, this.subscribe = t8.subscribe ?? false;
|
|
842
|
-
} else this.context = s8, this.callback = i7, this.subscribe = h5 ?? false;
|
|
843
|
-
this.host.addController(this);
|
|
844
|
-
}
|
|
845
|
-
hostConnected() {
|
|
846
|
-
this.dispatchRequest();
|
|
847
|
-
}
|
|
848
|
-
hostDisconnected() {
|
|
849
|
-
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
|
|
850
|
-
}
|
|
851
|
-
dispatchRequest() {
|
|
852
|
-
this.host.dispatchEvent(new s5(this.context, this.host, this.t, this.subscribe));
|
|
853
|
-
}
|
|
854
|
-
};
|
|
855
|
-
|
|
856
|
-
// node_modules/@lit/context/lib/value-notifier.js
|
|
857
|
-
var s7 = class {
|
|
858
|
-
get value() {
|
|
859
|
-
return this.o;
|
|
860
|
-
}
|
|
861
|
-
set value(s8) {
|
|
862
|
-
this.setValue(s8);
|
|
863
|
-
}
|
|
864
|
-
setValue(s8, t7 = false) {
|
|
865
|
-
const i7 = t7 || !Object.is(s8, this.o);
|
|
866
|
-
this.o = s8, i7 && this.updateObservers();
|
|
867
|
-
}
|
|
868
|
-
constructor(s8) {
|
|
869
|
-
this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
|
|
870
|
-
for (const [s9, { disposer: t7 }] of this.subscriptions) s9(this.o, t7);
|
|
871
|
-
}, void 0 !== s8 && (this.value = s8);
|
|
872
|
-
}
|
|
873
|
-
addCallback(s8, t7, i7) {
|
|
874
|
-
if (!i7) return void s8(this.value);
|
|
875
|
-
this.subscriptions.has(s8) || this.subscriptions.set(s8, { disposer: () => {
|
|
876
|
-
this.subscriptions.delete(s8);
|
|
877
|
-
}, consumerHost: t7 });
|
|
878
|
-
const { disposer: h5 } = this.subscriptions.get(s8);
|
|
879
|
-
s8(this.value, h5);
|
|
880
|
-
}
|
|
881
|
-
clearCallbacks() {
|
|
882
|
-
this.subscriptions.clear();
|
|
883
|
-
}
|
|
884
|
-
};
|
|
885
|
-
|
|
886
|
-
// node_modules/@lit/context/lib/controllers/context-provider.js
|
|
887
|
-
var e8 = class extends Event {
|
|
888
|
-
constructor(t7, s8) {
|
|
889
|
-
super("context-provider", { bubbles: true, composed: true }), this.context = t7, this.contextTarget = s8;
|
|
890
|
-
}
|
|
891
|
-
};
|
|
892
|
-
var i6 = class extends s7 {
|
|
893
|
-
constructor(s8, e10, i7) {
|
|
894
|
-
super(void 0 !== e10.context ? e10.initialValue : i7), this.onContextRequest = (t7) => {
|
|
895
|
-
if (t7.context !== this.context) return;
|
|
896
|
-
const s9 = t7.contextTarget ?? t7.composedPath()[0];
|
|
897
|
-
s9 !== this.host && (t7.stopPropagation(), this.addCallback(t7.callback, s9, t7.subscribe));
|
|
898
|
-
}, this.onProviderRequest = (s9) => {
|
|
899
|
-
if (s9.context !== this.context) return;
|
|
900
|
-
if ((s9.contextTarget ?? s9.composedPath()[0]) === this.host) return;
|
|
901
|
-
const e11 = /* @__PURE__ */ new Set();
|
|
902
|
-
for (const [s10, { consumerHost: i8 }] of this.subscriptions) e11.has(s10) || (e11.add(s10), i8.dispatchEvent(new s5(this.context, i8, s10, true)));
|
|
903
|
-
s9.stopPropagation();
|
|
904
|
-
}, this.host = s8, void 0 !== e10.context ? this.context = e10.context : this.context = e10, this.attachListeners(), this.host.addController?.(this);
|
|
905
|
-
}
|
|
906
|
-
attachListeners() {
|
|
907
|
-
this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
|
|
908
|
-
}
|
|
909
|
-
hostConnected() {
|
|
910
|
-
this.host.dispatchEvent(new e8(this.context, this.host));
|
|
911
|
-
}
|
|
912
|
-
};
|
|
913
|
-
|
|
914
|
-
// node_modules/@lit/context/lib/decorators/provide.js
|
|
915
|
-
function e9({ context: e10 }) {
|
|
916
|
-
return (n8, i7) => {
|
|
917
|
-
const r7 = /* @__PURE__ */ new WeakMap();
|
|
918
|
-
if ("object" == typeof i7) return { get() {
|
|
919
|
-
return n8.get.call(this);
|
|
920
|
-
}, set(t7) {
|
|
921
|
-
return r7.get(this).setValue(t7), n8.set.call(this, t7);
|
|
922
|
-
}, init(n9) {
|
|
923
|
-
return r7.set(this, new i6(this, { context: e10, initialValue: n9 })), n9;
|
|
924
|
-
} };
|
|
925
|
-
{
|
|
926
|
-
n8.constructor.addInitializer((n9) => {
|
|
927
|
-
r7.set(n9, new i6(n9, { context: e10 }));
|
|
928
|
-
});
|
|
929
|
-
const o10 = Object.getOwnPropertyDescriptor(n8, i7);
|
|
930
|
-
let s8;
|
|
931
|
-
if (void 0 === o10) {
|
|
932
|
-
const t7 = /* @__PURE__ */ new WeakMap();
|
|
933
|
-
s8 = { get() {
|
|
934
|
-
return t7.get(this);
|
|
935
|
-
}, set(e11) {
|
|
936
|
-
r7.get(this).setValue(e11), t7.set(this, e11);
|
|
937
|
-
}, configurable: true, enumerable: true };
|
|
938
|
-
} else {
|
|
939
|
-
const t7 = o10.set;
|
|
940
|
-
s8 = { ...o10, set(e11) {
|
|
941
|
-
r7.get(this).setValue(e11), t7?.call(this, e11);
|
|
942
|
-
} };
|
|
943
|
-
}
|
|
944
|
-
return void Object.defineProperty(n8, i7, s8);
|
|
945
|
-
}
|
|
946
|
-
};
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
// node_modules/@lit/context/lib/decorators/consume.js
|
|
950
|
-
function c5({ context: c6, subscribe: e10 }) {
|
|
951
|
-
return (o10, n8) => {
|
|
952
|
-
"object" == typeof n8 ? n8.addInitializer(function() {
|
|
953
|
-
new s6(this, { context: c6, callback: (t7) => {
|
|
954
|
-
o10.set.call(this, t7);
|
|
955
|
-
}, subscribe: e10 });
|
|
956
|
-
}) : o10.constructor.addInitializer((o11) => {
|
|
957
|
-
new s6(o11, { context: c6, callback: (t7) => {
|
|
958
|
-
o11[n8] = t7;
|
|
959
|
-
}, subscribe: e10 });
|
|
960
|
-
});
|
|
961
|
-
};
|
|
962
|
-
}
|
|
860
|
+
`;
|
|
861
|
+
var component_styles_default = ComponentStyles;
|
|
963
862
|
|
|
964
|
-
// dist/utils/
|
|
965
|
-
async function
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
}
|
|
973
|
-
const permissionStatus = await navigator.permissions.query({
|
|
974
|
-
name: "microphone"
|
|
975
|
-
});
|
|
976
|
-
if (permissionStatus.state === "denied") {
|
|
977
|
-
throw new Error("Microphone permission is denied");
|
|
978
|
-
}
|
|
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");
|
|
863
|
+
// dist/utils/auth.js
|
|
864
|
+
async function getInitialToken(config) {
|
|
865
|
+
const initialToken = "accessToken" in config ? {
|
|
866
|
+
accessToken: config.accessToken,
|
|
867
|
+
refreshToken: config.refreshToken
|
|
868
|
+
} : await config.refreshAccessToken();
|
|
869
|
+
if (!initialToken?.accessToken || typeof initialToken.accessToken !== "string") {
|
|
870
|
+
throw new Error("Access token is required and must be a string");
|
|
989
871
|
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
return { defaultDevice, devices: audioDevices };
|
|
872
|
+
return {
|
|
873
|
+
accessToken: initialToken.accessToken,
|
|
874
|
+
refreshToken: initialToken.refreshToken
|
|
875
|
+
};
|
|
995
876
|
}
|
|
996
877
|
|
|
997
878
|
// dist/utils/events.js
|
|
@@ -1055,6 +936,13 @@ function deltaUsageEvent(detail) {
|
|
|
1055
936
|
detail
|
|
1056
937
|
});
|
|
1057
938
|
}
|
|
939
|
+
function factsEvent(detail) {
|
|
940
|
+
return new CustomEvent("facts", {
|
|
941
|
+
bubbles: true,
|
|
942
|
+
composed: true,
|
|
943
|
+
detail
|
|
944
|
+
});
|
|
945
|
+
}
|
|
1058
946
|
function errorToMessage(error) {
|
|
1059
947
|
if (error instanceof Error) {
|
|
1060
948
|
return error.message;
|
|
@@ -1119,6 +1007,194 @@ function keybindingActivatedEvent(keyboardEvent) {
|
|
|
1119
1007
|
});
|
|
1120
1008
|
}
|
|
1121
1009
|
|
|
1010
|
+
// dist/utils/token.js
|
|
1011
|
+
function decodeToken(token) {
|
|
1012
|
+
const parts = token.split(".");
|
|
1013
|
+
if (parts.length < 2) {
|
|
1014
|
+
throw new Error("Invalid token format");
|
|
1015
|
+
}
|
|
1016
|
+
const base64Url = parts[1];
|
|
1017
|
+
const base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
|
|
1018
|
+
let jsonPayload;
|
|
1019
|
+
try {
|
|
1020
|
+
jsonPayload = decodeURIComponent(atob(base64).split("").map((c6) => "%" + ("00" + c6.charCodeAt(0).toString(16)).slice(-2)).join(""));
|
|
1021
|
+
} catch (error) {
|
|
1022
|
+
throw new Error("Failed to decode token payload");
|
|
1023
|
+
}
|
|
1024
|
+
let tokenDetails;
|
|
1025
|
+
try {
|
|
1026
|
+
tokenDetails = JSON.parse(jsonPayload);
|
|
1027
|
+
} catch (error) {
|
|
1028
|
+
throw new Error("Invalid JSON payload in token");
|
|
1029
|
+
}
|
|
1030
|
+
const issuerUrl = tokenDetails.iss;
|
|
1031
|
+
if (!issuerUrl) {
|
|
1032
|
+
throw new Error("Token payload does not contain an issuer (iss) field");
|
|
1033
|
+
}
|
|
1034
|
+
const regex = /^https:\/\/(keycloak|auth)\.([^.]+)\.corti\.app\/realms\/([^/]+)/;
|
|
1035
|
+
const match = issuerUrl.match(regex);
|
|
1036
|
+
if (!match) {
|
|
1037
|
+
throw new Error("Access token does not match expected format");
|
|
1038
|
+
}
|
|
1039
|
+
const expiresAt = tokenDetails.exp && typeof tokenDetails.exp === "number" ? tokenDetails.exp : void 0;
|
|
1040
|
+
return {
|
|
1041
|
+
accessToken: token,
|
|
1042
|
+
environment: match[2],
|
|
1043
|
+
expiresAt,
|
|
1044
|
+
tenant: match[3]
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
// dist/contexts/mixins/auth-context.js
|
|
1049
|
+
var __decorate = function(decorators, target, key, desc) {
|
|
1050
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
1051
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
1052
|
+
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;
|
|
1053
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
1054
|
+
};
|
|
1055
|
+
var regionContext = n(Symbol("region"));
|
|
1056
|
+
var tenantNameContext = n(Symbol("tenantName"));
|
|
1057
|
+
var accessTokenContext = n(Symbol("accessToken"));
|
|
1058
|
+
var authConfigContext = n(Symbol("authConfig"));
|
|
1059
|
+
function AuthContextMixin(superclass) {
|
|
1060
|
+
class AuthContextMixinClass extends superclass {
|
|
1061
|
+
set accessToken(token) {
|
|
1062
|
+
this.setAccessToken(token);
|
|
1063
|
+
}
|
|
1064
|
+
get accessToken() {
|
|
1065
|
+
return this._accessToken;
|
|
1066
|
+
}
|
|
1067
|
+
set authConfig(config) {
|
|
1068
|
+
this.setAuthConfig(config);
|
|
1069
|
+
}
|
|
1070
|
+
get authConfig() {
|
|
1071
|
+
return this._authConfig;
|
|
1072
|
+
}
|
|
1073
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
1074
|
+
// Public methods
|
|
1075
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
1076
|
+
/**
|
|
1077
|
+
* Sets the access token and parses region/tenant from it.
|
|
1078
|
+
* @returns ServerConfig with environment, tenant, and accessToken
|
|
1079
|
+
* @deprecated Use 'accessToken' property instead.
|
|
1080
|
+
*/
|
|
1081
|
+
setAccessToken(token) {
|
|
1082
|
+
this._accessToken = token;
|
|
1083
|
+
this.region = void 0;
|
|
1084
|
+
this.tenantName = void 0;
|
|
1085
|
+
if (!token) {
|
|
1086
|
+
return {
|
|
1087
|
+
accessToken: token,
|
|
1088
|
+
environment: void 0,
|
|
1089
|
+
tenant: void 0
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
try {
|
|
1093
|
+
const decoded = decodeToken(token);
|
|
1094
|
+
this.region = decoded?.environment;
|
|
1095
|
+
this.tenantName = decoded?.tenant;
|
|
1096
|
+
return {
|
|
1097
|
+
accessToken: token,
|
|
1098
|
+
environment: decoded?.environment,
|
|
1099
|
+
tenant: decoded?.tenant
|
|
1100
|
+
};
|
|
1101
|
+
} catch (error) {
|
|
1102
|
+
this.dispatchEvent(errorEvent(error));
|
|
1103
|
+
}
|
|
1104
|
+
return { accessToken: token, environment: void 0, tenant: void 0 };
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* Sets the auth config and parses region/tenant from the initial token.
|
|
1108
|
+
* @returns Promise with ServerConfig containing environment, tenant, and accessToken
|
|
1109
|
+
* @deprecated Use 'authConfig' property instead.
|
|
1110
|
+
*/
|
|
1111
|
+
async setAuthConfig(config) {
|
|
1112
|
+
this._authConfig = config;
|
|
1113
|
+
if (!config) {
|
|
1114
|
+
return {
|
|
1115
|
+
accessToken: void 0,
|
|
1116
|
+
environment: void 0,
|
|
1117
|
+
tenant: void 0
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
try {
|
|
1121
|
+
const { accessToken } = await getInitialToken(config);
|
|
1122
|
+
return this.setAccessToken(accessToken);
|
|
1123
|
+
} catch (error) {
|
|
1124
|
+
this.dispatchEvent(errorEvent(error));
|
|
1125
|
+
}
|
|
1126
|
+
return {
|
|
1127
|
+
accessToken: void 0,
|
|
1128
|
+
environment: void 0,
|
|
1129
|
+
tenant: void 0
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
__decorate([
|
|
1134
|
+
e2({ context: regionContext }),
|
|
1135
|
+
r4()
|
|
1136
|
+
], AuthContextMixinClass.prototype, "region", void 0);
|
|
1137
|
+
__decorate([
|
|
1138
|
+
e2({ context: tenantNameContext }),
|
|
1139
|
+
r4()
|
|
1140
|
+
], AuthContextMixinClass.prototype, "tenantName", void 0);
|
|
1141
|
+
__decorate([
|
|
1142
|
+
e2({ context: accessTokenContext }),
|
|
1143
|
+
r4()
|
|
1144
|
+
], AuthContextMixinClass.prototype, "_accessToken", void 0);
|
|
1145
|
+
__decorate([
|
|
1146
|
+
n4({ type: String })
|
|
1147
|
+
], AuthContextMixinClass.prototype, "accessToken", null);
|
|
1148
|
+
__decorate([
|
|
1149
|
+
e2({ context: authConfigContext }),
|
|
1150
|
+
r4()
|
|
1151
|
+
], AuthContextMixinClass.prototype, "_authConfig", void 0);
|
|
1152
|
+
__decorate([
|
|
1153
|
+
n4({ attribute: false, type: Object })
|
|
1154
|
+
], AuthContextMixinClass.prototype, "authConfig", null);
|
|
1155
|
+
return AuthContextMixinClass;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
// dist/utils/devices.js
|
|
1159
|
+
async function primeMicStream() {
|
|
1160
|
+
if (navigator.permissions) {
|
|
1161
|
+
const permissionStatus = await navigator.permissions.query({
|
|
1162
|
+
name: "microphone"
|
|
1163
|
+
});
|
|
1164
|
+
if (permissionStatus.state === "denied") {
|
|
1165
|
+
throw new Error("Microphone permission is denied");
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
1169
|
+
stream.getTracks().forEach((track) => {
|
|
1170
|
+
track.stop();
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1173
|
+
async function getAudioDevices() {
|
|
1174
|
+
if (!navigator.mediaDevices?.enumerateDevices) {
|
|
1175
|
+
throw new Error("MediaDevices API is not available");
|
|
1176
|
+
}
|
|
1177
|
+
let audioDevices = await listAudioInputs();
|
|
1178
|
+
if (needsMicPriming(audioDevices)) {
|
|
1179
|
+
await primeMicStream();
|
|
1180
|
+
audioDevices = await listAudioInputs();
|
|
1181
|
+
}
|
|
1182
|
+
return {
|
|
1183
|
+
defaultDevice: audioDevices[0],
|
|
1184
|
+
devices: audioDevices
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
async function listAudioInputs() {
|
|
1188
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
1189
|
+
return devices.filter((device) => device.kind === "audioinput");
|
|
1190
|
+
}
|
|
1191
|
+
function needsMicPriming(audioInputs) {
|
|
1192
|
+
if (audioInputs.length === 0) {
|
|
1193
|
+
return false;
|
|
1194
|
+
}
|
|
1195
|
+
return audioInputs.some((d3) => d3.deviceId === "" || d3.label === "");
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1122
1198
|
// dist/controllers/devices-controller.js
|
|
1123
1199
|
var __classPrivateFieldSet = function(receiver, state, value, kind, f5) {
|
|
1124
1200
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
@@ -1212,6 +1288,117 @@ _DevicesController_autoLoadedDevices = /* @__PURE__ */ new WeakMap(), _DevicesCo
|
|
|
1212
1288
|
}
|
|
1213
1289
|
};
|
|
1214
1290
|
|
|
1291
|
+
// dist/contexts/mixins/devices-context.js
|
|
1292
|
+
var __decorate2 = function(decorators, target, key, desc) {
|
|
1293
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
1294
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
1295
|
+
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;
|
|
1296
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
1297
|
+
};
|
|
1298
|
+
var __classPrivateFieldGet2 = function(receiver, state, kind, f5) {
|
|
1299
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
1300
|
+
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");
|
|
1301
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
1302
|
+
};
|
|
1303
|
+
var devicesContext = n(Symbol("devices"));
|
|
1304
|
+
var selectedDeviceContext = n(Symbol("selectedDevice"));
|
|
1305
|
+
function DevicesContextMixin(superclass) {
|
|
1306
|
+
var _DevicesContextMixinClass_devicesController;
|
|
1307
|
+
class DevicesContextMixinClass extends superclass {
|
|
1308
|
+
set devices(value) {
|
|
1309
|
+
this._devices = value;
|
|
1310
|
+
if (value !== void 0) {
|
|
1311
|
+
__classPrivateFieldGet2(this, _DevicesContextMixinClass_devicesController, "f").clearAutoLoadedFlag();
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
get devices() {
|
|
1315
|
+
return this._devices;
|
|
1316
|
+
}
|
|
1317
|
+
constructor(...args) {
|
|
1318
|
+
super(...args);
|
|
1319
|
+
_DevicesContextMixinClass_devicesController.set(this, new DevicesController(this));
|
|
1320
|
+
this.addEventListener("recording-devices-changed", (e10) => {
|
|
1321
|
+
const event = e10;
|
|
1322
|
+
this.selectedDevice = event.detail.selectedDevice;
|
|
1323
|
+
});
|
|
1324
|
+
this.addEventListener("context-request", (ev) => {
|
|
1325
|
+
if (ev.context === devicesContext) {
|
|
1326
|
+
__classPrivateFieldGet2(this, _DevicesContextMixinClass_devicesController, "f").initialize();
|
|
1327
|
+
}
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
_DevicesContextMixinClass_devicesController = /* @__PURE__ */ new WeakMap();
|
|
1332
|
+
__decorate2([
|
|
1333
|
+
e2({ context: devicesContext }),
|
|
1334
|
+
r4()
|
|
1335
|
+
], DevicesContextMixinClass.prototype, "_devices", void 0);
|
|
1336
|
+
__decorate2([
|
|
1337
|
+
n4({ attribute: false, type: Array })
|
|
1338
|
+
], DevicesContextMixinClass.prototype, "devices", null);
|
|
1339
|
+
__decorate2([
|
|
1340
|
+
e2({ context: selectedDeviceContext }),
|
|
1341
|
+
n4({ attribute: false, type: Object })
|
|
1342
|
+
], DevicesContextMixinClass.prototype, "selectedDevice", void 0);
|
|
1343
|
+
return DevicesContextMixinClass;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
// dist/contexts/mixins/keybindings-context.js
|
|
1347
|
+
var __decorate3 = function(decorators, target, key, desc) {
|
|
1348
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
1349
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
1350
|
+
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;
|
|
1351
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
1352
|
+
};
|
|
1353
|
+
var __classPrivateFieldGet3 = function(receiver, state, kind, f5) {
|
|
1354
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
1355
|
+
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");
|
|
1356
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
1357
|
+
};
|
|
1358
|
+
var pushToTalkKeybindingContext = n(Symbol("pushToTalkKeybinding"));
|
|
1359
|
+
var toggleToTalkKeybindingContext = n(Symbol("toggleToTalkKeybinding"));
|
|
1360
|
+
function KeybindingsContextMixin(superclass) {
|
|
1361
|
+
var _KeybindingsContextMixinClass_handleContextRequest, _KeybindingsContextMixinClass_handleKeybindingChanged;
|
|
1362
|
+
class KeybindingsContextMixinClass extends superclass {
|
|
1363
|
+
constructor(...args) {
|
|
1364
|
+
super(...args);
|
|
1365
|
+
_KeybindingsContextMixinClass_handleContextRequest.set(this, (e10) => {
|
|
1366
|
+
if (e10.contextTarget.tagName.toLowerCase() === "dictation-keybinding-selector") {
|
|
1367
|
+
if (e10.context === pushToTalkKeybindingContext && this.pushToTalkKeybinding === void 0) {
|
|
1368
|
+
this.pushToTalkKeybinding = "Space";
|
|
1369
|
+
this.dispatchEvent(keybindingChangedEvent(" ", "Space", "Space", "push-to-talk"));
|
|
1370
|
+
}
|
|
1371
|
+
if (e10.context === toggleToTalkKeybindingContext && this.toggleToTalkKeybinding === void 0) {
|
|
1372
|
+
this.toggleToTalkKeybinding = "Enter";
|
|
1373
|
+
this.dispatchEvent(keybindingChangedEvent("Enter", "Enter", "Enter", "toggle-to-talk"));
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
});
|
|
1377
|
+
_KeybindingsContextMixinClass_handleKeybindingChanged.set(this, (e10) => {
|
|
1378
|
+
const event = e10;
|
|
1379
|
+
const keybinding = event.detail.keybinding;
|
|
1380
|
+
if (event.detail.type === "push-to-talk") {
|
|
1381
|
+
this.pushToTalkKeybinding = keybinding;
|
|
1382
|
+
} else if (event.detail.type === "toggle-to-talk") {
|
|
1383
|
+
this.toggleToTalkKeybinding = keybinding;
|
|
1384
|
+
}
|
|
1385
|
+
});
|
|
1386
|
+
this.addEventListener("keybinding-changed", __classPrivateFieldGet3(this, _KeybindingsContextMixinClass_handleKeybindingChanged, "f"));
|
|
1387
|
+
this.addEventListener("context-request", __classPrivateFieldGet3(this, _KeybindingsContextMixinClass_handleContextRequest, "f"));
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
_KeybindingsContextMixinClass_handleContextRequest = /* @__PURE__ */ new WeakMap(), _KeybindingsContextMixinClass_handleKeybindingChanged = /* @__PURE__ */ new WeakMap();
|
|
1391
|
+
__decorate3([
|
|
1392
|
+
e2({ context: pushToTalkKeybindingContext }),
|
|
1393
|
+
n4({ type: String })
|
|
1394
|
+
], KeybindingsContextMixinClass.prototype, "pushToTalkKeybinding", void 0);
|
|
1395
|
+
__decorate3([
|
|
1396
|
+
e2({ context: toggleToTalkKeybindingContext }),
|
|
1397
|
+
n4({ type: String })
|
|
1398
|
+
], KeybindingsContextMixinClass.prototype, "toggleToTalkKeybinding", void 0);
|
|
1399
|
+
return KeybindingsContextMixinClass;
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1215
1402
|
// dist/utils/languages.js
|
|
1216
1403
|
var DEFAULT_LANGUAGES_BY_REGION = {
|
|
1217
1404
|
default: LANGUAGES_SUPPORTED_EU,
|
|
@@ -1243,7 +1430,7 @@ var __classPrivateFieldSet2 = function(receiver, state, value, kind, f5) {
|
|
|
1243
1430
|
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");
|
|
1244
1431
|
return kind === "a" ? f5.call(receiver, value) : f5 ? f5.value = value : state.set(receiver, value), value;
|
|
1245
1432
|
};
|
|
1246
|
-
var
|
|
1433
|
+
var __classPrivateFieldGet4 = function(receiver, state, kind, f5) {
|
|
1247
1434
|
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
1248
1435
|
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");
|
|
1249
1436
|
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
@@ -1267,15 +1454,15 @@ var LanguagesController = class {
|
|
|
1267
1454
|
initialize() {
|
|
1268
1455
|
__classPrivateFieldSet2(this, _LanguagesController_initialized, true, "f");
|
|
1269
1456
|
if (this.host._languages === void 0) {
|
|
1270
|
-
|
|
1457
|
+
__classPrivateFieldGet4(this, _LanguagesController_instances, "m", _LanguagesController_loadLanguages).call(this);
|
|
1271
1458
|
}
|
|
1272
1459
|
}
|
|
1273
1460
|
hostUpdate() {
|
|
1274
|
-
if (!
|
|
1461
|
+
if (!__classPrivateFieldGet4(this, _LanguagesController_initialized, "f")) {
|
|
1275
1462
|
return;
|
|
1276
1463
|
}
|
|
1277
|
-
if (
|
|
1278
|
-
|
|
1464
|
+
if (__classPrivateFieldGet4(this, _LanguagesController_previousRegion, "f") !== this.host.region && __classPrivateFieldGet4(this, _LanguagesController_autoLoadedLanguages, "f") || this.host._languages === void 0) {
|
|
1465
|
+
__classPrivateFieldGet4(this, _LanguagesController_instances, "m", _LanguagesController_loadLanguages).call(this);
|
|
1279
1466
|
}
|
|
1280
1467
|
__classPrivateFieldSet2(this, _LanguagesController_previousRegion, this.host.region, "f");
|
|
1281
1468
|
}
|
|
@@ -1287,291 +1474,142 @@ var LanguagesController = class {
|
|
|
1287
1474
|
}
|
|
1288
1475
|
};
|
|
1289
1476
|
_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() {
|
|
1290
|
-
if (
|
|
1477
|
+
if (__classPrivateFieldGet4(this, _LanguagesController_loadingLanguages, "f")) {
|
|
1291
1478
|
return;
|
|
1292
1479
|
}
|
|
1293
1480
|
__classPrivateFieldSet2(this, _LanguagesController_loadingLanguages, true, "f");
|
|
1294
1481
|
try {
|
|
1295
|
-
const { languages, defaultLanguage } = getLanguagesByRegion(this.host.region);
|
|
1296
|
-
__classPrivateFieldSet2(this, _LanguagesController_autoLoadedLanguages, true, "f");
|
|
1297
|
-
this.host._languages = languages;
|
|
1298
|
-
const previousLanguage = this.host.dictationConfig?.primaryLanguage;
|
|
1299
|
-
const selectedLanguage = previousLanguage && languages.includes(previousLanguage) ? previousLanguage : defaultLanguage;
|
|
1300
|
-
this.host.
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
this
|
|
1306
|
-
} catch (error) {
|
|
1307
|
-
this.host.dispatchEvent(errorEvent(error));
|
|
1308
|
-
} finally {
|
|
1309
|
-
__classPrivateFieldSet2(this, _LanguagesController_loadingLanguages, false, "f");
|
|
1310
|
-
}
|
|
1311
|
-
};
|
|
1312
|
-
|
|
1313
|
-
// dist/styles/component-styles.js
|
|
1314
|
-
var ComponentStyles = i`
|
|
1315
|
-
:host {
|
|
1316
|
-
font-family: var(--component-font-family, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif);
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
.wrapper {
|
|
1320
|
-
background-color: var(--card-background, light-dark(#fff, #333));
|
|
1321
|
-
border: 1px solid var(--card-border-color, light-dark(#ddd, #555));
|
|
1322
|
-
border-radius: var(--card-border-radius, 8px);
|
|
1323
|
-
box-shadow: var(--card-box-shadow, 0 2px 5px rgba(0, 0, 0, 0.1));
|
|
1324
|
-
padding: var(--card-padding, 4px);
|
|
1325
|
-
display: flex;
|
|
1326
|
-
gap: 4px;
|
|
1327
|
-
height: 46px;
|
|
1328
|
-
width: fit-content;
|
|
1329
|
-
box-sizing: border-box;
|
|
1330
|
-
overflow: hidden;
|
|
1331
|
-
}
|
|
1332
|
-
`;
|
|
1333
|
-
var LabelStyles = i`
|
|
1334
|
-
label {
|
|
1335
|
-
display: block;
|
|
1336
|
-
font-size: 0.8rem;
|
|
1337
|
-
padding-bottom: 0.5rem;
|
|
1338
|
-
font-weight: 500;
|
|
1339
|
-
color: var(--component-text-color, light-dark(#333, #eee));
|
|
1340
|
-
pointer-events: none;
|
|
1341
|
-
}
|
|
1342
|
-
`;
|
|
1343
|
-
var component_styles_default = ComponentStyles;
|
|
1344
|
-
|
|
1345
|
-
// dist/utils/auth.js
|
|
1346
|
-
async function getInitialToken(config) {
|
|
1347
|
-
const initialToken = "accessToken" in config ? {
|
|
1348
|
-
accessToken: config.accessToken,
|
|
1349
|
-
refreshToken: config.refreshToken
|
|
1350
|
-
} : await config.refreshAccessToken();
|
|
1351
|
-
if (!initialToken?.accessToken || typeof initialToken.accessToken !== "string") {
|
|
1352
|
-
throw new Error("Access token is required and must be a string");
|
|
1353
|
-
}
|
|
1354
|
-
return {
|
|
1355
|
-
accessToken: initialToken.accessToken,
|
|
1356
|
-
refreshToken: initialToken.refreshToken
|
|
1357
|
-
};
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
// dist/utils/token.js
|
|
1361
|
-
function decodeToken(token) {
|
|
1362
|
-
const parts = token.split(".");
|
|
1363
|
-
if (parts.length < 2) {
|
|
1364
|
-
throw new Error("Invalid token format");
|
|
1365
|
-
}
|
|
1366
|
-
const base64Url = parts[1];
|
|
1367
|
-
const base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
|
|
1368
|
-
let jsonPayload;
|
|
1369
|
-
try {
|
|
1370
|
-
jsonPayload = decodeURIComponent(atob(base64).split("").map((c6) => "%" + ("00" + c6.charCodeAt(0).toString(16)).slice(-2)).join(""));
|
|
1371
|
-
} catch (error) {
|
|
1372
|
-
throw new Error("Failed to decode token payload");
|
|
1373
|
-
}
|
|
1374
|
-
let tokenDetails;
|
|
1375
|
-
try {
|
|
1376
|
-
tokenDetails = JSON.parse(jsonPayload);
|
|
1377
|
-
} catch (error) {
|
|
1378
|
-
throw new Error("Invalid JSON payload in token");
|
|
1379
|
-
}
|
|
1380
|
-
const issuerUrl = tokenDetails.iss;
|
|
1381
|
-
if (!issuerUrl) {
|
|
1382
|
-
throw new Error("Token payload does not contain an issuer (iss) field");
|
|
1383
|
-
}
|
|
1384
|
-
const regex = /^https:\/\/(keycloak|auth)\.([^.]+)\.corti\.app\/realms\/([^/]+)/;
|
|
1385
|
-
const match = issuerUrl.match(regex);
|
|
1386
|
-
if (!match) {
|
|
1387
|
-
throw new Error("Access token does not match expected format");
|
|
1482
|
+
const { languages, defaultLanguage } = getLanguagesByRegion(this.host.region);
|
|
1483
|
+
__classPrivateFieldSet2(this, _LanguagesController_autoLoadedLanguages, true, "f");
|
|
1484
|
+
this.host._languages = languages;
|
|
1485
|
+
const previousLanguage = this.host.dictationConfig?.primaryLanguage;
|
|
1486
|
+
const selectedLanguage = previousLanguage && languages.includes(previousLanguage) ? previousLanguage : defaultLanguage;
|
|
1487
|
+
this.host.requestUpdate();
|
|
1488
|
+
this.host.dispatchEvent(languagesChangedEvent(languages, selectedLanguage));
|
|
1489
|
+
} catch (error) {
|
|
1490
|
+
this.host.dispatchEvent(errorEvent(error));
|
|
1491
|
+
} finally {
|
|
1492
|
+
__classPrivateFieldSet2(this, _LanguagesController_loadingLanguages, false, "f");
|
|
1388
1493
|
}
|
|
1389
|
-
|
|
1390
|
-
return {
|
|
1391
|
-
accessToken: token,
|
|
1392
|
-
environment: match[2],
|
|
1393
|
-
expiresAt,
|
|
1394
|
-
tenant: match[3]
|
|
1395
|
-
};
|
|
1396
|
-
}
|
|
1494
|
+
};
|
|
1397
1495
|
|
|
1398
|
-
// dist/
|
|
1399
|
-
var
|
|
1496
|
+
// dist/utils/converters.js
|
|
1497
|
+
var commaSeparatedConverter = {
|
|
1498
|
+
fromAttribute: (value) => value?.split(",").map((s8) => s8.trim()).filter(Boolean),
|
|
1499
|
+
toAttribute: (value) => value?.join(",")
|
|
1500
|
+
};
|
|
1501
|
+
|
|
1502
|
+
// dist/contexts/mixins/languages-context.js
|
|
1503
|
+
var __decorate4 = function(decorators, target, key, desc) {
|
|
1400
1504
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
1401
1505
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
1402
1506
|
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;
|
|
1403
1507
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
1404
1508
|
};
|
|
1405
|
-
var
|
|
1509
|
+
var __classPrivateFieldGet5 = function(receiver, state, kind, f5) {
|
|
1406
1510
|
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
1407
1511
|
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");
|
|
1408
1512
|
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
1409
1513
|
};
|
|
1410
|
-
var
|
|
1411
|
-
|
|
1412
|
-
var
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
set accessToken(token) {
|
|
1433
|
-
this.setAccessToken(token);
|
|
1434
|
-
}
|
|
1435
|
-
get accessToken() {
|
|
1436
|
-
return this._accessToken;
|
|
1437
|
-
}
|
|
1438
|
-
set authConfig(config) {
|
|
1439
|
-
this.setAuthConfig(config);
|
|
1440
|
-
}
|
|
1441
|
-
get authConfig() {
|
|
1442
|
-
return this._authConfig;
|
|
1443
|
-
}
|
|
1444
|
-
set languages(value) {
|
|
1445
|
-
this._languages = value;
|
|
1446
|
-
if (value !== void 0) {
|
|
1447
|
-
__classPrivateFieldGet3(this, _DictationRoot_languagesController, "f").clearAutoLoadedFlag();
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
get languages() {
|
|
1451
|
-
return this._languages;
|
|
1452
|
-
}
|
|
1453
|
-
set devices(value) {
|
|
1454
|
-
this._devices = value;
|
|
1455
|
-
if (value !== void 0) {
|
|
1456
|
-
__classPrivateFieldGet3(this, _DictationRoot_devicesController, "f").clearAutoLoadedFlag();
|
|
1514
|
+
var languagesContext = n(Symbol("languages"));
|
|
1515
|
+
function LanguagesContextMixin(superclass) {
|
|
1516
|
+
var _LanguagesContextMixinClass_languagesController;
|
|
1517
|
+
class LanguagesContextMixinClass extends superclass {
|
|
1518
|
+
set languages(value) {
|
|
1519
|
+
this._languages = value;
|
|
1520
|
+
if (value !== void 0) {
|
|
1521
|
+
__classPrivateFieldGet5(this, _LanguagesContextMixinClass_languagesController, "f").clearAutoLoadedFlag();
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
get languages() {
|
|
1525
|
+
return this._languages;
|
|
1526
|
+
}
|
|
1527
|
+
constructor(...args) {
|
|
1528
|
+
super(...args);
|
|
1529
|
+
_LanguagesContextMixinClass_languagesController.set(this, new LanguagesController(this));
|
|
1530
|
+
this.addEventListener("context-request", (e10) => {
|
|
1531
|
+
const ev = e10;
|
|
1532
|
+
if (ev.context === languagesContext) {
|
|
1533
|
+
__classPrivateFieldGet5(this, _LanguagesContextMixinClass_languagesController, "f").initialize();
|
|
1534
|
+
}
|
|
1535
|
+
});
|
|
1457
1536
|
}
|
|
1458
1537
|
}
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
this.recordingState = event.detail.state;
|
|
1485
|
-
});
|
|
1486
|
-
_DictationRoot_handleContextRequest.set(this, (e10) => {
|
|
1487
|
-
if (e10.context === languagesContext) {
|
|
1488
|
-
__classPrivateFieldGet3(this, _DictationRoot_languagesController, "f").initialize();
|
|
1489
|
-
} else if (e10.context === devicesContext) {
|
|
1490
|
-
__classPrivateFieldGet3(this, _DictationRoot_devicesController, "f").initialize();
|
|
1491
|
-
} else if (e10.contextTarget.tagName.toLowerCase() === "dictation-keybinding-selector") {
|
|
1492
|
-
if (e10.context === pushToTalkKeybindingContext && this.pushToTalkKeybinding === void 0) {
|
|
1493
|
-
this.pushToTalkKeybinding = "Space";
|
|
1494
|
-
this.dispatchEvent(keybindingChangedEvent(" ", "Space", "Space", "push-to-talk"));
|
|
1495
|
-
}
|
|
1496
|
-
if (e10.context === toggleToTalkKeybindingContext && this.toggleToTalkKeybinding === void 0) {
|
|
1497
|
-
this.toggleToTalkKeybinding = "Enter";
|
|
1498
|
-
this.dispatchEvent(keybindingChangedEvent("Enter", "Enter", "Enter", "toggle-to-talk"));
|
|
1499
|
-
}
|
|
1500
|
-
}
|
|
1501
|
-
});
|
|
1502
|
-
_DictationRoot_handleKeybindingChanged.set(this, (e10) => {
|
|
1503
|
-
const event = e10;
|
|
1504
|
-
const keybinding = event.detail.keybinding;
|
|
1505
|
-
if (event.detail.type === "push-to-talk") {
|
|
1506
|
-
this.pushToTalkKeybinding = keybinding;
|
|
1507
|
-
} else if (event.detail.type === "toggle-to-talk") {
|
|
1508
|
-
this.toggleToTalkKeybinding = keybinding;
|
|
1509
|
-
}
|
|
1510
|
-
});
|
|
1511
|
-
this.addEventListener("languages-changed", __classPrivateFieldGet3(this, _DictationRoot_handleLanguageChanged, "f"));
|
|
1512
|
-
this.addEventListener("recording-devices-changed", __classPrivateFieldGet3(this, _DictationRoot_handleDeviceChanged, "f"));
|
|
1513
|
-
this.addEventListener("recording-state-changed", __classPrivateFieldGet3(this, _DictationRoot_handleRecordingStateChanged, "f"));
|
|
1514
|
-
this.addEventListener("context-request", __classPrivateFieldGet3(this, _DictationRoot_handleContextRequest, "f"));
|
|
1515
|
-
this.addEventListener("keybinding-changed", __classPrivateFieldGet3(this, _DictationRoot_handleKeybindingChanged, "f"));
|
|
1538
|
+
_LanguagesContextMixinClass_languagesController = /* @__PURE__ */ new WeakMap();
|
|
1539
|
+
__decorate4([
|
|
1540
|
+
e2({ context: languagesContext }),
|
|
1541
|
+
r4()
|
|
1542
|
+
], LanguagesContextMixinClass.prototype, "_languages", void 0);
|
|
1543
|
+
__decorate4([
|
|
1544
|
+
n4({
|
|
1545
|
+
converter: commaSeparatedConverter,
|
|
1546
|
+
type: Array
|
|
1547
|
+
})
|
|
1548
|
+
], LanguagesContextMixinClass.prototype, "languages", null);
|
|
1549
|
+
return LanguagesContextMixinClass;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
// dist/contexts/mixins/proxy-context.js
|
|
1553
|
+
var __decorate5 = function(decorators, target, key, desc) {
|
|
1554
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
1555
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
1556
|
+
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;
|
|
1557
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
1558
|
+
};
|
|
1559
|
+
var socketUrlContext = n(Symbol("socketUrl"));
|
|
1560
|
+
var socketProxyContext = n(Symbol("socketProxy"));
|
|
1561
|
+
function ProxyContextMixin(superclass) {
|
|
1562
|
+
class ProxyContextMixinClass extends superclass {
|
|
1516
1563
|
}
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1564
|
+
__decorate5([
|
|
1565
|
+
e2({ context: socketUrlContext }),
|
|
1566
|
+
n4({ type: String })
|
|
1567
|
+
], ProxyContextMixinClass.prototype, "socketUrl", void 0);
|
|
1568
|
+
__decorate5([
|
|
1569
|
+
e2({ context: socketProxyContext }),
|
|
1570
|
+
n4({ attribute: false, type: Object })
|
|
1571
|
+
], ProxyContextMixinClass.prototype, "socketProxy", void 0);
|
|
1572
|
+
return ProxyContextMixinClass;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
// dist/contexts/mixins/recording-state-context.js
|
|
1576
|
+
var __decorate6 = function(decorators, target, key, desc) {
|
|
1577
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
1578
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
1579
|
+
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;
|
|
1580
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
1581
|
+
};
|
|
1582
|
+
var recordingStateContext = n(Symbol("recordingState"));
|
|
1583
|
+
function RecordingStateContextMixin(superclass) {
|
|
1584
|
+
class RecordingStateContextMixinClass extends superclass {
|
|
1585
|
+
constructor(...args) {
|
|
1586
|
+
super(...args);
|
|
1587
|
+
this.recordingState = "stopped";
|
|
1588
|
+
this.addEventListener("recording-state-changed", (e10) => {
|
|
1589
|
+
const event = e10;
|
|
1590
|
+
this.recordingState = event.detail.state;
|
|
1591
|
+
});
|
|
1543
1592
|
}
|
|
1544
|
-
return { accessToken: token, environment: void 0, tenant: void 0 };
|
|
1545
1593
|
}
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
this.dispatchEvent(errorEvent(error));
|
|
1565
|
-
}
|
|
1566
|
-
return {
|
|
1567
|
-
accessToken: void 0,
|
|
1568
|
-
environment: void 0,
|
|
1569
|
-
tenant: void 0
|
|
1570
|
-
};
|
|
1594
|
+
__decorate6([
|
|
1595
|
+
e2({ context: recordingStateContext }),
|
|
1596
|
+
r4()
|
|
1597
|
+
], RecordingStateContextMixinClass.prototype, "recordingState", void 0);
|
|
1598
|
+
return RecordingStateContextMixinClass;
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
// dist/contexts/root-context.js
|
|
1602
|
+
var __decorate7 = function(decorators, target, key, desc) {
|
|
1603
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
1604
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
1605
|
+
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;
|
|
1606
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
1607
|
+
};
|
|
1608
|
+
var RootContext = class extends DevicesContextMixin(RecordingStateContextMixin(KeybindingsContextMixin(LanguagesContextMixin(AuthContextMixin(ProxyContextMixin(i5)))))) {
|
|
1609
|
+
constructor() {
|
|
1610
|
+
super(...arguments);
|
|
1611
|
+
this.noWrapper = false;
|
|
1571
1612
|
}
|
|
1572
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
1573
|
-
// Render
|
|
1574
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
1575
1613
|
render() {
|
|
1576
1614
|
if (this.noWrapper) {
|
|
1577
1615
|
return x`<slot></slot>`;
|
|
@@ -1581,91 +1619,53 @@ var DictationRoot = class DictationRoot2 extends i4 {
|
|
|
1581
1619
|
</div>`;
|
|
1582
1620
|
}
|
|
1583
1621
|
};
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
__decorate([
|
|
1623
|
-
e9({ context: socketProxyContext }),
|
|
1624
|
-
n4({ attribute: false, type: Object })
|
|
1625
|
-
], DictationRoot.prototype, "socketProxy", void 0);
|
|
1626
|
-
__decorate([
|
|
1627
|
-
e9({ context: dictationConfigContext }),
|
|
1628
|
-
n4({ attribute: false, type: Object })
|
|
1629
|
-
], DictationRoot.prototype, "dictationConfig", void 0);
|
|
1630
|
-
__decorate([
|
|
1631
|
-
e9({ context: languagesContext }),
|
|
1632
|
-
r5()
|
|
1633
|
-
], DictationRoot.prototype, "_languages", void 0);
|
|
1634
|
-
__decorate([
|
|
1635
|
-
n4({
|
|
1636
|
-
converter: commaSeparatedConverter,
|
|
1637
|
-
type: Array
|
|
1638
|
-
})
|
|
1639
|
-
], DictationRoot.prototype, "languages", null);
|
|
1640
|
-
__decorate([
|
|
1641
|
-
e9({ context: devicesContext }),
|
|
1642
|
-
r5()
|
|
1643
|
-
], DictationRoot.prototype, "_devices", void 0);
|
|
1644
|
-
__decorate([
|
|
1645
|
-
n4({ attribute: false, type: Array })
|
|
1646
|
-
], DictationRoot.prototype, "devices", null);
|
|
1647
|
-
__decorate([
|
|
1648
|
-
e9({ context: selectedDeviceContext }),
|
|
1622
|
+
RootContext.styles = [component_styles_default];
|
|
1623
|
+
__decorate7([
|
|
1624
|
+
n4({ type: Boolean })
|
|
1625
|
+
], RootContext.prototype, "noWrapper", void 0);
|
|
1626
|
+
|
|
1627
|
+
// dist/contexts/ambient-context.js
|
|
1628
|
+
var __decorate8 = function(decorators, target, key, desc) {
|
|
1629
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
1630
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
1631
|
+
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;
|
|
1632
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
1633
|
+
};
|
|
1634
|
+
var ambientConfigContext = n(Symbol("ambientConfig"));
|
|
1635
|
+
var interactionIdContext = n(Symbol("interactionId"));
|
|
1636
|
+
var AmbientRoot = class AmbientRoot2 extends RootContext {
|
|
1637
|
+
constructor() {
|
|
1638
|
+
super();
|
|
1639
|
+
this.ambientConfig = DEFAULT_STREAM_CONFIG;
|
|
1640
|
+
this.addEventListener("languages-changed", (e10) => {
|
|
1641
|
+
const event = e10;
|
|
1642
|
+
const lang = event.detail.selectedLanguage ?? "en";
|
|
1643
|
+
const base = this.ambientConfig ?? DEFAULT_STREAM_CONFIG;
|
|
1644
|
+
this.ambientConfig = {
|
|
1645
|
+
...base,
|
|
1646
|
+
mode: {
|
|
1647
|
+
...base.mode,
|
|
1648
|
+
outputLocale: lang
|
|
1649
|
+
},
|
|
1650
|
+
transcription: {
|
|
1651
|
+
...base.transcription,
|
|
1652
|
+
primaryLanguage: lang
|
|
1653
|
+
}
|
|
1654
|
+
};
|
|
1655
|
+
});
|
|
1656
|
+
}
|
|
1657
|
+
};
|
|
1658
|
+
__decorate8([
|
|
1659
|
+
e2({ context: ambientConfigContext }),
|
|
1649
1660
|
n4({ attribute: false, type: Object })
|
|
1650
|
-
],
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
n4({ attribute: "debug-display-audio", type: Boolean })
|
|
1654
|
-
], DictationRoot.prototype, "debug_displayAudio", void 0);
|
|
1655
|
-
__decorate([
|
|
1656
|
-
e9({ context: pushToTalkKeybindingContext }),
|
|
1657
|
-
n4({ type: String })
|
|
1658
|
-
], DictationRoot.prototype, "pushToTalkKeybinding", void 0);
|
|
1659
|
-
__decorate([
|
|
1660
|
-
e9({ context: toggleToTalkKeybindingContext }),
|
|
1661
|
+
], AmbientRoot.prototype, "ambientConfig", void 0);
|
|
1662
|
+
__decorate8([
|
|
1663
|
+
e2({ context: interactionIdContext }),
|
|
1661
1664
|
n4({ type: String })
|
|
1662
|
-
],
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
],
|
|
1666
|
-
DictationRoot = __decorate([
|
|
1667
|
-
t3("dictation-root")
|
|
1668
|
-
], DictationRoot);
|
|
1665
|
+
], AmbientRoot.prototype, "interactionId", void 0);
|
|
1666
|
+
AmbientRoot = __decorate8([
|
|
1667
|
+
t2("ambient-root")
|
|
1668
|
+
], AmbientRoot);
|
|
1669
1669
|
|
|
1670
1670
|
// node_modules/@corti/sdk/dist/esm/core/json.mjs
|
|
1671
1671
|
var toJson = (value, replacer, space) => {
|
|
@@ -12530,8 +12530,8 @@ var CortiWebSocketProxyClient = class {
|
|
|
12530
12530
|
CortiWebSocketProxyClient.stream = new CustomProxyStream();
|
|
12531
12531
|
CortiWebSocketProxyClient.transcribe = new CustomProxyTranscribe();
|
|
12532
12532
|
|
|
12533
|
-
// dist/controllers/
|
|
12534
|
-
var
|
|
12533
|
+
// dist/controllers/socket-controller.js
|
|
12534
|
+
var __classPrivateFieldGet6 = function(receiver, state, kind, f5) {
|
|
12535
12535
|
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
12536
12536
|
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");
|
|
12537
12537
|
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
@@ -12542,121 +12542,126 @@ var __classPrivateFieldSet3 = function(receiver, state, value, kind, f5) {
|
|
|
12542
12542
|
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");
|
|
12543
12543
|
return kind === "a" ? f5.call(receiver, value) : f5 ? f5.value = value : state.set(receiver, value), value;
|
|
12544
12544
|
};
|
|
12545
|
-
var
|
|
12546
|
-
var
|
|
12547
|
-
var
|
|
12548
|
-
var
|
|
12549
|
-
var
|
|
12550
|
-
var
|
|
12551
|
-
var
|
|
12552
|
-
var
|
|
12553
|
-
var
|
|
12554
|
-
var
|
|
12555
|
-
var
|
|
12556
|
-
var
|
|
12557
|
-
var
|
|
12558
|
-
var
|
|
12559
|
-
var
|
|
12560
|
-
var
|
|
12561
|
-
var
|
|
12562
|
-
var
|
|
12563
|
-
var
|
|
12564
|
-
var
|
|
12565
|
-
var
|
|
12545
|
+
var _SocketController_instances;
|
|
12546
|
+
var _SocketController_webSocket;
|
|
12547
|
+
var _SocketController_cortiClient;
|
|
12548
|
+
var _SocketController_connectionGeneration;
|
|
12549
|
+
var _SocketController_socketReady;
|
|
12550
|
+
var _SocketController_closeTimeout;
|
|
12551
|
+
var _SocketController_outboundQueue;
|
|
12552
|
+
var _SocketController_callbacks;
|
|
12553
|
+
var _SocketController_lastConfig;
|
|
12554
|
+
var _SocketController_lastSocketUrl;
|
|
12555
|
+
var _SocketController_lastSocketProxy;
|
|
12556
|
+
var _SocketController_connectingPromise;
|
|
12557
|
+
var _SocketController_isConnecting;
|
|
12558
|
+
var _SocketController_openViaProxy;
|
|
12559
|
+
var _SocketController_openViaAuth;
|
|
12560
|
+
var _SocketController_doConnect;
|
|
12561
|
+
var _SocketController_isSocketOpen;
|
|
12562
|
+
var _SocketController_configHasChanged;
|
|
12563
|
+
var _SocketController_drain;
|
|
12564
|
+
var _SocketController_setupWebSocketHandlers;
|
|
12565
|
+
var SocketController = class {
|
|
12566
12566
|
constructor(host) {
|
|
12567
|
-
|
|
12568
|
-
|
|
12569
|
-
|
|
12570
|
-
|
|
12571
|
-
|
|
12572
|
-
|
|
12573
|
-
|
|
12574
|
-
|
|
12575
|
-
|
|
12576
|
-
|
|
12577
|
-
|
|
12578
|
-
|
|
12579
|
-
|
|
12567
|
+
_SocketController_instances.add(this);
|
|
12568
|
+
_SocketController_webSocket.set(this, null);
|
|
12569
|
+
_SocketController_cortiClient.set(this, null);
|
|
12570
|
+
_SocketController_connectionGeneration.set(this, 0);
|
|
12571
|
+
_SocketController_socketReady.set(this, false);
|
|
12572
|
+
_SocketController_closeTimeout.set(this, void 0);
|
|
12573
|
+
_SocketController_outboundQueue.set(this, []);
|
|
12574
|
+
_SocketController_callbacks.set(this, void 0);
|
|
12575
|
+
_SocketController_lastConfig.set(this, null);
|
|
12576
|
+
_SocketController_lastSocketUrl.set(this, void 0);
|
|
12577
|
+
_SocketController_lastSocketProxy.set(this, void 0);
|
|
12578
|
+
_SocketController_connectingPromise.set(this, null);
|
|
12579
|
+
_SocketController_isConnecting.set(this, false);
|
|
12580
12580
|
this.mediaRecorderHandler = (data) => {
|
|
12581
|
-
if (
|
|
12582
|
-
|
|
12583
|
-
|
|
12581
|
+
if (__classPrivateFieldGet6(this, _SocketController_socketReady, "f") && __classPrivateFieldGet6(this, _SocketController_instances, "m", _SocketController_isSocketOpen).call(this)) {
|
|
12582
|
+
__classPrivateFieldGet6(this, _SocketController_webSocket, "f")?.send(data);
|
|
12583
|
+
__classPrivateFieldGet6(this, _SocketController_callbacks, "f")?.onNetworkActivity?.("sent", {
|
|
12584
12584
|
size: data.size,
|
|
12585
12585
|
type: "audio"
|
|
12586
12586
|
});
|
|
12587
12587
|
return;
|
|
12588
12588
|
}
|
|
12589
|
-
|
|
12589
|
+
__classPrivateFieldGet6(this, _SocketController_outboundQueue, "f").push(data);
|
|
12590
12590
|
};
|
|
12591
12591
|
this.host = host;
|
|
12592
12592
|
host.addController(this);
|
|
12593
12593
|
}
|
|
12594
|
-
|
|
12595
|
-
this.
|
|
12596
|
-
|
|
12597
|
-
async connect(dictationConfig = DEFAULT_DICTATION_CONFIG, callbacks = {}) {
|
|
12598
|
-
if (__classPrivateFieldGet4(this, _DictationController_connectingPromise, "f") && !__classPrivateFieldGet4(this, _DictationController_instances, "m", _DictationController_configHasChanged).call(this)) {
|
|
12599
|
-
return __classPrivateFieldGet4(this, _DictationController_connectingPromise, "f");
|
|
12594
|
+
async connect(config, callbacks) {
|
|
12595
|
+
if (__classPrivateFieldGet6(this, _SocketController_connectingPromise, "f") && !__classPrivateFieldGet6(this, _SocketController_instances, "m", _SocketController_configHasChanged).call(this, config)) {
|
|
12596
|
+
return __classPrivateFieldGet6(this, _SocketController_connectingPromise, "f");
|
|
12600
12597
|
}
|
|
12601
|
-
__classPrivateFieldSet3(this,
|
|
12602
|
-
__classPrivateFieldSet3(this,
|
|
12603
|
-
__classPrivateFieldSet3(this,
|
|
12604
|
-
__classPrivateFieldSet3(this,
|
|
12598
|
+
__classPrivateFieldSet3(this, _SocketController_isConnecting, true, "f");
|
|
12599
|
+
__classPrivateFieldSet3(this, _SocketController_connectingPromise, __classPrivateFieldGet6(this, _SocketController_instances, "m", _SocketController_doConnect).call(this, config, callbacks).finally(() => {
|
|
12600
|
+
__classPrivateFieldSet3(this, _SocketController_isConnecting, false, "f");
|
|
12601
|
+
__classPrivateFieldSet3(this, _SocketController_connectingPromise, null, "f");
|
|
12605
12602
|
}), "f");
|
|
12606
|
-
return
|
|
12603
|
+
return __classPrivateFieldGet6(this, _SocketController_connectingPromise, "f");
|
|
12607
12604
|
}
|
|
12608
|
-
|
|
12609
|
-
|
|
12610
|
-
__classPrivateFieldGet4(this, _DictationController_webSocket, "f")?.send(JSON.stringify({ type: "flush" }));
|
|
12611
|
-
__classPrivateFieldGet4(this, _DictationController_callbacks, "f")?.onNetworkActivity?.("sent", { type: "flush" });
|
|
12612
|
-
return;
|
|
12613
|
-
}
|
|
12614
|
-
__classPrivateFieldGet4(this, _DictationController_outboundQueue, "f").push({ type: "flush" });
|
|
12605
|
+
hostDisconnected() {
|
|
12606
|
+
this.cleanup();
|
|
12615
12607
|
}
|
|
12616
12608
|
isConnectionOpen() {
|
|
12617
|
-
return
|
|
12609
|
+
return __classPrivateFieldGet6(this, _SocketController_webSocket, "f") !== null && (__classPrivateFieldGet6(this, _SocketController_webSocket, "f").readyState === WebSocket.OPEN || __classPrivateFieldGet6(this, _SocketController_webSocket, "f").readyState === WebSocket.CONNECTING);
|
|
12618
12610
|
}
|
|
12619
12611
|
isConnecting() {
|
|
12620
|
-
return
|
|
12612
|
+
return __classPrivateFieldGet6(this, _SocketController_isConnecting, "f");
|
|
12621
12613
|
}
|
|
12622
12614
|
async waitForConnection() {
|
|
12623
|
-
await
|
|
12615
|
+
await __classPrivateFieldGet6(this, _SocketController_connectingPromise, "f");
|
|
12616
|
+
}
|
|
12617
|
+
async pause() {
|
|
12618
|
+
if (__classPrivateFieldGet6(this, _SocketController_socketReady, "f") && __classPrivateFieldGet6(this, _SocketController_instances, "m", _SocketController_isSocketOpen).call(this)) {
|
|
12619
|
+
__classPrivateFieldGet6(this, _SocketController_webSocket, "f")?.send(JSON.stringify({ type: "flush" }));
|
|
12620
|
+
__classPrivateFieldGet6(this, _SocketController_callbacks, "f")?.onNetworkActivity?.("sent", { type: "flush" });
|
|
12621
|
+
return;
|
|
12622
|
+
}
|
|
12623
|
+
__classPrivateFieldGet6(this, _SocketController_outboundQueue, "f").push({ type: "flush" });
|
|
12624
|
+
}
|
|
12625
|
+
async stopRecording() {
|
|
12626
|
+
await this.pause();
|
|
12624
12627
|
}
|
|
12625
12628
|
async closeConnection(onClose) {
|
|
12626
12629
|
await new Promise((resolve, reject) => {
|
|
12627
|
-
const oldSocket =
|
|
12628
|
-
__classPrivateFieldSet3(this,
|
|
12630
|
+
const oldSocket = __classPrivateFieldGet6(this, _SocketController_webSocket, "f");
|
|
12631
|
+
__classPrivateFieldSet3(this, _SocketController_webSocket, null, "f");
|
|
12629
12632
|
if (!oldSocket || oldSocket.readyState !== WebSocket.OPEN && oldSocket.readyState !== WebSocket.CONNECTING) {
|
|
12630
|
-
__classPrivateFieldSet3(this,
|
|
12633
|
+
__classPrivateFieldSet3(this, _SocketController_socketReady, false, "f");
|
|
12631
12634
|
resolve();
|
|
12632
12635
|
return;
|
|
12633
12636
|
}
|
|
12634
12637
|
oldSocket.on("close", (event) => {
|
|
12635
|
-
if (
|
|
12636
|
-
clearTimeout(
|
|
12637
|
-
__classPrivateFieldSet3(this,
|
|
12638
|
+
if (__classPrivateFieldGet6(this, _SocketController_closeTimeout, "f")) {
|
|
12639
|
+
clearTimeout(__classPrivateFieldGet6(this, _SocketController_closeTimeout, "f"));
|
|
12640
|
+
__classPrivateFieldSet3(this, _SocketController_closeTimeout, void 0, "f");
|
|
12638
12641
|
}
|
|
12639
12642
|
if (onClose) {
|
|
12640
12643
|
onClose(event);
|
|
12644
|
+
} else if (__classPrivateFieldGet6(this, _SocketController_callbacks, "f")?.onClose) {
|
|
12645
|
+
__classPrivateFieldGet6(this, _SocketController_callbacks, "f").onClose(event);
|
|
12641
12646
|
}
|
|
12642
12647
|
resolve();
|
|
12643
12648
|
});
|
|
12644
|
-
const wasReady =
|
|
12645
|
-
__classPrivateFieldSet3(this,
|
|
12649
|
+
const wasReady = __classPrivateFieldGet6(this, _SocketController_socketReady, "f");
|
|
12650
|
+
__classPrivateFieldSet3(this, _SocketController_socketReady, false, "f");
|
|
12646
12651
|
oldSocket.on("message", (message) => {
|
|
12647
|
-
|
|
12648
|
-
if (
|
|
12649
|
-
|
|
12652
|
+
__classPrivateFieldGet6(this, _SocketController_callbacks, "f")?.onNetworkActivity?.("received", message);
|
|
12653
|
+
if (__classPrivateFieldGet6(this, _SocketController_callbacks, "f")?.onMessage) {
|
|
12654
|
+
__classPrivateFieldGet6(this, _SocketController_callbacks, "f").onMessage(message);
|
|
12650
12655
|
}
|
|
12651
12656
|
if (!wasReady && message.type === "CONFIG_ACCEPTED") {
|
|
12652
12657
|
oldSocket.sendEnd({ type: "end" });
|
|
12653
|
-
|
|
12658
|
+
__classPrivateFieldGet6(this, _SocketController_callbacks, "f")?.onNetworkActivity?.("sent", { type: "end" });
|
|
12654
12659
|
return;
|
|
12655
12660
|
}
|
|
12656
|
-
if (message.type === "ended") {
|
|
12657
|
-
if (
|
|
12658
|
-
clearTimeout(
|
|
12659
|
-
__classPrivateFieldSet3(this,
|
|
12661
|
+
if (message.type === "ended" || message.type === "ENDED") {
|
|
12662
|
+
if (__classPrivateFieldGet6(this, _SocketController_closeTimeout, "f")) {
|
|
12663
|
+
clearTimeout(__classPrivateFieldGet6(this, _SocketController_closeTimeout, "f"));
|
|
12664
|
+
__classPrivateFieldSet3(this, _SocketController_closeTimeout, void 0, "f");
|
|
12660
12665
|
}
|
|
12661
12666
|
resolve();
|
|
12662
12667
|
return;
|
|
@@ -12664,9 +12669,9 @@ var DictationController = class {
|
|
|
12664
12669
|
});
|
|
12665
12670
|
if (wasReady) {
|
|
12666
12671
|
oldSocket.sendEnd({ type: "end" });
|
|
12667
|
-
|
|
12672
|
+
__classPrivateFieldGet6(this, _SocketController_callbacks, "f")?.onNetworkActivity?.("sent", { type: "end" });
|
|
12668
12673
|
}
|
|
12669
|
-
__classPrivateFieldSet3(this,
|
|
12674
|
+
__classPrivateFieldSet3(this, _SocketController_closeTimeout, window.setTimeout(() => {
|
|
12670
12675
|
reject(new Error("Connection close timeout"));
|
|
12671
12676
|
if (oldSocket?.readyState === WebSocket.OPEN) {
|
|
12672
12677
|
oldSocket.close();
|
|
@@ -12676,68 +12681,35 @@ var DictationController = class {
|
|
|
12676
12681
|
}
|
|
12677
12682
|
cleanup() {
|
|
12678
12683
|
var _a;
|
|
12679
|
-
__classPrivateFieldSet3(this,
|
|
12680
|
-
__classPrivateFieldSet3(this,
|
|
12681
|
-
if (
|
|
12682
|
-
clearTimeout(
|
|
12683
|
-
__classPrivateFieldSet3(this,
|
|
12684
|
+
__classPrivateFieldSet3(this, _SocketController_connectionGeneration, (_a = __classPrivateFieldGet6(this, _SocketController_connectionGeneration, "f"), _a++, _a), "f");
|
|
12685
|
+
__classPrivateFieldSet3(this, _SocketController_socketReady, false, "f");
|
|
12686
|
+
if (__classPrivateFieldGet6(this, _SocketController_closeTimeout, "f")) {
|
|
12687
|
+
clearTimeout(__classPrivateFieldGet6(this, _SocketController_closeTimeout, "f"));
|
|
12688
|
+
__classPrivateFieldSet3(this, _SocketController_closeTimeout, void 0, "f");
|
|
12684
12689
|
}
|
|
12685
12690
|
if (this.isConnectionOpen()) {
|
|
12686
|
-
|
|
12691
|
+
__classPrivateFieldGet6(this, _SocketController_webSocket, "f")?.close();
|
|
12687
12692
|
}
|
|
12688
|
-
__classPrivateFieldSet3(this,
|
|
12689
|
-
__classPrivateFieldSet3(this,
|
|
12690
|
-
__classPrivateFieldSet3(this,
|
|
12691
|
-
__classPrivateFieldSet3(this,
|
|
12692
|
-
__classPrivateFieldSet3(this,
|
|
12693
|
-
if (
|
|
12694
|
-
this.host.dispatchEvent(errorEvent(`${
|
|
12693
|
+
__classPrivateFieldSet3(this, _SocketController_webSocket, null, "f");
|
|
12694
|
+
__classPrivateFieldSet3(this, _SocketController_cortiClient, null, "f");
|
|
12695
|
+
__classPrivateFieldSet3(this, _SocketController_lastConfig, null, "f");
|
|
12696
|
+
__classPrivateFieldSet3(this, _SocketController_lastSocketUrl, void 0, "f");
|
|
12697
|
+
__classPrivateFieldSet3(this, _SocketController_lastSocketProxy, void 0, "f");
|
|
12698
|
+
if (__classPrivateFieldGet6(this, _SocketController_outboundQueue, "f").length > 0) {
|
|
12699
|
+
this.host.dispatchEvent(errorEvent(`${__classPrivateFieldGet6(this, _SocketController_outboundQueue, "f").length} unsent message(s) were discarded because the configuration changed before the connection was closed`));
|
|
12695
12700
|
}
|
|
12696
|
-
__classPrivateFieldSet3(this,
|
|
12701
|
+
__classPrivateFieldSet3(this, _SocketController_outboundQueue, [], "f");
|
|
12697
12702
|
}
|
|
12698
12703
|
};
|
|
12699
|
-
|
|
12700
|
-
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"));
|
|
12701
|
-
}, _DictationController_doConnect = async function _DictationController_doConnect2(dictationConfig, callbacks) {
|
|
12702
|
-
const newConnection = __classPrivateFieldGet4(this, _DictationController_instances, "m", _DictationController_configHasChanged).call(this) || !this.isConnectionOpen();
|
|
12703
|
-
if (newConnection) {
|
|
12704
|
-
this.cleanup();
|
|
12705
|
-
__classPrivateFieldSet3(this, _DictationController_lastDictationConfig, this.host._dictationConfig || null, "f");
|
|
12706
|
-
__classPrivateFieldSet3(this, _DictationController_lastSocketUrl, this.host._socketUrl, "f");
|
|
12707
|
-
__classPrivateFieldSet3(this, _DictationController_lastSocketProxy, this.host._socketProxy, "f");
|
|
12708
|
-
const generation = __classPrivateFieldGet4(this, _DictationController_connectionGeneration, "f");
|
|
12709
|
-
const socket = 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);
|
|
12710
|
-
if (__classPrivateFieldGet4(this, _DictationController_connectionGeneration, "f") !== generation) {
|
|
12711
|
-
socket.close();
|
|
12712
|
-
return "superseded";
|
|
12713
|
-
}
|
|
12714
|
-
__classPrivateFieldSet3(this, _DictationController_webSocket, socket, "f");
|
|
12715
|
-
__classPrivateFieldGet4(this, _DictationController_callbacks, "f")?.onNetworkActivity?.("sent", {
|
|
12716
|
-
configuration: dictationConfig,
|
|
12717
|
-
type: "config"
|
|
12718
|
-
});
|
|
12719
|
-
}
|
|
12720
|
-
__classPrivateFieldSet3(this, _DictationController_callbacks, callbacks, "f");
|
|
12721
|
-
__classPrivateFieldGet4(this, _DictationController_instances, "m", _DictationController_setupWebSocketHandlers).call(this, callbacks);
|
|
12722
|
-
if (!newConnection && this.isConnectionOpen()) {
|
|
12723
|
-
__classPrivateFieldSet3(this, _DictationController_socketReady, true, "f");
|
|
12724
|
-
__classPrivateFieldGet4(this, _DictationController_instances, "m", _DictationController_drain).call(this);
|
|
12725
|
-
}
|
|
12726
|
-
return newConnection;
|
|
12727
|
-
}, _DictationController_connectProxy = async function _DictationController_connectProxy2(dictationConfig) {
|
|
12704
|
+
_SocketController_webSocket = /* @__PURE__ */ new WeakMap(), _SocketController_cortiClient = /* @__PURE__ */ new WeakMap(), _SocketController_connectionGeneration = /* @__PURE__ */ new WeakMap(), _SocketController_socketReady = /* @__PURE__ */ new WeakMap(), _SocketController_closeTimeout = /* @__PURE__ */ new WeakMap(), _SocketController_outboundQueue = /* @__PURE__ */ new WeakMap(), _SocketController_callbacks = /* @__PURE__ */ new WeakMap(), _SocketController_lastConfig = /* @__PURE__ */ new WeakMap(), _SocketController_lastSocketUrl = /* @__PURE__ */ new WeakMap(), _SocketController_lastSocketProxy = /* @__PURE__ */ new WeakMap(), _SocketController_connectingPromise = /* @__PURE__ */ new WeakMap(), _SocketController_isConnecting = /* @__PURE__ */ new WeakMap(), _SocketController_instances = /* @__PURE__ */ new WeakSet(), _SocketController_openViaProxy = async function _SocketController_openViaProxy2(config) {
|
|
12728
12705
|
const proxyOptions = this.host._socketProxy || {
|
|
12729
12706
|
url: this.host._socketUrl || ""
|
|
12730
12707
|
};
|
|
12731
12708
|
if (!proxyOptions.url) {
|
|
12732
12709
|
throw new Error("Proxy URL is required when using proxy client");
|
|
12733
12710
|
}
|
|
12734
|
-
return
|
|
12735
|
-
|
|
12736
|
-
awaitConfiguration: false,
|
|
12737
|
-
configuration: dictationConfig,
|
|
12738
|
-
proxy: proxyOptions
|
|
12739
|
-
});
|
|
12740
|
-
}, _DictationController_connectAuth = async function _DictationController_connectAuth2(dictationConfig) {
|
|
12711
|
+
return this._connectThroughProxy(config, proxyOptions);
|
|
12712
|
+
}, _SocketController_openViaAuth = async function _SocketController_openViaAuth2(config) {
|
|
12741
12713
|
if (!this.host._authConfig && !this.host._accessToken) {
|
|
12742
12714
|
throw new Error("Auth configuration or access token is required to connect");
|
|
12743
12715
|
}
|
|
@@ -12747,67 +12719,150 @@ _DictationController_cortiClient = /* @__PURE__ */ new WeakMap(), _DictationCont
|
|
|
12747
12719
|
accessToken: this.host._accessToken || ""
|
|
12748
12720
|
})
|
|
12749
12721
|
};
|
|
12750
|
-
__classPrivateFieldSet3(this,
|
|
12722
|
+
__classPrivateFieldSet3(this, _SocketController_cortiClient, new CortiClient2({
|
|
12751
12723
|
auth,
|
|
12752
12724
|
environment: this.host._region,
|
|
12753
12725
|
tenantName: this.host._tenantName
|
|
12754
12726
|
}), "f");
|
|
12755
|
-
return
|
|
12756
|
-
|
|
12757
|
-
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12727
|
+
return this._connectThroughAuth(__classPrivateFieldGet6(this, _SocketController_cortiClient, "f"), config);
|
|
12728
|
+
}, _SocketController_doConnect = async function _SocketController_doConnect2(config, callbacks) {
|
|
12729
|
+
const newConnection = __classPrivateFieldGet6(this, _SocketController_instances, "m", _SocketController_configHasChanged).call(this, config) || !this.isConnectionOpen();
|
|
12730
|
+
if (newConnection) {
|
|
12731
|
+
this.cleanup();
|
|
12732
|
+
__classPrivateFieldSet3(this, _SocketController_lastConfig, config, "f");
|
|
12733
|
+
__classPrivateFieldSet3(this, _SocketController_lastSocketUrl, this.host._socketUrl, "f");
|
|
12734
|
+
__classPrivateFieldSet3(this, _SocketController_lastSocketProxy, this.host._socketProxy, "f");
|
|
12735
|
+
const generation = __classPrivateFieldGet6(this, _SocketController_connectionGeneration, "f");
|
|
12736
|
+
const socket = this.host._socketUrl || this.host._socketProxy ? await __classPrivateFieldGet6(this, _SocketController_instances, "m", _SocketController_openViaProxy).call(this, config) : await __classPrivateFieldGet6(this, _SocketController_instances, "m", _SocketController_openViaAuth).call(this, config);
|
|
12737
|
+
if (__classPrivateFieldGet6(this, _SocketController_connectionGeneration, "f") !== generation) {
|
|
12738
|
+
socket.close();
|
|
12739
|
+
return "superseded";
|
|
12740
|
+
}
|
|
12741
|
+
__classPrivateFieldSet3(this, _SocketController_webSocket, socket, "f");
|
|
12742
|
+
__classPrivateFieldGet6(this, _SocketController_callbacks, "f")?.onNetworkActivity?.("sent", {
|
|
12743
|
+
configuration: config,
|
|
12744
|
+
type: "config"
|
|
12745
|
+
});
|
|
12746
|
+
}
|
|
12747
|
+
__classPrivateFieldSet3(this, _SocketController_callbacks, callbacks, "f");
|
|
12748
|
+
__classPrivateFieldGet6(this, _SocketController_instances, "m", _SocketController_setupWebSocketHandlers).call(this, callbacks);
|
|
12749
|
+
if (!newConnection && this.isConnectionOpen()) {
|
|
12750
|
+
__classPrivateFieldSet3(this, _SocketController_socketReady, true, "f");
|
|
12751
|
+
__classPrivateFieldGet6(this, _SocketController_instances, "m", _SocketController_drain).call(this);
|
|
12752
|
+
}
|
|
12753
|
+
return newConnection;
|
|
12754
|
+
}, _SocketController_isSocketOpen = function _SocketController_isSocketOpen2() {
|
|
12755
|
+
return __classPrivateFieldGet6(this, _SocketController_webSocket, "f") !== null && __classPrivateFieldGet6(this, _SocketController_webSocket, "f").readyState === WebSocket.OPEN;
|
|
12756
|
+
}, _SocketController_configHasChanged = function _SocketController_configHasChanged2(nextConfig) {
|
|
12757
|
+
return JSON.stringify(nextConfig) !== JSON.stringify(__classPrivateFieldGet6(this, _SocketController_lastConfig, "f")) || this.host._socketUrl !== __classPrivateFieldGet6(this, _SocketController_lastSocketUrl, "f") || JSON.stringify(this.host._socketProxy) !== JSON.stringify(__classPrivateFieldGet6(this, _SocketController_lastSocketProxy, "f"));
|
|
12758
|
+
}, _SocketController_drain = function _SocketController_drain2() {
|
|
12759
|
+
if (!__classPrivateFieldGet6(this, _SocketController_socketReady, "f") || !__classPrivateFieldGet6(this, _SocketController_instances, "m", _SocketController_isSocketOpen).call(this) || __classPrivateFieldGet6(this, _SocketController_outboundQueue, "f").length === 0) {
|
|
12760
|
+
return;
|
|
12761
|
+
}
|
|
12762
|
+
while (__classPrivateFieldGet6(this, _SocketController_outboundQueue, "f").length > 0 && __classPrivateFieldGet6(this, _SocketController_instances, "m", _SocketController_isSocketOpen).call(this)) {
|
|
12763
|
+
const item = __classPrivateFieldGet6(this, _SocketController_outboundQueue, "f").shift();
|
|
12764
|
+
if (item === void 0) {
|
|
12765
|
+
break;
|
|
12766
|
+
}
|
|
12767
|
+
if (item instanceof Blob) {
|
|
12768
|
+
__classPrivateFieldGet6(this, _SocketController_webSocket, "f").send(item);
|
|
12769
|
+
__classPrivateFieldGet6(this, _SocketController_callbacks, "f")?.onNetworkActivity?.("sent", {
|
|
12770
|
+
size: item.size,
|
|
12771
|
+
type: "audio"
|
|
12772
|
+
});
|
|
12773
|
+
continue;
|
|
12774
|
+
}
|
|
12775
|
+
__classPrivateFieldGet6(this, _SocketController_webSocket, "f").send(JSON.stringify(item));
|
|
12776
|
+
__classPrivateFieldGet6(this, _SocketController_callbacks, "f")?.onNetworkActivity?.("sent", {
|
|
12777
|
+
type: item.type
|
|
12778
|
+
});
|
|
12779
|
+
}
|
|
12780
|
+
}, _SocketController_setupWebSocketHandlers = function _SocketController_setupWebSocketHandlers2(callbacks) {
|
|
12781
|
+
if (!__classPrivateFieldGet6(this, _SocketController_webSocket, "f")) {
|
|
12762
12782
|
throw new Error("WebSocket not initialized");
|
|
12763
12783
|
}
|
|
12764
|
-
|
|
12784
|
+
__classPrivateFieldGet6(this, _SocketController_webSocket, "f").on("message", (message) => {
|
|
12765
12785
|
if (message.type === "CONFIG_ACCEPTED") {
|
|
12766
|
-
__classPrivateFieldSet3(this,
|
|
12767
|
-
|
|
12786
|
+
__classPrivateFieldSet3(this, _SocketController_socketReady, true, "f");
|
|
12787
|
+
__classPrivateFieldGet6(this, _SocketController_instances, "m", _SocketController_drain).call(this);
|
|
12768
12788
|
}
|
|
12769
12789
|
callbacks.onNetworkActivity?.("received", message);
|
|
12770
12790
|
if (callbacks.onMessage) {
|
|
12771
12791
|
callbacks.onMessage(message);
|
|
12772
12792
|
}
|
|
12773
12793
|
});
|
|
12774
|
-
|
|
12775
|
-
__classPrivateFieldSet3(this,
|
|
12794
|
+
__classPrivateFieldGet6(this, _SocketController_webSocket, "f").on("error", (event) => {
|
|
12795
|
+
__classPrivateFieldSet3(this, _SocketController_socketReady, false, "f");
|
|
12776
12796
|
if (callbacks.onError) {
|
|
12777
12797
|
callbacks.onError(event);
|
|
12778
12798
|
}
|
|
12779
12799
|
});
|
|
12780
|
-
|
|
12781
|
-
__classPrivateFieldSet3(this,
|
|
12800
|
+
__classPrivateFieldGet6(this, _SocketController_webSocket, "f").on("close", (event) => {
|
|
12801
|
+
__classPrivateFieldSet3(this, _SocketController_socketReady, false, "f");
|
|
12782
12802
|
if (callbacks.onClose) {
|
|
12783
12803
|
callbacks.onClose(event);
|
|
12784
12804
|
}
|
|
12785
12805
|
});
|
|
12786
|
-
}
|
|
12787
|
-
|
|
12788
|
-
|
|
12789
|
-
|
|
12790
|
-
|
|
12806
|
+
};
|
|
12807
|
+
|
|
12808
|
+
// dist/controllers/ambient-controller.js
|
|
12809
|
+
var AmbientController = class extends SocketController {
|
|
12810
|
+
async stopRecording() {
|
|
12811
|
+
await this.closeConnection();
|
|
12791
12812
|
}
|
|
12792
|
-
|
|
12793
|
-
|
|
12794
|
-
|
|
12795
|
-
|
|
12796
|
-
|
|
12797
|
-
|
|
12798
|
-
|
|
12799
|
-
|
|
12800
|
-
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
|
|
12806
|
-
|
|
12807
|
-
|
|
12813
|
+
async _connectThroughProxy(session, proxy) {
|
|
12814
|
+
return await CortiWebSocketProxyClient.stream.connect({
|
|
12815
|
+
// awaitConfiguration: false — CONFIG_* appears in network activity before the socket is configured server-side
|
|
12816
|
+
awaitConfiguration: false,
|
|
12817
|
+
configuration: session.configuration,
|
|
12818
|
+
proxy
|
|
12819
|
+
});
|
|
12820
|
+
}
|
|
12821
|
+
async _connectThroughAuth(client, session) {
|
|
12822
|
+
return await client.stream.connect({
|
|
12823
|
+
// awaitConfiguration: false — CONFIG_* appears in network activity before the socket is configured server-side
|
|
12824
|
+
awaitConfiguration: false,
|
|
12825
|
+
configuration: session.configuration,
|
|
12826
|
+
id: session.interactionId
|
|
12827
|
+
});
|
|
12828
|
+
}
|
|
12829
|
+
};
|
|
12830
|
+
|
|
12831
|
+
// dist/contexts/dictation-context.js
|
|
12832
|
+
var __decorate9 = function(decorators, target, key, desc) {
|
|
12833
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
12834
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
12835
|
+
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;
|
|
12836
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
12837
|
+
};
|
|
12838
|
+
var dictationConfigContext = n(Symbol("dictationConfig"));
|
|
12839
|
+
var debugDisplayAudioContext = n(Symbol("debugDisplayAudio"));
|
|
12840
|
+
var DictationRoot = class DictationRoot2 extends RootContext {
|
|
12841
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
12842
|
+
// Lifecycle
|
|
12843
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
12844
|
+
constructor() {
|
|
12845
|
+
super();
|
|
12846
|
+
this.addEventListener("languages-changed", (e10) => {
|
|
12847
|
+
const event = e10;
|
|
12848
|
+
this.dictationConfig = {
|
|
12849
|
+
...this.dictationConfig,
|
|
12850
|
+
primaryLanguage: event.detail.selectedLanguage ?? "en"
|
|
12851
|
+
};
|
|
12808
12852
|
});
|
|
12809
12853
|
}
|
|
12810
12854
|
};
|
|
12855
|
+
__decorate9([
|
|
12856
|
+
e2({ context: dictationConfigContext }),
|
|
12857
|
+
n4({ attribute: false, type: Object })
|
|
12858
|
+
], DictationRoot.prototype, "dictationConfig", void 0);
|
|
12859
|
+
__decorate9([
|
|
12860
|
+
e2({ context: debugDisplayAudioContext }),
|
|
12861
|
+
n4({ attribute: "debug-display-audio", type: Boolean })
|
|
12862
|
+
], DictationRoot.prototype, "debug_displayAudio", void 0);
|
|
12863
|
+
DictationRoot = __decorate9([
|
|
12864
|
+
t2("dictation-root")
|
|
12865
|
+
], DictationRoot);
|
|
12811
12866
|
|
|
12812
12867
|
// dist/utils/keybinding.js
|
|
12813
12868
|
function isMac() {
|
|
@@ -12845,11 +12900,10 @@ function normalizeKeybinding(keybinding) {
|
|
|
12845
12900
|
if (!keybinding) {
|
|
12846
12901
|
return null;
|
|
12847
12902
|
}
|
|
12848
|
-
|
|
12849
|
-
if (trimmed === "") {
|
|
12903
|
+
if (keybinding !== " " && keybinding.trim() === "") {
|
|
12850
12904
|
return null;
|
|
12851
12905
|
}
|
|
12852
|
-
return normalizeKeyForKeybinding(
|
|
12906
|
+
return normalizeKeyForKeybinding(keybinding);
|
|
12853
12907
|
}
|
|
12854
12908
|
function matchesKeybinding(event, keybinding) {
|
|
12855
12909
|
const normalizedKeybinding = normalizeKeybinding(keybinding);
|
|
@@ -12875,7 +12929,7 @@ function shouldIgnoreKeybinding(element) {
|
|
|
12875
12929
|
}
|
|
12876
12930
|
|
|
12877
12931
|
// dist/controllers/keybinding-controller.js
|
|
12878
|
-
var
|
|
12932
|
+
var __classPrivateFieldGet7 = function(receiver, state, kind, f5) {
|
|
12879
12933
|
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
12880
12934
|
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");
|
|
12881
12935
|
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
@@ -12904,19 +12958,19 @@ var KeybindingController = class {
|
|
|
12904
12958
|
host.addController(this);
|
|
12905
12959
|
}
|
|
12906
12960
|
hostConnected() {
|
|
12907
|
-
|
|
12961
|
+
__classPrivateFieldGet7(this, _KeybindingController_instances, "m", _KeybindingController_setupListeners).call(this);
|
|
12908
12962
|
}
|
|
12909
12963
|
hostDisconnected() {
|
|
12910
|
-
|
|
12964
|
+
__classPrivateFieldGet7(this, _KeybindingController_instances, "m", _KeybindingController_removeListeners).call(this);
|
|
12911
12965
|
}
|
|
12912
12966
|
};
|
|
12913
12967
|
_KeybindingController_keydownHandler = /* @__PURE__ */ new WeakMap(), _KeybindingController_keyupHandler = /* @__PURE__ */ new WeakMap(), _KeybindingController_blurHandler = /* @__PURE__ */ new WeakMap(), _KeybindingController_isPushToTalkKeyPressed = /* @__PURE__ */ new WeakMap(), _KeybindingController_instances = /* @__PURE__ */ new WeakSet(), _KeybindingController_setupListeners = function _KeybindingController_setupListeners2() {
|
|
12914
|
-
|
|
12968
|
+
__classPrivateFieldGet7(this, _KeybindingController_instances, "m", _KeybindingController_removeListeners).call(this);
|
|
12915
12969
|
__classPrivateFieldSet4(this, _KeybindingController_keydownHandler, (event) => {
|
|
12916
12970
|
if (shouldIgnoreKeybinding(document.activeElement)) {
|
|
12917
12971
|
return;
|
|
12918
12972
|
}
|
|
12919
|
-
if (this.host._toggleToTalkKeybinding && matchesKeybinding(event, this.host._toggleToTalkKeybinding) && !
|
|
12973
|
+
if (this.host._toggleToTalkKeybinding && matchesKeybinding(event, this.host._toggleToTalkKeybinding) && !__classPrivateFieldGet7(this, _KeybindingController_isPushToTalkKeyPressed, "f")) {
|
|
12920
12974
|
if (!this.host.dispatchEvent(keybindingActivatedEvent(event))) {
|
|
12921
12975
|
return;
|
|
12922
12976
|
}
|
|
@@ -12941,25 +12995,25 @@ _KeybindingController_keydownHandler = /* @__PURE__ */ new WeakMap(), _Keybindin
|
|
|
12941
12995
|
}
|
|
12942
12996
|
}, "f");
|
|
12943
12997
|
__classPrivateFieldSet4(this, _KeybindingController_blurHandler, () => {
|
|
12944
|
-
if (
|
|
12998
|
+
if (__classPrivateFieldGet7(this, _KeybindingController_isPushToTalkKeyPressed, "f")) {
|
|
12945
12999
|
__classPrivateFieldSet4(this, _KeybindingController_isPushToTalkKeyPressed, false, "f");
|
|
12946
13000
|
this.host.stopRecording();
|
|
12947
13001
|
}
|
|
12948
13002
|
}, "f");
|
|
12949
|
-
window.addEventListener("keydown",
|
|
12950
|
-
window.addEventListener("keyup",
|
|
12951
|
-
window.addEventListener("blur",
|
|
13003
|
+
window.addEventListener("keydown", __classPrivateFieldGet7(this, _KeybindingController_keydownHandler, "f"));
|
|
13004
|
+
window.addEventListener("keyup", __classPrivateFieldGet7(this, _KeybindingController_keyupHandler, "f"));
|
|
13005
|
+
window.addEventListener("blur", __classPrivateFieldGet7(this, _KeybindingController_blurHandler, "f"));
|
|
12952
13006
|
}, _KeybindingController_removeListeners = function _KeybindingController_removeListeners2() {
|
|
12953
|
-
if (
|
|
12954
|
-
window.removeEventListener("keydown",
|
|
13007
|
+
if (__classPrivateFieldGet7(this, _KeybindingController_keydownHandler, "f")) {
|
|
13008
|
+
window.removeEventListener("keydown", __classPrivateFieldGet7(this, _KeybindingController_keydownHandler, "f"));
|
|
12955
13009
|
__classPrivateFieldSet4(this, _KeybindingController_keydownHandler, void 0, "f");
|
|
12956
13010
|
}
|
|
12957
|
-
if (
|
|
12958
|
-
window.removeEventListener("keyup",
|
|
13011
|
+
if (__classPrivateFieldGet7(this, _KeybindingController_keyupHandler, "f")) {
|
|
13012
|
+
window.removeEventListener("keyup", __classPrivateFieldGet7(this, _KeybindingController_keyupHandler, "f"));
|
|
12959
13013
|
__classPrivateFieldSet4(this, _KeybindingController_keyupHandler, void 0, "f");
|
|
12960
13014
|
}
|
|
12961
|
-
if (
|
|
12962
|
-
window.removeEventListener("blur",
|
|
13015
|
+
if (__classPrivateFieldGet7(this, _KeybindingController_blurHandler, "f")) {
|
|
13016
|
+
window.removeEventListener("blur", __classPrivateFieldGet7(this, _KeybindingController_blurHandler, "f"));
|
|
12963
13017
|
__classPrivateFieldSet4(this, _KeybindingController_blurHandler, void 0, "f");
|
|
12964
13018
|
}
|
|
12965
13019
|
};
|
|
@@ -13009,7 +13063,7 @@ var __classPrivateFieldSet5 = function(receiver, state, value, kind, f5) {
|
|
|
13009
13063
|
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");
|
|
13010
13064
|
return kind === "a" ? f5.call(receiver, value) : f5 ? f5.value = value : state.set(receiver, value), value;
|
|
13011
13065
|
};
|
|
13012
|
-
var
|
|
13066
|
+
var __classPrivateFieldGet8 = function(receiver, state, kind, f5) {
|
|
13013
13067
|
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
13014
13068
|
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");
|
|
13015
13069
|
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
@@ -13045,25 +13099,25 @@ var MediaController = class {
|
|
|
13045
13099
|
__classPrivateFieldSet5(this, _MediaController_onTrackEnded, onTrackEnded, "f");
|
|
13046
13100
|
__classPrivateFieldSet5(this, _MediaController_dataHandler, dataHandler, "f");
|
|
13047
13101
|
__classPrivateFieldSet5(this, _MediaController_mediaStream, await getMediaStream(this.host._selectedDevice?.deviceId, this.host._debug_displayAudio), "f");
|
|
13048
|
-
|
|
13102
|
+
__classPrivateFieldGet8(this, _MediaController_mediaStream, "f").getTracks().forEach((track) => {
|
|
13049
13103
|
track.addEventListener("ended", () => {
|
|
13050
|
-
if (
|
|
13051
|
-
|
|
13104
|
+
if (__classPrivateFieldGet8(this, _MediaController_onTrackEnded, "f")) {
|
|
13105
|
+
__classPrivateFieldGet8(this, _MediaController_onTrackEnded, "f").call(this);
|
|
13052
13106
|
}
|
|
13053
13107
|
});
|
|
13054
13108
|
});
|
|
13055
|
-
const { audioContext, analyser } = createAudioAnalyzer(
|
|
13109
|
+
const { audioContext, analyser } = createAudioAnalyzer(__classPrivateFieldGet8(this, _MediaController_mediaStream, "f"));
|
|
13056
13110
|
__classPrivateFieldSet5(this, _MediaController_audioContext, audioContext, "f");
|
|
13057
13111
|
__classPrivateFieldSet5(this, _MediaController_analyser, analyser, "f");
|
|
13058
|
-
__classPrivateFieldSet5(this, _MediaController_mediaRecorder, new MediaRecorder(
|
|
13059
|
-
|
|
13060
|
-
if (
|
|
13061
|
-
|
|
13112
|
+
__classPrivateFieldSet5(this, _MediaController_mediaRecorder, new MediaRecorder(__classPrivateFieldGet8(this, _MediaController_mediaStream, "f")), "f");
|
|
13113
|
+
__classPrivateFieldGet8(this, _MediaController_mediaRecorder, "f").ondataavailable = (event) => {
|
|
13114
|
+
if (__classPrivateFieldGet8(this, _MediaController_dataHandler, "f")) {
|
|
13115
|
+
__classPrivateFieldGet8(this, _MediaController_dataHandler, "f").call(this, event.data);
|
|
13062
13116
|
}
|
|
13063
13117
|
};
|
|
13064
13118
|
}
|
|
13065
13119
|
getAudioLevel() {
|
|
13066
|
-
return
|
|
13120
|
+
return __classPrivateFieldGet8(this, _MediaController_analyser, "f") ? calculateAudioLevel(__classPrivateFieldGet8(this, _MediaController_analyser, "f")) : 0;
|
|
13067
13121
|
}
|
|
13068
13122
|
startAudioLevelMonitoring(onAudioLevelChange) {
|
|
13069
13123
|
this.stopAudioLevelMonitoring();
|
|
@@ -13071,38 +13125,38 @@ var MediaController = class {
|
|
|
13071
13125
|
__classPrivateFieldSet5(this, _MediaController_visualiserInterval, window.setInterval(() => {
|
|
13072
13126
|
__classPrivateFieldSet5(this, _MediaController_audioLevel, this.getAudioLevel() * 3, "f");
|
|
13073
13127
|
this.host.requestUpdate();
|
|
13074
|
-
if (
|
|
13075
|
-
|
|
13128
|
+
if (__classPrivateFieldGet8(this, _MediaController_onAudioLevelChange, "f")) {
|
|
13129
|
+
__classPrivateFieldGet8(this, _MediaController_onAudioLevelChange, "f").call(this, __classPrivateFieldGet8(this, _MediaController_audioLevel, "f"));
|
|
13076
13130
|
}
|
|
13077
13131
|
}, 150), "f");
|
|
13078
13132
|
}
|
|
13079
13133
|
stopAudioLevelMonitoring() {
|
|
13080
|
-
if (
|
|
13081
|
-
clearInterval(
|
|
13134
|
+
if (__classPrivateFieldGet8(this, _MediaController_visualiserInterval, "f")) {
|
|
13135
|
+
clearInterval(__classPrivateFieldGet8(this, _MediaController_visualiserInterval, "f"));
|
|
13082
13136
|
__classPrivateFieldSet5(this, _MediaController_visualiserInterval, void 0, "f");
|
|
13083
13137
|
}
|
|
13084
13138
|
__classPrivateFieldSet5(this, _MediaController_audioLevel, 0, "f");
|
|
13085
13139
|
this.host.requestUpdate();
|
|
13086
|
-
if (
|
|
13087
|
-
|
|
13140
|
+
if (__classPrivateFieldGet8(this, _MediaController_onAudioLevelChange, "f")) {
|
|
13141
|
+
__classPrivateFieldGet8(this, _MediaController_onAudioLevelChange, "f").call(this, __classPrivateFieldGet8(this, _MediaController_audioLevel, "f"));
|
|
13088
13142
|
}
|
|
13089
13143
|
}
|
|
13090
13144
|
async cleanup() {
|
|
13091
13145
|
this.stopAudioLevelMonitoring();
|
|
13092
|
-
if (
|
|
13093
|
-
|
|
13146
|
+
if (__classPrivateFieldGet8(this, _MediaController_mediaRecorder, "f")?.state === "recording") {
|
|
13147
|
+
__classPrivateFieldGet8(this, _MediaController_mediaRecorder, "f").stop();
|
|
13094
13148
|
}
|
|
13095
|
-
if (
|
|
13096
|
-
|
|
13149
|
+
if (__classPrivateFieldGet8(this, _MediaController_mediaRecorder, "f")) {
|
|
13150
|
+
__classPrivateFieldGet8(this, _MediaController_mediaRecorder, "f").ondataavailable = null;
|
|
13097
13151
|
}
|
|
13098
|
-
if (
|
|
13099
|
-
|
|
13152
|
+
if (__classPrivateFieldGet8(this, _MediaController_mediaStream, "f")) {
|
|
13153
|
+
__classPrivateFieldGet8(this, _MediaController_mediaStream, "f").getTracks().forEach((track) => {
|
|
13100
13154
|
track.stop();
|
|
13101
13155
|
});
|
|
13102
13156
|
__classPrivateFieldSet5(this, _MediaController_mediaStream, null, "f");
|
|
13103
13157
|
}
|
|
13104
|
-
if (
|
|
13105
|
-
await
|
|
13158
|
+
if (__classPrivateFieldGet8(this, _MediaController_audioContext, "f") && __classPrivateFieldGet8(this, _MediaController_audioContext, "f").state !== "closed") {
|
|
13159
|
+
await __classPrivateFieldGet8(this, _MediaController_audioContext, "f").close();
|
|
13106
13160
|
}
|
|
13107
13161
|
__classPrivateFieldSet5(this, _MediaController_audioContext, null, "f");
|
|
13108
13162
|
__classPrivateFieldSet5(this, _MediaController_analyser, null, "f");
|
|
@@ -13117,27 +13171,27 @@ var MediaController = class {
|
|
|
13117
13171
|
*/
|
|
13118
13172
|
async stopRecording() {
|
|
13119
13173
|
return new Promise((resolve) => {
|
|
13120
|
-
if (!
|
|
13174
|
+
if (!__classPrivateFieldGet8(this, _MediaController_mediaRecorder, "f") || __classPrivateFieldGet8(this, _MediaController_mediaRecorder, "f").state !== "recording") {
|
|
13121
13175
|
resolve();
|
|
13122
13176
|
return;
|
|
13123
13177
|
}
|
|
13124
|
-
|
|
13178
|
+
__classPrivateFieldGet8(this, _MediaController_mediaRecorder, "f").onstop = () => {
|
|
13125
13179
|
resolve();
|
|
13126
13180
|
};
|
|
13127
|
-
|
|
13181
|
+
__classPrivateFieldGet8(this, _MediaController_mediaRecorder, "f").stop();
|
|
13128
13182
|
});
|
|
13129
13183
|
}
|
|
13130
13184
|
get mediaRecorder() {
|
|
13131
|
-
return
|
|
13185
|
+
return __classPrivateFieldGet8(this, _MediaController_mediaRecorder, "f");
|
|
13132
13186
|
}
|
|
13133
13187
|
get audioLevel() {
|
|
13134
|
-
return
|
|
13188
|
+
return __classPrivateFieldGet8(this, _MediaController_audioLevel, "f");
|
|
13135
13189
|
}
|
|
13136
13190
|
};
|
|
13137
13191
|
_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(), _MediaController_dataHandler = /* @__PURE__ */ new WeakMap();
|
|
13138
13192
|
|
|
13139
13193
|
// dist/styles/buttons.js
|
|
13140
|
-
var ButtonStyles =
|
|
13194
|
+
var ButtonStyles = i2`
|
|
13141
13195
|
/* Default (plain) button styling */
|
|
13142
13196
|
button {
|
|
13143
13197
|
background: var(--action-plain-background, transparent);
|
|
@@ -13188,15 +13242,59 @@ var ButtonStyles = i`
|
|
|
13188
13242
|
var buttons_default = ButtonStyles;
|
|
13189
13243
|
|
|
13190
13244
|
// dist/styles/recording-button.js
|
|
13191
|
-
var RecordingButtonStyles =
|
|
13245
|
+
var RecordingButtonStyles = i2`
|
|
13192
13246
|
:host {
|
|
13193
13247
|
display: inline-flex;
|
|
13194
13248
|
}
|
|
13195
13249
|
`;
|
|
13196
13250
|
var recording_button_default = RecordingButtonStyles;
|
|
13197
13251
|
|
|
13252
|
+
// node_modules/lit-html/directive.js
|
|
13253
|
+
var t5 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
|
|
13254
|
+
var e7 = (t7) => (...e10) => ({ _$litDirective$: t7, values: e10 });
|
|
13255
|
+
var i6 = class {
|
|
13256
|
+
constructor(t7) {
|
|
13257
|
+
}
|
|
13258
|
+
get _$AU() {
|
|
13259
|
+
return this._$AM._$AU;
|
|
13260
|
+
}
|
|
13261
|
+
_$AT(t7, e10, i7) {
|
|
13262
|
+
this._$Ct = t7, this._$AM = e10, this._$Ci = i7;
|
|
13263
|
+
}
|
|
13264
|
+
_$AS(t7, e10) {
|
|
13265
|
+
return this.update(t7, e10);
|
|
13266
|
+
}
|
|
13267
|
+
update(t7, e10) {
|
|
13268
|
+
return this.render(...e10);
|
|
13269
|
+
}
|
|
13270
|
+
};
|
|
13271
|
+
|
|
13272
|
+
// node_modules/lit-html/directives/class-map.js
|
|
13273
|
+
var e8 = e7(class extends i6 {
|
|
13274
|
+
constructor(t7) {
|
|
13275
|
+
if (super(t7), t7.type !== t5.ATTRIBUTE || "class" !== t7.name || t7.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
13276
|
+
}
|
|
13277
|
+
render(t7) {
|
|
13278
|
+
return " " + Object.keys(t7).filter((s8) => t7[s8]).join(" ") + " ";
|
|
13279
|
+
}
|
|
13280
|
+
update(s8, [i7]) {
|
|
13281
|
+
if (void 0 === this.st) {
|
|
13282
|
+
this.st = /* @__PURE__ */ new Set(), void 0 !== s8.strings && (this.nt = new Set(s8.strings.join(" ").split(/\s/).filter((t7) => "" !== t7)));
|
|
13283
|
+
for (const t7 in i7) i7[t7] && !this.nt?.has(t7) && this.st.add(t7);
|
|
13284
|
+
return this.render(i7);
|
|
13285
|
+
}
|
|
13286
|
+
const r7 = s8.element.classList;
|
|
13287
|
+
for (const t7 of this.st) t7 in i7 || (r7.remove(t7), this.st.delete(t7));
|
|
13288
|
+
for (const t7 in i7) {
|
|
13289
|
+
const s9 = !!i7[t7];
|
|
13290
|
+
s9 === this.st.has(t7) || this.nt?.has(t7) || (s9 ? (r7.add(t7), this.st.add(t7)) : (r7.remove(t7), this.st.delete(t7)));
|
|
13291
|
+
}
|
|
13292
|
+
return T;
|
|
13293
|
+
}
|
|
13294
|
+
});
|
|
13295
|
+
|
|
13198
13296
|
// node_modules/lit-html/directives/map.js
|
|
13199
|
-
function*
|
|
13297
|
+
function* o6(o10, f5) {
|
|
13200
13298
|
if (void 0 !== o10) {
|
|
13201
13299
|
let i7 = 0;
|
|
13202
13300
|
for (const t7 of o10) yield f5(t7, i7++);
|
|
@@ -13204,14 +13302,14 @@ function* o8(o10, f5) {
|
|
|
13204
13302
|
}
|
|
13205
13303
|
|
|
13206
13304
|
// node_modules/lit-html/directives/range.js
|
|
13207
|
-
function*
|
|
13305
|
+
function* o7(o10, t7, e10 = 1) {
|
|
13208
13306
|
const i7 = void 0 === t7 ? 0 : o10;
|
|
13209
13307
|
t7 ??= o10;
|
|
13210
13308
|
for (let o11 = i7; e10 > 0 ? o11 < t7 : t7 < o11; o11 += e10) yield o11;
|
|
13211
13309
|
}
|
|
13212
13310
|
|
|
13213
13311
|
// dist/styles/audio-visualiser.js
|
|
13214
|
-
var AudioVisualiserStyles =
|
|
13312
|
+
var AudioVisualiserStyles = i2`
|
|
13215
13313
|
:host {
|
|
13216
13314
|
height: 100%;
|
|
13217
13315
|
}
|
|
@@ -13252,13 +13350,13 @@ function normalizeToRange(value, min = 0, max = 1) {
|
|
|
13252
13350
|
}
|
|
13253
13351
|
|
|
13254
13352
|
// dist/components/audio-visualiser.js
|
|
13255
|
-
var
|
|
13353
|
+
var __decorate10 = function(decorators, target, key, desc) {
|
|
13256
13354
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
13257
13355
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
13258
13356
|
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;
|
|
13259
13357
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
13260
13358
|
};
|
|
13261
|
-
var DictationAudioVisualiser = class DictationAudioVisualiser2 extends
|
|
13359
|
+
var DictationAudioVisualiser = class DictationAudioVisualiser2 extends i5 {
|
|
13262
13360
|
constructor() {
|
|
13263
13361
|
super(...arguments);
|
|
13264
13362
|
this.level = 0;
|
|
@@ -13272,12 +13370,12 @@ var DictationAudioVisualiser = class DictationAudioVisualiser2 extends i4 {
|
|
|
13272
13370
|
}
|
|
13273
13371
|
render() {
|
|
13274
13372
|
const activeSegments = Math.round(this.level * this.segmentCount);
|
|
13275
|
-
const segments =
|
|
13373
|
+
const segments = o6(o7(this.segmentCount), (i7) => x`<div class=${e8({
|
|
13276
13374
|
active: i7 < activeSegments,
|
|
13277
13375
|
segment: true
|
|
13278
13376
|
})} />`);
|
|
13279
13377
|
return x`
|
|
13280
|
-
<div class=${
|
|
13378
|
+
<div class=${e8({
|
|
13281
13379
|
active: this.active,
|
|
13282
13380
|
container: true
|
|
13283
13381
|
})}>
|
|
@@ -13287,27 +13385,27 @@ var DictationAudioVisualiser = class DictationAudioVisualiser2 extends i4 {
|
|
|
13287
13385
|
}
|
|
13288
13386
|
};
|
|
13289
13387
|
DictationAudioVisualiser.styles = audio_visualiser_default;
|
|
13290
|
-
|
|
13388
|
+
__decorate10([
|
|
13291
13389
|
n4({ type: Number })
|
|
13292
13390
|
], DictationAudioVisualiser.prototype, "level", void 0);
|
|
13293
|
-
|
|
13391
|
+
__decorate10([
|
|
13294
13392
|
n4({ type: Boolean })
|
|
13295
13393
|
], DictationAudioVisualiser.prototype, "active", void 0);
|
|
13296
|
-
|
|
13394
|
+
__decorate10([
|
|
13297
13395
|
n4({ type: Number })
|
|
13298
13396
|
], DictationAudioVisualiser.prototype, "segmentCount", void 0);
|
|
13299
|
-
DictationAudioVisualiser =
|
|
13300
|
-
|
|
13397
|
+
DictationAudioVisualiser = __decorate10([
|
|
13398
|
+
t2("dictation-audio-visualiser")
|
|
13301
13399
|
], DictationAudioVisualiser);
|
|
13302
13400
|
|
|
13303
13401
|
// dist/icons/icons.js
|
|
13304
|
-
var
|
|
13402
|
+
var __decorate11 = function(decorators, target, key, desc) {
|
|
13305
13403
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
13306
13404
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
13307
13405
|
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;
|
|
13308
13406
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
13309
13407
|
};
|
|
13310
|
-
var IconMicOn = class IconMicOn2 extends
|
|
13408
|
+
var IconMicOn = class IconMicOn2 extends i5 {
|
|
13311
13409
|
render() {
|
|
13312
13410
|
return x`
|
|
13313
13411
|
<div style="display: flex">
|
|
@@ -13331,10 +13429,10 @@ var IconMicOn = class IconMicOn2 extends i4 {
|
|
|
13331
13429
|
`;
|
|
13332
13430
|
}
|
|
13333
13431
|
};
|
|
13334
|
-
IconMicOn =
|
|
13335
|
-
|
|
13432
|
+
IconMicOn = __decorate11([
|
|
13433
|
+
t2("icon-mic-on")
|
|
13336
13434
|
], IconMicOn);
|
|
13337
|
-
var IconMicOff = class IconMicOff2 extends
|
|
13435
|
+
var IconMicOff = class IconMicOff2 extends i5 {
|
|
13338
13436
|
render() {
|
|
13339
13437
|
return x` <div style="display: flex">
|
|
13340
13438
|
<svg
|
|
@@ -13359,10 +13457,10 @@ var IconMicOff = class IconMicOff2 extends i4 {
|
|
|
13359
13457
|
</div>`;
|
|
13360
13458
|
}
|
|
13361
13459
|
};
|
|
13362
|
-
IconMicOff =
|
|
13363
|
-
|
|
13460
|
+
IconMicOff = __decorate11([
|
|
13461
|
+
t2("icon-mic-off")
|
|
13364
13462
|
], IconMicOff);
|
|
13365
|
-
var IconRecording = class IconRecording2 extends
|
|
13463
|
+
var IconRecording = class IconRecording2 extends i5 {
|
|
13366
13464
|
render() {
|
|
13367
13465
|
return x`
|
|
13368
13466
|
<div style="display: flex;">
|
|
@@ -13385,10 +13483,10 @@ var IconRecording = class IconRecording2 extends i4 {
|
|
|
13385
13483
|
`;
|
|
13386
13484
|
}
|
|
13387
13485
|
};
|
|
13388
|
-
IconRecording =
|
|
13389
|
-
|
|
13486
|
+
IconRecording = __decorate11([
|
|
13487
|
+
t2("icon-recording")
|
|
13390
13488
|
], IconRecording);
|
|
13391
|
-
var IconSettings = class IconSettings2 extends
|
|
13489
|
+
var IconSettings = class IconSettings2 extends i5 {
|
|
13392
13490
|
render() {
|
|
13393
13491
|
return x`<div style="display: flex">
|
|
13394
13492
|
<svg
|
|
@@ -13411,10 +13509,10 @@ var IconSettings = class IconSettings2 extends i4 {
|
|
|
13411
13509
|
</div>`;
|
|
13412
13510
|
}
|
|
13413
13511
|
};
|
|
13414
|
-
IconSettings =
|
|
13415
|
-
|
|
13512
|
+
IconSettings = __decorate11([
|
|
13513
|
+
t2("icon-settings")
|
|
13416
13514
|
], IconSettings);
|
|
13417
|
-
var IconLoadingSpinner = class IconLoadingSpinner2 extends
|
|
13515
|
+
var IconLoadingSpinner = class IconLoadingSpinner2 extends i5 {
|
|
13418
13516
|
render() {
|
|
13419
13517
|
return x`<div style="display: flex">
|
|
13420
13518
|
<svg
|
|
@@ -13434,7 +13532,7 @@ var IconLoadingSpinner = class IconLoadingSpinner2 extends i4 {
|
|
|
13434
13532
|
</div>`;
|
|
13435
13533
|
}
|
|
13436
13534
|
};
|
|
13437
|
-
IconLoadingSpinner.styles =
|
|
13535
|
+
IconLoadingSpinner.styles = i2`
|
|
13438
13536
|
@keyframes spin {
|
|
13439
13537
|
0% {
|
|
13440
13538
|
transform: rotate(0deg);
|
|
@@ -13447,18 +13545,18 @@ IconLoadingSpinner.styles = i`
|
|
|
13447
13545
|
animation: spin 1s linear infinite;
|
|
13448
13546
|
}
|
|
13449
13547
|
`;
|
|
13450
|
-
IconLoadingSpinner =
|
|
13451
|
-
|
|
13548
|
+
IconLoadingSpinner = __decorate11([
|
|
13549
|
+
t2("icon-loading-spinner")
|
|
13452
13550
|
], IconLoadingSpinner);
|
|
13453
13551
|
|
|
13454
|
-
// dist/components/recording-button.js
|
|
13455
|
-
var
|
|
13552
|
+
// dist/components/recording-button-base.js
|
|
13553
|
+
var __decorate12 = function(decorators, target, key, desc) {
|
|
13456
13554
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
13457
13555
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
13458
13556
|
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;
|
|
13459
13557
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
13460
13558
|
};
|
|
13461
|
-
var
|
|
13559
|
+
var __classPrivateFieldGet9 = function(receiver, state, kind, f5) {
|
|
13462
13560
|
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
13463
13561
|
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");
|
|
13464
13562
|
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
@@ -13469,41 +13567,39 @@ var __classPrivateFieldSet6 = function(receiver, state, value, kind, f5) {
|
|
|
13469
13567
|
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");
|
|
13470
13568
|
return kind === "a" ? f5.call(receiver, value) : f5 ? f5.value = value : state.set(receiver, value), value;
|
|
13471
13569
|
};
|
|
13472
|
-
var
|
|
13473
|
-
var
|
|
13474
|
-
var
|
|
13475
|
-
var
|
|
13476
|
-
var
|
|
13477
|
-
var
|
|
13478
|
-
var
|
|
13479
|
-
var
|
|
13480
|
-
var
|
|
13481
|
-
var
|
|
13482
|
-
var
|
|
13483
|
-
var
|
|
13484
|
-
var
|
|
13485
|
-
var
|
|
13486
|
-
var DictationRecordingButton = class DictationRecordingButton2 extends i4 {
|
|
13570
|
+
var _RecordingButtonBase_instances;
|
|
13571
|
+
var _RecordingButtonBase_mediaController;
|
|
13572
|
+
var _RecordingButtonBase_keybindingController;
|
|
13573
|
+
var _RecordingButtonBase_closeConnectionOnInit;
|
|
13574
|
+
var _RecordingButtonBase_processing;
|
|
13575
|
+
var _RecordingButtonBase_connection;
|
|
13576
|
+
var _RecordingButtonBase_handleClick;
|
|
13577
|
+
var _RecordingButtonBase_handleWebSocketMessage;
|
|
13578
|
+
var _RecordingButtonBase_handleWebSocketError;
|
|
13579
|
+
var _RecordingButtonBase_handleWebSocketClose;
|
|
13580
|
+
var _RecordingButtonBase_dispatchRecordingStateChanged;
|
|
13581
|
+
var _RecordingButtonBase_handleStart;
|
|
13582
|
+
var _RecordingButtonBase_handleStop;
|
|
13583
|
+
var RecordingButtonBase = class extends i5 {
|
|
13487
13584
|
constructor() {
|
|
13488
13585
|
super(...arguments);
|
|
13489
|
-
|
|
13586
|
+
_RecordingButtonBase_instances.add(this);
|
|
13490
13587
|
this._recordingState = "stopped";
|
|
13491
13588
|
this.allowButtonFocus = false;
|
|
13492
|
-
|
|
13493
|
-
|
|
13494
|
-
|
|
13495
|
-
|
|
13496
|
-
|
|
13497
|
-
|
|
13498
|
-
_DictationRecordingButton_handleWebSocketMessage.set(this, (message) => {
|
|
13589
|
+
_RecordingButtonBase_mediaController.set(this, new MediaController(this));
|
|
13590
|
+
_RecordingButtonBase_keybindingController.set(this, new KeybindingController(this));
|
|
13591
|
+
_RecordingButtonBase_closeConnectionOnInit.set(this, false);
|
|
13592
|
+
_RecordingButtonBase_processing.set(this, false);
|
|
13593
|
+
_RecordingButtonBase_connection.set(this, "CLOSED");
|
|
13594
|
+
_RecordingButtonBase_handleWebSocketMessage.set(this, (message) => {
|
|
13499
13595
|
switch (message.type) {
|
|
13500
13596
|
case "CONFIG_DENIED":
|
|
13501
13597
|
this.dispatchEvent(errorEvent(`Config denied: ${message.reason ?? "Unknown reason"}`));
|
|
13502
|
-
|
|
13598
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_handleStop).call(this);
|
|
13503
13599
|
break;
|
|
13504
13600
|
case "CONFIG_TIMEOUT":
|
|
13505
13601
|
this.dispatchEvent(errorEvent("Config timeout"));
|
|
13506
|
-
|
|
13602
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_handleStop).call(this);
|
|
13507
13603
|
break;
|
|
13508
13604
|
case "transcript":
|
|
13509
13605
|
this.dispatchEvent(transcriptEvent(message));
|
|
@@ -13511,6 +13607,9 @@ var DictationRecordingButton = class DictationRecordingButton2 extends i4 {
|
|
|
13511
13607
|
case "command":
|
|
13512
13608
|
this.dispatchEvent(commandEvent(message));
|
|
13513
13609
|
break;
|
|
13610
|
+
case "facts":
|
|
13611
|
+
this.dispatchEvent(factsEvent(message));
|
|
13612
|
+
break;
|
|
13514
13613
|
case "usage":
|
|
13515
13614
|
this.dispatchEvent(usageEvent(message));
|
|
13516
13615
|
break;
|
|
@@ -13519,36 +13618,41 @@ var DictationRecordingButton = class DictationRecordingButton2 extends i4 {
|
|
|
13519
13618
|
break;
|
|
13520
13619
|
case "error":
|
|
13521
13620
|
this.dispatchEvent(errorEvent(message.error));
|
|
13522
|
-
|
|
13621
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_handleStop).call(this);
|
|
13622
|
+
break;
|
|
13623
|
+
case "ended":
|
|
13624
|
+
case "ENDED":
|
|
13625
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_processing, false, "f");
|
|
13626
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_dispatchRecordingStateChanged).call(this, this._recordingState);
|
|
13523
13627
|
break;
|
|
13524
13628
|
case "flushed":
|
|
13525
13629
|
if (this._recordingState === "stopped" || this._recordingState === "stopping") {
|
|
13526
|
-
__classPrivateFieldSet6(this,
|
|
13527
|
-
|
|
13630
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_processing, false, "f");
|
|
13631
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_dispatchRecordingStateChanged).call(this, this._recordingState);
|
|
13528
13632
|
}
|
|
13529
13633
|
break;
|
|
13530
13634
|
}
|
|
13531
13635
|
});
|
|
13532
|
-
|
|
13533
|
-
this.dispatchEvent(errorEvent(
|
|
13534
|
-
__classPrivateFieldSet6(this,
|
|
13535
|
-
__classPrivateFieldSet6(this,
|
|
13536
|
-
|
|
13636
|
+
_RecordingButtonBase_handleWebSocketError.set(this, (error) => {
|
|
13637
|
+
this.dispatchEvent(errorEvent(`Socket error: ${error.message}`));
|
|
13638
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_processing, false, "f");
|
|
13639
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_connection, "CLOSED", "f");
|
|
13640
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_handleStop).call(this);
|
|
13537
13641
|
});
|
|
13538
|
-
|
|
13539
|
-
if (
|
|
13642
|
+
_RecordingButtonBase_handleWebSocketClose.set(this, (event) => {
|
|
13643
|
+
if (this._socketController.isConnectionOpen() || this._socketController.isConnecting()) {
|
|
13540
13644
|
return;
|
|
13541
13645
|
}
|
|
13542
|
-
__classPrivateFieldSet6(this,
|
|
13543
|
-
__classPrivateFieldSet6(this,
|
|
13646
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_processing, false, "f");
|
|
13647
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_connection, "CLOSED", "f");
|
|
13544
13648
|
this.dispatchEvent(streamClosedEvent(event));
|
|
13545
|
-
|
|
13649
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_dispatchRecordingStateChanged).call(this, this._recordingState);
|
|
13546
13650
|
});
|
|
13547
13651
|
}
|
|
13548
13652
|
update(changedProperties) {
|
|
13549
|
-
if (changedProperties.has("_recordingState") && this._recordingState === "recording" &&
|
|
13550
|
-
__classPrivateFieldSet6(this,
|
|
13551
|
-
|
|
13653
|
+
if (changedProperties.has("_recordingState") && this._recordingState === "recording" && __classPrivateFieldGet9(this, _RecordingButtonBase_closeConnectionOnInit, "f")) {
|
|
13654
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_closeConnectionOnInit, false, "f");
|
|
13655
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_handleStop).call(this);
|
|
13552
13656
|
}
|
|
13553
13657
|
super.update(changedProperties);
|
|
13554
13658
|
}
|
|
@@ -13556,17 +13660,17 @@ var DictationRecordingButton = class DictationRecordingButton2 extends i4 {
|
|
|
13556
13660
|
if (this._recordingState !== "stopped") {
|
|
13557
13661
|
return;
|
|
13558
13662
|
}
|
|
13559
|
-
|
|
13663
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_handleStart).call(this);
|
|
13560
13664
|
}
|
|
13561
13665
|
stopRecording() {
|
|
13562
13666
|
if (this._recordingState === "stopped" || this._recordingState === "stopping") {
|
|
13563
13667
|
return;
|
|
13564
13668
|
}
|
|
13565
13669
|
if (this._recordingState === "initializing") {
|
|
13566
|
-
__classPrivateFieldSet6(this,
|
|
13670
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_closeConnectionOnInit, true, "f");
|
|
13567
13671
|
return;
|
|
13568
13672
|
}
|
|
13569
|
-
|
|
13673
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_handleStop).call(this);
|
|
13570
13674
|
}
|
|
13571
13675
|
toggleRecording() {
|
|
13572
13676
|
if (this._recordingState === "stopped") {
|
|
@@ -13576,46 +13680,46 @@ var DictationRecordingButton = class DictationRecordingButton2 extends i4 {
|
|
|
13576
13680
|
}
|
|
13577
13681
|
}
|
|
13578
13682
|
async openConnection() {
|
|
13579
|
-
if (this._recordingState !== "stopped" ||
|
|
13683
|
+
if (this._recordingState !== "stopped" || __classPrivateFieldGet9(this, _RecordingButtonBase_processing, "f")) {
|
|
13580
13684
|
return;
|
|
13581
13685
|
}
|
|
13582
|
-
if (
|
|
13686
|
+
if (this._socketController.isConnectionOpen()) {
|
|
13583
13687
|
return;
|
|
13584
13688
|
}
|
|
13585
13689
|
try {
|
|
13586
|
-
__classPrivateFieldSet6(this,
|
|
13587
|
-
|
|
13588
|
-
await
|
|
13589
|
-
onClose:
|
|
13590
|
-
onError:
|
|
13591
|
-
onMessage:
|
|
13690
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_connection, "CONNECTING", "f");
|
|
13691
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_dispatchRecordingStateChanged).call(this, this._recordingState);
|
|
13692
|
+
await this._socketController.connect(this._getConnectConfig(), {
|
|
13693
|
+
onClose: __classPrivateFieldGet9(this, _RecordingButtonBase_handleWebSocketClose, "f"),
|
|
13694
|
+
onError: __classPrivateFieldGet9(this, _RecordingButtonBase_handleWebSocketError, "f"),
|
|
13695
|
+
onMessage: __classPrivateFieldGet9(this, _RecordingButtonBase_handleWebSocketMessage, "f"),
|
|
13592
13696
|
onNetworkActivity: (direction, data) => {
|
|
13593
13697
|
this.dispatchEvent(networkActivityEvent(direction, data));
|
|
13594
13698
|
}
|
|
13595
13699
|
});
|
|
13596
|
-
__classPrivateFieldSet6(this,
|
|
13597
|
-
|
|
13700
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_connection, "OPEN", "f");
|
|
13701
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_dispatchRecordingStateChanged).call(this, this._recordingState);
|
|
13598
13702
|
} catch (error) {
|
|
13599
|
-
__classPrivateFieldSet6(this,
|
|
13703
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_connection, "CLOSED", "f");
|
|
13600
13704
|
this.dispatchEvent(errorEvent(error));
|
|
13601
13705
|
}
|
|
13602
13706
|
}
|
|
13603
13707
|
async closeConnection() {
|
|
13604
|
-
if (this._recordingState !== "stopped" ||
|
|
13708
|
+
if (this._recordingState !== "stopped" || __classPrivateFieldGet9(this, _RecordingButtonBase_processing, "f")) {
|
|
13605
13709
|
return;
|
|
13606
13710
|
}
|
|
13607
|
-
if (
|
|
13608
|
-
await
|
|
13711
|
+
if (this._socketController.isConnecting()) {
|
|
13712
|
+
await this._socketController.waitForConnection();
|
|
13609
13713
|
}
|
|
13610
|
-
if (!
|
|
13611
|
-
__classPrivateFieldSet6(this,
|
|
13612
|
-
|
|
13714
|
+
if (!this._socketController.isConnectionOpen()) {
|
|
13715
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_connection, "CLOSED", "f");
|
|
13716
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_dispatchRecordingStateChanged).call(this, "stopped");
|
|
13613
13717
|
return;
|
|
13614
13718
|
}
|
|
13615
13719
|
try {
|
|
13616
|
-
__classPrivateFieldSet6(this,
|
|
13617
|
-
|
|
13618
|
-
await
|
|
13720
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_connection, "CLOSING", "f");
|
|
13721
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_dispatchRecordingStateChanged).call(this, "stopped");
|
|
13722
|
+
await this._socketController.closeConnection(__classPrivateFieldGet9(this, _RecordingButtonBase_handleWebSocketClose, "f"));
|
|
13619
13723
|
} catch (error) {
|
|
13620
13724
|
this.dispatchEvent(errorEvent(error));
|
|
13621
13725
|
}
|
|
@@ -13625,7 +13729,7 @@ var DictationRecordingButton = class DictationRecordingButton2 extends i4 {
|
|
|
13625
13729
|
const isRecording = this._recordingState === "recording";
|
|
13626
13730
|
return x`
|
|
13627
13731
|
<button
|
|
13628
|
-
@click=${
|
|
13732
|
+
@click=${__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_handleClick)}
|
|
13629
13733
|
?disabled=${isLoading}
|
|
13630
13734
|
class=${isRecording ? "red" : "accent"}
|
|
13631
13735
|
aria-label=${isRecording ? "Stop recording" : "Start recording"}
|
|
@@ -13633,57 +13737,45 @@ var DictationRecordingButton = class DictationRecordingButton2 extends i4 {
|
|
|
13633
13737
|
>
|
|
13634
13738
|
${isLoading ? x`<icon-loading-spinner />` : isRecording ? x`<icon-recording />` : x`<icon-mic-on />`}
|
|
13635
13739
|
<dictation-audio-visualiser
|
|
13636
|
-
.level=${
|
|
13740
|
+
.level=${__classPrivateFieldGet9(this, _RecordingButtonBase_mediaController, "f").audioLevel}
|
|
13637
13741
|
?active=${isRecording}
|
|
13638
13742
|
/>
|
|
13639
13743
|
</button>
|
|
13640
13744
|
`;
|
|
13641
13745
|
}
|
|
13642
13746
|
};
|
|
13643
|
-
|
|
13644
|
-
_DictationRecordingButton_dictationController = /* @__PURE__ */ new WeakMap();
|
|
13645
|
-
_DictationRecordingButton_keybindingController = /* @__PURE__ */ new WeakMap();
|
|
13646
|
-
_DictationRecordingButton_closeConnectionOnInit = /* @__PURE__ */ new WeakMap();
|
|
13647
|
-
_DictationRecordingButton_processing = /* @__PURE__ */ new WeakMap();
|
|
13648
|
-
_DictationRecordingButton_connection = /* @__PURE__ */ new WeakMap();
|
|
13649
|
-
_DictationRecordingButton_handleWebSocketMessage = /* @__PURE__ */ new WeakMap();
|
|
13650
|
-
_DictationRecordingButton_handleWebSocketError = /* @__PURE__ */ new WeakMap();
|
|
13651
|
-
_DictationRecordingButton_handleWebSocketClose = /* @__PURE__ */ new WeakMap();
|
|
13652
|
-
_DictationRecordingButton_instances = /* @__PURE__ */ new WeakSet();
|
|
13653
|
-
_DictationRecordingButton_handleClick = function _DictationRecordingButton_handleClick2(event) {
|
|
13747
|
+
_RecordingButtonBase_mediaController = /* @__PURE__ */ new WeakMap(), _RecordingButtonBase_keybindingController = /* @__PURE__ */ new WeakMap(), _RecordingButtonBase_closeConnectionOnInit = /* @__PURE__ */ new WeakMap(), _RecordingButtonBase_processing = /* @__PURE__ */ new WeakMap(), _RecordingButtonBase_connection = /* @__PURE__ */ new WeakMap(), _RecordingButtonBase_handleWebSocketMessage = /* @__PURE__ */ new WeakMap(), _RecordingButtonBase_handleWebSocketError = /* @__PURE__ */ new WeakMap(), _RecordingButtonBase_handleWebSocketClose = /* @__PURE__ */ new WeakMap(), _RecordingButtonBase_instances = /* @__PURE__ */ new WeakSet(), _RecordingButtonBase_handleClick = function _RecordingButtonBase_handleClick2(event) {
|
|
13654
13748
|
if (!this.allowButtonFocus) {
|
|
13655
13749
|
event.preventDefault();
|
|
13656
13750
|
}
|
|
13657
13751
|
this.toggleRecording();
|
|
13658
|
-
}
|
|
13659
|
-
_DictationRecordingButton_dispatchRecordingStateChanged = function _DictationRecordingButton_dispatchRecordingStateChanged2(state) {
|
|
13752
|
+
}, _RecordingButtonBase_dispatchRecordingStateChanged = function _RecordingButtonBase_dispatchRecordingStateChanged2(state) {
|
|
13660
13753
|
this.dispatchEvent(recordingStateChangedEvent(state, {
|
|
13661
|
-
connection:
|
|
13662
|
-
processing:
|
|
13754
|
+
connection: __classPrivateFieldGet9(this, _RecordingButtonBase_connection, "f"),
|
|
13755
|
+
processing: __classPrivateFieldGet9(this, _RecordingButtonBase_processing, "f")
|
|
13663
13756
|
}));
|
|
13664
|
-
}
|
|
13665
|
-
|
|
13666
|
-
__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_dispatchRecordingStateChanged).call(this, "initializing");
|
|
13757
|
+
}, _RecordingButtonBase_handleStart = async function _RecordingButtonBase_handleStart2() {
|
|
13758
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_dispatchRecordingStateChanged).call(this, "initializing");
|
|
13667
13759
|
try {
|
|
13668
|
-
await
|
|
13760
|
+
await __classPrivateFieldGet9(this, _RecordingButtonBase_mediaController, "f").initialize(() => {
|
|
13669
13761
|
if (this._recordingState === "recording") {
|
|
13670
13762
|
this.dispatchEvent(errorEvent("Recording device access was lost."));
|
|
13671
|
-
|
|
13763
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_handleStop).call(this);
|
|
13672
13764
|
}
|
|
13673
|
-
},
|
|
13674
|
-
|
|
13675
|
-
|
|
13765
|
+
}, this._socketController.mediaRecorderHandler);
|
|
13766
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_mediaController, "f").mediaRecorder?.start(AUDIO_CHUNK_INTERVAL_MS);
|
|
13767
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_mediaController, "f").startAudioLevelMonitoring((level) => {
|
|
13676
13768
|
this.dispatchEvent(audioLevelChangedEvent(level));
|
|
13677
13769
|
});
|
|
13678
|
-
__classPrivateFieldSet6(this,
|
|
13679
|
-
if (
|
|
13680
|
-
__classPrivateFieldSet6(this,
|
|
13770
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_processing, true, "f");
|
|
13771
|
+
if (__classPrivateFieldGet9(this, _RecordingButtonBase_connection, "f") !== "OPEN") {
|
|
13772
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_connection, "CONNECTING", "f");
|
|
13681
13773
|
}
|
|
13682
|
-
|
|
13683
|
-
const isNewConnection = await
|
|
13684
|
-
onClose:
|
|
13685
|
-
onError:
|
|
13686
|
-
onMessage:
|
|
13774
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_dispatchRecordingStateChanged).call(this, "recording");
|
|
13775
|
+
const isNewConnection = await this._socketController.connect(this._getConnectConfig(), {
|
|
13776
|
+
onClose: __classPrivateFieldGet9(this, _RecordingButtonBase_handleWebSocketClose, "f"),
|
|
13777
|
+
onError: __classPrivateFieldGet9(this, _RecordingButtonBase_handleWebSocketError, "f"),
|
|
13778
|
+
onMessage: __classPrivateFieldGet9(this, _RecordingButtonBase_handleWebSocketMessage, "f"),
|
|
13687
13779
|
onNetworkActivity: (direction, data) => {
|
|
13688
13780
|
this.dispatchEvent(networkActivityEvent(direction, data));
|
|
13689
13781
|
}
|
|
@@ -13691,83 +13783,404 @@ _DictationRecordingButton_handleStart = async function _DictationRecordingButton
|
|
|
13691
13783
|
if (isNewConnection === "superseded") {
|
|
13692
13784
|
return;
|
|
13693
13785
|
}
|
|
13694
|
-
__classPrivateFieldSet6(this,
|
|
13695
|
-
|
|
13786
|
+
__classPrivateFieldSet6(this, _RecordingButtonBase_connection, "OPEN", "f");
|
|
13787
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_dispatchRecordingStateChanged).call(this, this._recordingState);
|
|
13696
13788
|
} catch (error) {
|
|
13697
13789
|
this.dispatchEvent(errorEvent(error));
|
|
13698
|
-
await
|
|
13790
|
+
await __classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_handleStop).call(this);
|
|
13699
13791
|
}
|
|
13700
|
-
}
|
|
13701
|
-
|
|
13702
|
-
__classPrivateFieldGet7(this, _DictationRecordingButton_instances, "m", _DictationRecordingButton_dispatchRecordingStateChanged).call(this, "stopping");
|
|
13792
|
+
}, _RecordingButtonBase_handleStop = async function _RecordingButtonBase_handleStop2() {
|
|
13793
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_dispatchRecordingStateChanged).call(this, "stopping");
|
|
13703
13794
|
try {
|
|
13704
|
-
|
|
13705
|
-
await
|
|
13706
|
-
|
|
13707
|
-
await
|
|
13708
|
-
await __classPrivateFieldGet7(this, _DictationRecordingButton_mediaController, "f").cleanup();
|
|
13795
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_mediaController, "f").stopAudioLevelMonitoring();
|
|
13796
|
+
await __classPrivateFieldGet9(this, _RecordingButtonBase_mediaController, "f").stopRecording();
|
|
13797
|
+
await this._socketController.stopRecording();
|
|
13798
|
+
await __classPrivateFieldGet9(this, _RecordingButtonBase_mediaController, "f").cleanup();
|
|
13709
13799
|
} catch (error) {
|
|
13710
13800
|
this.dispatchEvent(errorEvent(error));
|
|
13711
13801
|
}
|
|
13802
|
+
__classPrivateFieldGet9(this, _RecordingButtonBase_instances, "m", _RecordingButtonBase_dispatchRecordingStateChanged).call(this, "stopped");
|
|
13803
|
+
};
|
|
13804
|
+
RecordingButtonBase.styles = [recording_button_default, buttons_default];
|
|
13805
|
+
__decorate12([
|
|
13806
|
+
c({ context: recordingStateContext, subscribe: true }),
|
|
13807
|
+
r4()
|
|
13808
|
+
], RecordingButtonBase.prototype, "_recordingState", void 0);
|
|
13809
|
+
__decorate12([
|
|
13810
|
+
c({ context: selectedDeviceContext, subscribe: true }),
|
|
13811
|
+
r4()
|
|
13812
|
+
], RecordingButtonBase.prototype, "_selectedDevice", void 0);
|
|
13813
|
+
__decorate12([
|
|
13814
|
+
c({ context: accessTokenContext, subscribe: true }),
|
|
13815
|
+
r4()
|
|
13816
|
+
], RecordingButtonBase.prototype, "_accessToken", void 0);
|
|
13817
|
+
__decorate12([
|
|
13818
|
+
c({ context: authConfigContext, subscribe: true }),
|
|
13819
|
+
r4()
|
|
13820
|
+
], RecordingButtonBase.prototype, "_authConfig", void 0);
|
|
13821
|
+
__decorate12([
|
|
13822
|
+
c({ context: regionContext, subscribe: true }),
|
|
13823
|
+
r4()
|
|
13824
|
+
], RecordingButtonBase.prototype, "_region", void 0);
|
|
13825
|
+
__decorate12([
|
|
13826
|
+
c({ context: tenantNameContext, subscribe: true }),
|
|
13827
|
+
r4()
|
|
13828
|
+
], RecordingButtonBase.prototype, "_tenantName", void 0);
|
|
13829
|
+
__decorate12([
|
|
13830
|
+
c({ context: socketUrlContext, subscribe: true }),
|
|
13831
|
+
r4()
|
|
13832
|
+
], RecordingButtonBase.prototype, "_socketUrl", void 0);
|
|
13833
|
+
__decorate12([
|
|
13834
|
+
c({ context: socketProxyContext, subscribe: true }),
|
|
13835
|
+
r4()
|
|
13836
|
+
], RecordingButtonBase.prototype, "_socketProxy", void 0);
|
|
13837
|
+
__decorate12([
|
|
13838
|
+
c({ context: debugDisplayAudioContext, subscribe: true }),
|
|
13839
|
+
r4()
|
|
13840
|
+
], RecordingButtonBase.prototype, "_debug_displayAudio", void 0);
|
|
13841
|
+
__decorate12([
|
|
13842
|
+
c({ context: pushToTalkKeybindingContext, subscribe: true }),
|
|
13843
|
+
r4()
|
|
13844
|
+
], RecordingButtonBase.prototype, "_pushToTalkKeybinding", void 0);
|
|
13845
|
+
__decorate12([
|
|
13846
|
+
c({ context: toggleToTalkKeybindingContext, subscribe: true }),
|
|
13847
|
+
r4()
|
|
13848
|
+
], RecordingButtonBase.prototype, "_toggleToTalkKeybinding", void 0);
|
|
13849
|
+
__decorate12([
|
|
13850
|
+
n4({ type: Boolean })
|
|
13851
|
+
], RecordingButtonBase.prototype, "allowButtonFocus", void 0);
|
|
13852
|
+
|
|
13853
|
+
// dist/components/ambient-recording-button.js
|
|
13854
|
+
var __decorate13 = function(decorators, target, key, desc) {
|
|
13855
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
13856
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
13857
|
+
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;
|
|
13858
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
13859
|
+
};
|
|
13860
|
+
var __classPrivateFieldGet10 = function(receiver, state, kind, f5) {
|
|
13861
|
+
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
13862
|
+
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");
|
|
13863
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
13864
|
+
};
|
|
13865
|
+
var _AmbientRecordingButton_instances;
|
|
13866
|
+
var _AmbientRecordingButton_trimmedInteractionId;
|
|
13867
|
+
var interactionIdRequiredError = () => new Error("interactionId is required. Set interactionId on ambient-root.");
|
|
13868
|
+
var AmbientRecordingButton = class AmbientRecordingButton2 extends RecordingButtonBase {
|
|
13869
|
+
constructor() {
|
|
13870
|
+
super(...arguments);
|
|
13871
|
+
_AmbientRecordingButton_instances.add(this);
|
|
13872
|
+
this._socketController = new AmbientController(this);
|
|
13873
|
+
}
|
|
13874
|
+
startRecording() {
|
|
13875
|
+
if (!__classPrivateFieldGet10(this, _AmbientRecordingButton_instances, "m", _AmbientRecordingButton_trimmedInteractionId).call(this)) {
|
|
13876
|
+
this.dispatchEvent(errorEvent(interactionIdRequiredError()));
|
|
13877
|
+
return;
|
|
13878
|
+
}
|
|
13879
|
+
super.startRecording();
|
|
13880
|
+
}
|
|
13881
|
+
async openConnection() {
|
|
13882
|
+
if (!__classPrivateFieldGet10(this, _AmbientRecordingButton_instances, "m", _AmbientRecordingButton_trimmedInteractionId).call(this)) {
|
|
13883
|
+
this.dispatchEvent(errorEvent(interactionIdRequiredError()));
|
|
13884
|
+
return;
|
|
13885
|
+
}
|
|
13886
|
+
await super.openConnection();
|
|
13887
|
+
}
|
|
13888
|
+
_getConnectConfig() {
|
|
13889
|
+
const interactionId = __classPrivateFieldGet10(this, _AmbientRecordingButton_instances, "m", _AmbientRecordingButton_trimmedInteractionId).call(this);
|
|
13890
|
+
if (!interactionId) {
|
|
13891
|
+
throw interactionIdRequiredError();
|
|
13892
|
+
}
|
|
13893
|
+
return {
|
|
13894
|
+
configuration: this._ambientConfig ?? DEFAULT_STREAM_CONFIG,
|
|
13895
|
+
interactionId
|
|
13896
|
+
};
|
|
13897
|
+
}
|
|
13898
|
+
};
|
|
13899
|
+
_AmbientRecordingButton_instances = /* @__PURE__ */ new WeakSet();
|
|
13900
|
+
_AmbientRecordingButton_trimmedInteractionId = function _AmbientRecordingButton_trimmedInteractionId2() {
|
|
13901
|
+
return this._interactionId?.trim();
|
|
13902
|
+
};
|
|
13903
|
+
__decorate13([
|
|
13904
|
+
c({ context: ambientConfigContext, subscribe: true }),
|
|
13905
|
+
r4()
|
|
13906
|
+
], AmbientRecordingButton.prototype, "_ambientConfig", void 0);
|
|
13907
|
+
__decorate13([
|
|
13908
|
+
c({ context: interactionIdContext, subscribe: true }),
|
|
13909
|
+
r4()
|
|
13910
|
+
], AmbientRecordingButton.prototype, "_interactionId", void 0);
|
|
13911
|
+
AmbientRecordingButton = __decorate13([
|
|
13912
|
+
t2("ambient-recording-button")
|
|
13913
|
+
], AmbientRecordingButton);
|
|
13914
|
+
|
|
13915
|
+
// node_modules/lit-html/directive-helpers.js
|
|
13916
|
+
var { I: t6 } = Z;
|
|
13917
|
+
var f3 = (o10) => void 0 === o10.strings;
|
|
13918
|
+
|
|
13919
|
+
// node_modules/lit-html/async-directive.js
|
|
13920
|
+
var s7 = (i7, t7) => {
|
|
13921
|
+
const e10 = i7._$AN;
|
|
13922
|
+
if (void 0 === e10) return false;
|
|
13923
|
+
for (const i8 of e10) i8._$AO?.(t7, false), s7(i8, t7);
|
|
13924
|
+
return true;
|
|
13925
|
+
};
|
|
13926
|
+
var o8 = (i7) => {
|
|
13927
|
+
let t7, e10;
|
|
13928
|
+
do {
|
|
13929
|
+
if (void 0 === (t7 = i7._$AM)) break;
|
|
13930
|
+
e10 = t7._$AN, e10.delete(i7), i7 = t7;
|
|
13931
|
+
} while (0 === e10?.size);
|
|
13932
|
+
};
|
|
13933
|
+
var r6 = (i7) => {
|
|
13934
|
+
for (let t7; t7 = i7._$AM; i7 = t7) {
|
|
13935
|
+
let e10 = t7._$AN;
|
|
13936
|
+
if (void 0 === e10) t7._$AN = e10 = /* @__PURE__ */ new Set();
|
|
13937
|
+
else if (e10.has(i7)) break;
|
|
13938
|
+
e10.add(i7), c5(t7);
|
|
13939
|
+
}
|
|
13940
|
+
};
|
|
13941
|
+
function h3(i7) {
|
|
13942
|
+
void 0 !== this._$AN ? (o8(this), this._$AM = i7, r6(this)) : this._$AM = i7;
|
|
13943
|
+
}
|
|
13944
|
+
function n6(i7, t7 = false, e10 = 0) {
|
|
13945
|
+
const r7 = this._$AH, h5 = this._$AN;
|
|
13946
|
+
if (void 0 !== h5 && 0 !== h5.size) if (t7) if (Array.isArray(r7)) for (let i8 = e10; i8 < r7.length; i8++) s7(r7[i8], false), o8(r7[i8]);
|
|
13947
|
+
else null != r7 && (s7(r7, false), o8(r7));
|
|
13948
|
+
else s7(this, i7);
|
|
13949
|
+
}
|
|
13950
|
+
var c5 = (i7) => {
|
|
13951
|
+
i7.type == t5.CHILD && (i7._$AP ??= n6, i7._$AQ ??= h3);
|
|
13952
|
+
};
|
|
13953
|
+
var f4 = class extends i6 {
|
|
13954
|
+
constructor() {
|
|
13955
|
+
super(...arguments), this._$AN = void 0;
|
|
13956
|
+
}
|
|
13957
|
+
_$AT(i7, t7, e10) {
|
|
13958
|
+
super._$AT(i7, t7, e10), r6(this), this.isConnected = i7._$AU;
|
|
13959
|
+
}
|
|
13960
|
+
_$AO(i7, t7 = true) {
|
|
13961
|
+
i7 !== this.isConnected && (this.isConnected = i7, i7 ? this.reconnected?.() : this.disconnected?.()), t7 && (s7(this, i7), o8(this));
|
|
13962
|
+
}
|
|
13963
|
+
setValue(t7) {
|
|
13964
|
+
if (f3(this._$Ct)) this._$Ct._$AI(t7, this);
|
|
13965
|
+
else {
|
|
13966
|
+
const i7 = [...this._$Ct._$AH];
|
|
13967
|
+
i7[this._$Ci] = t7, this._$Ct._$AI(i7, this, 0);
|
|
13968
|
+
}
|
|
13969
|
+
}
|
|
13970
|
+
disconnected() {
|
|
13971
|
+
}
|
|
13972
|
+
reconnected() {
|
|
13973
|
+
}
|
|
13974
|
+
};
|
|
13975
|
+
|
|
13976
|
+
// node_modules/lit-html/directives/ref.js
|
|
13977
|
+
var e9 = () => new h4();
|
|
13978
|
+
var h4 = class {
|
|
13979
|
+
};
|
|
13980
|
+
var o9 = /* @__PURE__ */ new WeakMap();
|
|
13981
|
+
var n7 = e7(class extends f4 {
|
|
13982
|
+
render(i7) {
|
|
13983
|
+
return E;
|
|
13984
|
+
}
|
|
13985
|
+
update(i7, [s8]) {
|
|
13986
|
+
const e10 = s8 !== this.G;
|
|
13987
|
+
return e10 && void 0 !== this.G && this.rt(void 0), (e10 || this.lt !== this.ct) && (this.G = s8, this.ht = i7.options?.host, this.rt(this.ct = i7.element)), E;
|
|
13988
|
+
}
|
|
13989
|
+
rt(t7) {
|
|
13990
|
+
if (this.isConnected || (t7 = void 0), "function" == typeof this.G) {
|
|
13991
|
+
const i7 = this.ht ?? globalThis;
|
|
13992
|
+
let s8 = o9.get(i7);
|
|
13993
|
+
void 0 === s8 && (s8 = /* @__PURE__ */ new WeakMap(), o9.set(i7, s8)), void 0 !== s8.get(this.G) && this.G.call(this.ht, void 0), s8.set(this.G, t7), void 0 !== t7 && this.G.call(this.ht, t7);
|
|
13994
|
+
} else this.G.value = t7;
|
|
13995
|
+
}
|
|
13996
|
+
get lt() {
|
|
13997
|
+
return "function" == typeof this.G ? o9.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
|
|
13998
|
+
}
|
|
13999
|
+
disconnected() {
|
|
14000
|
+
this.lt === this.ct && this.rt(void 0);
|
|
14001
|
+
}
|
|
14002
|
+
reconnected() {
|
|
14003
|
+
this.rt(this.ct);
|
|
14004
|
+
}
|
|
14005
|
+
});
|
|
14006
|
+
|
|
14007
|
+
// dist/components/corti-root.js
|
|
14008
|
+
var __decorate14 = function(decorators, target, key, desc) {
|
|
14009
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
14010
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
14011
|
+
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;
|
|
14012
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
14013
|
+
};
|
|
14014
|
+
var CortiRoot = class extends i5 {
|
|
14015
|
+
constructor() {
|
|
14016
|
+
super(...arguments);
|
|
14017
|
+
this.settingsEnabled = ["device", "language"];
|
|
14018
|
+
this.allowButtonFocus = false;
|
|
14019
|
+
this._contextProviderRef = e9();
|
|
14020
|
+
this._recordingButtonRef = e9();
|
|
14021
|
+
}
|
|
14022
|
+
/**
|
|
14023
|
+
* List of all language codes available for use with the Web Component.
|
|
14024
|
+
* Default list depends on the accessToken
|
|
14025
|
+
*/
|
|
14026
|
+
set languagesSupported(value) {
|
|
14027
|
+
this._languagesSupported = value;
|
|
14028
|
+
}
|
|
14029
|
+
get languagesSupported() {
|
|
14030
|
+
return this._contextProviderRef.value?.languages || this._languagesSupported || [];
|
|
14031
|
+
}
|
|
14032
|
+
/**
|
|
14033
|
+
* List of available recording devices
|
|
14034
|
+
*/
|
|
14035
|
+
set devices(value) {
|
|
14036
|
+
this._devices = value;
|
|
14037
|
+
}
|
|
14038
|
+
get devices() {
|
|
14039
|
+
return this._contextProviderRef.value?.devices || this._devices || [];
|
|
14040
|
+
}
|
|
14041
|
+
/**
|
|
14042
|
+
* The selected device used for recording (MediaDeviceInfo).
|
|
14043
|
+
*/
|
|
14044
|
+
set selectedDevice(value) {
|
|
14045
|
+
this._selectedDevice = value;
|
|
14046
|
+
}
|
|
14047
|
+
get selectedDevice() {
|
|
14048
|
+
return this._contextProviderRef.value?.selectedDevice || this._selectedDevice;
|
|
14049
|
+
}
|
|
14050
|
+
/**
|
|
14051
|
+
* Push-to-talk keybinding for keyboard shortcut. Single key only (e.g., "Space", "k", "meta", "ctrl").
|
|
14052
|
+
* Combinations with "+" are not supported.
|
|
14053
|
+
* Keydown starts recording, keyup stops recording.
|
|
14054
|
+
* Defaults to "Space" if keybinding is in settingsEnabled, otherwise undefined
|
|
14055
|
+
*/
|
|
14056
|
+
set pushToTalkKeybinding(value) {
|
|
14057
|
+
this._pushToTalkKeybinding = value;
|
|
14058
|
+
}
|
|
14059
|
+
get pushToTalkKeybinding() {
|
|
14060
|
+
return this._contextProviderRef.value?.pushToTalkKeybinding || this._pushToTalkKeybinding;
|
|
14061
|
+
}
|
|
14062
|
+
/**
|
|
14063
|
+
* Toggle-to-talk keybinding for keyboard shortcut. Single key only (e.g., "`", "k", "meta", "ctrl").
|
|
14064
|
+
* Combinations with "+" are not supported.
|
|
14065
|
+
* Pressing the key toggles recording on/off.
|
|
14066
|
+
* Defaults to "`" if keybinding is in settingsEnabled, otherwise undefined
|
|
14067
|
+
*/
|
|
14068
|
+
set toggleToTalkKeybinding(value) {
|
|
14069
|
+
this._toggleToTalkKeybinding = value;
|
|
14070
|
+
}
|
|
14071
|
+
get toggleToTalkKeybinding() {
|
|
14072
|
+
return this._contextProviderRef.value?.toggleToTalkKeybinding || this._toggleToTalkKeybinding;
|
|
14073
|
+
}
|
|
14074
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
14075
|
+
// Public methods
|
|
14076
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
14077
|
+
/**
|
|
14078
|
+
* Current state of recording (stopped, recording, initializing and stopping, ).
|
|
14079
|
+
*/
|
|
14080
|
+
get recordingState() {
|
|
14081
|
+
return this._contextProviderRef.value?.recordingState ?? "stopped";
|
|
14082
|
+
}
|
|
14083
|
+
/**
|
|
14084
|
+
* Starts a recording.
|
|
14085
|
+
*/
|
|
14086
|
+
startRecording() {
|
|
14087
|
+
this._recordingButtonRef.value?.startRecording();
|
|
14088
|
+
}
|
|
14089
|
+
/**
|
|
14090
|
+
* Stops a recording.
|
|
14091
|
+
*/
|
|
14092
|
+
stopRecording() {
|
|
14093
|
+
this._recordingButtonRef.value?.stopRecording();
|
|
14094
|
+
}
|
|
14095
|
+
/**
|
|
14096
|
+
* Starts or stops recording. Convenience layer on top of the start/stop methods.
|
|
14097
|
+
*/
|
|
14098
|
+
toggleRecording() {
|
|
14099
|
+
this._recordingButtonRef.value?.toggleRecording();
|
|
14100
|
+
}
|
|
14101
|
+
/**
|
|
14102
|
+
* Opens the WebSocket connection without starting recording.
|
|
14103
|
+
* Use this to pre-establish the connection before recording starts.
|
|
14104
|
+
*/
|
|
14105
|
+
async openConnection() {
|
|
14106
|
+
await this._recordingButtonRef.value?.openConnection();
|
|
14107
|
+
}
|
|
14108
|
+
/**
|
|
14109
|
+
* Closes the WebSocket connection by sending "end" and waiting for "ended".
|
|
14110
|
+
* Call this to receive "usage" statistics or when done with the connection.
|
|
14111
|
+
*/
|
|
14112
|
+
async closeConnection() {
|
|
14113
|
+
await this._recordingButtonRef.value?.closeConnection();
|
|
14114
|
+
}
|
|
14115
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
14116
|
+
// Render
|
|
14117
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
14118
|
+
render() {
|
|
14119
|
+
return x``;
|
|
14120
|
+
}
|
|
13712
14121
|
};
|
|
13713
|
-
|
|
13714
|
-
|
|
13715
|
-
|
|
13716
|
-
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
|
|
13720
|
-
|
|
13721
|
-
|
|
13722
|
-
|
|
13723
|
-
|
|
13724
|
-
|
|
13725
|
-
|
|
13726
|
-
|
|
13727
|
-
|
|
13728
|
-
|
|
13729
|
-
],
|
|
13730
|
-
|
|
13731
|
-
|
|
13732
|
-
|
|
13733
|
-
|
|
13734
|
-
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
], DictationRecordingButton.prototype, "_tenantName", void 0);
|
|
13738
|
-
__decorate4([
|
|
13739
|
-
c5({ context: dictationConfigContext, subscribe: true }),
|
|
13740
|
-
r5()
|
|
13741
|
-
], DictationRecordingButton.prototype, "_dictationConfig", void 0);
|
|
13742
|
-
__decorate4([
|
|
13743
|
-
c5({ context: socketUrlContext, subscribe: true }),
|
|
13744
|
-
r5()
|
|
13745
|
-
], DictationRecordingButton.prototype, "_socketUrl", void 0);
|
|
13746
|
-
__decorate4([
|
|
13747
|
-
c5({ context: socketProxyContext, subscribe: true }),
|
|
13748
|
-
r5()
|
|
13749
|
-
], DictationRecordingButton.prototype, "_socketProxy", void 0);
|
|
13750
|
-
__decorate4([
|
|
13751
|
-
c5({ context: debugDisplayAudioContext, subscribe: true }),
|
|
13752
|
-
r5()
|
|
13753
|
-
], DictationRecordingButton.prototype, "_debug_displayAudio", void 0);
|
|
13754
|
-
__decorate4([
|
|
13755
|
-
c5({ context: pushToTalkKeybindingContext, subscribe: true }),
|
|
13756
|
-
r5()
|
|
13757
|
-
], DictationRecordingButton.prototype, "_pushToTalkKeybinding", void 0);
|
|
13758
|
-
__decorate4([
|
|
13759
|
-
c5({ context: toggleToTalkKeybindingContext, subscribe: true }),
|
|
13760
|
-
r5()
|
|
13761
|
-
], DictationRecordingButton.prototype, "_toggleToTalkKeybinding", void 0);
|
|
13762
|
-
__decorate4([
|
|
14122
|
+
CortiRoot.styles = i2`
|
|
14123
|
+
.hidden {
|
|
14124
|
+
display: none;
|
|
14125
|
+
}
|
|
14126
|
+
`;
|
|
14127
|
+
__decorate14([
|
|
14128
|
+
n4({ type: String })
|
|
14129
|
+
], CortiRoot.prototype, "accessToken", void 0);
|
|
14130
|
+
__decorate14([
|
|
14131
|
+
n4({ attribute: false, type: Object })
|
|
14132
|
+
], CortiRoot.prototype, "authConfig", void 0);
|
|
14133
|
+
__decorate14([
|
|
14134
|
+
n4({ type: String })
|
|
14135
|
+
], CortiRoot.prototype, "socketUrl", void 0);
|
|
14136
|
+
__decorate14([
|
|
14137
|
+
n4({ attribute: false, type: Object })
|
|
14138
|
+
], CortiRoot.prototype, "socketProxy", void 0);
|
|
14139
|
+
__decorate14([
|
|
14140
|
+
n4({
|
|
14141
|
+
converter: commaSeparatedConverter,
|
|
14142
|
+
type: Array
|
|
14143
|
+
})
|
|
14144
|
+
], CortiRoot.prototype, "settingsEnabled", void 0);
|
|
14145
|
+
__decorate14([
|
|
13763
14146
|
n4({ type: Boolean })
|
|
13764
|
-
],
|
|
13765
|
-
|
|
13766
|
-
|
|
13767
|
-
|
|
14147
|
+
], CortiRoot.prototype, "allowButtonFocus", void 0);
|
|
14148
|
+
__decorate14([
|
|
14149
|
+
n4({
|
|
14150
|
+
converter: commaSeparatedConverter,
|
|
14151
|
+
type: Array
|
|
14152
|
+
})
|
|
14153
|
+
], CortiRoot.prototype, "languagesSupported", null);
|
|
14154
|
+
__decorate14([
|
|
14155
|
+
r4()
|
|
14156
|
+
], CortiRoot.prototype, "_languagesSupported", void 0);
|
|
14157
|
+
__decorate14([
|
|
14158
|
+
n4({ attribute: false, type: Array })
|
|
14159
|
+
], CortiRoot.prototype, "devices", null);
|
|
14160
|
+
__decorate14([
|
|
14161
|
+
r4()
|
|
14162
|
+
], CortiRoot.prototype, "_devices", void 0);
|
|
14163
|
+
__decorate14([
|
|
14164
|
+
n4({ attribute: false, type: Object })
|
|
14165
|
+
], CortiRoot.prototype, "selectedDevice", null);
|
|
14166
|
+
__decorate14([
|
|
14167
|
+
r4()
|
|
14168
|
+
], CortiRoot.prototype, "_selectedDevice", void 0);
|
|
14169
|
+
__decorate14([
|
|
14170
|
+
n4({ type: String })
|
|
14171
|
+
], CortiRoot.prototype, "pushToTalkKeybinding", null);
|
|
14172
|
+
__decorate14([
|
|
14173
|
+
r4()
|
|
14174
|
+
], CortiRoot.prototype, "_pushToTalkKeybinding", void 0);
|
|
14175
|
+
__decorate14([
|
|
14176
|
+
n4({ type: String })
|
|
14177
|
+
], CortiRoot.prototype, "toggleToTalkKeybinding", null);
|
|
14178
|
+
__decorate14([
|
|
14179
|
+
r4()
|
|
14180
|
+
], CortiRoot.prototype, "_toggleToTalkKeybinding", void 0);
|
|
13768
14181
|
|
|
13769
14182
|
// dist/styles/callout.js
|
|
13770
|
-
var CalloutStyles =
|
|
14183
|
+
var CalloutStyles = i2`
|
|
13771
14184
|
.callout {
|
|
13772
14185
|
background: var(--callout-info-background, light-dark(#007bff33, #0056b333));
|
|
13773
14186
|
border: 1px solid var(--callout-info-border, light-dark(#007bff99, #0056b399));
|
|
@@ -13790,7 +14203,7 @@ var CalloutStyles = i`
|
|
|
13790
14203
|
var callout_default = CalloutStyles;
|
|
13791
14204
|
|
|
13792
14205
|
// dist/styles/settings-menu.js
|
|
13793
|
-
var SettingsMenuStyles =
|
|
14206
|
+
var SettingsMenuStyles = i2`
|
|
13794
14207
|
:host {
|
|
13795
14208
|
display: block;
|
|
13796
14209
|
}
|
|
@@ -13826,7 +14239,7 @@ var settings_menu_default = SettingsMenuStyles;
|
|
|
13826
14239
|
// dist/styles/select.js
|
|
13827
14240
|
var SelectStyles = [
|
|
13828
14241
|
LabelStyles,
|
|
13829
|
-
|
|
14242
|
+
i2`
|
|
13830
14243
|
select {
|
|
13831
14244
|
background: var(--card-background, light-dark(#fff, #333));
|
|
13832
14245
|
color: var(--component-text-color, light-dark(#333, #eee));
|
|
@@ -13855,20 +14268,20 @@ var SelectStyles = [
|
|
|
13855
14268
|
var select_default = SelectStyles;
|
|
13856
14269
|
|
|
13857
14270
|
// dist/components/device-selector.js
|
|
13858
|
-
var
|
|
14271
|
+
var __decorate15 = function(decorators, target, key, desc) {
|
|
13859
14272
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
13860
14273
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
13861
14274
|
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;
|
|
13862
14275
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
13863
14276
|
};
|
|
13864
|
-
var
|
|
14277
|
+
var __classPrivateFieldGet11 = function(receiver, state, kind, f5) {
|
|
13865
14278
|
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
13866
14279
|
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");
|
|
13867
14280
|
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
13868
14281
|
};
|
|
13869
14282
|
var _DictationDeviceSelector_instances;
|
|
13870
14283
|
var _DictationDeviceSelector_handleSelectDevice;
|
|
13871
|
-
var DictationDeviceSelector = class DictationDeviceSelector2 extends
|
|
14284
|
+
var DictationDeviceSelector = class DictationDeviceSelector2 extends i5 {
|
|
13872
14285
|
constructor() {
|
|
13873
14286
|
super(...arguments);
|
|
13874
14287
|
_DictationDeviceSelector_instances.add(this);
|
|
@@ -13883,7 +14296,7 @@ var DictationDeviceSelector = class DictationDeviceSelector2 extends i4 {
|
|
|
13883
14296
|
<select
|
|
13884
14297
|
id="device-select"
|
|
13885
14298
|
aria-labelledby="device-select-label"
|
|
13886
|
-
@change=${
|
|
14299
|
+
@change=${__classPrivateFieldGet11(this, _DictationDeviceSelector_instances, "m", _DictationDeviceSelector_handleSelectDevice)}
|
|
13887
14300
|
?disabled=${this.disabled || !this._devices || this._devices.length === 0}
|
|
13888
14301
|
>
|
|
13889
14302
|
${this._devices?.map((device) => x`
|
|
@@ -13909,25 +14322,25 @@ _DictationDeviceSelector_handleSelectDevice = function _DictationDeviceSelector_
|
|
|
13909
14322
|
this.dispatchEvent(recordingDevicesChangedEvent(this._devices || [], device));
|
|
13910
14323
|
};
|
|
13911
14324
|
DictationDeviceSelector.styles = select_default;
|
|
13912
|
-
|
|
13913
|
-
|
|
13914
|
-
|
|
14325
|
+
__decorate15([
|
|
14326
|
+
c({ context: devicesContext, subscribe: true }),
|
|
14327
|
+
r4()
|
|
13915
14328
|
], DictationDeviceSelector.prototype, "_devices", void 0);
|
|
13916
|
-
|
|
13917
|
-
|
|
13918
|
-
|
|
14329
|
+
__decorate15([
|
|
14330
|
+
c({ context: selectedDeviceContext, subscribe: true }),
|
|
14331
|
+
r4()
|
|
13919
14332
|
], DictationDeviceSelector.prototype, "_selectedDevice", void 0);
|
|
13920
|
-
|
|
14333
|
+
__decorate15([
|
|
13921
14334
|
n4({ type: Boolean })
|
|
13922
14335
|
], DictationDeviceSelector.prototype, "disabled", void 0);
|
|
13923
|
-
DictationDeviceSelector =
|
|
13924
|
-
|
|
14336
|
+
DictationDeviceSelector = __decorate15([
|
|
14337
|
+
t2("dictation-device-selector")
|
|
13925
14338
|
], DictationDeviceSelector);
|
|
13926
14339
|
|
|
13927
14340
|
// dist/styles/keybinding-selector.js
|
|
13928
14341
|
var KeybindingSelectorStyles = [
|
|
13929
14342
|
LabelStyles,
|
|
13930
|
-
|
|
14343
|
+
i2`
|
|
13931
14344
|
:host {
|
|
13932
14345
|
display: block;
|
|
13933
14346
|
}
|
|
@@ -14002,13 +14415,13 @@ var KeybindingSelectorStyles = [
|
|
|
14002
14415
|
var keybinding_selector_default = KeybindingSelectorStyles;
|
|
14003
14416
|
|
|
14004
14417
|
// dist/components/keybinding-input.js
|
|
14005
|
-
var
|
|
14418
|
+
var __decorate16 = function(decorators, target, key, desc) {
|
|
14006
14419
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
14007
14420
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
14008
14421
|
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;
|
|
14009
14422
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
14010
14423
|
};
|
|
14011
|
-
var
|
|
14424
|
+
var __classPrivateFieldGet12 = function(receiver, state, kind, f5) {
|
|
14012
14425
|
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
14013
14426
|
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");
|
|
14014
14427
|
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
@@ -14017,7 +14430,7 @@ var _DictationKeybindingInput_instances;
|
|
|
14017
14430
|
var _DictationKeybindingInput_handleKeybindingInputFocus;
|
|
14018
14431
|
var _DictationKeybindingInput_handleKeybindingInputBlur;
|
|
14019
14432
|
var _DictationKeybindingInput_handleKeybindingKeyDown;
|
|
14020
|
-
var DictationKeybindingInput = class DictationKeybindingInput2 extends
|
|
14433
|
+
var DictationKeybindingInput = class DictationKeybindingInput2 extends i5 {
|
|
14021
14434
|
constructor() {
|
|
14022
14435
|
super(...arguments);
|
|
14023
14436
|
_DictationKeybindingInput_instances.add(this);
|
|
@@ -14039,9 +14452,9 @@ var DictationKeybindingInput = class DictationKeybindingInput2 extends i4 {
|
|
|
14039
14452
|
.value=""
|
|
14040
14453
|
placeholder="Click and press a key..."
|
|
14041
14454
|
readonly
|
|
14042
|
-
@focusin=${
|
|
14043
|
-
@focusout=${
|
|
14044
|
-
@keydown=${
|
|
14455
|
+
@focusin=${__classPrivateFieldGet12(this, _DictationKeybindingInput_instances, "m", _DictationKeybindingInput_handleKeybindingInputFocus)}
|
|
14456
|
+
@focusout=${__classPrivateFieldGet12(this, _DictationKeybindingInput_instances, "m", _DictationKeybindingInput_handleKeybindingInputBlur)}
|
|
14457
|
+
@keydown=${__classPrivateFieldGet12(this, _DictationKeybindingInput_instances, "m", _DictationKeybindingInput_handleKeybindingKeyDown)}
|
|
14045
14458
|
?disabled=${this.disabled}
|
|
14046
14459
|
/>
|
|
14047
14460
|
</div>
|
|
@@ -14066,35 +14479,35 @@ _DictationKeybindingInput_handleKeybindingKeyDown = function _DictationKeybindin
|
|
|
14066
14479
|
this.dispatchEvent(keybindingChangedEvent(event.key, event.code, keybinding, this.keybindingType));
|
|
14067
14480
|
};
|
|
14068
14481
|
DictationKeybindingInput.styles = keybinding_selector_default;
|
|
14069
|
-
|
|
14482
|
+
__decorate16([
|
|
14070
14483
|
n4({ type: String })
|
|
14071
14484
|
], DictationKeybindingInput.prototype, "keybindingType", void 0);
|
|
14072
|
-
|
|
14073
|
-
|
|
14074
|
-
|
|
14485
|
+
__decorate16([
|
|
14486
|
+
c({ context: pushToTalkKeybindingContext, subscribe: true }),
|
|
14487
|
+
r4()
|
|
14075
14488
|
], DictationKeybindingInput.prototype, "_pushToTalkKeybinding", void 0);
|
|
14076
|
-
|
|
14077
|
-
|
|
14078
|
-
|
|
14489
|
+
__decorate16([
|
|
14490
|
+
c({ context: toggleToTalkKeybindingContext, subscribe: true }),
|
|
14491
|
+
r4()
|
|
14079
14492
|
], DictationKeybindingInput.prototype, "_toggleToTalkKeybinding", void 0);
|
|
14080
|
-
|
|
14493
|
+
__decorate16([
|
|
14081
14494
|
n4({ type: Boolean })
|
|
14082
14495
|
], DictationKeybindingInput.prototype, "disabled", void 0);
|
|
14083
|
-
|
|
14084
|
-
|
|
14496
|
+
__decorate16([
|
|
14497
|
+
r4()
|
|
14085
14498
|
], DictationKeybindingInput.prototype, "_isCapturingKeybinding", void 0);
|
|
14086
|
-
DictationKeybindingInput =
|
|
14087
|
-
|
|
14499
|
+
DictationKeybindingInput = __decorate16([
|
|
14500
|
+
t2("dictation-keybinding-input")
|
|
14088
14501
|
], DictationKeybindingInput);
|
|
14089
14502
|
|
|
14090
14503
|
// dist/components/keybinding-selector.js
|
|
14091
|
-
var
|
|
14504
|
+
var __decorate17 = function(decorators, target, key, desc) {
|
|
14092
14505
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
14093
14506
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
14094
14507
|
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;
|
|
14095
14508
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
14096
14509
|
};
|
|
14097
|
-
var DictationKeybindingSelector = class DictationKeybindingSelector2 extends
|
|
14510
|
+
var DictationKeybindingSelector = class DictationKeybindingSelector2 extends i5 {
|
|
14098
14511
|
constructor() {
|
|
14099
14512
|
super(...arguments);
|
|
14100
14513
|
this.disabled = false;
|
|
@@ -14118,36 +14531,36 @@ var DictationKeybindingSelector = class DictationKeybindingSelector2 extends i4
|
|
|
14118
14531
|
}
|
|
14119
14532
|
};
|
|
14120
14533
|
DictationKeybindingSelector.styles = keybinding_selector_default;
|
|
14121
|
-
|
|
14122
|
-
|
|
14123
|
-
|
|
14534
|
+
__decorate17([
|
|
14535
|
+
c({ context: pushToTalkKeybindingContext, subscribe: true }),
|
|
14536
|
+
r4()
|
|
14124
14537
|
], DictationKeybindingSelector.prototype, "_pushToTalkKeybinding", void 0);
|
|
14125
|
-
|
|
14126
|
-
|
|
14127
|
-
|
|
14538
|
+
__decorate17([
|
|
14539
|
+
c({ context: toggleToTalkKeybindingContext, subscribe: true }),
|
|
14540
|
+
r4()
|
|
14128
14541
|
], DictationKeybindingSelector.prototype, "_toggleToTalkKeybinding", void 0);
|
|
14129
|
-
|
|
14542
|
+
__decorate17([
|
|
14130
14543
|
n4({ type: Boolean })
|
|
14131
14544
|
], DictationKeybindingSelector.prototype, "disabled", void 0);
|
|
14132
|
-
DictationKeybindingSelector =
|
|
14133
|
-
|
|
14545
|
+
DictationKeybindingSelector = __decorate17([
|
|
14546
|
+
t2("dictation-keybinding-selector")
|
|
14134
14547
|
], DictationKeybindingSelector);
|
|
14135
14548
|
|
|
14136
14549
|
// dist/components/language-selector.js
|
|
14137
|
-
var
|
|
14550
|
+
var __decorate18 = function(decorators, target, key, desc) {
|
|
14138
14551
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
14139
14552
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
14140
14553
|
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;
|
|
14141
14554
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
14142
14555
|
};
|
|
14143
|
-
var
|
|
14556
|
+
var __classPrivateFieldGet13 = function(receiver, state, kind, f5) {
|
|
14144
14557
|
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
14145
14558
|
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");
|
|
14146
14559
|
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
14147
14560
|
};
|
|
14148
14561
|
var _DictationLanguageSelector_instances;
|
|
14149
14562
|
var _DictationLanguageSelector_handleSelectLanguage;
|
|
14150
|
-
var DictationLanguageSelector = class DictationLanguageSelector2 extends
|
|
14563
|
+
var DictationLanguageSelector = class DictationLanguageSelector2 extends i5 {
|
|
14151
14564
|
constructor() {
|
|
14152
14565
|
super(...arguments);
|
|
14153
14566
|
_DictationLanguageSelector_instances.add(this);
|
|
@@ -14162,7 +14575,7 @@ var DictationLanguageSelector = class DictationLanguageSelector2 extends i4 {
|
|
|
14162
14575
|
<select
|
|
14163
14576
|
id="language-select"
|
|
14164
14577
|
aria-labelledby="language-select-label"
|
|
14165
|
-
@change=${
|
|
14578
|
+
@change=${__classPrivateFieldGet13(this, _DictationLanguageSelector_instances, "m", _DictationLanguageSelector_handleSelectLanguage)}
|
|
14166
14579
|
?disabled=${this.disabled || !this._languages || this._languages.length === 0}
|
|
14167
14580
|
>
|
|
14168
14581
|
${this._languages?.map((language) => x`
|
|
@@ -14185,29 +14598,29 @@ _DictationLanguageSelector_handleSelectLanguage = function _DictationLanguageSel
|
|
|
14185
14598
|
this.dispatchEvent(languageChangedEvent(language));
|
|
14186
14599
|
};
|
|
14187
14600
|
DictationLanguageSelector.styles = select_default;
|
|
14188
|
-
|
|
14189
|
-
|
|
14190
|
-
|
|
14601
|
+
__decorate18([
|
|
14602
|
+
c({ context: languagesContext, subscribe: true }),
|
|
14603
|
+
r4()
|
|
14191
14604
|
], DictationLanguageSelector.prototype, "_languages", void 0);
|
|
14192
|
-
|
|
14193
|
-
|
|
14194
|
-
|
|
14605
|
+
__decorate18([
|
|
14606
|
+
c({ context: dictationConfigContext, subscribe: true }),
|
|
14607
|
+
r4()
|
|
14195
14608
|
], DictationLanguageSelector.prototype, "_dictationConfig", void 0);
|
|
14196
|
-
|
|
14609
|
+
__decorate18([
|
|
14197
14610
|
n4({ type: Boolean })
|
|
14198
14611
|
], DictationLanguageSelector.prototype, "disabled", void 0);
|
|
14199
|
-
DictationLanguageSelector =
|
|
14200
|
-
|
|
14612
|
+
DictationLanguageSelector = __decorate18([
|
|
14613
|
+
t2("dictation-language-selector")
|
|
14201
14614
|
], DictationLanguageSelector);
|
|
14202
14615
|
|
|
14203
14616
|
// dist/components/settings-menu.js
|
|
14204
|
-
var
|
|
14617
|
+
var __decorate19 = function(decorators, target, key, desc) {
|
|
14205
14618
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
14206
14619
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
14207
14620
|
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;
|
|
14208
14621
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
14209
14622
|
};
|
|
14210
|
-
var DictationSettingsMenu = class DictationSettingsMenu2 extends
|
|
14623
|
+
var DictationSettingsMenu = class DictationSettingsMenu2 extends i5 {
|
|
14211
14624
|
constructor() {
|
|
14212
14625
|
super(...arguments);
|
|
14213
14626
|
this._recordingState = "stopped";
|
|
@@ -14253,110 +14666,165 @@ DictationSettingsMenu.styles = [
|
|
|
14253
14666
|
buttons_default,
|
|
14254
14667
|
callout_default
|
|
14255
14668
|
];
|
|
14256
|
-
|
|
14257
|
-
|
|
14258
|
-
|
|
14669
|
+
__decorate19([
|
|
14670
|
+
c({ context: recordingStateContext, subscribe: true }),
|
|
14671
|
+
r4()
|
|
14259
14672
|
], DictationSettingsMenu.prototype, "_recordingState", void 0);
|
|
14260
|
-
|
|
14673
|
+
__decorate19([
|
|
14261
14674
|
n4({
|
|
14262
14675
|
converter: commaSeparatedConverter,
|
|
14263
14676
|
type: Array
|
|
14264
14677
|
})
|
|
14265
14678
|
], DictationSettingsMenu.prototype, "settingsEnabled", void 0);
|
|
14266
|
-
DictationSettingsMenu =
|
|
14267
|
-
|
|
14679
|
+
DictationSettingsMenu = __decorate19([
|
|
14680
|
+
t2("dictation-settings-menu")
|
|
14268
14681
|
], DictationSettingsMenu);
|
|
14269
14682
|
|
|
14270
|
-
// dist/components/corti-
|
|
14271
|
-
var
|
|
14683
|
+
// dist/components/corti-ambient.js
|
|
14684
|
+
var __decorate20 = function(decorators, target, key, desc) {
|
|
14272
14685
|
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
14273
14686
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
14274
14687
|
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;
|
|
14275
14688
|
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
14276
14689
|
};
|
|
14277
|
-
var
|
|
14278
|
-
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
14279
|
-
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");
|
|
14280
|
-
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
|
|
14281
|
-
};
|
|
14282
|
-
var _CortiDictation_recordingButtonRef;
|
|
14283
|
-
var _CortiDictation_contextProviderRef;
|
|
14284
|
-
var CortiDictation = class CortiDictation2 extends i4 {
|
|
14690
|
+
var CortiAmbient = class CortiAmbient2 extends CortiRoot {
|
|
14285
14691
|
constructor() {
|
|
14286
14692
|
super(...arguments);
|
|
14287
|
-
|
|
14288
|
-
_CortiDictation_contextProviderRef.set(this, e7());
|
|
14289
|
-
this.settingsEnabled = ["device", "language"];
|
|
14290
|
-
this.allowButtonFocus = false;
|
|
14291
|
-
this.debug_displayAudio = false;
|
|
14292
|
-
this._dictationConfig = DEFAULT_DICTATION_CONFIG;
|
|
14693
|
+
this._ambientConfig = DEFAULT_STREAM_CONFIG;
|
|
14293
14694
|
}
|
|
14294
14695
|
/**
|
|
14295
|
-
*
|
|
14296
|
-
* Default list depends on the accessToken
|
|
14696
|
+
* Stream configuration for ambient capture (modes, transcription, etc.).
|
|
14297
14697
|
*/
|
|
14298
|
-
set
|
|
14299
|
-
this.
|
|
14698
|
+
set ambientConfig(value) {
|
|
14699
|
+
this._ambientConfig = value;
|
|
14300
14700
|
}
|
|
14301
|
-
get
|
|
14302
|
-
return
|
|
14701
|
+
get ambientConfig() {
|
|
14702
|
+
return this._contextProviderRef.value?.ambientConfig ?? this._ambientConfig ?? DEFAULT_STREAM_CONFIG;
|
|
14303
14703
|
}
|
|
14304
14704
|
/**
|
|
14305
|
-
*
|
|
14705
|
+
* Stream interaction id passed to `stream.connect` for this session.
|
|
14306
14706
|
*/
|
|
14307
|
-
set
|
|
14308
|
-
this.
|
|
14707
|
+
set interactionId(value) {
|
|
14708
|
+
this._interactionId = value;
|
|
14309
14709
|
}
|
|
14310
|
-
get
|
|
14311
|
-
return
|
|
14710
|
+
get interactionId() {
|
|
14711
|
+
return this._contextProviderRef.value?.interactionId ?? this._interactionId;
|
|
14312
14712
|
}
|
|
14313
|
-
|
|
14314
|
-
|
|
14315
|
-
|
|
14316
|
-
|
|
14317
|
-
this.
|
|
14713
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
14714
|
+
// Render
|
|
14715
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
14716
|
+
render() {
|
|
14717
|
+
const isHidden = !this.accessToken && !this.authConfig && !this.socketUrl && !this.socketProxy;
|
|
14718
|
+
return x`
|
|
14719
|
+
<ambient-root
|
|
14720
|
+
${n7(this._contextProviderRef)}
|
|
14721
|
+
class=${e8({ hidden: isHidden })}
|
|
14722
|
+
.accessToken=${this.accessToken}
|
|
14723
|
+
.authConfig=${this.authConfig}
|
|
14724
|
+
.socketUrl=${this.socketUrl}
|
|
14725
|
+
.socketProxy=${this.socketProxy}
|
|
14726
|
+
.ambientConfig=${this._ambientConfig}
|
|
14727
|
+
.interactionId=${this._interactionId}
|
|
14728
|
+
.languages=${this._languagesSupported}
|
|
14729
|
+
.devices=${this._devices}
|
|
14730
|
+
.selectedDevice=${this._selectedDevice}
|
|
14731
|
+
.pushToTalkKeybinding=${this._pushToTalkKeybinding}
|
|
14732
|
+
.toggleToTalkKeybinding=${this._toggleToTalkKeybinding}
|
|
14733
|
+
>
|
|
14734
|
+
<ambient-recording-button
|
|
14735
|
+
${n7(this._recordingButtonRef)}
|
|
14736
|
+
?allowButtonFocus=${this.allowButtonFocus}
|
|
14737
|
+
></ambient-recording-button>
|
|
14738
|
+
${this.settingsEnabled?.length > 0 ? x`<dictation-settings-menu
|
|
14739
|
+
.settingsEnabled=${this.settingsEnabled}
|
|
14740
|
+
></dictation-settings-menu>` : E}
|
|
14741
|
+
</ambient-root>
|
|
14742
|
+
`;
|
|
14318
14743
|
}
|
|
14319
|
-
|
|
14320
|
-
|
|
14744
|
+
};
|
|
14745
|
+
__decorate20([
|
|
14746
|
+
n4({ attribute: false, type: Object })
|
|
14747
|
+
], CortiAmbient.prototype, "ambientConfig", null);
|
|
14748
|
+
__decorate20([
|
|
14749
|
+
r4()
|
|
14750
|
+
], CortiAmbient.prototype, "_ambientConfig", void 0);
|
|
14751
|
+
__decorate20([
|
|
14752
|
+
n4({ type: String })
|
|
14753
|
+
], CortiAmbient.prototype, "interactionId", null);
|
|
14754
|
+
__decorate20([
|
|
14755
|
+
r4()
|
|
14756
|
+
], CortiAmbient.prototype, "_interactionId", void 0);
|
|
14757
|
+
CortiAmbient = __decorate20([
|
|
14758
|
+
t2("corti-ambient")
|
|
14759
|
+
], CortiAmbient);
|
|
14760
|
+
|
|
14761
|
+
// dist/controllers/dictation-controller.js
|
|
14762
|
+
var DictationController = class extends SocketController {
|
|
14763
|
+
async stopRecording() {
|
|
14764
|
+
await this.pause();
|
|
14321
14765
|
}
|
|
14322
|
-
|
|
14323
|
-
|
|
14324
|
-
|
|
14325
|
-
|
|
14326
|
-
|
|
14766
|
+
async _connectThroughProxy(dictationConfig, proxy) {
|
|
14767
|
+
return await CortiWebSocketProxyClient.transcribe.connect({
|
|
14768
|
+
// awaitConfiguration: false — CONFIG_* appears in network activity before the socket is configured server-side
|
|
14769
|
+
awaitConfiguration: false,
|
|
14770
|
+
configuration: dictationConfig,
|
|
14771
|
+
proxy
|
|
14772
|
+
});
|
|
14327
14773
|
}
|
|
14328
|
-
|
|
14329
|
-
return
|
|
14774
|
+
async _connectThroughAuth(client, dictationConfig) {
|
|
14775
|
+
return await client.transcribe.connect({
|
|
14776
|
+
// awaitConfiguration: false — CONFIG_* appears in network activity before the socket is configured server-side
|
|
14777
|
+
awaitConfiguration: false,
|
|
14778
|
+
configuration: dictationConfig
|
|
14779
|
+
});
|
|
14330
14780
|
}
|
|
14331
|
-
|
|
14332
|
-
|
|
14333
|
-
|
|
14334
|
-
|
|
14335
|
-
|
|
14781
|
+
};
|
|
14782
|
+
|
|
14783
|
+
// dist/components/dictation-recording-button.js
|
|
14784
|
+
var __decorate21 = function(decorators, target, key, desc) {
|
|
14785
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
14786
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
14787
|
+
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;
|
|
14788
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
14789
|
+
};
|
|
14790
|
+
var DictationRecordingButton = class DictationRecordingButton2 extends RecordingButtonBase {
|
|
14791
|
+
constructor() {
|
|
14792
|
+
super(...arguments);
|
|
14793
|
+
this._socketController = new DictationController(this);
|
|
14336
14794
|
}
|
|
14337
|
-
|
|
14338
|
-
|
|
14339
|
-
* Combinations with "+" are not supported.
|
|
14340
|
-
* Keydown starts recording, keyup stops recording.
|
|
14341
|
-
* Defaults to "Space" if keybinding is in settingsEnabled, otherwise undefined
|
|
14342
|
-
*/
|
|
14343
|
-
set pushToTalkKeybinding(value) {
|
|
14344
|
-
this._pushToTalkKeybinding = value;
|
|
14795
|
+
_getConnectConfig() {
|
|
14796
|
+
return this._dictationConfig ?? DEFAULT_DICTATION_CONFIG;
|
|
14345
14797
|
}
|
|
14346
|
-
|
|
14347
|
-
|
|
14798
|
+
};
|
|
14799
|
+
__decorate21([
|
|
14800
|
+
c({ context: dictationConfigContext, subscribe: true }),
|
|
14801
|
+
r4()
|
|
14802
|
+
], DictationRecordingButton.prototype, "_dictationConfig", void 0);
|
|
14803
|
+
DictationRecordingButton = __decorate21([
|
|
14804
|
+
t2("dictation-recording-button")
|
|
14805
|
+
], DictationRecordingButton);
|
|
14806
|
+
|
|
14807
|
+
// dist/components/corti-dictation.js
|
|
14808
|
+
var __decorate22 = function(decorators, target, key, desc) {
|
|
14809
|
+
var c6 = arguments.length, r7 = c6 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
14810
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r7 = Reflect.decorate(decorators, target, key, desc);
|
|
14811
|
+
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;
|
|
14812
|
+
return c6 > 3 && r7 && Object.defineProperty(target, key, r7), r7;
|
|
14813
|
+
};
|
|
14814
|
+
var CortiDictation = class CortiDictation2 extends CortiRoot {
|
|
14815
|
+
constructor() {
|
|
14816
|
+
super(...arguments);
|
|
14817
|
+
this.debug_displayAudio = false;
|
|
14818
|
+
this._dictationConfig = DEFAULT_DICTATION_CONFIG;
|
|
14348
14819
|
}
|
|
14349
14820
|
/**
|
|
14350
|
-
*
|
|
14351
|
-
* Combinations with "+" are not supported.
|
|
14352
|
-
* Pressing the key toggles recording on/off.
|
|
14353
|
-
* Defaults to "`" if keybinding is in settingsEnabled, otherwise undefined
|
|
14821
|
+
* Configuration settings for dictation
|
|
14354
14822
|
*/
|
|
14355
|
-
set
|
|
14356
|
-
this.
|
|
14823
|
+
set dictationConfig(value) {
|
|
14824
|
+
this._dictationConfig = value;
|
|
14357
14825
|
}
|
|
14358
|
-
get
|
|
14359
|
-
return
|
|
14826
|
+
get dictationConfig() {
|
|
14827
|
+
return this._contextProviderRef.value?.dictationConfig || this._dictationConfig;
|
|
14360
14828
|
}
|
|
14361
14829
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
14362
14830
|
// Public methods
|
|
@@ -14368,7 +14836,7 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
14368
14836
|
*/
|
|
14369
14837
|
setAccessToken(token) {
|
|
14370
14838
|
this.accessToken = token;
|
|
14371
|
-
return
|
|
14839
|
+
return this._contextProviderRef.value?.setAccessToken(token) ?? {
|
|
14372
14840
|
accessToken: token,
|
|
14373
14841
|
environment: void 0,
|
|
14374
14842
|
tenant: void 0
|
|
@@ -14381,44 +14849,12 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
14381
14849
|
*/
|
|
14382
14850
|
async setAuthConfig(config) {
|
|
14383
14851
|
this.authConfig = config;
|
|
14384
|
-
return
|
|
14852
|
+
return this._contextProviderRef.value?.setAuthConfig(config) ?? {
|
|
14385
14853
|
accessToken: void 0,
|
|
14386
14854
|
environment: void 0,
|
|
14387
14855
|
tenant: void 0
|
|
14388
14856
|
};
|
|
14389
14857
|
}
|
|
14390
|
-
/**
|
|
14391
|
-
* Starts a recording.
|
|
14392
|
-
*/
|
|
14393
|
-
startRecording() {
|
|
14394
|
-
__classPrivateFieldGet11(this, _CortiDictation_recordingButtonRef, "f").value?.startRecording();
|
|
14395
|
-
}
|
|
14396
|
-
/**
|
|
14397
|
-
* Stops a recording.
|
|
14398
|
-
*/
|
|
14399
|
-
stopRecording() {
|
|
14400
|
-
__classPrivateFieldGet11(this, _CortiDictation_recordingButtonRef, "f").value?.stopRecording();
|
|
14401
|
-
}
|
|
14402
|
-
/**
|
|
14403
|
-
* Starts or stops recording. Convenience layer on top of the start/stop methods.
|
|
14404
|
-
*/
|
|
14405
|
-
toggleRecording() {
|
|
14406
|
-
__classPrivateFieldGet11(this, _CortiDictation_recordingButtonRef, "f").value?.toggleRecording();
|
|
14407
|
-
}
|
|
14408
|
-
/**
|
|
14409
|
-
* Opens the WebSocket connection without starting recording.
|
|
14410
|
-
* Use this to pre-establish the connection before recording starts.
|
|
14411
|
-
*/
|
|
14412
|
-
async openConnection() {
|
|
14413
|
-
await __classPrivateFieldGet11(this, _CortiDictation_recordingButtonRef, "f").value?.openConnection();
|
|
14414
|
-
}
|
|
14415
|
-
/**
|
|
14416
|
-
* Closes the WebSocket connection by sending "end" and waiting for "ended".
|
|
14417
|
-
* Call this to receive "usage" statistics or when done with the connection.
|
|
14418
|
-
*/
|
|
14419
|
-
async closeConnection() {
|
|
14420
|
-
await __classPrivateFieldGet11(this, _CortiDictation_recordingButtonRef, "f").value?.closeConnection();
|
|
14421
|
-
}
|
|
14422
14858
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
14423
14859
|
// Render
|
|
14424
14860
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -14426,8 +14862,8 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
14426
14862
|
const isHidden = !this.accessToken && !this.authConfig && !this.socketUrl && !this.socketProxy;
|
|
14427
14863
|
return x`
|
|
14428
14864
|
<dictation-root
|
|
14429
|
-
${
|
|
14430
|
-
class=${
|
|
14865
|
+
${n7(this._contextProviderRef)}
|
|
14866
|
+
class=${e8({ hidden: isHidden })}
|
|
14431
14867
|
.accessToken=${this.accessToken}
|
|
14432
14868
|
.authConfig=${this.authConfig}
|
|
14433
14869
|
.socketUrl=${this.socketUrl}
|
|
@@ -14441,7 +14877,7 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
14441
14877
|
.toggleToTalkKeybinding=${this._toggleToTalkKeybinding}
|
|
14442
14878
|
>
|
|
14443
14879
|
<dictation-recording-button
|
|
14444
|
-
${
|
|
14880
|
+
${n7(this._recordingButtonRef)}
|
|
14445
14881
|
?allowButtonFocus=${this.allowButtonFocus}
|
|
14446
14882
|
></dictation-recording-button>
|
|
14447
14883
|
${this.settingsEnabled?.length > 0 ? x`<dictation-settings-menu
|
|
@@ -14451,81 +14887,26 @@ var CortiDictation = class CortiDictation2 extends i4 {
|
|
|
14451
14887
|
`;
|
|
14452
14888
|
}
|
|
14453
14889
|
};
|
|
14454
|
-
|
|
14455
|
-
_CortiDictation_contextProviderRef = /* @__PURE__ */ new WeakMap();
|
|
14456
|
-
CortiDictation.styles = i`
|
|
14457
|
-
.hidden {
|
|
14458
|
-
display: none;
|
|
14459
|
-
}
|
|
14460
|
-
`;
|
|
14461
|
-
__decorate10([
|
|
14462
|
-
n4({ type: String })
|
|
14463
|
-
], CortiDictation.prototype, "accessToken", void 0);
|
|
14464
|
-
__decorate10([
|
|
14465
|
-
n4({ attribute: false, type: Object })
|
|
14466
|
-
], CortiDictation.prototype, "authConfig", void 0);
|
|
14467
|
-
__decorate10([
|
|
14468
|
-
n4({ type: String })
|
|
14469
|
-
], CortiDictation.prototype, "socketUrl", void 0);
|
|
14470
|
-
__decorate10([
|
|
14471
|
-
n4({ attribute: false, type: Object })
|
|
14472
|
-
], CortiDictation.prototype, "socketProxy", void 0);
|
|
14473
|
-
__decorate10([
|
|
14474
|
-
n4({
|
|
14475
|
-
converter: commaSeparatedConverter,
|
|
14476
|
-
type: Array
|
|
14477
|
-
})
|
|
14478
|
-
], CortiDictation.prototype, "languagesSupported", null);
|
|
14479
|
-
__decorate10([
|
|
14480
|
-
r5()
|
|
14481
|
-
], CortiDictation.prototype, "_languagesSupported", void 0);
|
|
14482
|
-
__decorate10([
|
|
14483
|
-
n4({
|
|
14484
|
-
converter: commaSeparatedConverter,
|
|
14485
|
-
type: Array
|
|
14486
|
-
})
|
|
14487
|
-
], CortiDictation.prototype, "settingsEnabled", void 0);
|
|
14488
|
-
__decorate10([
|
|
14489
|
-
n4({ type: Boolean })
|
|
14490
|
-
], CortiDictation.prototype, "allowButtonFocus", void 0);
|
|
14491
|
-
__decorate10([
|
|
14890
|
+
__decorate22([
|
|
14492
14891
|
n4({ attribute: "debug-display-audio", type: Boolean })
|
|
14493
14892
|
], CortiDictation.prototype, "debug_displayAudio", void 0);
|
|
14494
|
-
|
|
14893
|
+
__decorate22([
|
|
14495
14894
|
n4({ attribute: false, type: Object })
|
|
14496
14895
|
], CortiDictation.prototype, "dictationConfig", null);
|
|
14497
|
-
|
|
14498
|
-
|
|
14896
|
+
__decorate22([
|
|
14897
|
+
r4()
|
|
14499
14898
|
], CortiDictation.prototype, "_dictationConfig", void 0);
|
|
14500
|
-
|
|
14501
|
-
|
|
14502
|
-
], CortiDictation.prototype, "devices", null);
|
|
14503
|
-
__decorate10([
|
|
14504
|
-
r5()
|
|
14505
|
-
], CortiDictation.prototype, "_devices", void 0);
|
|
14506
|
-
__decorate10([
|
|
14507
|
-
n4({ attribute: false, type: Object })
|
|
14508
|
-
], CortiDictation.prototype, "selectedDevice", null);
|
|
14509
|
-
__decorate10([
|
|
14510
|
-
r5()
|
|
14511
|
-
], CortiDictation.prototype, "_selectedDevice", void 0);
|
|
14512
|
-
__decorate10([
|
|
14513
|
-
n4({ type: String })
|
|
14514
|
-
], CortiDictation.prototype, "pushToTalkKeybinding", null);
|
|
14515
|
-
__decorate10([
|
|
14516
|
-
r5()
|
|
14517
|
-
], CortiDictation.prototype, "_pushToTalkKeybinding", void 0);
|
|
14518
|
-
__decorate10([
|
|
14519
|
-
n4({ type: String })
|
|
14520
|
-
], CortiDictation.prototype, "toggleToTalkKeybinding", null);
|
|
14521
|
-
__decorate10([
|
|
14522
|
-
r5()
|
|
14523
|
-
], CortiDictation.prototype, "_toggleToTalkKeybinding", void 0);
|
|
14524
|
-
CortiDictation = __decorate10([
|
|
14525
|
-
t3("corti-dictation")
|
|
14899
|
+
CortiDictation = __decorate22([
|
|
14900
|
+
t2("corti-dictation")
|
|
14526
14901
|
], CortiDictation);
|
|
14527
14902
|
|
|
14528
14903
|
// dist/index.js
|
|
14904
|
+
if (!customElements.get("ambient-recording-button")) {
|
|
14905
|
+
customElements.define("ambient-recording-button", AmbientRecordingButton);
|
|
14906
|
+
}
|
|
14907
|
+
if (!customElements.get("corti-ambient")) {
|
|
14908
|
+
customElements.define("corti-ambient", CortiAmbient);
|
|
14909
|
+
}
|
|
14529
14910
|
if (!customElements.get("corti-dictation")) {
|
|
14530
14911
|
customElements.define("corti-dictation", CortiDictation);
|
|
14531
14912
|
}
|
|
@@ -14549,6 +14930,8 @@ if (!customElements.get("dictation-root")) {
|
|
|
14549
14930
|
}
|
|
14550
14931
|
var index_default = CortiDictation;
|
|
14551
14932
|
export {
|
|
14933
|
+
AmbientRecordingButton,
|
|
14934
|
+
CortiAmbient,
|
|
14552
14935
|
CortiDictation,
|
|
14553
14936
|
DictationDeviceSelector,
|
|
14554
14937
|
DictationKeybindingSelector,
|
|
@@ -14560,17 +14943,24 @@ export {
|
|
|
14560
14943
|
};
|
|
14561
14944
|
/*! Bundled license information:
|
|
14562
14945
|
|
|
14563
|
-
@lit/
|
|
14946
|
+
@lit/context/lib/context-request-event.js:
|
|
14947
|
+
@lit/context/lib/create-context.js:
|
|
14948
|
+
@lit/context/lib/controllers/context-consumer.js:
|
|
14949
|
+
@lit/context/lib/value-notifier.js:
|
|
14950
|
+
@lit/context/lib/controllers/context-provider.js:
|
|
14951
|
+
@lit/context/lib/context-root.js:
|
|
14952
|
+
@lit/reactive-element/decorators/query-assigned-elements.js:
|
|
14953
|
+
lit-html/directives/map.js:
|
|
14954
|
+
lit-html/directives/range.js:
|
|
14564
14955
|
(**
|
|
14565
14956
|
* @license
|
|
14566
|
-
* Copyright
|
|
14957
|
+
* Copyright 2021 Google LLC
|
|
14567
14958
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
14568
14959
|
*)
|
|
14569
14960
|
|
|
14570
|
-
@lit/
|
|
14571
|
-
lit-html/lit-html.js:
|
|
14572
|
-
lit-element/lit-element.js:
|
|
14961
|
+
@lit/context/lib/decorators/provide.js:
|
|
14573
14962
|
@lit/reactive-element/decorators/custom-element.js:
|
|
14963
|
+
@lit/reactive-element/reactive-element.js:
|
|
14574
14964
|
@lit/reactive-element/decorators/property.js:
|
|
14575
14965
|
@lit/reactive-element/decorators/state.js:
|
|
14576
14966
|
@lit/reactive-element/decorators/event-options.js:
|
|
@@ -14579,35 +14969,28 @@ lit-element/lit-element.js:
|
|
|
14579
14969
|
@lit/reactive-element/decorators/query-all.js:
|
|
14580
14970
|
@lit/reactive-element/decorators/query-async.js:
|
|
14581
14971
|
@lit/reactive-element/decorators/query-assigned-nodes.js:
|
|
14972
|
+
lit-html/lit-html.js:
|
|
14973
|
+
lit-element/lit-element.js:
|
|
14582
14974
|
lit-html/directive.js:
|
|
14583
14975
|
lit-html/async-directive.js:
|
|
14584
|
-
@lit/context/lib/decorators/provide.js:
|
|
14585
14976
|
(**
|
|
14586
14977
|
* @license
|
|
14587
14978
|
* Copyright 2017 Google LLC
|
|
14588
14979
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
14589
14980
|
*)
|
|
14590
14981
|
|
|
14591
|
-
lit-html/is-server.js:
|
|
14592
14982
|
@lit/context/lib/decorators/consume.js:
|
|
14983
|
+
lit-html/is-server.js:
|
|
14593
14984
|
(**
|
|
14594
14985
|
* @license
|
|
14595
14986
|
* Copyright 2022 Google LLC
|
|
14596
14987
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
14597
14988
|
*)
|
|
14598
14989
|
|
|
14599
|
-
@lit/reactive-element/
|
|
14600
|
-
@lit/context/lib/context-request-event.js:
|
|
14601
|
-
@lit/context/lib/create-context.js:
|
|
14602
|
-
@lit/context/lib/controllers/context-consumer.js:
|
|
14603
|
-
@lit/context/lib/value-notifier.js:
|
|
14604
|
-
@lit/context/lib/controllers/context-provider.js:
|
|
14605
|
-
@lit/context/lib/context-root.js:
|
|
14606
|
-
lit-html/directives/map.js:
|
|
14607
|
-
lit-html/directives/range.js:
|
|
14990
|
+
@lit/reactive-element/css-tag.js:
|
|
14608
14991
|
(**
|
|
14609
14992
|
* @license
|
|
14610
|
-
* Copyright
|
|
14993
|
+
* Copyright 2019 Google LLC
|
|
14611
14994
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
14612
14995
|
*)
|
|
14613
14996
|
|