@corti/dictation-web 0.7.0-ambient → 0.7.0-ambient.2

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 CHANGED
@@ -1417,9 +1417,18 @@ function getLanguageName(languageCode) {
1417
1417
  return languageCode;
1418
1418
  }
1419
1419
  }
1420
+ function getPreferredDefaultLanguage(languages = []) {
1421
+ if (languages.includes("en")) {
1422
+ return "en";
1423
+ }
1424
+ if (languages.includes("en-GB")) {
1425
+ return "en-GB";
1426
+ }
1427
+ return languages[0];
1428
+ }
1420
1429
  function getLanguagesByRegion(region) {
1421
- const languages = DEFAULT_LANGUAGES_BY_REGION[region || "default"] || DEFAULT_LANGUAGES_BY_REGION["default"];
1422
- const defaultLanguage = languages?.[0];
1430
+ const languages = DEFAULT_LANGUAGES_BY_REGION[region || "default"] ?? DEFAULT_LANGUAGES_BY_REGION.default;
1431
+ const defaultLanguage = getPreferredDefaultLanguage(languages);
1423
1432
  return { defaultLanguage, languages };
1424
1433
  }
1425
1434
 
@@ -1482,8 +1491,9 @@ _LanguagesController_autoLoadedLanguages = /* @__PURE__ */ new WeakMap(), _Langu
1482
1491
  const { languages, defaultLanguage } = getLanguagesByRegion(this.host.region);
1483
1492
  __classPrivateFieldSet2(this, _LanguagesController_autoLoadedLanguages, true, "f");
1484
1493
  this.host._languages = languages;
1485
- const previousLanguage = this.host.dictationConfig?.primaryLanguage;
1494
+ const previousLanguage = this.host.selectedLanguage;
1486
1495
  const selectedLanguage = previousLanguage && languages.includes(previousLanguage) ? previousLanguage : defaultLanguage;
1496
+ this.host._selectedLanguage = selectedLanguage;
1487
1497
  this.host.requestUpdate();
1488
1498
  this.host.dispatchEvent(languagesChangedEvent(languages, selectedLanguage));
1489
1499
  } catch (error) {
@@ -1512,6 +1522,7 @@ var __classPrivateFieldGet5 = function(receiver, state, kind, f5) {
1512
1522
  return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
1513
1523
  };
1514
1524
  var languagesContext = n(Symbol("languages"));
1525
+ var selectedLanguageContext = n(Symbol("selectedLanguage"));
1515
1526
  function LanguagesContextMixin(superclass) {
1516
1527
  var _LanguagesContextMixinClass_languagesController;
1517
1528
  class LanguagesContextMixinClass extends superclass {
@@ -1520,10 +1531,23 @@ function LanguagesContextMixin(superclass) {
1520
1531
  if (value !== void 0) {
1521
1532
  __classPrivateFieldGet5(this, _LanguagesContextMixinClass_languagesController, "f").clearAutoLoadedFlag();
1522
1533
  }
1534
+ if (value === void 0 || value.length === 0) {
1535
+ this.selectedLanguage = void 0;
1536
+ return;
1537
+ }
1538
+ if (this.selectedLanguage === void 0 || !value.includes(this.selectedLanguage)) {
1539
+ this.selectedLanguage = getPreferredDefaultLanguage(value);
1540
+ }
1523
1541
  }
1524
1542
  get languages() {
1525
1543
  return this._languages;
1526
1544
  }
1545
+ set selectedLanguage(value) {
1546
+ this._selectedLanguage = value;
1547
+ }
1548
+ get selectedLanguage() {
1549
+ return this._selectedLanguage;
1550
+ }
1527
1551
  constructor(...args) {
1528
1552
  super(...args);
1529
1553
  _LanguagesContextMixinClass_languagesController.set(this, new LanguagesController(this));
@@ -1533,6 +1557,11 @@ function LanguagesContextMixin(superclass) {
1533
1557
  __classPrivateFieldGet5(this, _LanguagesContextMixinClass_languagesController, "f").initialize();
1534
1558
  }
1535
1559
  });
1560
+ this.addEventListener("languages-changed", (e10) => {
1561
+ const event = e10;
1562
+ const selectedLanguage = event.detail.selectedLanguage;
1563
+ this.selectedLanguage = selectedLanguage ?? getPreferredDefaultLanguage(event.detail.languages);
1564
+ });
1536
1565
  }
1537
1566
  }
1538
1567
  _LanguagesContextMixinClass_languagesController = /* @__PURE__ */ new WeakMap();
@@ -1540,12 +1569,19 @@ function LanguagesContextMixin(superclass) {
1540
1569
  e2({ context: languagesContext }),
1541
1570
  r4()
1542
1571
  ], LanguagesContextMixinClass.prototype, "_languages", void 0);
1572
+ __decorate4([
1573
+ e2({ context: selectedLanguageContext }),
1574
+ r4()
1575
+ ], LanguagesContextMixinClass.prototype, "_selectedLanguage", void 0);
1543
1576
  __decorate4([
1544
1577
  n4({
1545
1578
  converter: commaSeparatedConverter,
1546
1579
  type: Array
1547
1580
  })
1548
1581
  ], LanguagesContextMixinClass.prototype, "languages", null);
1582
+ __decorate4([
1583
+ n4({ type: String })
1584
+ ], LanguagesContextMixinClass.prototype, "selectedLanguage", null);
1549
1585
  return LanguagesContextMixinClass;
1550
1586
  }
1551
1587
 
@@ -1654,6 +1690,16 @@ var AmbientRoot = class AmbientRoot2 extends RootContext {
1654
1690
  };
1655
1691
  });
1656
1692
  }
1693
+ willUpdate(changedProperties) {
1694
+ super.willUpdate(changedProperties);
1695
+ if (!changedProperties.has("ambientConfig")) {
1696
+ return;
1697
+ }
1698
+ const configuredLanguage = this.ambientConfig?.transcription?.primaryLanguage ?? "en";
1699
+ if (configuredLanguage !== void 0 && configuredLanguage !== this.selectedLanguage) {
1700
+ this.selectedLanguage = configuredLanguage;
1701
+ }
1702
+ }
1657
1703
  };
1658
1704
  __decorate8([
1659
1705
  e2({ context: ambientConfigContext }),
@@ -5443,12 +5489,6 @@ ReconnectingWebSocket.OPEN = 1;
5443
5489
  ReconnectingWebSocket.CLOSING = 2;
5444
5490
  ReconnectingWebSocket.CLOSED = 3;
5445
5491
 
5446
- // node_modules/@corti/sdk/dist/esm/serialization/resources/agents/types/AgentsCreateAgentAgentType.mjs
5447
- var AgentsCreateAgentAgentType = schemas_exports.enum_(["expert", "orchestrator", "interviewing-expert"]);
5448
-
5449
- // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsCreateExpertType.mjs
5450
- var AgentsCreateExpertType = schemas_exports.enum_(["new"]);
5451
-
5452
5492
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsCreateMcpServerAuthorizationType.mjs
5453
5493
  var AgentsCreateMcpServerAuthorizationType = schemas_exports.enum_(["none", "bearer", "inherit", "oauth2.0"]);
5454
5494
 
@@ -5467,6 +5507,12 @@ var AgentsCreateMcpServer = schemas_exports.object({
5467
5507
  token: schemas_exports.string().optional()
5468
5508
  });
5469
5509
 
5510
+ // node_modules/@corti/sdk/dist/esm/serialization/resources/agents/types/AgentsCreateAgentAgentType.mjs
5511
+ var AgentsCreateAgentAgentType = schemas_exports.enum_(["expert", "orchestrator", "interviewing-expert"]);
5512
+
5513
+ // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsCreateExpertType.mjs
5514
+ var AgentsCreateExpertType = schemas_exports.enum_(["new"]);
5515
+
5470
5516
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsCreateExpert.mjs
5471
5517
  var AgentsCreateExpert = schemas_exports.object({
5472
5518
  type: AgentsCreateExpertType,
@@ -5496,7 +5542,8 @@ var AgentsCreateAgent = schemas_exports.object({
5496
5542
  agentType: AgentsCreateAgentAgentType.optional(),
5497
5543
  systemPrompt: schemas_exports.string().optional(),
5498
5544
  description: schemas_exports.string(),
5499
- experts: schemas_exports.list(AgentsCreateAgentExpertsItem).optional()
5545
+ experts: schemas_exports.list(AgentsCreateAgentExpertsItem).optional(),
5546
+ mcpServers: schemas_exports.list(AgentsCreateMcpServer).optional()
5500
5547
  });
5501
5548
 
5502
5549
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsMessageKind.mjs
@@ -5597,15 +5644,19 @@ var AgentsMessageSendParams = schemas_exports.object({
5597
5644
  metadata: schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional()
5598
5645
  });
5599
5646
 
5647
+ // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsUpdateExpertReference.mjs
5648
+ var AgentsUpdateExpertReference = AgentsCreateExpertReference;
5649
+
5600
5650
  // node_modules/@corti/sdk/dist/esm/serialization/resources/agents/types/AgentsUpdateAgentExpertsItem.mjs
5601
- var AgentsUpdateAgentExpertsItem = schemas_exports.undiscriminatedUnion([AgentsCreateExpert, AgentsCreateExpertReference]);
5651
+ var AgentsUpdateAgentExpertsItem = schemas_exports.undiscriminatedUnion([AgentsCreateExpert, AgentsUpdateExpertReference]);
5602
5652
 
5603
5653
  // node_modules/@corti/sdk/dist/esm/serialization/resources/agents/client/requests/AgentsUpdateAgent.mjs
5604
5654
  var AgentsUpdateAgent = schemas_exports.object({
5605
5655
  name: schemas_exports.string().optional(),
5606
5656
  systemPrompt: schemas_exports.string().optional(),
5607
5657
  description: schemas_exports.string().optional(),
5608
- experts: schemas_exports.list(AgentsUpdateAgentExpertsItem).optional()
5658
+ experts: schemas_exports.list(AgentsUpdateAgentExpertsItem).optional(),
5659
+ mcpServers: schemas_exports.list(AgentsCreateMcpServer).optional()
5609
5660
  });
5610
5661
 
5611
5662
  // node_modules/@corti/sdk/dist/esm/serialization/resources/agents/index.mjs
@@ -5634,7 +5685,7 @@ var AgentsExpertType = schemas_exports.enum_(["expert"]);
5634
5685
  var AgentsMcpServerAuthorizationType = schemas_exports.enum_(["none", "bearer", "inherit", "oauth2.0"]);
5635
5686
 
5636
5687
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsMcpServerTransportType.mjs
5637
- var AgentsMcpServerTransportType = schemas_exports.enum_(["stdio", "streamable_http"]);
5688
+ var AgentsMcpServerTransportType = schemas_exports.enum_(["stdio", "streamable_http", "sse"]);
5638
5689
 
5639
5690
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsMcpServer.mjs
5640
5691
  var AgentsMcpServer = schemas_exports.object({
@@ -5677,7 +5728,8 @@ var AgentsAgent = schemas_exports.object({
5677
5728
  name: schemas_exports.string(),
5678
5729
  description: schemas_exports.string(),
5679
5730
  systemPrompt: schemas_exports.string(),
5680
- experts: schemas_exports.list(AgentsAgentExpertsItem).optional()
5731
+ experts: schemas_exports.list(AgentsAgentExpertsItem).optional(),
5732
+ mcpServers: schemas_exports.list(AgentsMcpServer).optional()
5681
5733
  });
5682
5734
 
5683
5735
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsAgentReferenceType.mjs
@@ -5838,7 +5890,14 @@ var CommonCodingSystemEnum = schemas_exports.enum_([
5838
5890
  "icd10int-inpatient",
5839
5891
  "icd10int-outpatient",
5840
5892
  "icd10uk-inpatient",
5841
- "icd10uk-outpatient"
5893
+ "icd10uk-outpatient",
5894
+ "cim10fr-inpatient",
5895
+ "cim10fr-outpatient",
5896
+ "icd10gm-inpatient",
5897
+ "icd10gm-outpatient",
5898
+ "opcs4",
5899
+ "ops",
5900
+ "ccam"
5842
5901
  ]);
5843
5902
 
5844
5903
  // node_modules/@corti/sdk/dist/esm/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.mjs
@@ -5966,6 +6025,46 @@ var InteractionsUpdateRequest = schemas_exports.object({
5966
6025
  // node_modules/@corti/sdk/dist/esm/serialization/resources/interactions/types/InteractionsListRequestSort.mjs
5967
6026
  var InteractionsListRequestSort = schemas_exports.enum_(["id", "assignedUserId", "patient", "createdAt", "endedAt", "updatedAt"]);
5968
6027
 
6028
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigModeType.mjs
6029
+ var StreamConfigModeType = schemas_exports.enum_(["facts", "transcription"]);
6030
+
6031
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamSupportedLanguage.mjs
6032
+ var StreamSupportedLanguage = schemas_exports.string();
6033
+
6034
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigMode.mjs
6035
+ var StreamConfigMode = schemas_exports.object({
6036
+ type: StreamConfigModeType,
6037
+ outputLocale: StreamSupportedLanguage.optional()
6038
+ });
6039
+
6040
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigRetentionPolicy.mjs
6041
+ var StreamConfigRetentionPolicy = schemas_exports.enum_(["retain", "none"]);
6042
+
6043
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigParticipantRole.mjs
6044
+ var StreamConfigParticipantRole = schemas_exports.enum_(["doctor", "patient", "multiple"]);
6045
+
6046
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigParticipant.mjs
6047
+ var StreamConfigParticipant = schemas_exports.object({
6048
+ channel: schemas_exports.number(),
6049
+ role: StreamConfigParticipantRole
6050
+ });
6051
+
6052
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigTranscription.mjs
6053
+ var StreamConfigTranscription = schemas_exports.object({
6054
+ primaryLanguage: StreamSupportedLanguage,
6055
+ isDiarization: schemas_exports.boolean().optional(),
6056
+ isMultichannel: schemas_exports.boolean().optional(),
6057
+ participants: schemas_exports.list(StreamConfigParticipant)
6058
+ });
6059
+
6060
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfig.mjs
6061
+ var StreamConfig = schemas_exports.object({
6062
+ transcription: StreamConfigTranscription,
6063
+ mode: StreamConfigMode,
6064
+ retentionPolicy: StreamConfigRetentionPolicy.optional(),
6065
+ audioFormat: schemas_exports.string().optional()
6066
+ });
6067
+
5969
6068
  // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigStatusMessageType.mjs
5970
6069
  var StreamConfigStatusMessageType2 = schemas_exports.enum_([
5971
6070
  "CONFIG_ACCEPTED",
@@ -5978,7 +6077,8 @@ var StreamConfigStatusMessageType2 = schemas_exports.enum_([
5978
6077
  // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigStatusMessage.mjs
5979
6078
  var StreamConfigStatusMessage = schemas_exports.object({
5980
6079
  type: StreamConfigStatusMessageType2,
5981
- reason: schemas_exports.string().optional()
6080
+ reason: schemas_exports.string().optional(),
6081
+ configuration: StreamConfig.optional()
5982
6082
  });
5983
6083
 
5984
6084
  // node_modules/@corti/sdk/dist/esm/serialization/types/StreamDeltaUsageMessage.mjs
@@ -6092,6 +6192,62 @@ var TranscribeCommandMessage = schemas_exports.object({
6092
6192
  data: TranscribeCommandData
6093
6193
  });
6094
6194
 
6195
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeCommandVariable.mjs
6196
+ var TranscribeCommandVariable = schemas_exports.object({
6197
+ key: schemas_exports.string(),
6198
+ type: schemas_exports.stringLiteral("enum"),
6199
+ enum: schemas_exports.list(schemas_exports.string())
6200
+ });
6201
+
6202
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeCommand.mjs
6203
+ var TranscribeCommand = schemas_exports.object({
6204
+ id: schemas_exports.string(),
6205
+ phrases: schemas_exports.list(schemas_exports.string()),
6206
+ variables: schemas_exports.list(TranscribeCommandVariable).optional()
6207
+ });
6208
+
6209
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingDates.mjs
6210
+ var TranscribeFormattingDates = schemas_exports.enum_(["locale:long", "locale:medium", "locale:short", "as_dictated", "iso"]);
6211
+
6212
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingMeasurements.mjs
6213
+ var TranscribeFormattingMeasurements = schemas_exports.enum_(["abbreviated", "as_dictated"]);
6214
+
6215
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingNumbers.mjs
6216
+ var TranscribeFormattingNumbers = schemas_exports.enum_(["numerals_above_nine", "numerals", "as_dictated"]);
6217
+
6218
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingNumericRanges.mjs
6219
+ var TranscribeFormattingNumericRanges = schemas_exports.enum_(["numerals", "as_dictated"]);
6220
+
6221
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingOrdinals.mjs
6222
+ var TranscribeFormattingOrdinals = schemas_exports.enum_(["numerals_above_nine", "as_dictated", "numerals"]);
6223
+
6224
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingTimes.mjs
6225
+ var TranscribeFormattingTimes = schemas_exports.enum_(["locale", "h24", "h12", "as_dictated"]);
6226
+
6227
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormatting.mjs
6228
+ var TranscribeFormatting = schemas_exports.object({
6229
+ dates: TranscribeFormattingDates.optional(),
6230
+ times: TranscribeFormattingTimes.optional(),
6231
+ numbers: TranscribeFormattingNumbers.optional(),
6232
+ measurements: TranscribeFormattingMeasurements.optional(),
6233
+ numericRanges: TranscribeFormattingNumericRanges.optional(),
6234
+ ordinals: TranscribeFormattingOrdinals.optional()
6235
+ });
6236
+
6237
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeSupportedLanguage.mjs
6238
+ var TranscribeSupportedLanguage = schemas_exports.string();
6239
+
6240
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeConfig.mjs
6241
+ var TranscribeConfig = schemas_exports.object({
6242
+ primaryLanguage: TranscribeSupportedLanguage,
6243
+ interimResults: schemas_exports.boolean().optional(),
6244
+ spokenPunctuation: schemas_exports.boolean().optional(),
6245
+ automaticPunctuation: schemas_exports.boolean().optional(),
6246
+ commands: schemas_exports.list(TranscribeCommand).optional(),
6247
+ formatting: TranscribeFormatting.optional(),
6248
+ audioFormat: schemas_exports.string().optional()
6249
+ });
6250
+
6095
6251
  // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeConfigStatusMessageType.mjs
6096
6252
  var TranscribeConfigStatusMessageType2 = schemas_exports.enum_([
6097
6253
  "CONFIG_ACCEPTED",
@@ -6105,7 +6261,8 @@ var TranscribeConfigStatusMessageType2 = schemas_exports.enum_([
6105
6261
  var TranscribeConfigStatusMessage = schemas_exports.object({
6106
6262
  type: TranscribeConfigStatusMessageType2,
6107
6263
  reason: schemas_exports.string().optional(),
6108
- sessionId: schemas_exports.string()
6264
+ sessionId: schemas_exports.string().optional(),
6265
+ configuration: TranscribeConfig.optional()
6109
6266
  });
6110
6267
 
6111
6268
  // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeDeltaUsageMessage.mjs
@@ -6290,6 +6447,8 @@ var AgentsRegistryMcpServer = schemas_exports.object({
6290
6447
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsRegistryExpert.mjs
6291
6448
  var AgentsRegistryExpert = schemas_exports.object({
6292
6449
  name: schemas_exports.string(),
6450
+ displayName: schemas_exports.string().optional(),
6451
+ displayDescription: schemas_exports.string().optional(),
6293
6452
  description: schemas_exports.string(),
6294
6453
  mcpServers: schemas_exports.list(AgentsRegistryMcpServer).optional()
6295
6454
  });
@@ -6677,45 +6836,6 @@ var RecordingsListResponse = schemas_exports.object({
6677
6836
  recordings: schemas_exports.list(Uuid)
6678
6837
  });
6679
6838
 
6680
- // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigModeType.mjs
6681
- var StreamConfigModeType = schemas_exports.enum_(["facts", "transcription"]);
6682
-
6683
- // node_modules/@corti/sdk/dist/esm/serialization/types/StreamSupportedLanguage.mjs
6684
- var StreamSupportedLanguage = schemas_exports.string();
6685
-
6686
- // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigMode.mjs
6687
- var StreamConfigMode = schemas_exports.object({
6688
- type: StreamConfigModeType,
6689
- outputLocale: StreamSupportedLanguage.optional()
6690
- });
6691
-
6692
- // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigParticipantRole.mjs
6693
- var StreamConfigParticipantRole = schemas_exports.enum_(["doctor", "patient", "multiple"]);
6694
-
6695
- // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigParticipant.mjs
6696
- var StreamConfigParticipant = schemas_exports.object({
6697
- channel: schemas_exports.number(),
6698
- role: StreamConfigParticipantRole
6699
- });
6700
-
6701
- // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigTranscription.mjs
6702
- var StreamConfigTranscription = schemas_exports.object({
6703
- primaryLanguage: StreamSupportedLanguage,
6704
- isDiarization: schemas_exports.boolean().optional(),
6705
- isMultichannel: schemas_exports.boolean().optional(),
6706
- participants: schemas_exports.list(StreamConfigParticipant)
6707
- });
6708
-
6709
- // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigXCortiRetentionPolicy.mjs
6710
- var StreamConfigXCortiRetentionPolicy = schemas_exports.enum_(["retain", "none"]);
6711
-
6712
- // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfig.mjs
6713
- var StreamConfig = schemas_exports.object({
6714
- transcription: StreamConfigTranscription,
6715
- mode: StreamConfigMode,
6716
- xCortiRetentionPolicy: schemas_exports.property("X-Corti-Retention-Policy", StreamConfigXCortiRetentionPolicy.optional())
6717
- });
6718
-
6719
6839
  // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigMessage.mjs
6720
6840
  var StreamConfigMessage = schemas_exports.object({
6721
6841
  type: schemas_exports.stringLiteral("config"),
@@ -6801,61 +6921,6 @@ var TemplatesSectionListResponse = schemas_exports.object({
6801
6921
  data: schemas_exports.list(TemplatesSection)
6802
6922
  });
6803
6923
 
6804
- // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeCommandVariable.mjs
6805
- var TranscribeCommandVariable = schemas_exports.object({
6806
- key: schemas_exports.string(),
6807
- type: schemas_exports.stringLiteral("enum"),
6808
- enum: schemas_exports.list(schemas_exports.string())
6809
- });
6810
-
6811
- // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeCommand.mjs
6812
- var TranscribeCommand = schemas_exports.object({
6813
- id: schemas_exports.string(),
6814
- phrases: schemas_exports.list(schemas_exports.string()),
6815
- variables: schemas_exports.list(TranscribeCommandVariable).optional()
6816
- });
6817
-
6818
- // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingDates.mjs
6819
- var TranscribeFormattingDates = schemas_exports.enum_(["locale:long", "locale:medium", "locale:short", "as_dictated", "iso"]);
6820
-
6821
- // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingMeasurements.mjs
6822
- var TranscribeFormattingMeasurements = schemas_exports.enum_(["abbreviated", "as_dictated"]);
6823
-
6824
- // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingNumbers.mjs
6825
- var TranscribeFormattingNumbers = schemas_exports.enum_(["numerals_above_nine", "numerals", "as_dictated"]);
6826
-
6827
- // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingNumericRanges.mjs
6828
- var TranscribeFormattingNumericRanges = schemas_exports.enum_(["numerals", "as_dictated"]);
6829
-
6830
- // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingOrdinals.mjs
6831
- var TranscribeFormattingOrdinals = schemas_exports.enum_(["numerals_above_nine", "as_dictated", "numerals"]);
6832
-
6833
- // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingTimes.mjs
6834
- var TranscribeFormattingTimes = schemas_exports.enum_(["locale", "h24", "h12", "as_dictated"]);
6835
-
6836
- // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormatting.mjs
6837
- var TranscribeFormatting = schemas_exports.object({
6838
- dates: TranscribeFormattingDates.optional(),
6839
- times: TranscribeFormattingTimes.optional(),
6840
- numbers: TranscribeFormattingNumbers.optional(),
6841
- measurements: TranscribeFormattingMeasurements.optional(),
6842
- numericRanges: TranscribeFormattingNumericRanges.optional(),
6843
- ordinals: TranscribeFormattingOrdinals.optional()
6844
- });
6845
-
6846
- // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeSupportedLanguage.mjs
6847
- var TranscribeSupportedLanguage = schemas_exports.string();
6848
-
6849
- // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeConfig.mjs
6850
- var TranscribeConfig = schemas_exports.object({
6851
- primaryLanguage: TranscribeSupportedLanguage,
6852
- interimResults: schemas_exports.boolean().optional(),
6853
- spokenPunctuation: schemas_exports.boolean().optional(),
6854
- automaticPunctuation: schemas_exports.boolean().optional(),
6855
- commands: schemas_exports.list(TranscribeCommand).optional(),
6856
- formatting: TranscribeFormatting.optional()
6857
- });
6858
-
6859
6924
  // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeConfigMessage.mjs
6860
6925
  var TranscribeConfigMessage = schemas_exports.object({
6861
6926
  type: schemas_exports.stringLiteral("config"),
@@ -7548,8 +7613,8 @@ function normalizeClientOptions(options) {
7548
7613
  const headers = mergeHeaders({
7549
7614
  "X-Fern-Language": "JavaScript",
7550
7615
  "X-Fern-SDK-Name": "@corti/sdk",
7551
- "X-Fern-SDK-Version": "1.0.0",
7552
- "User-Agent": "@corti/sdk/1.0.0",
7616
+ "X-Fern-SDK-Version": "2.0.0",
7617
+ "User-Agent": "@corti/sdk/2.0.0",
7553
7618
  "X-Fern-Runtime": RUNTIME.type,
7554
7619
  "X-Fern-Runtime-Version": RUNTIME.version,
7555
7620
  "Tenant-Name": options === null || options === void 0 ? void 0 : options.tenantName
@@ -8924,7 +8989,7 @@ var CodesClient = class {
8924
8989
  this._options = normalizeClientOptionsWithAuth(options);
8925
8990
  }
8926
8991
  /**
8927
- * Predict medical codes from provided context.<br/><Note>This is a stateless endpoint, designed to predict ICD-10-CM, ICD-10-PCS, ICD-10-UK and CPT codes based on input text string or documentId.<br/><br/>More than one code system may be defined in a single request.<br/><br/>Code prediction requests have two possible values for context:<br/>- `text`: One set of code prediction results will be returned based on all input text defined.<br/>- `documentId`: Code prediction will be based on that defined document only.<br/><br/>The response includes two sets of results:<br/>- `Codes`: Codes predicted by the model.<br/>- `Candidates`: Lower-confidence codes the model considered potentially relevant but excluded from the predicted set.<br/><br/>All predicted code results are based on input context defined in the request only (not other external data or assets associated with an interaction).</Note>
8992
+ * Predict medical codes from provided context.<br/><Note>This is a stateless endpoint, designed to predict ICD-10-CM, ICD-10-PCS, ICD-10 (international), ICD-10-UK, CIM-10-FR, ICD-10-GM, OPCS-4, OPS, CCAM and CPT codes based on input text string or documentId.<br/><br/>More than one code system may be defined in a single request.<br/><br/>Code prediction requests have two possible values for context:<br/>- `text`: One set of code prediction results will be returned based on all input text defined.<br/>- `documentId`: Code prediction will be based on that defined document only.<br/><br/>The response includes two sets of results:<br/>- `Codes`: Codes predicted by the model.<br/>- `Candidates`: Lower-confidence codes the model considered potentially relevant but excluded from the predicted set.<br/><br/>All predicted code results are based on input context defined in the request only (not other external data or assets associated with an interaction).</Note>
8928
8993
  *
8929
8994
  * @param {Corti.CodesGeneralPredictRequest} request
8930
8995
  * @param {CodesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -12845,12 +12910,23 @@ var DictationRoot = class DictationRoot2 extends RootContext {
12845
12910
  super();
12846
12911
  this.addEventListener("languages-changed", (e10) => {
12847
12912
  const event = e10;
12913
+ const selectedLanguage = event.detail.selectedLanguage;
12848
12914
  this.dictationConfig = {
12849
12915
  ...this.dictationConfig,
12850
- primaryLanguage: event.detail.selectedLanguage ?? "en"
12916
+ primaryLanguage: selectedLanguage ?? "en"
12851
12917
  };
12852
12918
  });
12853
12919
  }
12920
+ willUpdate(changedProperties) {
12921
+ super.willUpdate(changedProperties);
12922
+ if (!changedProperties.has("dictationConfig")) {
12923
+ return;
12924
+ }
12925
+ const configuredLanguage = this.dictationConfig?.primaryLanguage;
12926
+ if (configuredLanguage !== void 0 && configuredLanguage !== this.selectedLanguage) {
12927
+ this.selectedLanguage = configuredLanguage;
12928
+ }
12929
+ }
12854
12930
  };
12855
12931
  __decorate9([
12856
12932
  e2({ context: dictationConfigContext }),
@@ -14291,7 +14367,7 @@ var DictationDeviceSelector = class DictationDeviceSelector2 extends i5 {
14291
14367
  return x`
14292
14368
  <div>
14293
14369
  <label id="device-select-label" for="device-select">
14294
- Recording Device
14370
+ Microphone
14295
14371
  </label>
14296
14372
  <select
14297
14373
  id="device-select"
@@ -14570,7 +14646,7 @@ var DictationLanguageSelector = class DictationLanguageSelector2 extends i5 {
14570
14646
  return x`
14571
14647
  <div>
14572
14648
  <label id="language-select-label" for="language-select">
14573
- Dictation Language
14649
+ Spoken language
14574
14650
  </label>
14575
14651
  <select
14576
14652
  id="language-select"
@@ -14581,7 +14657,7 @@ var DictationLanguageSelector = class DictationLanguageSelector2 extends i5 {
14581
14657
  ${this._languages?.map((language) => x`
14582
14658
  <option
14583
14659
  value=${language}
14584
- ?selected=${this._dictationConfig?.primaryLanguage === language}
14660
+ ?selected=${this._selectedLanguage === language}
14585
14661
  >
14586
14662
  ${getLanguageName(language)}
14587
14663
  </option>
@@ -14603,9 +14679,9 @@ __decorate18([
14603
14679
  r4()
14604
14680
  ], DictationLanguageSelector.prototype, "_languages", void 0);
14605
14681
  __decorate18([
14606
- c({ context: dictationConfigContext, subscribe: true }),
14682
+ c({ context: selectedLanguageContext, subscribe: true }),
14607
14683
  r4()
14608
- ], DictationLanguageSelector.prototype, "_dictationConfig", void 0);
14684
+ ], DictationLanguageSelector.prototype, "_selectedLanguage", void 0);
14609
14685
  __decorate18([
14610
14686
  n4({ type: Boolean })
14611
14687
  ], DictationLanguageSelector.prototype, "disabled", void 0);
@@ -26,7 +26,7 @@ let DictationDeviceSelector = class DictationDeviceSelector extends LitElement {
26
26
  return html `
27
27
  <div>
28
28
  <label id="device-select-label" for="device-select">
29
- Recording Device
29
+ Microphone
30
30
  </label>
31
31
  <select
32
32
  id="device-select"
@@ -1 +1 @@
1
- {"version":3,"file":"device-selector.js","sourceRoot":"","sources":["../../src/components/device-selector.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EACL,cAAc,EACd,qBAAqB,GACtB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAG3D,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,UAAU;IAAhD;;;QAUL,aAAQ,GAAY,KAAK,CAAC;IA2C5B,CAAC;IA1BC,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;oBAQK,uBAAA,IAAI,uFAAoB;sBACtB,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;;YAEvE,IAAI,CAAC,QAAQ,EAAE,GAAG,CAClB,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAA;;wBAEJ,MAAM,CAAC,QAAQ;4BACX,IAAI,CAAC,eAAe,EAAE,QAAQ,KAAK,MAAM,CAAC,QAAQ;;kBAE5D,MAAM,CAAC,KAAK,IAAI,gBAAgB;;aAErC,CACF;;;KAGN,CAAC;IACJ,CAAC;;;mGAtCmB,CAAQ;IAC1B,MAAM,QAAQ,GAAI,CAAC,CAAC,MAA4B,CAAC,KAAK,CAAC;IACvD,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;IAEnE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,IAAI,CAAC,aAAa,CAChB,4BAA4B,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE,MAAM,CAAC,CAC1D,CAAC;AACJ,CAAC;AAbM,8BAAM,GAAG,YAAY,AAAf,CAAgB;AAT7B;IAFC,OAAO,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IACrD,KAAK,EAAE;yDACqB;AAI7B;IAFC,OAAO,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC5D,KAAK,EAAE;gEAC0B;AAGlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yDACF;AAVf,uBAAuB;IADnC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,uBAAuB,CAqDnC","sourcesContent":["import { consume } from \"@lit/context\";\nimport { html, LitElement } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport {\n devicesContext,\n selectedDeviceContext,\n} from \"../contexts/mixins/devices-context.js\";\nimport SelectStyles from \"../styles/select.js\";\nimport { recordingDevicesChangedEvent } from \"../utils/events.js\";\n\n@customElement(\"dictation-device-selector\")\nexport class DictationDeviceSelector extends LitElement {\n @consume({ context: devicesContext, subscribe: true })\n @state()\n _devices?: MediaDeviceInfo[];\n\n @consume({ context: selectedDeviceContext, subscribe: true })\n @state()\n _selectedDevice?: MediaDeviceInfo;\n\n @property({ type: Boolean })\n disabled: boolean = false;\n\n static styles = SelectStyles;\n\n #handleSelectDevice(e: Event): void {\n const deviceId = (e.target as HTMLSelectElement).value;\n const device = this._devices?.find((d) => d.deviceId === deviceId);\n\n if (!device) {\n return;\n }\n\n this.dispatchEvent(\n recordingDevicesChangedEvent(this._devices || [], device),\n );\n }\n\n render() {\n return html`\n <div>\n <label id=\"device-select-label\" for=\"device-select\">\n Recording Device\n </label>\n <select\n id=\"device-select\"\n aria-labelledby=\"device-select-label\"\n @change=${this.#handleSelectDevice}\n ?disabled=${this.disabled || !this._devices || this._devices.length === 0}\n >\n ${this._devices?.map(\n (device) => html`\n <option\n value=${device.deviceId}\n ?selected=${this._selectedDevice?.deviceId === device.deviceId}\n >\n ${device.label || \"Unknown Device\"}\n </option>\n `,\n )}\n </select>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"dictation-device-selector\": DictationDeviceSelector;\n }\n}\n"]}
1
+ {"version":3,"file":"device-selector.js","sourceRoot":"","sources":["../../src/components/device-selector.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EACL,cAAc,EACd,qBAAqB,GACtB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAG3D,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,UAAU;IAAhD;;;QAUL,aAAQ,GAAY,KAAK,CAAC;IA2C5B,CAAC;IA1BC,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;oBAQK,uBAAA,IAAI,uFAAoB;sBACtB,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;;YAEvE,IAAI,CAAC,QAAQ,EAAE,GAAG,CAClB,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAA;;wBAEJ,MAAM,CAAC,QAAQ;4BACX,IAAI,CAAC,eAAe,EAAE,QAAQ,KAAK,MAAM,CAAC,QAAQ;;kBAE5D,MAAM,CAAC,KAAK,IAAI,gBAAgB;;aAErC,CACF;;;KAGN,CAAC;IACJ,CAAC;;;mGAtCmB,CAAQ;IAC1B,MAAM,QAAQ,GAAI,CAAC,CAAC,MAA4B,CAAC,KAAK,CAAC;IACvD,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;IAEnE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,IAAI,CAAC,aAAa,CAChB,4BAA4B,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE,MAAM,CAAC,CAC1D,CAAC;AACJ,CAAC;AAbM,8BAAM,GAAG,YAAY,AAAf,CAAgB;AAT7B;IAFC,OAAO,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IACrD,KAAK,EAAE;yDACqB;AAI7B;IAFC,OAAO,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC5D,KAAK,EAAE;gEAC0B;AAGlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yDACF;AAVf,uBAAuB;IADnC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,uBAAuB,CAqDnC","sourcesContent":["import { consume } from \"@lit/context\";\nimport { html, LitElement } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport {\n devicesContext,\n selectedDeviceContext,\n} from \"../contexts/mixins/devices-context.js\";\nimport SelectStyles from \"../styles/select.js\";\nimport { recordingDevicesChangedEvent } from \"../utils/events.js\";\n\n@customElement(\"dictation-device-selector\")\nexport class DictationDeviceSelector extends LitElement {\n @consume({ context: devicesContext, subscribe: true })\n @state()\n _devices?: MediaDeviceInfo[];\n\n @consume({ context: selectedDeviceContext, subscribe: true })\n @state()\n _selectedDevice?: MediaDeviceInfo;\n\n @property({ type: Boolean })\n disabled: boolean = false;\n\n static styles = SelectStyles;\n\n #handleSelectDevice(e: Event): void {\n const deviceId = (e.target as HTMLSelectElement).value;\n const device = this._devices?.find((d) => d.deviceId === deviceId);\n\n if (!device) {\n return;\n }\n\n this.dispatchEvent(\n recordingDevicesChangedEvent(this._devices || [], device),\n );\n }\n\n render() {\n return html`\n <div>\n <label id=\"device-select-label\" for=\"device-select\">\n Microphone\n </label>\n <select\n id=\"device-select\"\n aria-labelledby=\"device-select-label\"\n @change=${this.#handleSelectDevice}\n ?disabled=${this.disabled || !this._devices || this._devices.length === 0}\n >\n ${this._devices?.map(\n (device) => html`\n <option\n value=${device.deviceId}\n ?selected=${this._selectedDevice?.deviceId === device.deviceId}\n >\n ${device.label || \"Unknown Device\"}\n </option>\n `,\n )}\n </select>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"dictation-device-selector\": DictationDeviceSelector;\n }\n}\n"]}
@@ -3,7 +3,7 @@ import { LitElement } from "lit";
3
3
  export declare class DictationLanguageSelector extends LitElement {
4
4
  #private;
5
5
  _languages?: Corti.TranscribeSupportedLanguage[];
6
- _dictationConfig?: Corti.TranscribeConfig;
6
+ _selectedLanguage?: Corti.TranscribeSupportedLanguage;
7
7
  disabled: boolean;
8
8
  static styles: import("lit").CSSResult[];
9
9
  render(): import("lit-html").TemplateResult<1>;
@@ -13,8 +13,7 @@ var _DictationLanguageSelector_instances, _DictationLanguageSelector_handleSelec
13
13
  import { consume } from "@lit/context";
14
14
  import { html, LitElement } from "lit";
15
15
  import { customElement, property, state } from "lit/decorators.js";
16
- import { dictationConfigContext } from "../contexts/dictation-context.js";
17
- import { languagesContext } from "../contexts/mixins/languages-context.js";
16
+ import { languagesContext, selectedLanguageContext, } from "../contexts/mixins/languages-context.js";
18
17
  import SelectStyles from "../styles/select.js";
19
18
  import { languageChangedEvent, languagesChangedEvent, } from "../utils/events.js";
20
19
  import { getLanguageName } from "../utils/languages.js";
@@ -28,7 +27,7 @@ let DictationLanguageSelector = class DictationLanguageSelector extends LitEleme
28
27
  return html `
29
28
  <div>
30
29
  <label id="language-select-label" for="language-select">
31
- Dictation Language
30
+ Spoken language
32
31
  </label>
33
32
  <select
34
33
  id="language-select"
@@ -39,7 +38,7 @@ let DictationLanguageSelector = class DictationLanguageSelector extends LitEleme
39
38
  ${this._languages?.map((language) => html `
40
39
  <option
41
40
  value=${language}
42
- ?selected=${this._dictationConfig?.primaryLanguage === language}
41
+ ?selected=${this._selectedLanguage === language}
43
42
  >
44
43
  ${getLanguageName(language)}
45
44
  </option>
@@ -62,9 +61,9 @@ __decorate([
62
61
  state()
63
62
  ], DictationLanguageSelector.prototype, "_languages", void 0);
64
63
  __decorate([
65
- consume({ context: dictationConfigContext, subscribe: true }),
64
+ consume({ context: selectedLanguageContext, subscribe: true }),
66
65
  state()
67
- ], DictationLanguageSelector.prototype, "_dictationConfig", void 0);
66
+ ], DictationLanguageSelector.prototype, "_selectedLanguage", void 0);
68
67
  __decorate([
69
68
  property({ type: Boolean })
70
69
  ], DictationLanguageSelector.prototype, "disabled", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"language-selector.js","sourceRoot":"","sources":["../../src/components/language-selector.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGjD,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,UAAU;IAAlD;;;QAUL,aAAQ,GAAY,KAAK,CAAC;IAuC5B,CAAC;IA1BC,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;oBAQK,uBAAA,IAAI,6FAAsB;sBACxB,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;;YAE3E,IAAI,CAAC,UAAU,EAAE,GAAG,CACpB,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAA;;wBAEN,QAAQ;4BACJ,IAAI,CAAC,gBAAgB,EAAE,eAAe,KAAK,QAAQ;;kBAE7D,eAAe,CAAC,QAAQ,CAAC;;aAE9B,CACF;;;KAGN,CAAC;IACJ,CAAC;;;2GAlCqB,CAAQ;IAC5B,MAAM,QAAQ,GAAI,CAAC,CAAC,MAA4B,CAAC,KAAK,CAAC;IAEvD,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE3E,qCAAqC;IACrC,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACrD,CAAC;AATM,gCAAM,GAAG,YAAY,AAAf,CAAgB;AAT7B;IAFC,OAAO,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IACvD,KAAK,EAAE;6DACyC;AAIjD;IAFC,OAAO,CAAC,EAAE,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC7D,KAAK,EAAE;mEACkC;AAG1C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2DACF;AAVf,yBAAyB;IADrC,aAAa,CAAC,6BAA6B,CAAC;GAChC,yBAAyB,CAiDrC","sourcesContent":["import type { Corti } from \"@corti/sdk\";\nimport { consume } from \"@lit/context\";\nimport { html, LitElement } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { dictationConfigContext } from \"../contexts/dictation-context.js\";\nimport { languagesContext } from \"../contexts/mixins/languages-context.js\";\nimport SelectStyles from \"../styles/select.js\";\nimport {\n languageChangedEvent,\n languagesChangedEvent,\n} from \"../utils/events.js\";\nimport { getLanguageName } from \"../utils/languages.js\";\n\n@customElement(\"dictation-language-selector\")\nexport class DictationLanguageSelector extends LitElement {\n @consume({ context: languagesContext, subscribe: true })\n @state()\n _languages?: Corti.TranscribeSupportedLanguage[];\n\n @consume({ context: dictationConfigContext, subscribe: true })\n @state()\n _dictationConfig?: Corti.TranscribeConfig;\n\n @property({ type: Boolean })\n disabled: boolean = false;\n\n static styles = SelectStyles;\n\n #handleSelectLanguage(e: Event): void {\n const language = (e.target as HTMLSelectElement).value;\n\n this.dispatchEvent(languagesChangedEvent(this._languages || [], language));\n\n // Dispatch backward compatible event\n this.dispatchEvent(languageChangedEvent(language));\n }\n\n render() {\n return html`\n <div>\n <label id=\"language-select-label\" for=\"language-select\">\n Dictation Language\n </label>\n <select\n id=\"language-select\"\n aria-labelledby=\"language-select-label\"\n @change=${this.#handleSelectLanguage}\n ?disabled=${this.disabled || !this._languages || this._languages.length === 0}\n >\n ${this._languages?.map(\n (language) => html`\n <option\n value=${language}\n ?selected=${this._dictationConfig?.primaryLanguage === language}\n >\n ${getLanguageName(language)}\n </option>\n `,\n )}\n </select>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"dictation-language-selector\": DictationLanguageSelector;\n }\n}\n"]}
1
+ {"version":3,"file":"language-selector.js","sourceRoot":"","sources":["../../src/components/language-selector.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,yCAAyC,CAAC;AACjD,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGjD,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,UAAU;IAAlD;;;QAUL,aAAQ,GAAY,KAAK,CAAC;IAuC5B,CAAC;IA1BC,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;oBAQK,uBAAA,IAAI,6FAAsB;sBACxB,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;;YAE3E,IAAI,CAAC,UAAU,EAAE,GAAG,CACpB,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAA;;wBAEN,QAAQ;4BACJ,IAAI,CAAC,iBAAiB,KAAK,QAAQ;;kBAE7C,eAAe,CAAC,QAAQ,CAAC;;aAE9B,CACF;;;KAGN,CAAC;IACJ,CAAC;;;2GAlCqB,CAAQ;IAC5B,MAAM,QAAQ,GAAI,CAAC,CAAC,MAA4B,CAAC,KAAK,CAAC;IAEvD,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE3E,qCAAqC;IACrC,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACrD,CAAC;AATM,gCAAM,GAAG,YAAY,AAAf,CAAgB;AAT7B;IAFC,OAAO,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IACvD,KAAK,EAAE;6DACyC;AAIjD;IAFC,OAAO,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC9D,KAAK,EAAE;oEAC8C;AAGtD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2DACF;AAVf,yBAAyB;IADrC,aAAa,CAAC,6BAA6B,CAAC;GAChC,yBAAyB,CAiDrC","sourcesContent":["import type { Corti } from \"@corti/sdk\";\nimport { consume } from \"@lit/context\";\nimport { html, LitElement } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport {\n languagesContext,\n selectedLanguageContext,\n} from \"../contexts/mixins/languages-context.js\";\nimport SelectStyles from \"../styles/select.js\";\nimport {\n languageChangedEvent,\n languagesChangedEvent,\n} from \"../utils/events.js\";\nimport { getLanguageName } from \"../utils/languages.js\";\n\n@customElement(\"dictation-language-selector\")\nexport class DictationLanguageSelector extends LitElement {\n @consume({ context: languagesContext, subscribe: true })\n @state()\n _languages?: Corti.TranscribeSupportedLanguage[];\n\n @consume({ context: selectedLanguageContext, subscribe: true })\n @state()\n _selectedLanguage?: Corti.TranscribeSupportedLanguage;\n\n @property({ type: Boolean })\n disabled: boolean = false;\n\n static styles = SelectStyles;\n\n #handleSelectLanguage(e: Event): void {\n const language = (e.target as HTMLSelectElement).value;\n\n this.dispatchEvent(languagesChangedEvent(this._languages || [], language));\n\n // Dispatch backward compatible event\n this.dispatchEvent(languageChangedEvent(language));\n }\n\n render() {\n return html`\n <div>\n <label id=\"language-select-label\" for=\"language-select\">\n Spoken language\n </label>\n <select\n id=\"language-select\"\n aria-labelledby=\"language-select-label\"\n @change=${this.#handleSelectLanguage}\n ?disabled=${this.disabled || !this._languages || this._languages.length === 0}\n >\n ${this._languages?.map(\n (language) => html`\n <option\n value=${language}\n ?selected=${this._selectedLanguage === language}\n >\n ${getLanguageName(language)}\n </option>\n `,\n )}\n </select>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"dictation-language-selector\": DictationLanguageSelector;\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import type { Corti } from "@corti/sdk";
2
+ import type { PropertyValues } from "lit";
2
3
  import { RootContext } from "./root-context.js";
3
4
  export declare const ambientConfigContext: {
4
5
  __context__: Corti.StreamConfig | undefined;
@@ -10,6 +11,7 @@ export declare class AmbientRoot extends RootContext {
10
11
  ambientConfig: Corti.StreamConfig;
11
12
  interactionId?: string;
12
13
  constructor();
14
+ protected willUpdate(changedProperties: PropertyValues): void;
13
15
  }
14
16
  declare global {
15
17
  interface HTMLElementTagNameMap {