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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -1482,8 +1482,9 @@ _LanguagesController_autoLoadedLanguages = /* @__PURE__ */ new WeakMap(), _Langu
1482
1482
  const { languages, defaultLanguage } = getLanguagesByRegion(this.host.region);
1483
1483
  __classPrivateFieldSet2(this, _LanguagesController_autoLoadedLanguages, true, "f");
1484
1484
  this.host._languages = languages;
1485
- const previousLanguage = this.host.dictationConfig?.primaryLanguage;
1485
+ const previousLanguage = this.host.selectedLanguage;
1486
1486
  const selectedLanguage = previousLanguage && languages.includes(previousLanguage) ? previousLanguage : defaultLanguage;
1487
+ this.host._selectedLanguage = selectedLanguage;
1487
1488
  this.host.requestUpdate();
1488
1489
  this.host.dispatchEvent(languagesChangedEvent(languages, selectedLanguage));
1489
1490
  } catch (error) {
@@ -1512,6 +1513,7 @@ var __classPrivateFieldGet5 = function(receiver, state, kind, f5) {
1512
1513
  return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state.get(receiver);
1513
1514
  };
1514
1515
  var languagesContext = n(Symbol("languages"));
1516
+ var selectedLanguageContext = n(Symbol("selectedLanguage"));
1515
1517
  function LanguagesContextMixin(superclass) {
1516
1518
  var _LanguagesContextMixinClass_languagesController;
1517
1519
  class LanguagesContextMixinClass extends superclass {
@@ -1524,6 +1526,12 @@ function LanguagesContextMixin(superclass) {
1524
1526
  get languages() {
1525
1527
  return this._languages;
1526
1528
  }
1529
+ set selectedLanguage(value) {
1530
+ this._selectedLanguage = value;
1531
+ }
1532
+ get selectedLanguage() {
1533
+ return this._selectedLanguage;
1534
+ }
1527
1535
  constructor(...args) {
1528
1536
  super(...args);
1529
1537
  _LanguagesContextMixinClass_languagesController.set(this, new LanguagesController(this));
@@ -1533,6 +1541,11 @@ function LanguagesContextMixin(superclass) {
1533
1541
  __classPrivateFieldGet5(this, _LanguagesContextMixinClass_languagesController, "f").initialize();
1534
1542
  }
1535
1543
  });
1544
+ this.addEventListener("languages-changed", (e10) => {
1545
+ const event = e10;
1546
+ const selectedLanguage = event.detail.selectedLanguage;
1547
+ this.selectedLanguage = selectedLanguage ?? event.detail.languages[0];
1548
+ });
1536
1549
  }
1537
1550
  }
1538
1551
  _LanguagesContextMixinClass_languagesController = /* @__PURE__ */ new WeakMap();
@@ -1540,12 +1553,19 @@ function LanguagesContextMixin(superclass) {
1540
1553
  e2({ context: languagesContext }),
1541
1554
  r4()
1542
1555
  ], LanguagesContextMixinClass.prototype, "_languages", void 0);
1556
+ __decorate4([
1557
+ e2({ context: selectedLanguageContext }),
1558
+ r4()
1559
+ ], LanguagesContextMixinClass.prototype, "_selectedLanguage", void 0);
1543
1560
  __decorate4([
1544
1561
  n4({
1545
1562
  converter: commaSeparatedConverter,
1546
1563
  type: Array
1547
1564
  })
1548
1565
  ], LanguagesContextMixinClass.prototype, "languages", null);
1566
+ __decorate4([
1567
+ n4({ type: String })
1568
+ ], LanguagesContextMixinClass.prototype, "selectedLanguage", null);
1549
1569
  return LanguagesContextMixinClass;
1550
1570
  }
1551
1571
 
@@ -1654,6 +1674,16 @@ var AmbientRoot = class AmbientRoot2 extends RootContext {
1654
1674
  };
1655
1675
  });
1656
1676
  }
1677
+ willUpdate(changedProperties) {
1678
+ super.willUpdate(changedProperties);
1679
+ if (!changedProperties.has("ambientConfig")) {
1680
+ return;
1681
+ }
1682
+ const configuredLanguage = this.ambientConfig?.transcription?.primaryLanguage ?? "en";
1683
+ if (configuredLanguage !== void 0 && configuredLanguage !== this.selectedLanguage) {
1684
+ this.selectedLanguage = configuredLanguage;
1685
+ }
1686
+ }
1657
1687
  };
1658
1688
  __decorate8([
1659
1689
  e2({ context: ambientConfigContext }),
@@ -5443,12 +5473,6 @@ ReconnectingWebSocket.OPEN = 1;
5443
5473
  ReconnectingWebSocket.CLOSING = 2;
5444
5474
  ReconnectingWebSocket.CLOSED = 3;
5445
5475
 
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
5476
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsCreateMcpServerAuthorizationType.mjs
5453
5477
  var AgentsCreateMcpServerAuthorizationType = schemas_exports.enum_(["none", "bearer", "inherit", "oauth2.0"]);
5454
5478
 
@@ -5467,6 +5491,12 @@ var AgentsCreateMcpServer = schemas_exports.object({
5467
5491
  token: schemas_exports.string().optional()
5468
5492
  });
5469
5493
 
5494
+ // node_modules/@corti/sdk/dist/esm/serialization/resources/agents/types/AgentsCreateAgentAgentType.mjs
5495
+ var AgentsCreateAgentAgentType = schemas_exports.enum_(["expert", "orchestrator", "interviewing-expert"]);
5496
+
5497
+ // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsCreateExpertType.mjs
5498
+ var AgentsCreateExpertType = schemas_exports.enum_(["new"]);
5499
+
5470
5500
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsCreateExpert.mjs
5471
5501
  var AgentsCreateExpert = schemas_exports.object({
5472
5502
  type: AgentsCreateExpertType,
@@ -5496,7 +5526,8 @@ var AgentsCreateAgent = schemas_exports.object({
5496
5526
  agentType: AgentsCreateAgentAgentType.optional(),
5497
5527
  systemPrompt: schemas_exports.string().optional(),
5498
5528
  description: schemas_exports.string(),
5499
- experts: schemas_exports.list(AgentsCreateAgentExpertsItem).optional()
5529
+ experts: schemas_exports.list(AgentsCreateAgentExpertsItem).optional(),
5530
+ mcpServers: schemas_exports.list(AgentsCreateMcpServer).optional()
5500
5531
  });
5501
5532
 
5502
5533
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsMessageKind.mjs
@@ -5597,15 +5628,19 @@ var AgentsMessageSendParams = schemas_exports.object({
5597
5628
  metadata: schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional()
5598
5629
  });
5599
5630
 
5631
+ // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsUpdateExpertReference.mjs
5632
+ var AgentsUpdateExpertReference = AgentsCreateExpertReference;
5633
+
5600
5634
  // node_modules/@corti/sdk/dist/esm/serialization/resources/agents/types/AgentsUpdateAgentExpertsItem.mjs
5601
- var AgentsUpdateAgentExpertsItem = schemas_exports.undiscriminatedUnion([AgentsCreateExpert, AgentsCreateExpertReference]);
5635
+ var AgentsUpdateAgentExpertsItem = schemas_exports.undiscriminatedUnion([AgentsCreateExpert, AgentsUpdateExpertReference]);
5602
5636
 
5603
5637
  // node_modules/@corti/sdk/dist/esm/serialization/resources/agents/client/requests/AgentsUpdateAgent.mjs
5604
5638
  var AgentsUpdateAgent = schemas_exports.object({
5605
5639
  name: schemas_exports.string().optional(),
5606
5640
  systemPrompt: schemas_exports.string().optional(),
5607
5641
  description: schemas_exports.string().optional(),
5608
- experts: schemas_exports.list(AgentsUpdateAgentExpertsItem).optional()
5642
+ experts: schemas_exports.list(AgentsUpdateAgentExpertsItem).optional(),
5643
+ mcpServers: schemas_exports.list(AgentsCreateMcpServer).optional()
5609
5644
  });
5610
5645
 
5611
5646
  // node_modules/@corti/sdk/dist/esm/serialization/resources/agents/index.mjs
@@ -5634,7 +5669,7 @@ var AgentsExpertType = schemas_exports.enum_(["expert"]);
5634
5669
  var AgentsMcpServerAuthorizationType = schemas_exports.enum_(["none", "bearer", "inherit", "oauth2.0"]);
5635
5670
 
5636
5671
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsMcpServerTransportType.mjs
5637
- var AgentsMcpServerTransportType = schemas_exports.enum_(["stdio", "streamable_http"]);
5672
+ var AgentsMcpServerTransportType = schemas_exports.enum_(["stdio", "streamable_http", "sse"]);
5638
5673
 
5639
5674
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsMcpServer.mjs
5640
5675
  var AgentsMcpServer = schemas_exports.object({
@@ -5677,7 +5712,8 @@ var AgentsAgent = schemas_exports.object({
5677
5712
  name: schemas_exports.string(),
5678
5713
  description: schemas_exports.string(),
5679
5714
  systemPrompt: schemas_exports.string(),
5680
- experts: schemas_exports.list(AgentsAgentExpertsItem).optional()
5715
+ experts: schemas_exports.list(AgentsAgentExpertsItem).optional(),
5716
+ mcpServers: schemas_exports.list(AgentsMcpServer).optional()
5681
5717
  });
5682
5718
 
5683
5719
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsAgentReferenceType.mjs
@@ -5838,7 +5874,14 @@ var CommonCodingSystemEnum = schemas_exports.enum_([
5838
5874
  "icd10int-inpatient",
5839
5875
  "icd10int-outpatient",
5840
5876
  "icd10uk-inpatient",
5841
- "icd10uk-outpatient"
5877
+ "icd10uk-outpatient",
5878
+ "cim10fr-inpatient",
5879
+ "cim10fr-outpatient",
5880
+ "icd10gm-inpatient",
5881
+ "icd10gm-outpatient",
5882
+ "opcs4",
5883
+ "ops",
5884
+ "ccam"
5842
5885
  ]);
5843
5886
 
5844
5887
  // node_modules/@corti/sdk/dist/esm/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.mjs
@@ -5966,6 +6009,46 @@ var InteractionsUpdateRequest = schemas_exports.object({
5966
6009
  // node_modules/@corti/sdk/dist/esm/serialization/resources/interactions/types/InteractionsListRequestSort.mjs
5967
6010
  var InteractionsListRequestSort = schemas_exports.enum_(["id", "assignedUserId", "patient", "createdAt", "endedAt", "updatedAt"]);
5968
6011
 
6012
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigModeType.mjs
6013
+ var StreamConfigModeType = schemas_exports.enum_(["facts", "transcription"]);
6014
+
6015
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamSupportedLanguage.mjs
6016
+ var StreamSupportedLanguage = schemas_exports.string();
6017
+
6018
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigMode.mjs
6019
+ var StreamConfigMode = schemas_exports.object({
6020
+ type: StreamConfigModeType,
6021
+ outputLocale: StreamSupportedLanguage.optional()
6022
+ });
6023
+
6024
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigRetentionPolicy.mjs
6025
+ var StreamConfigRetentionPolicy = schemas_exports.enum_(["retain", "none"]);
6026
+
6027
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigParticipantRole.mjs
6028
+ var StreamConfigParticipantRole = schemas_exports.enum_(["doctor", "patient", "multiple"]);
6029
+
6030
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigParticipant.mjs
6031
+ var StreamConfigParticipant = schemas_exports.object({
6032
+ channel: schemas_exports.number(),
6033
+ role: StreamConfigParticipantRole
6034
+ });
6035
+
6036
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigTranscription.mjs
6037
+ var StreamConfigTranscription = schemas_exports.object({
6038
+ primaryLanguage: StreamSupportedLanguage,
6039
+ isDiarization: schemas_exports.boolean().optional(),
6040
+ isMultichannel: schemas_exports.boolean().optional(),
6041
+ participants: schemas_exports.list(StreamConfigParticipant)
6042
+ });
6043
+
6044
+ // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfig.mjs
6045
+ var StreamConfig = schemas_exports.object({
6046
+ transcription: StreamConfigTranscription,
6047
+ mode: StreamConfigMode,
6048
+ retentionPolicy: StreamConfigRetentionPolicy.optional(),
6049
+ audioFormat: schemas_exports.string().optional()
6050
+ });
6051
+
5969
6052
  // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigStatusMessageType.mjs
5970
6053
  var StreamConfigStatusMessageType2 = schemas_exports.enum_([
5971
6054
  "CONFIG_ACCEPTED",
@@ -5978,7 +6061,8 @@ var StreamConfigStatusMessageType2 = schemas_exports.enum_([
5978
6061
  // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigStatusMessage.mjs
5979
6062
  var StreamConfigStatusMessage = schemas_exports.object({
5980
6063
  type: StreamConfigStatusMessageType2,
5981
- reason: schemas_exports.string().optional()
6064
+ reason: schemas_exports.string().optional(),
6065
+ configuration: StreamConfig.optional()
5982
6066
  });
5983
6067
 
5984
6068
  // node_modules/@corti/sdk/dist/esm/serialization/types/StreamDeltaUsageMessage.mjs
@@ -6092,6 +6176,62 @@ var TranscribeCommandMessage = schemas_exports.object({
6092
6176
  data: TranscribeCommandData
6093
6177
  });
6094
6178
 
6179
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeCommandVariable.mjs
6180
+ var TranscribeCommandVariable = schemas_exports.object({
6181
+ key: schemas_exports.string(),
6182
+ type: schemas_exports.stringLiteral("enum"),
6183
+ enum: schemas_exports.list(schemas_exports.string())
6184
+ });
6185
+
6186
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeCommand.mjs
6187
+ var TranscribeCommand = schemas_exports.object({
6188
+ id: schemas_exports.string(),
6189
+ phrases: schemas_exports.list(schemas_exports.string()),
6190
+ variables: schemas_exports.list(TranscribeCommandVariable).optional()
6191
+ });
6192
+
6193
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingDates.mjs
6194
+ var TranscribeFormattingDates = schemas_exports.enum_(["locale:long", "locale:medium", "locale:short", "as_dictated", "iso"]);
6195
+
6196
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingMeasurements.mjs
6197
+ var TranscribeFormattingMeasurements = schemas_exports.enum_(["abbreviated", "as_dictated"]);
6198
+
6199
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingNumbers.mjs
6200
+ var TranscribeFormattingNumbers = schemas_exports.enum_(["numerals_above_nine", "numerals", "as_dictated"]);
6201
+
6202
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingNumericRanges.mjs
6203
+ var TranscribeFormattingNumericRanges = schemas_exports.enum_(["numerals", "as_dictated"]);
6204
+
6205
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingOrdinals.mjs
6206
+ var TranscribeFormattingOrdinals = schemas_exports.enum_(["numerals_above_nine", "as_dictated", "numerals"]);
6207
+
6208
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormattingTimes.mjs
6209
+ var TranscribeFormattingTimes = schemas_exports.enum_(["locale", "h24", "h12", "as_dictated"]);
6210
+
6211
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeFormatting.mjs
6212
+ var TranscribeFormatting = schemas_exports.object({
6213
+ dates: TranscribeFormattingDates.optional(),
6214
+ times: TranscribeFormattingTimes.optional(),
6215
+ numbers: TranscribeFormattingNumbers.optional(),
6216
+ measurements: TranscribeFormattingMeasurements.optional(),
6217
+ numericRanges: TranscribeFormattingNumericRanges.optional(),
6218
+ ordinals: TranscribeFormattingOrdinals.optional()
6219
+ });
6220
+
6221
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeSupportedLanguage.mjs
6222
+ var TranscribeSupportedLanguage = schemas_exports.string();
6223
+
6224
+ // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeConfig.mjs
6225
+ var TranscribeConfig = schemas_exports.object({
6226
+ primaryLanguage: TranscribeSupportedLanguage,
6227
+ interimResults: schemas_exports.boolean().optional(),
6228
+ spokenPunctuation: schemas_exports.boolean().optional(),
6229
+ automaticPunctuation: schemas_exports.boolean().optional(),
6230
+ commands: schemas_exports.list(TranscribeCommand).optional(),
6231
+ formatting: TranscribeFormatting.optional(),
6232
+ audioFormat: schemas_exports.string().optional()
6233
+ });
6234
+
6095
6235
  // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeConfigStatusMessageType.mjs
6096
6236
  var TranscribeConfigStatusMessageType2 = schemas_exports.enum_([
6097
6237
  "CONFIG_ACCEPTED",
@@ -6105,7 +6245,8 @@ var TranscribeConfigStatusMessageType2 = schemas_exports.enum_([
6105
6245
  var TranscribeConfigStatusMessage = schemas_exports.object({
6106
6246
  type: TranscribeConfigStatusMessageType2,
6107
6247
  reason: schemas_exports.string().optional(),
6108
- sessionId: schemas_exports.string()
6248
+ sessionId: schemas_exports.string().optional(),
6249
+ configuration: TranscribeConfig.optional()
6109
6250
  });
6110
6251
 
6111
6252
  // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeDeltaUsageMessage.mjs
@@ -6290,6 +6431,8 @@ var AgentsRegistryMcpServer = schemas_exports.object({
6290
6431
  // node_modules/@corti/sdk/dist/esm/serialization/types/AgentsRegistryExpert.mjs
6291
6432
  var AgentsRegistryExpert = schemas_exports.object({
6292
6433
  name: schemas_exports.string(),
6434
+ displayName: schemas_exports.string().optional(),
6435
+ displayDescription: schemas_exports.string().optional(),
6293
6436
  description: schemas_exports.string(),
6294
6437
  mcpServers: schemas_exports.list(AgentsRegistryMcpServer).optional()
6295
6438
  });
@@ -6677,45 +6820,6 @@ var RecordingsListResponse = schemas_exports.object({
6677
6820
  recordings: schemas_exports.list(Uuid)
6678
6821
  });
6679
6822
 
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
6823
  // node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigMessage.mjs
6720
6824
  var StreamConfigMessage = schemas_exports.object({
6721
6825
  type: schemas_exports.stringLiteral("config"),
@@ -6801,61 +6905,6 @@ var TemplatesSectionListResponse = schemas_exports.object({
6801
6905
  data: schemas_exports.list(TemplatesSection)
6802
6906
  });
6803
6907
 
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
6908
  // node_modules/@corti/sdk/dist/esm/serialization/types/TranscribeConfigMessage.mjs
6860
6909
  var TranscribeConfigMessage = schemas_exports.object({
6861
6910
  type: schemas_exports.stringLiteral("config"),
@@ -7548,8 +7597,8 @@ function normalizeClientOptions(options) {
7548
7597
  const headers = mergeHeaders({
7549
7598
  "X-Fern-Language": "JavaScript",
7550
7599
  "X-Fern-SDK-Name": "@corti/sdk",
7551
- "X-Fern-SDK-Version": "1.0.0",
7552
- "User-Agent": "@corti/sdk/1.0.0",
7600
+ "X-Fern-SDK-Version": "2.0.0",
7601
+ "User-Agent": "@corti/sdk/2.0.0",
7553
7602
  "X-Fern-Runtime": RUNTIME.type,
7554
7603
  "X-Fern-Runtime-Version": RUNTIME.version,
7555
7604
  "Tenant-Name": options === null || options === void 0 ? void 0 : options.tenantName
@@ -8924,7 +8973,7 @@ var CodesClient = class {
8924
8973
  this._options = normalizeClientOptionsWithAuth(options);
8925
8974
  }
8926
8975
  /**
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>
8976
+ * 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
8977
  *
8929
8978
  * @param {Corti.CodesGeneralPredictRequest} request
8930
8979
  * @param {CodesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -12845,12 +12894,23 @@ var DictationRoot = class DictationRoot2 extends RootContext {
12845
12894
  super();
12846
12895
  this.addEventListener("languages-changed", (e10) => {
12847
12896
  const event = e10;
12897
+ const selectedLanguage = event.detail.selectedLanguage;
12848
12898
  this.dictationConfig = {
12849
12899
  ...this.dictationConfig,
12850
- primaryLanguage: event.detail.selectedLanguage ?? "en"
12900
+ primaryLanguage: selectedLanguage ?? "en"
12851
12901
  };
12852
12902
  });
12853
12903
  }
12904
+ willUpdate(changedProperties) {
12905
+ super.willUpdate(changedProperties);
12906
+ if (!changedProperties.has("dictationConfig")) {
12907
+ return;
12908
+ }
12909
+ const configuredLanguage = this.dictationConfig?.primaryLanguage;
12910
+ if (configuredLanguage !== void 0 && configuredLanguage !== this.selectedLanguage) {
12911
+ this.selectedLanguage = configuredLanguage;
12912
+ }
12913
+ }
12854
12914
  };
12855
12915
  __decorate9([
12856
12916
  e2({ context: dictationConfigContext }),
@@ -14291,7 +14351,7 @@ var DictationDeviceSelector = class DictationDeviceSelector2 extends i5 {
14291
14351
  return x`
14292
14352
  <div>
14293
14353
  <label id="device-select-label" for="device-select">
14294
- Recording Device
14354
+ Microphone
14295
14355
  </label>
14296
14356
  <select
14297
14357
  id="device-select"
@@ -14570,7 +14630,7 @@ var DictationLanguageSelector = class DictationLanguageSelector2 extends i5 {
14570
14630
  return x`
14571
14631
  <div>
14572
14632
  <label id="language-select-label" for="language-select">
14573
- Dictation Language
14633
+ Spoken language
14574
14634
  </label>
14575
14635
  <select
14576
14636
  id="language-select"
@@ -14581,7 +14641,7 @@ var DictationLanguageSelector = class DictationLanguageSelector2 extends i5 {
14581
14641
  ${this._languages?.map((language) => x`
14582
14642
  <option
14583
14643
  value=${language}
14584
- ?selected=${this._dictationConfig?.primaryLanguage === language}
14644
+ ?selected=${this._selectedLanguage === language}
14585
14645
  >
14586
14646
  ${getLanguageName(language)}
14587
14647
  </option>
@@ -14603,9 +14663,9 @@ __decorate18([
14603
14663
  r4()
14604
14664
  ], DictationLanguageSelector.prototype, "_languages", void 0);
14605
14665
  __decorate18([
14606
- c({ context: dictationConfigContext, subscribe: true }),
14666
+ c({ context: selectedLanguageContext, subscribe: true }),
14607
14667
  r4()
14608
- ], DictationLanguageSelector.prototype, "_dictationConfig", void 0);
14668
+ ], DictationLanguageSelector.prototype, "_selectedLanguage", void 0);
14609
14669
  __decorate18([
14610
14670
  n4({ type: Boolean })
14611
14671
  ], 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 {
@@ -32,6 +32,18 @@ let AmbientRoot = class AmbientRoot extends RootContext {
32
32
  };
33
33
  });
34
34
  }
35
+ willUpdate(changedProperties) {
36
+ super.willUpdate(changedProperties);
37
+ if (!changedProperties.has("ambientConfig")) {
38
+ return;
39
+ }
40
+ const configuredLanguage = this.ambientConfig?.transcription?.primaryLanguage ?? "en";
41
+ if (configuredLanguage !== undefined &&
42
+ configuredLanguage !== this.selectedLanguage) {
43
+ this.selectedLanguage =
44
+ configuredLanguage;
45
+ }
46
+ }
35
47
  };
36
48
  __decorate([
37
49
  provide({ context: ambientConfigContext }),