@burdenoff/fe-libs 2026.1115.13 → 2026.1116.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.
Files changed (57) hide show
  1. package/dist/shared/assistant/history/useHistoryRowControls.d.ts +16 -0
  2. package/dist/shared/assistant/history/useHistoryRowControls.js +38 -14
  3. package/dist/shared/assistant/i18nManifest.d.ts +9 -0
  4. package/dist/shared/assistant/i18nManifest.js +9 -0
  5. package/dist/shared/assistant/index.d.ts +2 -0
  6. package/dist/shared/assistant/ui/AIAssistantPanel.d.ts +16 -0
  7. package/dist/shared/assistant/ui/AIAssistantPanel.js +247 -223
  8. package/dist/shared/assistant/ui/AssistantChatArea.js +1355 -1347
  9. package/dist/shared/assistant/ui/AssistantOverlay.d.ts +6 -0
  10. package/dist/shared/assistant/ui/AssistantOverlay.js +4 -2
  11. package/dist/shared/assistant/ui/AssistantPageHost.d.ts +14 -1
  12. package/dist/shared/assistant/ui/AssistantPageHost.js +32 -19
  13. package/dist/shared/assistant/ui/AssistantRenameConversationDialog.d.ts +33 -0
  14. package/dist/shared/assistant/ui/AssistantRenameConversationDialog.js +70 -0
  15. package/dist/shared/assistant/ui/assistantPageBar.d.ts +33 -0
  16. package/dist/shared/assistant/ui/assistantPageBar.js +53 -0
  17. package/dist/shared/assistant/ui/assistantPageLayout.d.ts +20 -0
  18. package/dist/shared/assistant/ui/assistantPageLayout.js +10 -2
  19. package/dist/shared/assistant/ui/assistantPageStart.d.ts +17 -0
  20. package/dist/shared/assistant/ui/assistantPageStart.js +7 -4
  21. package/dist/shared/assistant/ui/compact/AssistantConversationMenu.d.ts +30 -0
  22. package/dist/shared/assistant/ui/compact/AssistantConversationMenu.js +174 -53
  23. package/dist/shared/assistant/ui/compact/AssistantPageBar.d.ts +19 -0
  24. package/dist/shared/assistant/ui/compact/AssistantPageBar.js +24 -19
  25. package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +2 -0
  26. package/dist/shared/assistant/ui/composer/AssistantComposer.js +347 -340
  27. package/dist/shared/assistant/ui/composer/AssistantDictation.d.ts +5 -0
  28. package/dist/shared/assistant/ui/composer/AssistantDictation.js +41 -40
  29. package/dist/shared/assistant/ui/composer/pageBoxClass.d.ts +28 -1
  30. package/dist/shared/assistant/ui/composer/pageBoxClass.js +17 -1
  31. package/dist/shared/assistant/ui/conversationDeleteDialog.d.ts +14 -4
  32. package/dist/shared/assistant/ui/conversationDeleteDialog.js +7 -6
  33. package/dist/shared/assistant/ui/voice/AssistantVoiceSessionButton.js +1 -1
  34. package/dist/shared/assistant/ui/voice/LiveWaveform.js +1 -1
  35. package/dist/shared/events/index.d.ts +7 -2
  36. package/dist/shared/events/sinks/OtelBrowserSink.d.ts +5 -0
  37. package/dist/shared/events/sinks/WebVitalsSink.d.ts +25 -0
  38. package/dist/shared/events/sinks/WebVitalsSink.js +51 -0
  39. package/dist/shared/events/sinks/index.d.ts +3 -0
  40. package/dist/shared/events/sinks/index.js +2 -1
  41. package/dist/shared/index.d.ts +1 -0
  42. package/dist/shared/providers/AppShellProvider.d.ts +16 -0
  43. package/dist/shared/providers/AppShellProvider.js +291 -292
  44. package/dist/shared/providers/shell/ObservabilityProvider.d.ts +6 -6
  45. package/dist/shared/rum/context.d.ts +24 -0
  46. package/dist/shared/rum/context.js +40 -0
  47. package/dist/shared/rum/index.d.ts +14 -0
  48. package/dist/shared/rum/mount.d.ts +12 -0
  49. package/dist/shared/rum/mount.js +5 -0
  50. package/dist/shared/rum/reporter.d.ts +22 -0
  51. package/dist/shared/rum/reporter.js +166 -0
  52. package/dist/shared/rum/types.d.ts +56 -0
  53. package/dist/shared-assistant.js +256 -254
  54. package/dist/shared-events.js +29 -28
  55. package/dist/shared.js +78 -74
  56. package/dist/ui/glass-card.d.ts +1 -1
  57. package/package.json +1 -1
@@ -21,318 +21,319 @@ import { isAssistantModeId as y } from "../modeIds.js";
21
21
  import { AUTO_READ_MODE as b, autoSuggestions as le, classifyAssistantIntent as ue, escalationToUndo as de, isAutoRoutingOffered as fe, resolveAutoRoute as pe } from "../autoRouting.js";
22
22
  import { AssistantEmptyState as me } from "./AssistantEmptyState.js";
23
23
  import { AssistantSpokenTurnsNotice as he } from "./AssistantSpokenTurnsNotice.js";
24
- import { AssistantHistoryArchivedNotice as x, AssistantHistoryDeletedNotice as ge, AssistantHistoryLoadState as _e, AssistantHistoryReadOnlyBanner as ve, AssistantHistoryShowEarlier as S } from "./AssistantHistoryNotices.js";
25
- import { AssistantNothingToDeleteNotice as ye } from "./AssistantDeleteConversationDialog.js";
26
- import { useConversationDeleteDialog as be } from "./conversationDeleteDialog.js";
27
- import { assistantHistoryIsOn as xe } from "./conversationDelete.js";
28
- import { VoiceTranscriptDrawer as Se } from "./voice/VoiceTranscriptDrawer.js";
29
- import { AssistantComposer as Ce } from "./composer/AssistantComposer.js";
30
- import { assistantModeOptionName as we } from "./composer/AssistantModeMenu.js";
31
- import { draftIsUnsent as Te } from "./compact/compactChrome.js";
32
- import { AssistantWaitingChangeRow as Ee } from "./compact/AssistantWaitingChangeRow.js";
33
- import { voiceStartedCueShows as De } from "../voice/voiceStartedCue.js";
34
- import { countWaitingChanges as Oe, focusFirstWaitingCard as ke } from "./compact/waitingChange.js";
35
- import { planModeSwitch as Ae } from "./composer/modeSwitchPlan.js";
36
- import { AssistantAiDisclaimer as je } from "./AssistantAiDisclaimer.js";
37
- import { AssistantCompactFooter as Me } from "./composer/AssistantCompactFooter.js";
38
- import { AiCreditBalance as Ne } from "./AiCreditBalance.js";
39
- import { AssistantVoiceSession as Pe } from "./voice/AssistantVoiceSession.js";
40
- import { AssistantAvatarTab as Fe } from "./avatar/AssistantAvatarTab.js";
41
- import { AssistantCompactAvatar as Ie } from "./avatar/AssistantCompactAvatar.js";
42
- import { AssistantViewSwitch as Le } from "./compact/AssistantViewSwitch.js";
43
- import { AssistantViewSwitchDock as Re } from "./compact/AssistantViewSwitchDock.js";
44
- import { useAssistantPageLayout as ze } from "./assistantPageLayout.js";
45
- import { setAssistantPageStartSlot as Be, useAssistantPageStartOffered as Ve } from "./assistantPageStart.js";
46
- import { useLiveAvatarTab as He, useLiveAvatarTabSeam as Ue } from "./assistantLiveAvatarSeam.js";
47
- import { useAvatarCopy as We } from "../avatar/useAvatarCopy.js";
48
- import { voiceStartBlocker as Ge, voiceStartBlockerLasts as Ke } from "./voice/voiceStartGate.js";
49
- import { avatarAskBlocker as C, avatarAskWrites as qe, avatarTabAskLine as Je } from "./avatar/avatarAskGate.js";
50
- import { createAvatarTabDraft as Ye } from "./avatar/avatarTabDraft.js";
51
- import { parseToolActivity as Xe } from "./AssistantToolActivity.js";
52
- import { useVoiceSession as Ze } from "./useVoiceSession.js";
53
- import { useAssistantApiAccess as Qe } from "../useAssistantApiAccess.js";
54
- import { useAssistantAttachments as $e } from "../useAssistantAttachments.js";
55
- import { useAttachmentUrlResolver as et } from "../useAttachmentCommitter.js";
56
- import { VOICE_COMMIT_BUDGET_MS as tt, settleAndCommitSpokenTurn as nt } from "../voiceCommit.js";
57
- import { attachmentUrlIsStale as rt, refreshStaleAttachmentUrls as it } from "../attachmentCommit.js";
58
- import { useConversationTurns as at } from "../useConversationTurns.js";
59
- import { resolveActiveModeSandbox as ot, useAssistantStore as w } from "../store.js";
60
- import { abortAssistantTurn as st, approvePendingWrite as ct, createAssistantSandbox as lt, createAssistantSession as ut, findExistingSandboxWithStatus as dt, getAssistantArtifacts as ft, getAssistantMessages as pt, getAssistantSession as mt, mintAssistantTurnStream as ht, modeRequiresConfirmWrites as gt, postClientToolResult as _t, promptGatewayRequestBytes as vt, releaseSupersededAssistantSandboxes as yt, sendAssistantPromptAsync as bt, waitForAssistantServiceReady as xt, waitForSandboxRunning as St, writeApprovalModeOf as Ct } from "../api.js";
61
- import { createClientToolRunner as wt, offerClientTools as Tt } from "../../agent-tools/adapters/assistant.js";
62
- import { sanitize as Et } from "../progress.js";
63
- import { createSandboxBusyGate as Dt, gateDoneOnSandboxBusy as Ot } from "../sandboxBusy.js";
64
- import { speechFeed as kt } from "../speech/speechFeed.js";
65
- import { requestReplyOnAvatar as At } from "../speech/replySpeechRequests.js";
66
- import { isTurnSuperseded as jt, markTurnSuperseded as Mt } from "../voice/supersededTurns.js";
67
- import { NO_FIRST_TEXT as Nt, buildAssistantProgress as Pt, readAheadFor as Ft, rememberSessionFloor as It, snapshotReplyFloor as Lt, startSessionReadAhead as Rt, takeRememberedSessionFloor as zt, trackFirstText as Bt } from "../turnProgress.js";
68
- import { getOrganizationId as Vt, getWorkspaceId as T } from "../context.js";
69
- import { dispatchAssistantQuotaExhausted as Ht, notifyAiCreditsUpdated as Ut } from "../aiCredits.js";
70
- import { AssistantSendRefusal as Wt, classifyTurnFailure as Gt, turnConfirmsNoAction as Kt, turnOutcomeCopy as qt } from "../turnOutcome.js";
71
- import { QuarantineSet as Jt, WarmCancelled as Yt, claimPreopenedSession as Xt, consumeWarm as Zt, preopenKey as Qt, preopenWanted as $t, prewarmTarget as en, settleWarmBeforeSend as tn, startPreopen as nn, startWarm as rn, warmState as an, withWarmProofs as on } from "../prewarm.js";
72
- import { beginTurn as sn, describeTurn as cn, detectTurnDevice as ln, markTurn as E, restartAttempt as un, turnClockMs as dn } from "../turnTimeline.js";
73
- import { sendAssistantTurnTimings as fn, startTurnTimingReporting as pn } from "../turnTimingReporter.js";
74
- import { countInlineImageCandidates as mn, countInlinedImageParts as hn, largestInlineCharsPerFile as gn, resolveAssistantInlineLimits as _n, toMessageAttachment as vn } from "../attachments.js";
75
- import { buildBoundedAttachmentTurn as yn } from "../attachmentTurn.js";
76
- import { assistantUsageLedger as bn, hasPendingUsageReports as xn, reportUsageInBackground as Sn, retryPendingUsageReports as Cn, settleInFlightUsageReports as wn, usageSendRefusal as Tn } from "../usageReporting.js";
77
- import { isMultimodalBodyRejection as En, isRecoverableAssistantError as Dn } from "../transportErrors.js";
78
- import { isTurnInFlight as On, planAbandonedTurn as kn, planTurnAbort as An } from "../turnState.js";
79
- import { useAssistantTr as jn } from "../i18n.js";
80
- import { isProdRuntime as Mn } from "../env.js";
81
- import { useAssistantProduct as Nn } from "../product.js";
82
- import { pollDelayMs as Pn } from "../voice/assistantPollSchedule.js";
83
- import { holdAssistantActivity as Fn } from "../keepAlive.js";
84
- import { StaleSessionRestart as In, isStaleSessionRefusal as Ln } from "../staleSession.js";
85
- import { noteAssistantTurnSent as Rn } from "../signInWarm.js";
86
- import { keepAssistantSandboxAlive as zn } from "../useAssistantHeartbeat.js";
87
- import { liveCoverage as Bn } from "../liveDeltas.js";
88
- import { phraseSpeechEnabled as Vn } from "../voice/phraseSpeechConfig.js";
89
- import { createLivePhraseSpeech as Hn } from "../voice/livePhraseSpeech.js";
90
- import { createLiveRender as Un } from "../liveOverlay.js";
91
- import { createSnapshotPoller as Wn } from "../snapshotPoller.js";
92
- import { openTurnStream as Gn, turnStreamAvailable as Kn } from "../turnStream.js";
93
- import { withIncompleteTurnNotice as qn } from "../streamBudget.js";
94
- import { isWriteModeAcknowledged as Jn, writeModeSendRefusalReason as Yn } from "../writeModeConsent.js";
95
- import { createAdminModeAccessGate as Xn, resolveAssistantSendModeAfterAccess as Zn } from "../adminModeSendGate.js";
96
- import { getAssistantDisplayContent as Qn } from "../displayContent.js";
97
- import { countSpokenTurns as $n, spokenMessagesSinceContinueNote as er, spokenTurnText as tr } from "../spokenTurns.js";
98
- import { toCaptionText as nr } from "../voice/captionText.js";
99
- import { buildContinuedFromVoiceNote as rr, buildVoiceTranscriptMarkdown as ir, voiceTranscriptFilename as ar } from "../voice/voiceTranscript.js";
100
- import { downloadFile as or } from "../exportConversation.js";
101
- import { chatTurns as sr, isVoiceTurn as cr, voiceMarker as lr, voiceSessionIdOf as ur } from "../voice/turnVisibility.js";
102
- import { VoiceChatEnded as dr, VoiceTurnTag as fr } from "./voice/VoiceTurnMarks.js";
103
- import { revealSpokenMarkdown as pr } from "../voice/revealSpoken.js";
104
- import { isAwaitingOwnConversation as mr, maySendSpokenTurn as hr, planTranscriptAutoOpen as gr, planVoiceSessionBinding as _r, planVoiceSessionStart as vr, planVoiceSpokenEntry as yr, voiceBindingAtStart as br, voiceBindingConversationId as xr } from "../voice/voiceReopen.js";
105
- import { transcriptAutoOpenSlot as Sr } from "./transcriptAutoOpenSlot.js";
106
- import { toVoiceReply as Cr } from "../voice/voiceReply.js";
107
- import { beginApprovalInFlight as wr, endApprovalInFlight as Tr, getApprovalInFlight as Er, markLiveTurn as Dr, newestModelReplyId as Or, resolveApprovablePendingWrite as kr, resolveRetryableMessageId as Ar, subscribeApprovalInFlight as jr } from "../liveTurns.js";
108
- import { createReadinessTracker as Mr, planAfterTransportFailure as Nr, planTrustedSandboxFailure as Pr } from "../sandboxReadiness.js";
109
- import { couldBeLocalUiCommand as Fr, isAlreadyThere as Ir, matchLocalUiCommand as Lr, mayBeNavigationFollowUp as Rr, navDestinations as zr, planThemeChange as Br } from "../localUiCommands.js";
110
- import { backDoneCopy as Vr, chooseDestinationCopy as Hr, chooseLinkedCopy as Ur, entityNounText as Wr, linkNotOpenableCopy as Gr, navigationCommandCopy as Kr, navigationOutcomeCopy as qr, offerExpiredCopy as Jr, offerKeptForUnsavedCopy as Yr, offerNotAvailableCopy as Xr, pickFromListCopy as Zr, recordChoiceCopy as Qr, recordKindsCopy as $r, themeCommandCopy as ei } from "../localUiCommandCopy.js";
111
- import { offerAssentFor as ti } from "../localeCommands/assent.js";
112
- import { appControlCopy as ni } from "../appControls/copy.js";
113
- import { LANGUAGE_REPLY_DEADLINE_MS as ri, languageConfirmationCopy as ii, languageReplyStep as ai } from "../appControls/languageReply.js";
114
- import { planAppControl as oi } from "../appControls/plan.js";
115
- import { readControlSnapshot as si } from "../appControls/snapshot.js";
116
- import { subscribeAssistantControls as ci } from "../appControls/registry.js";
117
- import { useAssistantControl as li } from "../appControls/useAssistantControl.js";
118
- import { useControlConfirmDialog as ui } from "./controlConfirmDialog.js";
119
- import { useLeaveConfirmAsking as di } from "./leaveConfirm.js";
120
- import { startFocusReturnAfterKeep as fi } from "./leaveConfirmFocus.js";
121
- import { buildNavigationContext as pi, latestReplyOnSurface as mi, rememberPresentedList as hi } from "../uiActions/linkContext.js";
122
- import { lookupNamedRecords as gi } from "../uiActions/recordNames.js";
123
- import { navEntryIds as _i } from "../uiActions/resolveTarget.js";
124
- import { buildUiCatalogue as vi, markUiCatalogueSent as yi, uiCatalogueSent as bi, uiCatalogueSessionKey as xi } from "../uiActions/uiCatalogue.js";
125
- import { offerYesOnSurface as Si } from "../uiActions/offerYesOnSurface.js";
126
- import { UiOfferSession as Ci, sandboxServesUiOffers as wi, uiOfferHintKind as Ti, uiOfferInTime as Ei } from "../uiActions/uiOffers.js";
127
- import { parseNavIntent as Di } from "../uiActions/navIntent.js";
128
- import { decideActOnResolve as Oi, n4LeaveGuard as ki } from "../uiActions/actOnResolve.js";
129
- import { AssistantUiOfferLinks as Ai } from "./AssistantUiOfferLink.js";
130
- import { assistantBackStack as ji, isBackRunnable as Mi } from "../uiActions/backStack.js";
131
- import { subscribeDraftPathname as Ni } from "../uiActions/draftPathname.js";
132
- import { buildNavigateAction as Pi, destinationForPath as Fi, labelForPath as Ii, newestAssistantOnSurface as Li } from "../uiActions/navigateAction.js";
133
- import { runNavigation as Ri } from "../uiActions/navigationOutcome.js";
134
- import { assistantHistory as zi } from "../history/historyEngine.js";
135
- import { conversationHasHistory as Bi, isOtherScopeHistoryConversation as Vi, isReadOnlyHistoryConversation as Hi, isReusableHistoryDraft as Ui } from "../history/historyList.js";
136
- import { resumeContextFor as Wi } from "../history/historyResume.js";
137
- import { useAssistantHistoryStatus as Gi } from "../history/historyStatus.js";
138
- import { useHistoryRowControlsFor as Ki } from "../history/useHistoryRowControls.js";
139
- import { getHistoryStamp as qi, setHistoryBusyProbe as Ji } from "../history/stampRegistry.js";
140
- import { resolveConversationDeleteTarget as Yi } from "../conversationDeleteCommand.js";
141
- import { useAssistantNavigate as Xi } from "./AssistantMarkdownRenderer.js";
142
- import { useAssistantSpeech as Zi } from "./AssistantSpeechProvider.js";
143
- import { useAssistantStopTurnLabel as Qi } from "../../providers/shell/useAssistantShellLabels.js";
144
- import { useThemeOrNull as $i } from "../../providers/shell/ThemeProvider.js";
145
- import { useVisibleNavItems as ea } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
146
- import { useAskAboutStore as ta } from "../askAbout/askAboutStore.js";
147
- import { readMessageFocus as na, withFocusNote as ra } from "../askAbout/focus.js";
148
- import { useCallback as D, useEffect as O, useLayoutEffect as ia, useMemo as k, useRef as A, useState as j, useSyncExternalStore as aa } from "react";
149
- import { Fragment as oa, jsx as M, jsxs as sa } from "react/jsx-runtime";
24
+ import { AssistantHistoryArchivedNotice as x, AssistantHistoryDeletedNotice as ge, AssistantHistoryLoadState as _e, AssistantHistoryPinLimitBanner as ve, AssistantHistoryReadOnlyBanner as S, AssistantHistoryShowEarlier as ye } from "./AssistantHistoryNotices.js";
25
+ import { useAssistantPageChatManaged as be } from "./assistantPageBar.js";
26
+ import { AssistantNothingToDeleteNotice as xe } from "./AssistantDeleteConversationDialog.js";
27
+ import { useConversationDeleteDialog as Se } from "./conversationDeleteDialog.js";
28
+ import { assistantHistoryIsOn as Ce } from "./conversationDelete.js";
29
+ import { VoiceTranscriptDrawer as we } from "./voice/VoiceTranscriptDrawer.js";
30
+ import { AssistantComposer as Te } from "./composer/AssistantComposer.js";
31
+ import { assistantModeOptionName as Ee } from "./composer/AssistantModeMenu.js";
32
+ import { draftIsUnsent as De } from "./compact/compactChrome.js";
33
+ import { AssistantWaitingChangeRow as Oe } from "./compact/AssistantWaitingChangeRow.js";
34
+ import { voiceStartedCueShows as ke } from "../voice/voiceStartedCue.js";
35
+ import { countWaitingChanges as Ae, focusFirstWaitingCard as je } from "./compact/waitingChange.js";
36
+ import { planModeSwitch as Me } from "./composer/modeSwitchPlan.js";
37
+ import { AssistantAiDisclaimer as Ne } from "./AssistantAiDisclaimer.js";
38
+ import { AssistantCompactFooter as Pe } from "./composer/AssistantCompactFooter.js";
39
+ import { AiCreditBalance as Fe } from "./AiCreditBalance.js";
40
+ import { AssistantVoiceSession as Ie } from "./voice/AssistantVoiceSession.js";
41
+ import { AssistantAvatarTab as Le } from "./avatar/AssistantAvatarTab.js";
42
+ import { AssistantCompactAvatar as Re } from "./avatar/AssistantCompactAvatar.js";
43
+ import { AssistantViewSwitch as ze } from "./compact/AssistantViewSwitch.js";
44
+ import { AssistantViewSwitchDock as Be } from "./compact/AssistantViewSwitchDock.js";
45
+ import { useAssistantPageLayout as Ve } from "./assistantPageLayout.js";
46
+ import { assistantPageStartShows as He, setAssistantPageStartSlot as Ue, useAssistantPageStartOffered as We } from "./assistantPageStart.js";
47
+ import { useLiveAvatarTab as Ge, useLiveAvatarTabSeam as Ke } from "./assistantLiveAvatarSeam.js";
48
+ import { useAvatarCopy as C } from "../avatar/useAvatarCopy.js";
49
+ import { voiceStartBlocker as qe, voiceStartBlockerLasts as Je } from "./voice/voiceStartGate.js";
50
+ import { avatarAskBlocker as Ye, avatarAskWrites as Xe, avatarTabAskLine as Ze } from "./avatar/avatarAskGate.js";
51
+ import { createAvatarTabDraft as Qe } from "./avatar/avatarTabDraft.js";
52
+ import { parseToolActivity as $e } from "./AssistantToolActivity.js";
53
+ import { useVoiceSession as et } from "./useVoiceSession.js";
54
+ import { useAssistantApiAccess as tt } from "../useAssistantApiAccess.js";
55
+ import { useAssistantAttachments as nt } from "../useAssistantAttachments.js";
56
+ import { useAttachmentUrlResolver as rt } from "../useAttachmentCommitter.js";
57
+ import { VOICE_COMMIT_BUDGET_MS as it, settleAndCommitSpokenTurn as at } from "../voiceCommit.js";
58
+ import { attachmentUrlIsStale as ot, refreshStaleAttachmentUrls as st } from "../attachmentCommit.js";
59
+ import { useConversationTurns as ct } from "../useConversationTurns.js";
60
+ import { resolveActiveModeSandbox as lt, useAssistantStore as w } from "../store.js";
61
+ import { abortAssistantTurn as ut, approvePendingWrite as dt, createAssistantSandbox as ft, createAssistantSession as pt, findExistingSandboxWithStatus as mt, getAssistantArtifacts as ht, getAssistantMessages as gt, getAssistantSession as _t, mintAssistantTurnStream as vt, modeRequiresConfirmWrites as yt, postClientToolResult as bt, promptGatewayRequestBytes as xt, releaseSupersededAssistantSandboxes as St, sendAssistantPromptAsync as Ct, waitForAssistantServiceReady as wt, waitForSandboxRunning as Tt, writeApprovalModeOf as Et } from "../api.js";
62
+ import { createClientToolRunner as Dt, offerClientTools as Ot } from "../../agent-tools/adapters/assistant.js";
63
+ import { sanitize as kt } from "../progress.js";
64
+ import { createSandboxBusyGate as At, gateDoneOnSandboxBusy as jt } from "../sandboxBusy.js";
65
+ import { speechFeed as Mt } from "../speech/speechFeed.js";
66
+ import { requestReplyOnAvatar as Nt } from "../speech/replySpeechRequests.js";
67
+ import { isTurnSuperseded as Pt, markTurnSuperseded as Ft } from "../voice/supersededTurns.js";
68
+ import { NO_FIRST_TEXT as It, buildAssistantProgress as Lt, readAheadFor as Rt, rememberSessionFloor as zt, snapshotReplyFloor as Bt, startSessionReadAhead as Vt, takeRememberedSessionFloor as Ht, trackFirstText as Ut } from "../turnProgress.js";
69
+ import { getOrganizationId as Wt, getWorkspaceId as T } from "../context.js";
70
+ import { dispatchAssistantQuotaExhausted as Gt, notifyAiCreditsUpdated as Kt } from "../aiCredits.js";
71
+ import { AssistantSendRefusal as qt, classifyTurnFailure as Jt, turnConfirmsNoAction as Yt, turnOutcomeCopy as Xt } from "../turnOutcome.js";
72
+ import { QuarantineSet as Zt, WarmCancelled as Qt, claimPreopenedSession as $t, consumeWarm as en, preopenKey as tn, preopenWanted as nn, prewarmTarget as rn, settleWarmBeforeSend as an, startPreopen as on, startWarm as sn, warmState as cn, withWarmProofs as ln } from "../prewarm.js";
73
+ import { beginTurn as un, describeTurn as dn, detectTurnDevice as fn, markTurn as E, restartAttempt as pn, turnClockMs as mn } from "../turnTimeline.js";
74
+ import { sendAssistantTurnTimings as hn, startTurnTimingReporting as gn } from "../turnTimingReporter.js";
75
+ import { countInlineImageCandidates as _n, countInlinedImageParts as vn, largestInlineCharsPerFile as yn, resolveAssistantInlineLimits as bn, toMessageAttachment as xn } from "../attachments.js";
76
+ import { buildBoundedAttachmentTurn as Sn } from "../attachmentTurn.js";
77
+ import { assistantUsageLedger as Cn, hasPendingUsageReports as wn, reportUsageInBackground as Tn, retryPendingUsageReports as En, settleInFlightUsageReports as Dn, usageSendRefusal as On } from "../usageReporting.js";
78
+ import { isMultimodalBodyRejection as kn, isRecoverableAssistantError as An } from "../transportErrors.js";
79
+ import { isTurnInFlight as jn, planAbandonedTurn as Mn, planTurnAbort as Nn } from "../turnState.js";
80
+ import { useAssistantTr as Pn } from "../i18n.js";
81
+ import { isProdRuntime as Fn } from "../env.js";
82
+ import { useAssistantProduct as In } from "../product.js";
83
+ import { pollDelayMs as Ln } from "../voice/assistantPollSchedule.js";
84
+ import { holdAssistantActivity as Rn } from "../keepAlive.js";
85
+ import { StaleSessionRestart as zn, isStaleSessionRefusal as Bn } from "../staleSession.js";
86
+ import { noteAssistantTurnSent as Vn } from "../signInWarm.js";
87
+ import { keepAssistantSandboxAlive as Hn } from "../useAssistantHeartbeat.js";
88
+ import { liveCoverage as Un } from "../liveDeltas.js";
89
+ import { phraseSpeechEnabled as Wn } from "../voice/phraseSpeechConfig.js";
90
+ import { createLivePhraseSpeech as Gn } from "../voice/livePhraseSpeech.js";
91
+ import { createLiveRender as Kn } from "../liveOverlay.js";
92
+ import { createSnapshotPoller as qn } from "../snapshotPoller.js";
93
+ import { openTurnStream as Jn, turnStreamAvailable as Yn } from "../turnStream.js";
94
+ import { withIncompleteTurnNotice as Xn } from "../streamBudget.js";
95
+ import { isWriteModeAcknowledged as Zn, writeModeSendRefusalReason as Qn } from "../writeModeConsent.js";
96
+ import { createAdminModeAccessGate as $n, resolveAssistantSendModeAfterAccess as er } from "../adminModeSendGate.js";
97
+ import { getAssistantDisplayContent as tr } from "../displayContent.js";
98
+ import { countSpokenTurns as nr, spokenMessagesSinceContinueNote as rr, spokenTurnText as ir } from "../spokenTurns.js";
99
+ import { toCaptionText as ar } from "../voice/captionText.js";
100
+ import { buildContinuedFromVoiceNote as or, buildVoiceTranscriptMarkdown as sr, voiceTranscriptFilename as cr } from "../voice/voiceTranscript.js";
101
+ import { downloadFile as lr } from "../exportConversation.js";
102
+ import { chatTurns as ur, isVoiceTurn as dr, voiceMarker as fr, voiceSessionIdOf as pr } from "../voice/turnVisibility.js";
103
+ import { VoiceChatEnded as mr, VoiceTurnTag as hr } from "./voice/VoiceTurnMarks.js";
104
+ import { revealSpokenMarkdown as gr } from "../voice/revealSpoken.js";
105
+ import { isAwaitingOwnConversation as _r, maySendSpokenTurn as vr, planTranscriptAutoOpen as yr, planVoiceSessionBinding as br, planVoiceSessionStart as xr, planVoiceSpokenEntry as Sr, voiceBindingAtStart as Cr, voiceBindingConversationId as wr } from "../voice/voiceReopen.js";
106
+ import { transcriptAutoOpenSlot as Tr } from "./transcriptAutoOpenSlot.js";
107
+ import { toVoiceReply as Er } from "../voice/voiceReply.js";
108
+ import { beginApprovalInFlight as Dr, endApprovalInFlight as Or, getApprovalInFlight as kr, markLiveTurn as Ar, newestModelReplyId as jr, resolveApprovablePendingWrite as Mr, resolveRetryableMessageId as Nr, subscribeApprovalInFlight as Pr } from "../liveTurns.js";
109
+ import { createReadinessTracker as Fr, planAfterTransportFailure as Ir, planTrustedSandboxFailure as Lr } from "../sandboxReadiness.js";
110
+ import { couldBeLocalUiCommand as Rr, isAlreadyThere as zr, matchLocalUiCommand as Br, mayBeNavigationFollowUp as Vr, navDestinations as Hr, planThemeChange as Ur } from "../localUiCommands.js";
111
+ import { backDoneCopy as Wr, chooseDestinationCopy as Gr, chooseLinkedCopy as Kr, entityNounText as qr, linkNotOpenableCopy as Jr, navigationCommandCopy as Yr, navigationOutcomeCopy as Xr, offerExpiredCopy as Zr, offerKeptForUnsavedCopy as Qr, offerNotAvailableCopy as $r, pickFromListCopy as ei, recordChoiceCopy as ti, recordKindsCopy as ni, themeCommandCopy as ri } from "../localUiCommandCopy.js";
112
+ import { offerAssentFor as ii } from "../localeCommands/assent.js";
113
+ import { appControlCopy as ai } from "../appControls/copy.js";
114
+ import { LANGUAGE_REPLY_DEADLINE_MS as oi, languageConfirmationCopy as si, languageReplyStep as ci } from "../appControls/languageReply.js";
115
+ import { planAppControl as li } from "../appControls/plan.js";
116
+ import { readControlSnapshot as ui } from "../appControls/snapshot.js";
117
+ import { subscribeAssistantControls as di } from "../appControls/registry.js";
118
+ import { useAssistantControl as fi } from "../appControls/useAssistantControl.js";
119
+ import { useControlConfirmDialog as pi } from "./controlConfirmDialog.js";
120
+ import { useLeaveConfirmAsking as mi } from "./leaveConfirm.js";
121
+ import { startFocusReturnAfterKeep as hi } from "./leaveConfirmFocus.js";
122
+ import { buildNavigationContext as gi, latestReplyOnSurface as _i, rememberPresentedList as vi } from "../uiActions/linkContext.js";
123
+ import { lookupNamedRecords as yi } from "../uiActions/recordNames.js";
124
+ import { navEntryIds as bi } from "../uiActions/resolveTarget.js";
125
+ import { buildUiCatalogue as xi, markUiCatalogueSent as Si, uiCatalogueSent as Ci, uiCatalogueSessionKey as wi } from "../uiActions/uiCatalogue.js";
126
+ import { offerYesOnSurface as Ti } from "../uiActions/offerYesOnSurface.js";
127
+ import { UiOfferSession as Ei, sandboxServesUiOffers as Di, uiOfferHintKind as Oi, uiOfferInTime as ki } from "../uiActions/uiOffers.js";
128
+ import { parseNavIntent as Ai } from "../uiActions/navIntent.js";
129
+ import { decideActOnResolve as ji, n4LeaveGuard as Mi } from "../uiActions/actOnResolve.js";
130
+ import { AssistantUiOfferLinks as Ni } from "./AssistantUiOfferLink.js";
131
+ import { assistantBackStack as Pi, isBackRunnable as Fi } from "../uiActions/backStack.js";
132
+ import { subscribeDraftPathname as Ii } from "../uiActions/draftPathname.js";
133
+ import { buildNavigateAction as Li, destinationForPath as Ri, labelForPath as zi, newestAssistantOnSurface as Bi } from "../uiActions/navigateAction.js";
134
+ import { runNavigation as Vi } from "../uiActions/navigationOutcome.js";
135
+ import { assistantHistory as Hi } from "../history/historyEngine.js";
136
+ import { conversationHasHistory as Ui, isOtherScopeHistoryConversation as Wi, isReadOnlyHistoryConversation as Gi, isReusableHistoryDraft as Ki } from "../history/historyList.js";
137
+ import { resumeContextFor as qi } from "../history/historyResume.js";
138
+ import { useAssistantHistoryStatus as Ji } from "../history/historyStatus.js";
139
+ import { useHistoryRowControlsFor as Yi } from "../history/useHistoryRowControls.js";
140
+ import { getHistoryStamp as Xi, setHistoryBusyProbe as Zi } from "../history/stampRegistry.js";
141
+ import { resolveConversationDeleteTarget as Qi } from "../conversationDeleteCommand.js";
142
+ import { useAssistantNavigate as $i } from "./AssistantMarkdownRenderer.js";
143
+ import { useAssistantSpeech as ea } from "./AssistantSpeechProvider.js";
144
+ import { useAssistantStopTurnLabel as ta } from "../../providers/shell/useAssistantShellLabels.js";
145
+ import { useThemeOrNull as na } from "../../providers/shell/ThemeProvider.js";
146
+ import { useVisibleNavItems as ra } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
147
+ import { useAskAboutStore as ia } from "../askAbout/askAboutStore.js";
148
+ import { readMessageFocus as aa, withFocusNote as oa } from "../askAbout/focus.js";
149
+ import { useCallback as D, useEffect as O, useLayoutEffect as sa, useMemo as k, useRef as A, useState as j, useSyncExternalStore as ca } from "react";
150
+ import { Fragment as la, jsx as M, jsxs as ua } from "react/jsx-runtime";
150
151
  // src/shared/assistant/ui/AssistantChatArea.tsx
151
- var ca = 2500, la = 300, ua = 2e4, da = 1e4, fa = 1e4, pa = !1, ma = {
152
+ var da = 2500, fa = 300, pa = 2e4, ma = 1e4, ha = 1e4, ga = !1, _a = {
152
153
  committing: !1,
153
154
  dictating: !1
154
- }, ha = 6e3;
155
+ }, va = 6e3;
155
156
  function N() {
156
157
  return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
157
158
  }
158
- var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ visible: ya = !0, writeAccess: ba = "unknown", presentation: xa = "classic", inputRef: Sa, onDraftDirtyChange: Ca, surface: wa, onWindowVoiceChange: Ta, onOpenFull: Ea, onContinuedInChat: Da }) => {
159
- let P = jn(), Oa = Qi(), F = xa === "compact", I = ze(), ka = Ve(), Aa = D((e) => Be("above", e), []), ja = D((e) => Be("below", e), []), Ma = F && wa === "window", { product: L, modes: R, gatherPageContext: Na, buildPrompt: Pa, reportTurnTimings: Fa, reportTokenUsage: Ia, localUiCommands: La } = Nn(), z = Ct(Nn().writeApproval), Ra = D((e, t) => {
159
+ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ visible: Sa = !0, writeAccess: Ca = "unknown", presentation: wa = "classic", inputRef: Ta, onDraftDirtyChange: Ea, surface: Da, onWindowVoiceChange: Oa, onOpenFull: ka, onContinuedInChat: Aa }) => {
160
+ let P = Pn(), ja = ta(), F = wa === "compact", I = Ve(), Ma = We(), Na = D((e) => Ue("above", e), []), Pa = D((e) => Ue("below", e), []), Fa = F && Da === "window", { product: L, modes: R, gatherPageContext: Ia, buildPrompt: La, reportTurnTimings: Ra, reportTokenUsage: za, localUiCommands: Ba } = In(), z = Et(In().writeApproval), Va = D((e, t) => {
160
161
  let n = w.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
161
162
  return g({
162
163
  mode: e,
163
164
  productWriteApproval: z,
164
165
  capabilities: r ? n.sandboxWriteCapabilities[r] : null
165
166
  });
166
- }, [z]), { getAccessToken: za, getWorkspaceToken: Ba, userId: B } = r(), { locale: V, isLocaleLoading: Va } = n(), Ha = w((e) => e.voiceGraceMs), Ua = w((e) => e.handsFreeInterrupt), Wa = w((e) => e.handsFreeStreamNoticeAccepted), Ga = w((e) => e.acceptHandsFreeStreamNotice), Ka = w((e) => e.assistantLanguage), qa = w((e) => e.replyLanguage), Ja = k(() => s(Ka, qa, V), [
167
- Ka,
168
- qa,
167
+ }, [z]), { getAccessToken: Ha, getWorkspaceToken: Ua, userId: B } = r(), { locale: V, isLocaleLoading: Wa } = n(), Ga = w((e) => e.voiceGraceMs), Ka = w((e) => e.handsFreeInterrupt), qa = w((e) => e.handsFreeStreamNoticeAccepted), Ja = w((e) => e.acceptHandsFreeStreamNotice), Ya = w((e) => e.assistantLanguage), Xa = w((e) => e.replyLanguage), Za = k(() => s(Ya, Xa, V), [
168
+ Ya,
169
+ Xa,
169
170
  V
170
- ]), Ya = Ja.reply.english, Xa = Ja.replyIsExplicit, Za = Ja.reply.code, { conversations: Qa, activeConversationId: H, mode: U, processingByConversationId: $a, setMode: eo, setConversationMode: to, setActiveConversation: no, createConversation: ro, addMessage: W, updateMessage: io, patchMessage: ao, mergeMessageMetadata: oo, setConversationProcessing: so, clearConversationProcessing: co, setBackendSessionId: lo, clearBackendSessionId: uo, setSandbox: fo, clearSandbox: po, acknowledgedWriteModes: mo, acknowledgeWriteMode: ho, autoRouting: go, setAutoRouting: _o, routeConversation: vo } = w(), G = Qa.find((e) => e.id === H), yo = at(G), bo = yo.all, xo = H ? $a[H] : void 0, So = On(xo?.status), Co = So ? xo?.messageId ?? null : null, wo = xo?.status === "error" ? xo.messageId : null, To = w((e) => e.sandboxWriteCapabilities), { panel: K, entries: Eo, retiredSandboxes: Do } = ee({
171
+ ]), Qa = Za.reply.english, $a = Za.replyIsExplicit, eo = Za.reply.code, { conversations: to, activeConversationId: H, mode: U, processingByConversationId: no, setMode: ro, setConversationMode: io, setActiveConversation: ao, createConversation: oo, addMessage: W, updateMessage: so, patchMessage: co, mergeMessageMetadata: lo, setConversationProcessing: uo, clearConversationProcessing: fo, setBackendSessionId: po, clearBackendSessionId: mo, setSandbox: ho, clearSandbox: go, acknowledgedWriteModes: _o, acknowledgeWriteMode: vo, autoRouting: yo, setAutoRouting: bo, routeConversation: xo } = w(), G = to.find((e) => e.id === H), So = ct(G), Co = So.all, wo = H ? no[H] : void 0, To = jn(wo?.status), Eo = To ? wo?.messageId ?? null : null, Do = wo?.status === "error" ? wo.messageId : null, Oo = w((e) => e.sandboxWriteCapabilities), { panel: K, entries: ko, retiredSandboxes: Ao } = ee({
171
172
  tr: P,
172
173
  productWriteApproval: z
173
- }), Oo = p({
174
+ }), jo = p({
174
175
  approve: (e, t) => K.approve(e, t),
175
176
  decline: (e, t, n) => K.decline(e, t, n),
176
177
  presented: (e, t) => K.presented(e, t)
177
- }), ko = Oo.dismiss, Ao = A(null);
178
+ }), Mo = jo.dismiss, No = A(null);
178
179
  O(() => {
179
- ko();
180
- let e = Ao.current;
181
- Ao.current = H, e && e !== H && K.withdraw(e, "conversation_closed"), H && K.openConversation(H);
180
+ Mo();
181
+ let e = No.current;
182
+ No.current = H, e && e !== H && K.withdraw(e, "conversation_closed"), H && K.openConversation(H);
182
183
  }, [
183
184
  H,
184
185
  K,
185
- ko
186
+ Mo
186
187
  ]);
187
- let jo = Hi(G), Mo = Ki(G)?.archivedAt != null, No = Gi((e) => H !== null && H in e.loadingIds), Po = Gi((e) => H !== null && H in e.loadErrorIds), Fo = Gi((e) => e.remoteDelete), [Io, Lo] = j(() => Gi.getState().remoteDelete?.at ?? null), Ro = Fo?.wasActive === !0 && Fo.at !== Io ? Fo.at : null;
188
+ let Po = Gi(G), Fo = Yi(G)?.archivedAt != null, Io = Ji((e) => H !== null && H in e.loadingIds), Lo = Ji((e) => H !== null && H in e.loadErrorIds), Ro = Ji((e) => e.remoteDelete), [zo, Bo] = j(() => Ji.getState().remoteDelete?.at ?? null), Vo = Ro?.wasActive === !0 && Ro.at !== zo ? Ro.at : null;
188
189
  O(() => {
189
- if (Ro === null) return;
190
- let e = window.setTimeout(() => Lo(Ro), fa);
190
+ if (Vo === null) return;
191
+ let e = window.setTimeout(() => Bo(Vo), ha);
191
192
  return () => window.clearTimeout(e);
192
- }, [Ro]);
193
- let zo = T(), { canUseApiCalls: Bo, loading: Vo } = Qe(zo, B), Ho = A(Xn({
194
- loading: Vo,
195
- canUseAdminModes: Bo
196
- })).current, Uo = A(R);
193
+ }, [Vo]);
194
+ let Ho = be(), Uo = Ji((e) => e.pinLimit), Wo = I && Ho && Uo !== void 0 && Uo.conversationId === H ? Uo : null, Go = T(), { canUseApiCalls: Ko, loading: qo } = tt(Go, B), Jo = A($n({
195
+ loading: qo,
196
+ canUseAdminModes: Ko
197
+ })).current, Yo = A(R);
197
198
  O(() => {
198
- Uo.current = R;
199
+ Yo.current = R;
199
200
  }, [R]);
200
- let Wo = () => {
201
+ let Xo = () => {
201
202
  let e = w.getState().activeConversationId;
202
- e && zi.openConversation(e, { modes: Uo.current });
203
- }, Go = () => {
203
+ e && Hi.openConversation(e, { modes: Yo.current });
204
+ }, Zo = () => {
204
205
  let e = w.getState().activeConversationId;
205
- e && zi.loadEarlier(e);
206
- }, Ko = A(za);
206
+ e && Hi.loadEarlier(e);
207
+ }, Qo = A(Ha);
207
208
  O(() => {
208
- Ko.current = za;
209
- }, [za]);
210
- let qo = !!L && Fa !== !1;
209
+ Qo.current = Ha;
210
+ }, [Ha]);
211
+ let $o = !!L && Ra !== !1;
211
212
  O(() => {
212
- if (qo) return pn({ send: (e) => fn(e, {
213
+ if ($o) return gn({ send: (e) => hn(e, {
213
214
  workspaceId: T(),
214
215
  authContext: {
215
- accessToken: Ko.current(),
216
- organizationId: Vt()
216
+ accessToken: Qo.current(),
217
+ organizationId: Wt()
217
218
  }
218
219
  }) });
219
- }, [qo]), O(() => {
220
- Ho.update({
221
- loading: Vo,
222
- canUseAdminModes: Bo
220
+ }, [$o]), O(() => {
221
+ Jo.update({
222
+ loading: qo,
223
+ canUseAdminModes: Ko
223
224
  });
224
225
  }, [
225
- Ho,
226
- Vo,
227
- Bo
226
+ Jo,
227
+ qo,
228
+ Ko
228
229
  ]), O(() => () => {
229
- Ho.abandon();
230
- }, [Ho]);
231
- let Jo = k(() => R.filter((e) => !e.requiresAdmin || Bo), [R, Bo]), Yo = fe(Jo), Xo = go && Yo, Zo = A(Yo);
230
+ Jo.abandon();
231
+ }, [Jo]);
232
+ let es = k(() => R.filter((e) => !e.requiresAdmin || Ko), [R, Ko]), ts = fe(es), ns = yo && ts, rs = A(ts);
232
233
  O(() => {
233
- Zo.current = Yo;
234
- }, [Yo]);
235
- let Qo = A(null), $o = A(!1), [es, ts] = j(!1), ns = gn(R), [rs, is] = j(null), [as, os] = j(() => Sr.openFor());
234
+ rs.current = ts;
235
+ }, [ts]);
236
+ let is = A(null), as = A(!1), [os, ss] = j(!1), cs = yn(R), [ls, us] = j(null), [ds, fs] = j(() => Tr.openFor());
236
237
  O(() => {
237
- Sr.setOpenFor(as);
238
- }, [as]);
239
- let ss = as !== null && as === H, q = He(), cs = Ue(), J = q.open && cs !== null, ls = q.close, us = A(J);
240
- ia(() => {
241
- us.current = J;
238
+ Tr.setOpenFor(ds);
239
+ }, [ds]);
240
+ let ps = ds !== null && ds === H, q = Ge(), ms = Ke(), J = q.open && ms !== null, hs = q.close, gs = A(J);
241
+ sa(() => {
242
+ gs.current = J;
242
243
  }, [J]);
243
- let ds = D((e) => {
244
- e && us.current || e && I || os(e ? w.getState().activeConversationId : null);
244
+ let _s = D((e) => {
245
+ e && gs.current || e && I || fs(e ? w.getState().activeConversationId : null);
245
246
  }, [I]);
246
247
  O(() => {
247
- os((e) => e !== null && e !== H ? null : e);
248
+ fs((e) => e !== null && e !== H ? null : e);
248
249
  }, [H]);
249
- let fs = A(void 0), [ps, ms] = j(!1), [hs, gs] = j(!1), _s = D((e) => {
250
- fs.current = e, ms(mr(e));
251
- }, []), vs = A(null), ys = A(!1), bs = D(() => {
250
+ let vs = A(void 0), [ys, bs] = j(!1), [xs, Ss] = j(!1), Cs = D((e) => {
251
+ vs.current = e, bs(_r(e));
252
+ }, []), ws = A(null), Ts = A(!1), Es = D(() => {
252
253
  let e = w.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
253
254
  return !t || !n ? null : {
254
255
  id: t,
255
- reusableDraft: Ui(n, qi()),
256
+ reusableDraft: Ki(n, Xi()),
256
257
  liveProposals: K.liveFor(t).count,
257
- turnInFlight: On(e.processingByConversationId[t]?.status)
258
+ turnInFlight: jn(e.processingByConversationId[t]?.status)
258
259
  };
259
- }, [K]), xs = A({}), Ss = A(on(Mr())), Cs = A(new Jt()), ws = A(/* @__PURE__ */ new Set()), Ts = k(() => R.find((e) => e.id === U), [R, U]), Es = w((e) => {
260
+ }, [K]), Ds = A({}), Os = A(ln(Fr())), ks = A(new Zt()), As = A(/* @__PURE__ */ new Set()), js = k(() => R.find((e) => e.id === U), [R, U]), Ms = w((e) => {
260
261
  let t = e.sandboxesByMode[U]?.sandboxId;
261
262
  return t ? e.sandboxWriteCapabilities[t] : void 0;
262
- }), Ds = Ts !== void 0 && g({
263
+ }), Ns = js !== void 0 && g({
263
264
  mode: U,
264
265
  productWriteApproval: z,
265
- capabilities: Es
266
- }), Os = U === "assistant" || Ts !== void 0 && !Ts.writeCapable && !gt(U) || Ds;
266
+ capabilities: Ms
267
+ }), Ps = U === "assistant" || js !== void 0 && !js.writeCapable && !yt(U) || Ns;
267
268
  O(() => {
268
- let e = R.find((e) => e.id === "assistant" || !e.requiresAdmin || Bo)?.id ?? R[0]?.id ?? "assistant";
269
- U !== "assistant" && Ts?.writeCapable && !Jn(mo, U) ? eo(e) : Vo || (!Ts || Ts.requiresAdmin && !Bo) && U !== e && eo(e);
269
+ let e = R.find((e) => e.id === "assistant" || !e.requiresAdmin || Ko)?.id ?? R[0]?.id ?? "assistant";
270
+ U !== "assistant" && js?.writeCapable && !Zn(_o, U) ? ro(e) : qo || (!js || js.requiresAdmin && !Ko) && U !== e && ro(e);
270
271
  }, [
271
272
  U,
272
- Ts,
273
- Bo,
274
- Vo,
275
- eo,
276
- mo,
273
+ js,
274
+ Ko,
275
+ qo,
276
+ ro,
277
+ _o,
277
278
  R
278
279
  ]);
279
- let ks = D((e, t, n, r) => {
280
- so(e, n, t, null, r);
281
- }, [so]), As = D(async (e, t, n, r, i, a = null) => {
280
+ let Fs = D((e, t, n, r) => {
281
+ uo(e, n, t, null, r);
282
+ }, [uo]), Is = D(async (e, t, n, r, i, a = null) => {
282
283
  let o = (e, t) => {
283
- r && ks(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
284
+ r && Fs(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
284
285
  }, s = (e) => {
285
286
  r && E(r.assistantMessageId, e);
286
287
  }, c = () => {
287
288
  s("bootAdopted"), a?.beginBoot();
288
289
  }, l = () => a !== null && (a.signal.aborted || T() !== t), u = () => {
289
- if (l()) throw new Yt("cancelled");
290
+ if (l()) throw new Qt("cancelled");
290
291
  }, d = w.getState().sandboxesByMode[e]?.sandboxId ?? null, f = !1, p = !1, ee = !1, m = !1, h = !1, g = async (r) => {
291
- if (i && !Cs.current.has(r) && Ss.current.isFresh(r)) return f = !0, !0;
292
+ if (i && !ks.current.has(r) && Os.current.isFresh(r)) return f = !0, !0;
292
293
  ee = !0;
293
294
  let o = !1;
294
295
  try {
295
- await St(r, t, n, 3e5), await xt(r, t, e, n, 9e4, () => {
296
+ await Tt(r, t, n, 3e5), await wt(r, t, e, n, 9e4, () => {
296
297
  o = !0, c();
297
298
  });
298
299
  } catch {
299
- if (l()) throw new Yt("cancelled");
300
- return Ss.current.invalidate(r), Cs.current.add(r), a?.dead.push(r), h = !0, !1;
300
+ if (l()) throw new Qt("cancelled");
301
+ return Os.current.invalidate(r), ks.current.add(r), a?.dead.push(r), h = !0, !1;
301
302
  }
302
- return u(), Ss.current.markVerified(r), o && (m = !0), !0;
303
+ return u(), Os.current.markVerified(r), o && (m = !0), !0;
303
304
  };
304
- if (d && (fo(e, d, "provisioning"), o("provisioning", "reusingEnvironment"), await g(d) || (fo(e, null, "provisioning"), d = null)), !d) {
305
+ if (d && (ho(e, d, "provisioning"), o("provisioning", "reusingEnvironment"), await g(d) || (ho(e, null, "provisioning"), d = null)), !d) {
305
306
  o("provisioning", "lookingForEnvironment");
306
- let r = await dt(t, L, e, Mn(), n, Cs.current, z);
307
+ let r = await mt(t, L, e, Fn(), n, ks.current, z);
307
308
  u();
308
309
  let i = r?.id ?? null;
309
310
  if (i) {
310
- fo(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
311
+ ho(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
311
312
  let t = r?.status === "PROVISIONING" || r?.status === "PENDING";
312
- t && c(), await g(i) ? (d = i, t && (m = !0)) : fo(e, null, "provisioning");
313
+ t && c(), await g(i) ? (d = i, t && (m = !0)) : ho(e, null, "provisioning");
313
314
  }
314
315
  }
315
316
  if (!d) {
316
- if (a && !a.mayCreate) throw new Yt("no-create");
317
- if (s("provisionStarted"), e === "api-calls" && !za()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
318
- o("provisioning", "startingEnvironment"), fo(e, null, "provisioning");
319
- let r = a ? [] : await yt(t, L, e, Mn(), n, Cs.current, z);
317
+ if (a && !a.mayCreate) throw new Qt("no-create");
318
+ if (s("provisionStarted"), e === "api-calls" && !Ha()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
319
+ o("provisioning", "startingEnvironment"), ho(e, null, "provisioning");
320
+ let r = a ? [] : await St(t, L, e, Fn(), n, ks.current, z);
320
321
  if (r.length > 0) {
321
322
  let e = new Set(r);
322
- for (let e of r) Ss.current.invalidate(e), Cs.current.add(e);
323
+ for (let e of r) Os.current.invalidate(e), ks.current.add(e);
323
324
  let t = w.getState().sandboxesByMode;
324
- for (let [n, r] of Object.entries(t)) y(n) && r?.sandboxId && e.has(r.sandboxId) && po(n);
325
+ for (let [n, r] of Object.entries(t)) y(n) && r?.sandboxId && e.has(r.sandboxId) && go(n);
325
326
  }
326
327
  s("createRequested");
327
328
  let i = a?.beginCreate();
328
329
  try {
329
- d = await lt(L, e, t, Mn(), la, n, { writeApproval: z });
330
+ d = await ft(L, e, t, Fn(), fa, n, { writeApproval: z });
330
331
  } finally {
331
332
  i?.();
332
333
  }
333
- p = !0, u(), fo(e, d, "provisioning"), await St(d, t, n, 3e5), u(), s("sandboxRunning"), await xt(d, t, e, n, 9e4), u(), s("serviceReady"), Ss.current.markVerified(d);
334
+ p = !0, u(), ho(e, d, "provisioning"), await Tt(d, t, n, 3e5), u(), s("sandboxRunning"), await wt(d, t, e, n, 9e4), u(), s("serviceReady"), Os.current.markVerified(d);
334
335
  }
335
- return fo(e, d, "running"), {
336
+ return ho(e, d, "running"), {
336
337
  sandboxId: d,
337
338
  sandboxIsNew: p,
338
339
  sandboxProbed: ee,
@@ -341,64 +342,64 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
341
342
  trustedFromCache: f
342
343
  };
343
344
  }, [
344
- po,
345
- za,
345
+ go,
346
+ Ha,
346
347
  L,
347
348
  z,
348
- fo,
349
- ks
350
- ]), js = D(async function e(t, n, r, i, a, o = {}) {
351
- let s = await tn(i, r, (e) => ks(t, n, "provisioning", e), () => E(n, "prewarmJoined"));
352
- for (let e of s.dead) Ss.current.invalidate(e), Cs.current.add(e);
353
- s.verified && !Cs.current.has(s.verified) && Ss.current.markVerified(s.verified), s.joined && cn(n, { prewarm: s.joined });
354
- let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await As(r, i, a, {
349
+ ho,
350
+ Fs
351
+ ]), Ls = D(async function e(t, n, r, i, a, o = {}) {
352
+ let s = await an(i, r, (e) => Fs(t, n, "provisioning", e), () => E(n, "prewarmJoined"));
353
+ for (let e of s.dead) Os.current.invalidate(e), ks.current.add(e);
354
+ s.verified && !ks.current.has(s.verified) && Os.current.markVerified(s.verified), s.joined && dn(n, { prewarm: s.joined });
355
+ let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await Is(r, i, a, {
355
356
  conversationId: t,
356
357
  assistantMessageId: n
357
- }, o.trustCache !== !1), ee = Zt(i, r, c);
358
- !s.waited && ee && cn(n, { prewarm: "hit" });
358
+ }, o.trustCache !== !1), ee = en(i, r, c);
359
+ !s.waited && ee && dn(n, { prewarm: "hit" });
359
360
  let m = w.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, h = !1, g = null, _ = null;
360
- if (m && o.verifySession !== !0 && w.getState().sandboxWriteCapabilities[c]?.promptRejectsUnknownSession === !0 && w.getState().conversations.find((e) => e.id === t)?.mode === r && (_ = zt(c, m)), m && _ === null) {
361
- let e = Rt(c, m, (e, t) => pt(e, i, t, r, a, { limit: 50 }));
361
+ if (m && o.verifySession !== !0 && w.getState().sandboxWriteCapabilities[c]?.promptRejectsUnknownSession === !0 && w.getState().conversations.find((e) => e.id === t)?.mode === r && (_ = Ht(c, m)), m && _ === null) {
362
+ let e = Vt(c, m, (e, t) => gt(e, i, t, r, a, { limit: 50 }));
362
363
  try {
363
- let t = await mt(c, i, m, r, a);
364
+ let t = await _t(c, i, m, r, a);
364
365
  if (t.mode !== r) throw Error(`Session mode mismatch: expected ${r}, received ${t.mode}`);
365
366
  g = e;
366
367
  } catch {
367
- uo(t), m = null;
368
+ mo(t), m = null;
368
369
  }
369
370
  }
370
371
  let te = !1;
371
372
  if (!m) {
372
- let e = Xt(Qt({
373
+ let e = $t(tn({
373
374
  workspaceId: i,
374
375
  mode: r,
375
376
  sandboxId: c,
376
377
  userId: B
377
378
  }), Date.now());
378
379
  if (e) {
379
- "pending" in e && ks(t, n, "connecting", "preparingSession");
380
+ "pending" in e && Fs(t, n, "connecting", "preparingSession");
380
381
  let o = "sessionId" in e ? e.sessionId : await e.pending;
381
- if (o && !Cs.current.has(c)) try {
382
- (await mt(c, i, o, r, a)).mode === r && (m = o, te = !0, lo(t, m), h = !0);
382
+ if (o && !ks.current.has(c)) try {
383
+ (await _t(c, i, o, r, a)).mode === r && (m = o, te = !0, po(t, m), h = !0);
383
384
  } catch {}
384
385
  }
385
386
  }
386
387
  if (!m) {
387
- ks(t, n, "connecting", "preparingSession");
388
+ Fs(t, n, "connecting", "preparingSession");
388
389
  let s;
389
390
  try {
390
- s = await ut(c, i, r, a);
391
+ s = await pt(c, i, r, a);
391
392
  } catch (s) {
392
393
  if (p) {
393
- Ss.current.invalidate(c);
394
- let l = Pr(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
395
- if (l === "check-network" && (l = await Nr(() => dt(i, L, r, Mn(), a, Cs.current, z))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
396
- p || cn(n, { cacheProofFailed: !0 }), l === "replace" && (Cs.current.add(c), uo(t), po(r), K.retireSandbox(c));
394
+ Os.current.invalidate(c);
395
+ let l = Lr(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
396
+ if (l === "check-network" && (l = await Ir(() => mt(i, L, r, Fn(), a, ks.current, z))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
397
+ p || dn(n, { cacheProofFailed: !0 }), l === "replace" && (ks.current.add(c), mo(t), go(r), K.retireSandbox(c));
397
398
  let s = await e(t, n, r, i, a, {
398
399
  ...o,
399
400
  trustCache: !1
400
401
  });
401
- return p && (s.deadSandboxProbe || s.sandboxId !== c) && cn(n, { cacheProofFailed: !0 }), {
402
+ return p && (s.deadSandboxProbe || s.sandboxId !== c) && dn(n, { cacheProofFailed: !0 }), {
402
403
  ...s,
403
404
  sandboxProbed: s.sandboxProbed || u,
404
405
  sandboxAdopted: s.sandboxAdopted || d,
@@ -408,7 +409,7 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
408
409
  }
409
410
  throw s;
410
411
  }
411
- m = s.sessionId, lo(t, m), h = !0;
412
+ m = s.sessionId, po(t, m), h = !0;
412
413
  }
413
414
  return {
414
415
  sandboxId: c,
@@ -423,67 +424,67 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
423
424
  knownFloor: _
424
425
  };
425
426
  }, [
426
- As,
427
- uo,
428
- po,
427
+ Is,
428
+ mo,
429
+ go,
429
430
  L,
430
431
  z,
431
- lo,
432
- ks,
432
+ po,
433
+ Fs,
433
434
  B,
434
435
  K
435
- ]), Ms = D((e, t = !1) => {
436
+ ]), Rs = D((e, t = !1) => {
436
437
  let n = T();
437
438
  if (!n) return;
438
- let r = w.getState(), i = Date.now(), a = en({
439
+ let r = w.getState(), i = Date.now(), a = rn({
439
440
  autoRouting: r.autoRouting,
440
- autoOffered: Zo.current,
441
+ autoOffered: rs.current,
441
442
  active: !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0,
442
443
  selectedMode: r.mode,
443
444
  autoReadMode: b,
444
- modes: Uo.current,
445
+ modes: Yo.current,
445
446
  acknowledgedWriteModes: r.acknowledgedWriteModes,
446
- adminAccess: Ho.read(),
447
+ adminAccess: Jo.read(),
447
448
  dictated: e,
448
- voiceProposalBound: (e) => Ra(e),
449
- turnInFlight: Object.values(r.processingByConversationId).some((e) => On(e?.status)),
450
- ...an(n),
449
+ voiceProposalBound: (e) => Va(e),
450
+ turnInFlight: Object.values(r.processingByConversationId).some((e) => jn(e?.status)),
451
+ ...cn(n),
451
452
  now: i
452
453
  });
453
454
  if (!a) return;
454
- let o = rn(n, a, i), s = {
455
- accessToken: za(),
456
- workspaceToken: Ba(),
455
+ let o = sn(n, a, i), s = {
456
+ accessToken: Ha(),
457
+ workspaceToken: Ua(),
457
458
  userId: B,
458
- organizationId: Vt()
459
+ organizationId: Wt()
459
460
  };
460
- As(a.mode, n, s, null, !0, o).then((e) => {
461
+ Is(a.mode, n, s, null, !0, o).then((e) => {
461
462
  if (o.finish({
462
463
  ok: !0,
463
464
  sandboxId: e.sandboxId,
464
465
  didWork: !e.trustedFromCache && (e.sandboxIsNew || e.sandboxProbed || e.sandboxAdopted),
465
466
  booted: e.sandboxIsNew || e.sandboxAdopted,
466
467
  dead: o.dead
467
- }), o.signal.aborted || T() !== n || Cs.current.has(e.sandboxId)) return;
468
- let r = w.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = qi();
469
- $t({
468
+ }), o.signal.aborted || T() !== n || ks.current.has(e.sandboxId)) return;
469
+ let r = w.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = Xi();
470
+ nn({
470
471
  active: i ? {
471
472
  mode: i.mode,
472
473
  backendSessionId: i.backendSessionId,
473
- continuable: !Hi(i) && !Vi(i, c),
474
- hasHistory: Bi(i)
474
+ continuable: !Gi(i) && !Wi(i, c),
475
+ hasHistory: Ui(i)
475
476
  } : void 0,
476
477
  mode: a.mode
477
- }) && nn(Qt({
478
+ }) && on(tn({
478
479
  workspaceId: n,
479
480
  mode: a.mode,
480
481
  sandboxId: e.sandboxId,
481
482
  userId: B
482
- }), () => ut(e.sandboxId, n, a.mode, s).then((e) => e.sessionId), Date.now());
483
+ }), () => pt(e.sandboxId, n, a.mode, s).then((e) => e.sessionId), Date.now());
483
484
  }, (e) => {
484
- if (!(e instanceof Yt) && !o.signal.aborted && T() === n) {
485
+ if (!(e instanceof Qt) && !o.signal.aborted && T() === n) {
485
486
  let e = w.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
486
- e && (Ss.current.invalidate(e), Cs.current.add(e), o.dead.push(e), po(a.mode));
487
+ e && (Os.current.invalidate(e), ks.current.add(e), o.dead.push(e), go(a.mode));
487
488
  }
488
489
  o.finish({
489
490
  ok: !1,
@@ -493,68 +494,68 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
493
494
  });
494
495
  });
495
496
  }, [
496
- As,
497
- Ho,
498
- po,
499
- za,
500
- Ba,
497
+ Is,
498
+ Jo,
499
+ go,
500
+ Ha,
501
+ Ua,
501
502
  B,
502
- Ra
503
- ]), Ns = A(!1), Ps = A(null), Fs = k(() => a(), []);
504
- O(() => () => Fs.cancel(), [Fs]);
505
- let Is = aa(jr, Er, Er)?.reference ?? null, [Ls, Rs] = j(0), zs = A(/* @__PURE__ */ new Set()), Bs = A(null), Vs = D(() => {
503
+ Va
504
+ ]), zs = A(!1), Bs = A(null), Vs = k(() => a(), []);
505
+ O(() => () => Vs.cancel(), [Vs]);
506
+ let Hs = ca(Pr, kr, kr)?.reference ?? null, [Us, Ws] = j(0), Gs = A(/* @__PURE__ */ new Set()), Ks = A(null), qs = D(() => {
506
507
  let e = w.getState(), t = e.activeConversationId;
507
508
  if (!t) return null;
508
- let n = e.processingByConversationId[t], r = On(n?.status) ? n?.messageId ?? null : null;
509
- if (!An({
509
+ let n = e.processingByConversationId[t], r = jn(n?.status) ? n?.messageId ?? null : null;
510
+ if (!Nn({
510
511
  interruptedTurnId: r,
511
512
  activeTurnId: r,
512
- alreadyRequested: r ? zs.current.has(r) : !1
513
+ alreadyRequested: r ? Gs.current.has(r) : !1
513
514
  }).send || !r) return null;
514
- zs.current.add(r);
515
- let i = ot(e), a = T(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
516
- return i && a && o && st(i.sandboxId, a, o, i.mode, {
517
- accessToken: za(),
518
- workspaceToken: Ba(),
515
+ Gs.current.add(r);
516
+ let i = lt(e), a = T(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
517
+ return i && a && o && ut(i.sandboxId, a, o, i.mode, {
518
+ accessToken: Ha(),
519
+ workspaceToken: Ua(),
519
520
  userId: B,
520
- organizationId: Vt()
521
+ organizationId: Wt()
521
522
  }), r;
522
523
  }, [
523
524
  B,
524
- za,
525
- Ba
526
- ]), Hs = D(() => {
527
- let e = Vs();
528
- return e && (Mt(e), kt.abort(e)), e;
529
- }, [Vs]), Us = D(() => {
525
+ Ha,
526
+ Ua
527
+ ]), Js = D(() => {
528
+ let e = qs();
529
+ return e && (Ft(e), Mt.abort(e)), e;
530
+ }, [qs]), Ys = D(() => {
530
531
  let e = w.getState().activeConversationId;
531
- Hs(), e && K.declineForReply(e, "corrected", "spoken");
532
- }, [Hs, K]), Ws = D(async (e) => {
533
- let t = w.getState(), n = ot(t), r = T(), i = t.activeConversationId;
532
+ Js(), e && K.declineForReply(e, "corrected", "spoken");
533
+ }, [Js, K]), Xs = D(async (e) => {
534
+ let t = w.getState(), n = lt(t), r = T(), i = t.activeConversationId;
534
535
  if (!n || !r || !i || oe(t.sandboxWriteCapabilities[n.sandboxId])) return;
535
- let a = t.conversations.find((e) => e.id === i), o = a ? kr(sr(a.messages), {
536
+ let a = t.conversations.find((e) => e.id === i), o = a ? Mr(ur(a.messages), {
536
537
  sessionId: a.backendSessionId,
537
538
  sandboxId: n.sandboxId,
538
539
  nowMs: Date.now()
539
540
  }) : null;
540
541
  if (o?.reference !== e) {
541
- Rs((e) => e + 1);
542
+ Ws((e) => e + 1);
542
543
  return;
543
544
  }
544
545
  let s = {
545
546
  conversationId: i,
546
547
  reference: e
547
548
  };
548
- if (!wr(s)) return;
549
+ if (!Dr(s)) return;
549
550
  try {
550
- await ct(n.sandboxId, r, e, n.mode, {
551
- accessToken: za(),
552
- workspaceToken: Ba(),
551
+ await dt(n.sandboxId, r, e, n.mode, {
552
+ accessToken: Ha(),
553
+ workspaceToken: Ua(),
553
554
  userId: B,
554
- organizationId: Vt()
555
+ organizationId: Wt()
555
556
  });
556
557
  } catch (e) {
557
- Tr(s), W(i, {
558
+ Or(s), W(i, {
558
559
  id: N(),
559
560
  role: "system",
560
561
  content: e instanceof Error ? e.message : "The change could not be approved.",
@@ -562,70 +563,70 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
562
563
  });
563
564
  return;
564
565
  }
565
- Tr(s), oo(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
566
+ Or(s), lo(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
566
567
  let c = w.getState(), l = c.conversations.find((e) => e.id === i);
567
- c.activeConversationId === i && l && c.mode === n.mode && l.backendSessionId === a?.backendSessionId && ot(c)?.sandboxId === n.sandboxId && !On(c.processingByConversationId[i]?.status) && Or(sr(l.messages)) === o.messageId && Yc.current(P("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
568
+ c.activeConversationId === i && l && c.mode === n.mode && l.backendSessionId === a?.backendSessionId && lt(c)?.sandboxId === n.sandboxId && !jn(c.processingByConversationId[i]?.status) && jr(ur(l.messages)) === o.messageId && tl.current(P("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
568
569
  approvalFollowUp: { approvedReplyId: o.messageId },
569
570
  targetConversationId: i
570
571
  });
571
572
  }, [
572
573
  B,
573
574
  W,
574
- oo,
575
+ lo,
575
576
  P
576
- ]), Gs = $i(), { speakFinishedReply: Ks, speakingMessageId: qs, stop: Js } = Zi(), Ys = A(null), Xs = D((e, t) => {
577
- let n = Ys.current;
577
+ ]), Zs = na(), { speakFinishedReply: Qs, speakingMessageId: $s, stop: ec } = ea(), tc = A(null), nc = D((e, t) => {
578
+ let n = tc.current;
578
579
  n?.token === e && n.exchange === null && (n.exchange = t);
579
- }, []), Zs = D((e) => {
580
- let t = Ys.current;
580
+ }, []), rc = D((e) => {
581
+ let t = tc.current;
581
582
  e !== void 0 && t?.token === e && (t.handled = !0);
582
- }, []), Qs = D((e, t) => {
583
- Xs(e, t), us.current && At(t);
584
- }, [Xs]), $s = Xi(), { items: ec, permissionsSettled: tc, simulating: nc } = ea(), Y = A({
585
- theme: Gs,
586
- navigate: $s,
587
- navItems: ec,
588
- options: La ?? {},
589
- navPermissionsSettled: tc,
590
- navSimulating: nc
583
+ }, []), ic = D((e, t) => {
584
+ nc(e, t), gs.current && Nt(t);
585
+ }, [nc]), ac = $i(), { items: oc, permissionsSettled: sc, simulating: cc } = ra(), Y = A({
586
+ theme: Zs,
587
+ navigate: ac,
588
+ navItems: oc,
589
+ options: Ba ?? {},
590
+ navPermissionsSettled: sc,
591
+ navSimulating: cc
591
592
  });
592
593
  O(() => {
593
594
  Y.current = {
594
- theme: Gs,
595
- navigate: $s,
596
- navItems: ec,
597
- options: La ?? {},
598
- navPermissionsSettled: tc,
599
- navSimulating: nc
595
+ theme: Zs,
596
+ navigate: ac,
597
+ navItems: oc,
598
+ options: Ba ?? {},
599
+ navPermissionsSettled: sc,
600
+ navSimulating: cc
600
601
  };
601
602
  }, [
602
- Gs,
603
- $s,
604
- ec,
605
- La,
606
- tc,
607
- nc
603
+ Zs,
604
+ ac,
605
+ oc,
606
+ Ba,
607
+ sc,
608
+ cc
608
609
  ]);
609
610
  let X = A(!0);
610
611
  O(() => (X.current = !0, () => {
611
612
  X.current = !1;
612
613
  }), []);
613
- let rc = A({
614
+ let lc = A({
614
615
  tr: P,
615
616
  locale: V
616
- }), ic = A(null), [ac, oc] = j(null), sc = A(null), cc = D((e) => {
617
- sc.current !== null && (window.clearTimeout(sc.current), sc.current = null);
618
- let t = ic.current;
619
- t && (ic.current = null, window.clearTimeout(t.deadline), X.current && oc(null), e && X.current && (sc.current = window.setTimeout(() => {
620
- if (sc.current = null, !X.current) return;
617
+ }), uc = A(null), [dc, fc] = j(null), pc = A(null), mc = D((e) => {
618
+ pc.current !== null && (window.clearTimeout(pc.current), pc.current = null);
619
+ let t = uc.current;
620
+ t && (uc.current = null, window.clearTimeout(t.deadline), X.current && fc(null), e && X.current && (pc.current = window.setTimeout(() => {
621
+ if (pc.current = null, !X.current) return;
621
622
  let e = w.getState();
622
623
  if (e.activeConversationId !== t.conversationId) return;
623
624
  let n = e.conversations.find((e) => e.id === t.conversationId)?.messages.find((e) => e.id === t.messageId);
624
625
  if (!n) return;
625
- let r = rc.current, i = Qn(n, null, r.tr);
626
+ let r = lc.current, i = tr(n, null, r.tr);
626
627
  if (i.kind !== "output") return;
627
- let a = ii(n, r.tr);
628
- kt.publish(n.id, {
628
+ let a = si(n, r.tr);
629
+ Mt.publish(n.id, {
629
630
  conversationId: t.conversationId,
630
631
  channel: n.metadata?.voice === !0 ? "voice" : "chat",
631
632
  voiceSessionId: n.metadata?.voiceSessionId,
@@ -634,44 +635,44 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
634
635
  final: !0
635
636
  });
636
637
  }, 0)));
637
- }, []), lc = D(() => cc(!0), [cc]);
638
+ }, []), hc = D(() => mc(!0), [mc]);
638
639
  O(() => {
639
- rc.current = {
640
+ lc.current = {
640
641
  tr: P,
641
642
  locale: V
642
643
  };
643
- let e = ic.current;
644
+ let e = uc.current;
644
645
  if (!e) return;
645
- let t = ai({
646
+ let t = ci({
646
647
  wanted: e.wanted,
647
648
  locale: V,
648
- isLoading: Va(e.wanted),
649
- translatedNow: ni(P, e.reply).translated
649
+ isLoading: Wa(e.wanted),
650
+ translatedNow: ai(P, e.reply).translated
650
651
  });
651
- if (t === "write") lc();
652
+ if (t === "write") hc();
652
653
  else if (t === "grace") {
653
- let e = window.setTimeout(lc, 400);
654
+ let e = window.setTimeout(hc, 400);
654
655
  return () => window.clearTimeout(e);
655
656
  }
656
657
  }, [
657
658
  P,
658
659
  V,
659
- Va,
660
- ac,
661
- lc
662
- ]), O(() => () => cc(!1), [cc]);
663
- let uc = A(null), [dc, fc] = j(!1), [pc, mc] = j(null), [Z] = j(() => new Ci()), [hc, gc] = j(0), _c = D(() => gc((e) => e + 1), []), vc = D(() => {
660
+ Wa,
661
+ dc,
662
+ hc
663
+ ]), O(() => () => mc(!1), [mc]);
664
+ let gc = A(null), [_c, vc] = j(!1), [yc, bc] = j(null), [Z] = j(() => new Ei()), [xc, Sc] = j(0), Cc = D(() => Sc((e) => e + 1), []), wc = D(() => {
664
665
  let e = Y.current;
665
666
  return {
666
- destinations: zr(e.navItems),
667
+ destinations: Hr(e.navItems),
667
668
  permissionsSettled: e.navPermissionsSettled,
668
669
  simulating: e.navSimulating
669
670
  };
670
- }, []), yc = A(B);
671
+ }, []), Tc = A(B);
671
672
  O(() => {
672
- yc.current = B;
673
+ Tc.current = B;
673
674
  }, [B]);
674
- let bc = D((e, t) => {
675
+ let Ec = D((e, t) => {
675
676
  let n = Z.replyIdOf(e), r = n ? Z.turnFor(n) : void 0, i = Z.offer(e), a = {
676
677
  ok: !1,
677
678
  reason: "gone",
@@ -683,22 +684,22 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
683
684
  let o = r.conversationId, s = w.getState().conversations.find((e) => e.id === o);
684
685
  if (!s) return a;
685
686
  let c = s.messages.find((e) => e.id === n), l = c?.metadata?.voice === !0 ? c.metadata.voiceSessionId : void 0, u = Z.liveOffersFor(n, {
686
- registry: vc(),
687
- actorId: yc.current,
687
+ registry: wc(),
688
+ actorId: Tc.current,
688
689
  conversationId: o,
689
690
  perfNow: performance.now()
690
691
  }).find((t) => t.offer.offerId === e);
691
692
  if (!u) {
692
- let e = Ei(i, performance.now());
693
+ let e = ki(i, performance.now());
693
694
  return {
694
695
  ok: !1,
695
696
  reason: e ? "unavailable" : "expired",
696
- copy: e ? Xr(P, t || null) : Jr(P),
697
+ copy: e ? $r(P, t || null) : Zr(P),
697
698
  conversationId: o,
698
699
  voiceSessionId: l
699
700
  };
700
701
  }
701
- return Z.markUsed(e) ? (_c(), {
702
+ return Z.markUsed(e) ? (Cc(), {
702
703
  ok: !0,
703
704
  target: u.target,
704
705
  conversationId: o,
@@ -706,10 +707,10 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
706
707
  }) : a;
707
708
  }, [
708
709
  Z,
709
- vc,
710
+ wc,
710
711
  P,
711
- _c
712
- ]), xc = D((e, t, n, r, i) => {
712
+ Cc
713
+ ]), Dc = D((e, t, n, r, i) => {
713
714
  let a = N();
714
715
  W(e, {
715
716
  id: a,
@@ -719,20 +720,20 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
719
720
  metadata: {
720
721
  lang: n.translated ? V : "en",
721
722
  ...i ? { localAction: i } : {},
722
- ...lr(t)
723
+ ...fr(t)
723
724
  }
724
- }), i && zi.recordCommittedEntries(e, [a], "NOTE", r);
725
- }, [W, V]), Sc = D((e, t) => (t.status === "kept" || t.status === "refused" && t.reason === "unsaved-changes") && Z.release(e), [Z]), Cc = A(null);
725
+ }), i && Hi.recordCommittedEntries(e, [a], "NOTE", r);
726
+ }, [W, V]), Oc = D((e, t) => (t.status === "kept" || t.status === "refused" && t.reason === "unsaved-changes") && Z.release(e), [Z]), kc = A(null);
726
727
  O(() => () => {
727
- Cc.current?.(), Cc.current = null;
728
+ kc.current?.(), kc.current = null;
728
729
  }, []);
729
- let wc = D((e) => {
730
- Cc.current?.(), Cc.current = X.current ? fi(document, e) : null;
731
- }, []), Tc = D((e, t, n, r = !1) => {
732
- if (uc.current !== null) return;
733
- let i = bc(e, n), a = T(), o = (e, t, n, r) => xc(e, t, n, a, r);
730
+ let Ac = D((e) => {
731
+ kc.current?.(), kc.current = X.current ? hi(document, e) : null;
732
+ }, []), jc = D((e, t, n, r = !1) => {
733
+ if (gc.current !== null) return;
734
+ let i = Ec(e, n), a = T(), o = (e, t, n, r) => Dc(e, t, n, a, r);
734
735
  if (!i.ok) {
735
- i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy), _c();
736
+ i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy), Cc();
736
737
  return;
737
738
  }
738
739
  let { target: s, conversationId: c, voiceSessionId: l } = i, u = {
@@ -740,7 +741,7 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
740
741
  offerId: e
741
742
  };
742
743
  if (r) {
743
- o(c, l, Kr(P, s.label, !0), Pi({
744
+ o(c, l, Yr(P, s.label, !0), Li({
744
745
  destinationId: s.id,
745
746
  path: s.path,
746
747
  alreadyHere: !0,
@@ -750,16 +751,16 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
750
751
  return;
751
752
  }
752
753
  let d = N();
753
- uc.current = d, fc(!0);
754
+ gc.current = d, vc(!0);
754
755
  let f = (t) => {
755
756
  try {
756
- if (Sc(e, t) && (_c(), t.status === "kept" && wc(e)), t.status === "kept" || !w.getState().conversations.some((e) => e.id === c)) return;
757
+ if (Oc(e, t) && (Cc(), t.status === "kept" && Ac(e)), t.status === "kept" || !w.getState().conversations.some((e) => e.id === c)) return;
757
758
  let n = t.status === "arrived" || t.status === "redirected" ? t.landedPath : null;
758
- o(c, l, qr(P, t, {
759
+ o(c, l, Xr(P, t, {
759
760
  page: s.label,
760
- landed: n === null ? null : Ii(zr(Y.current.navItems), n),
761
+ landed: n === null ? null : zi(Hr(Y.current.navItems), n),
761
762
  path: s.path
762
- }), Pi({
763
+ }), Li({
763
764
  destinationId: s.id,
764
765
  path: s.path,
765
766
  alreadyHere: !1,
@@ -768,10 +769,10 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
768
769
  offer: u
769
770
  }));
770
771
  } finally {
771
- uc.current === d && (uc.current = null, X.current && fc(!1));
772
+ gc.current === d && (gc.current = null, X.current && vc(!1));
772
773
  }
773
774
  };
774
- Ri(Y.current.navigate, s.path, {
775
+ Vi(Y.current.navigate, s.path, {
775
776
  readPath: () => window.location.pathname + window.location.search,
776
777
  now: () => Date.now(),
777
778
  schedule: (e, t) => {
@@ -782,20 +783,20 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
782
783
  surface: "offer"
783
784
  }).then(f, () => f({ status: "unconfirmed" }));
784
785
  }, [
785
- bc,
786
- xc,
786
+ Ec,
787
+ Dc,
787
788
  P,
788
- _c,
789
- Sc,
790
- wc
791
- ]), Ec = D((e, t) => Tc(e, "tap", t || null), [Tc]), Dc = D((e) => {
789
+ Cc,
790
+ Oc,
791
+ Ac
792
+ ]), Mc = D((e, t) => jc(e, "tap", t || null), [jc]), Nc = D((e) => {
792
793
  let { replyId: t, conversationId: n } = e, r = Z.turnFor(t);
793
794
  if (!r) return;
794
- let i = window.location.pathname + window.location.search, a = zr(Y.current.navItems), o = Oi({
795
+ let i = window.location.pathname + window.location.search, a = Hr(Y.current.navItems), o = ji({
795
796
  intent: e.intent,
796
797
  live: Z.liveOffersFor(t, {
797
- registry: vc(),
798
- actorId: yc.current,
798
+ registry: wc(),
799
+ actorId: Tc.current,
799
800
  conversationId: n,
800
801
  perfNow: performance.now()
801
802
  }),
@@ -807,50 +808,50 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
807
808
  location: i,
808
809
  conversationId: w.getState().activeConversationId,
809
810
  workspaceId: T(),
810
- actorId: yc.current ?? null
811
+ actorId: Tc.current ?? null
811
812
  },
812
813
  mounted: X.current,
813
814
  visible: document.visibilityState === "visible",
814
- unsavedChanges: ki(Y.current.options),
815
+ unsavedChanges: Mi(Y.current.options),
815
816
  alreadyThere: ({ target: e }) => {
816
817
  let t = a.find((t) => t.id === e.id);
817
- return t ? Ir(t, i, a) : !1;
818
+ return t ? zr(t, i, a) : !1;
818
819
  }
819
820
  });
820
821
  if (o.act === "navigate" || o.act === "already-here") {
821
- Tc(o.offer.offer.offerId, "resolve", o.offer.target.label, o.act === "already-here");
822
+ jc(o.offer.offer.offerId, "resolve", o.offer.target.label, o.act === "already-here");
822
823
  return;
823
824
  }
824
825
  let [s] = o.unsaved ?? [], [c] = Z.liveOffersFor(t, {
825
- registry: vc(),
826
- actorId: yc.current,
826
+ registry: wc(),
827
+ actorId: Tc.current,
827
828
  conversationId: n,
828
829
  perfNow: performance.now()
829
830
  });
830
- o.hold === "R5-unsaved" && s && c && xc(n, e.voiceSessionId, Yr(P, s.label, c.target.label), T());
831
+ o.hold === "R5-unsaved" && s && c && Dc(n, e.voiceSessionId, Qr(P, s.label, c.target.label), T());
831
832
  }, [
832
833
  Z,
833
- vc,
834
+ wc,
834
835
  K,
835
- Tc,
836
- xc,
836
+ jc,
837
+ Dc,
837
838
  P
838
- ]), Oc = D((e) => {
839
+ ]), Pc = D((e) => {
839
840
  let t = w.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
840
- return n ? Mi(ji, window.location.pathname, Li(n.messages, e)) : !1;
841
- }, []), kc = be(), Ac = ui(), jc = kc?.request ?? null, Mc = D((e, t, n = !1, r = !1) => {
842
- let { navItems: i, options: a, theme: o, navigate: s } = Y.current, c = zr(i), l = null, u = {
841
+ return n ? Fi(Pi, window.location.pathname, Bi(n.messages, e)) : !1;
842
+ }, []), Fc = Se(), Ic = pi(), Lc = Fc?.request ?? null, Rc = D((e, t, n = !1, r = !1) => {
843
+ let { navItems: i, options: a, theme: o, navigate: s } = Y.current, c = Hr(i), l = null, u = {
843
844
  ...a,
844
- locale: t === void 0 ? V : Ja.input.code,
845
+ locale: t === void 0 ? V : Za.input.code,
845
846
  uiLocale: V,
846
- inputLocale: Ja.input.code
847
+ inputLocale: Za.input.code
847
848
  };
848
- if (r || Rr(e, u)) {
849
- let e = w.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), r = n ? mi(n.messages, t, { lookThroughRefusedOffers: { ownsOffer: (e, t) => Z.offersFor(e.id).some((e) => e.offerId === t) } }) : null, o = n ? e.processingByConversationId[n.id] ?? null : null, s = o !== null && o.messageId === r?.id && On(o.status);
849
+ if (r || Vr(e, u)) {
850
+ let e = w.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), r = n ? _i(n.messages, t, { lookThroughRefusedOffers: { ownsOffer: (e, t) => Z.offersFor(e.id).some((e) => e.offerId === t) } }) : null, o = n ? e.processingByConversationId[n.id] ?? null : null, s = o !== null && o.messageId === r?.id && jn(o.status);
850
851
  if (n && r && !s) {
851
852
  let e = Z.liveOffersFor(r.id, {
852
- registry: vc(),
853
- actorId: yc.current,
853
+ registry: wc(),
854
+ actorId: Tc.current,
854
855
  conversationId: n.id,
855
856
  perfNow: performance.now()
856
857
  }).flatMap(({ offer: e, target: t }) => {
@@ -860,14 +861,14 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
860
861
  target: n
861
862
  }] : [];
862
863
  });
863
- l = pi({
864
+ l = gi({
864
865
  reply: r,
865
- text: tr(r, o, P),
866
+ text: ir(r, o, P),
866
867
  resolve: {
867
868
  destinations: c,
868
869
  entityRoutes: a.entityRoutes,
869
- visibleNavIds: _i(i),
870
- nounLabel: (e) => Wr(P, e)
870
+ visibleNavIds: bi(i),
871
+ nounLabel: (e) => qr(P, e)
871
872
  },
872
873
  offers: e
873
874
  });
@@ -877,18 +878,18 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
877
878
  destinations: c,
878
879
  sentenceOptions: u,
879
880
  context: {
880
- backRunnable: Oc(t),
881
+ backRunnable: Pc(t),
881
882
  navigation: l,
882
883
  skipRecords: n,
883
- controls: si(),
884
+ controls: ui(),
884
885
  executors: {
885
886
  theme: o !== null,
886
887
  navigation: s !== null,
887
- conversationDelete: jc !== null,
888
+ conversationDelete: Lc !== null,
888
889
  appControl: (e) => {
889
890
  try {
890
- let n = oi(e, { voiceLive: t !== void 0 || Hl.current });
891
- return n !== null && (n.kind !== "confirm" || Ac !== null);
891
+ let n = li(e, { voiceLive: t !== void 0 || Jl.current });
892
+ return n !== null && (n.kind !== "confirm" || Ic !== null);
892
893
  } catch {
893
894
  return !1;
894
895
  }
@@ -897,34 +898,34 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
897
898
  }
898
899
  };
899
900
  }, [
900
- Oc,
901
- Ja,
901
+ Pc,
902
+ Za,
902
903
  V,
903
904
  P,
904
905
  Z,
905
- vc,
906
- jc,
907
- Ac
908
- ]), Nc = D((e, t, n = !1) => {
909
- let { destinations: r, sentenceOptions: i, context: a } = Mc(e, t, n);
910
- return Lr(e, r, i, a);
911
- }, [Mc]), Pc = D((e) => {
912
- if (Ps.current = e, Ca?.(Te(e)), Fs.cancel(), !e.text.trim() && !e.hasAttachments) {
913
- Ns.current = !1;
906
+ wc,
907
+ Lc,
908
+ Ic
909
+ ]), zc = D((e, t, n = !1) => {
910
+ let { destinations: r, sentenceOptions: i, context: a } = Rc(e, t, n);
911
+ return Br(e, r, i, a);
912
+ }, [Rc]), Bc = D((e) => {
913
+ if (Bs.current = e, Ea?.(De(e)), Vs.cancel(), !e.text.trim() && !e.hasAttachments) {
914
+ zs.current = !1;
914
915
  return;
915
916
  }
916
- if (Ns.current) return;
917
+ if (zs.current) return;
917
918
  let t = () => {
918
- Ns.current = !0, Ms(!1);
919
+ zs.current = !0, Rs(!1);
919
920
  };
920
- e.hasAttachments || e.dictated ? t() : Fs.schedule(() => {
921
- if (!Ns.current) {
921
+ e.hasAttachments || e.dictated ? t() : Vs.schedule(() => {
922
+ if (!zs.current) {
922
923
  try {
923
- let { destinations: t, sentenceOptions: n, context: r } = Mc(e.text, void 0, !1, !0);
924
- if (Fr(e.text, t, n, r)) return;
924
+ let { destinations: t, sentenceOptions: n, context: r } = Rc(e.text, void 0, !1, !0);
925
+ if (Rr(e.text, t, n, r)) return;
925
926
  } catch {
926
- if (!pa) {
927
- pa = !0;
927
+ if (!ga) {
928
+ ga = !0;
928
929
  try {
929
930
  i.getLogger("assistant").warn("Draft command classification failed; using standard warm-up.");
930
931
  } catch {}
@@ -934,36 +935,36 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
934
935
  }
935
936
  });
936
937
  }, [
937
- Fs,
938
- Ca,
939
- Ms,
940
- Mc
938
+ Vs,
939
+ Ea,
940
+ Rs,
941
+ Rc
941
942
  ]);
942
943
  O(() => {
943
944
  let e = () => {
944
- Ps.current && Pc(Ps.current);
945
- }, t = ci(e), n = Ni(window, e), r = ji.subscribe(e);
945
+ Bs.current && Bc(Bs.current);
946
+ }, t = di(e), n = Ii(window, e), r = Pi.subscribe(e);
946
947
  return () => {
947
- t(), n(), r(), Fs.cancel();
948
+ t(), n(), r(), Vs.cancel();
948
949
  };
949
- }, [Fs, Pc]), O(() => {
950
- Ps.current && Pc(Ps.current);
950
+ }, [Vs, Bc]), O(() => {
951
+ Bs.current && Bc(Bs.current);
951
952
  }, [
952
- Pc,
953
- ec,
954
- La,
955
- tc,
956
- nc,
957
- Gs,
958
- $s,
953
+ Bc,
954
+ oc,
955
+ Ba,
956
+ sc,
957
+ cc,
958
+ Zs,
959
+ ac,
959
960
  U,
960
- hc,
961
+ xc,
961
962
  H,
962
963
  G?.messages,
963
- xo
964
+ wo
964
965
  ]);
965
- let Fc = D((e, t) => {
966
- let n = Nc(e, t);
966
+ let Vc = D((e, t) => {
967
+ let n = zc(e, t);
967
968
  if (!n) return !1;
968
969
  let { theme: r, navigate: i } = Y.current;
969
970
  switch (n.kind) {
@@ -975,14 +976,14 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
975
976
  case "link-not-openable":
976
977
  case "back": return i !== null;
977
978
  case "conversation-delete": return !1;
978
- case "app-control": return oi(n.request, { voiceLive: t !== void 0 || Hl.current }) !== null;
979
+ case "app-control": return li(n.request, { voiceLive: t !== void 0 || Jl.current }) !== null;
979
980
  case "open-record": return !1;
980
981
  }
981
- }, [Nc]), Ic = A(Fc);
982
+ }, [zc]), Hc = A(Vc);
982
983
  O(() => {
983
- Ic.current = Fc;
984
- }, [Fc]);
985
- let Lc = D((e, t) => {
984
+ Hc.current = Vc;
985
+ }, [Vc]);
986
+ let Uc = D((e, t) => {
986
987
  let n = {
987
988
  state: "none",
988
989
  accept: null
@@ -991,16 +992,16 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
991
992
  let o = w.getState(), s = o.conversations.find((t) => t.id === e);
992
993
  if (!s) return n;
993
994
  let c = o.processingByConversationId[s.id] ?? null, l = {
994
- registry: vc(),
995
- actorId: yc.current,
995
+ registry: wc(),
996
+ actorId: Tc.current,
996
997
  conversationId: s.id,
997
998
  perfNow: performance.now()
998
- }, { state: u, reply: d } = Si(Z, {
999
+ }, { state: u, reply: d } = Ti(Z, {
999
1000
  ...l,
1000
1001
  messages: s.messages,
1001
1002
  voiceSessionId: t,
1002
1003
  processing: c,
1003
- displayedText: (e) => tr(e, c, P),
1004
+ displayedText: (e) => ir(e, c, P),
1004
1005
  productWriteApproval: z,
1005
1006
  capabilitiesOf: (e) => w.getState().sandboxWriteCapabilities[e]
1006
1007
  });
@@ -1008,7 +1009,7 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1008
1009
  state: u,
1009
1010
  accept: null
1010
1011
  };
1011
- let [f] = Z.liveOffersFor(d.id, l), p = f ? zr(a).find((e) => e.id === f.target.id) : void 0;
1012
+ let [f] = Z.liveOffersFor(d.id, l), p = f ? Hr(a).find((e) => e.id === f.target.id) : void 0;
1012
1013
  return !f || !p ? n : {
1013
1014
  state: u,
1014
1015
  accept: {
@@ -1018,10 +1019,10 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1018
1019
  };
1019
1020
  }, [
1020
1021
  Z,
1021
- vc,
1022
+ wc,
1022
1023
  z,
1023
1024
  P
1024
- ]), Rc = D((e, t, n, r, i, a) => {
1025
+ ]), Wc = D((e, t, n, r, i, a) => {
1025
1026
  let o = P(n.key, n.fallback, r), s = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), c = {
1026
1027
  kind: "write-reply",
1027
1028
  line: n.key
@@ -1033,7 +1034,7 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1033
1034
  timestamp: l,
1034
1035
  metadata: {
1035
1036
  localAction: c,
1036
- ...lr(i)
1037
+ ...fr(i)
1037
1038
  }
1038
1039
  });
1039
1040
  let d = N();
@@ -1045,55 +1046,55 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1045
1046
  metadata: {
1046
1047
  lang: o === s ? "en" : V,
1047
1048
  localAction: c,
1048
- ...lr(i)
1049
+ ...fr(i)
1049
1050
  }
1050
- }), zi.recordCommittedEntries(e, [u, d], "LOCAL_COMMAND", T()), a !== void 0 && Qs(a, {
1051
+ }), Hi.recordCommittedEntries(e, [u, d], "LOCAL_COMMAND", T()), a !== void 0 && ic(a, {
1051
1052
  conversationId: e,
1052
1053
  questionId: u,
1053
1054
  replyId: d
1054
- }), Ks(e, d);
1055
+ }), Qs(e, d);
1055
1056
  }, [
1056
1057
  W,
1057
1058
  V,
1059
+ ic,
1058
1060
  Qs,
1059
- Ks,
1060
1061
  P
1061
- ]), zc = A(() => void 0), [Bc, Vc] = j(null);
1062
+ ]), Gc = A(() => void 0), [Kc, qc] = j(null);
1062
1063
  O(() => {
1063
- if (Bc === null) return;
1064
- let e = window.setTimeout(() => Vc(null), ha);
1064
+ if (Kc === null) return;
1065
+ let e = window.setTimeout(() => qc(null), va);
1065
1066
  return () => window.clearTimeout(e);
1066
- }, [Bc]);
1067
- let Hc = D(() => {
1067
+ }, [Kc]);
1068
+ let Jc = D(() => {
1068
1069
  let e = w.getState();
1069
- return ro(void 0, e.autoRouting && Zo.current ? b : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
1070
- }, [ro]), Uc = D((e) => {
1071
- if (!jc) return !1;
1072
- let t = e !== void 0, n = w.getState(), r = Yi({
1070
+ return oo(void 0, e.autoRouting && rs.current ? b : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
1071
+ }, [oo]), Yc = D((e) => {
1072
+ if (!Lc) return !1;
1073
+ let t = e !== void 0, n = w.getState(), r = Qi({
1073
1074
  spoken: t,
1074
- bound: fs.current,
1075
+ bound: vs.current,
1075
1076
  activeConversationId: n.activeConversationId,
1076
1077
  conversations: n.conversations,
1077
- historyOn: xe()
1078
+ historyOn: Ce()
1078
1079
  });
1079
- if (r && jc(r), t) {
1080
+ if (r && Lc(r), t) {
1080
1081
  let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? P("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : P("deleteConversation.nothing", "There is no conversation to delete.");
1081
- zc.current({
1082
+ Gc.current({
1082
1083
  id: `conversation-delete:${N()}`,
1083
1084
  text: t,
1084
1085
  lang: t === e ? "en" : V
1085
1086
  });
1086
- } else r || Vc(Date.now());
1087
+ } else r || qc(Date.now());
1087
1088
  return !0;
1088
1089
  }, [
1089
- jc,
1090
+ Lc,
1090
1091
  V,
1091
1092
  P
1092
- ]), Wc = D((e, t, n, r = !1, i) => {
1093
- if (e.kind === "conversation-delete") return Uc(n);
1093
+ ]), Xc = D((e, t, n, r = !1, i) => {
1094
+ if (e.kind === "conversation-delete") return Yc(n);
1094
1095
  let { theme: a, navigate: o } = Y.current, s = null, c = () => {
1095
- let e = (r ? null : s ?? w.getState().activeConversationId) ?? Hc();
1096
- return r && _s(e), e;
1096
+ let e = (r ? null : s ?? w.getState().activeConversationId) ?? Jc();
1097
+ return r && Cs(e), e;
1097
1098
  }, l = (e, r) => {
1098
1099
  let i = N();
1099
1100
  return W(e, {
@@ -1103,7 +1104,7 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1103
1104
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1104
1105
  metadata: {
1105
1106
  localAction: r,
1106
- ...lr(n)
1107
+ ...fr(n)
1107
1108
  }
1108
1109
  }), i;
1109
1110
  }, u = (e, t, r, a, o, s, c) => {
@@ -1116,35 +1117,35 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1116
1117
  metadata: {
1117
1118
  lang: r.translated ? V : "en",
1118
1119
  localAction: a,
1119
- ...lr(n)
1120
+ ...fr(n)
1120
1121
  }
1121
- }), zi.recordCommittedEntries(e, [t, l], "LOCAL_COMMAND", o), i !== void 0 && Qs(i, {
1122
+ }), Hi.recordCommittedEntries(e, [t, l], "LOCAL_COMMAND", o), i !== void 0 && ic(i, {
1122
1123
  conversationId: e,
1123
1124
  questionId: t,
1124
1125
  replyId: l
1125
- }), s && Ks(e, l), l;
1126
+ }), s && Qs(e, l), l;
1126
1127
  }, d = (e, t, n) => {
1127
1128
  let r = c(), i = l(r, t), a = u(r, i, e, t, T(), !0);
1128
1129
  return n?.(a), !0;
1129
1130
  }, f = (e) => {
1130
- let t = c(), n = T(), r = window.location.pathname, a = Pi({
1131
+ let t = c(), n = T(), r = window.location.pathname, a = Li({
1131
1132
  destinationId: e.destinationId,
1132
1133
  path: e.registryPath,
1133
1134
  alreadyHere: !1,
1134
1135
  via: e.via,
1135
1136
  offer: e.offer
1136
1137
  }), s = l(t, a), d = i === void 0 ? void 0 : N();
1137
- i !== void 0 && d !== void 0 && (Xs(i, {
1138
+ i !== void 0 && d !== void 0 && (nc(i, {
1138
1139
  conversationId: t,
1139
1140
  questionId: s,
1140
1141
  replyId: d
1141
- }), mc(d));
1142
+ }), bc(d));
1142
1143
  let f = N();
1143
- uc.current = f, fc(!0);
1144
+ gc.current = f, vc(!0);
1144
1145
  let p = (i) => {
1145
1146
  try {
1146
- if (e.offer && Sc(e.offer.offerId, i) && _c(), i.status === "kept" || !w.getState().conversations.some((e) => e.id === t)) return;
1147
- let a = zr(Y.current.navItems), o = i.status === "arrived" || i.status === "redirected" ? i.landedPath : null, c = Pi({
1147
+ if (e.offer && Oc(e.offer.offerId, i) && Cc(), i.status === "kept" || !w.getState().conversations.some((e) => e.id === t)) return;
1148
+ let a = Hr(Y.current.navItems), o = i.status === "arrived" || i.status === "redirected" ? i.landedPath : null, c = Li({
1148
1149
  destinationId: e.destinationId,
1149
1150
  path: e.registryPath,
1150
1151
  alreadyHere: !1,
@@ -1152,10 +1153,10 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1152
1153
  outcome: i,
1153
1154
  offer: e.offer
1154
1155
  });
1155
- oo(t, s, { localAction: c });
1156
- let l = e.via === "back" && i.status === "arrived" ? Vr(P, e.pageLabel()) : qr(P, i, {
1156
+ lo(t, s, { localAction: c });
1157
+ let l = e.via === "back" && i.status === "arrived" ? Wr(P, e.pageLabel()) : Xr(P, i, {
1157
1158
  page: e.pageLabel(),
1158
- landed: o === null ? null : Ii(a, o),
1159
+ landed: o === null ? null : zi(a, o),
1159
1160
  path: e.target
1160
1161
  }), f = u(t, s, l, c, n, X.current, d);
1161
1162
  i.status === "arrived" && e.onArrived?.({
@@ -1164,10 +1165,10 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1164
1165
  landedPath: i.landedPath
1165
1166
  });
1166
1167
  } finally {
1167
- uc.current === f && (uc.current = null, X.current && fc(!1)), d !== void 0 && X.current && mc((e) => e === d ? null : e);
1168
+ gc.current === f && (gc.current = null, X.current && vc(!1)), d !== void 0 && X.current && bc((e) => e === d ? null : e);
1168
1169
  }
1169
1170
  };
1170
- return Ri(o, e.target, {
1171
+ return Vi(o, e.target, {
1171
1172
  readPath: () => window.location.pathname + window.location.search,
1172
1173
  now: () => Date.now(),
1173
1174
  schedule: (e, t) => {
@@ -1175,7 +1176,7 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1175
1176
  },
1176
1177
  isShellLess: () => !X.current
1177
1178
  }).then(p, () => p({ status: "unconfirmed" })), !0;
1178
- }, p = ({ replyId: e, fromPath: t, landedPath: n }) => ji.push({
1179
+ }, p = ({ replyId: e, fromPath: t, landedPath: n }) => Pi.push({
1179
1180
  fromPath: t,
1180
1181
  toPath: n,
1181
1182
  replyMessageId: e,
@@ -1183,21 +1184,21 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1183
1184
  });
1184
1185
  if (e.kind === "theme") {
1185
1186
  if (!a) return !1;
1186
- let t = Br(e.request, {
1187
+ let t = Ur(e.request, {
1187
1188
  mode: a.mode,
1188
1189
  resolvedTheme: a.resolvedTheme
1189
1190
  });
1190
1191
  if (!t.alreadyApplied) try {
1191
1192
  a.setMode(t.mode);
1192
1193
  } catch {}
1193
- return d(ei(P, t, e.request.kind === "family"), {
1194
+ return d(ri(P, t, e.request.kind === "family"), {
1194
1195
  kind: "theme",
1195
1196
  mode: t.mode,
1196
1197
  alreadyApplied: t.alreadyApplied
1197
1198
  });
1198
1199
  }
1199
1200
  if (e.kind === "app-control") {
1200
- let t = oi(e.request, { voiceLive: n !== void 0 || Hl.current });
1201
+ let t = li(e.request, { voiceLive: n !== void 0 || Jl.current });
1201
1202
  if (!t) return !1;
1202
1203
  let r = (e) => ({
1203
1204
  kind: "app-control",
@@ -1205,34 +1206,34 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1205
1206
  outcome: e.outcome,
1206
1207
  ...e.reply.code === "language" ? { languageLabel: e.reply.label } : {}
1207
1208
  }), i = (t) => {
1208
- if (e.request.control === "language" && cc(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
1209
- let n = c(), i = r(t), a = l(n, i), o = u(n, a, ni((e, t) => t, t.reply), i, T(), !1);
1210
- return ic.current = {
1209
+ if (e.request.control === "language" && mc(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
1210
+ let n = c(), i = r(t), a = l(n, i), o = u(n, a, ai((e, t) => t, t.reply), i, T(), !1);
1211
+ return uc.current = {
1211
1212
  wanted: e.request.code,
1212
1213
  reply: t.reply,
1213
1214
  conversationId: n,
1214
1215
  messageId: o,
1215
- deadline: window.setTimeout(lc, ri)
1216
- }, oc(o), !0;
1216
+ deadline: window.setTimeout(hc, oi)
1217
+ }, fc(o), !0;
1217
1218
  }
1218
- return d(ni(P, t.reply), r(t));
1219
+ return d(ai(P, t.reply), r(t));
1219
1220
  };
1220
1221
  if (t.kind === "reply") return i(t.run);
1221
1222
  if (t.kind === "run") {
1222
1223
  let e = t.run();
1223
1224
  return t.silent && (e.outcome === "done" || e.outcome === "already") ? !0 : i(e);
1224
1225
  }
1225
- let a = Ac;
1226
+ let a = Ic;
1226
1227
  if (!a) return !1;
1227
1228
  let o = null;
1228
- return d(ni(P, t.ask.reply), r(t.ask), (e) => {
1229
+ return d(ai(P, t.ask.reply), r(t.ask), (e) => {
1229
1230
  o = w.getState().conversations.find((t) => t.messages.some((t) => t.id === e))?.id ?? null;
1230
1231
  }), a.request({
1231
1232
  prompt: t.prompt,
1232
1233
  onConfirm: () => {
1233
1234
  let e = t.confirmed(), i = o, a = i !== null && w.getState().conversations.some((e) => e.id === i);
1234
1235
  if (!i || !a) return;
1235
- let s = ni(P, e.reply);
1236
+ let s = ai(P, e.reply);
1236
1237
  W(i, {
1237
1238
  id: N(),
1238
1239
  role: "assistant",
@@ -1241,30 +1242,30 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1241
1242
  metadata: {
1242
1243
  lang: s.translated ? V : "en",
1243
1244
  localAction: r(e),
1244
- ...lr(n)
1245
+ ...fr(n)
1245
1246
  }
1246
1247
  });
1247
1248
  }
1248
1249
  }), !0;
1249
1250
  }
1250
1251
  if (!o) return !1;
1251
- if (e.kind === "choose-destination") return d(Hr(P, e.candidates[0]?.label ?? e.query, e.candidates), {
1252
+ if (e.kind === "choose-destination") return d(Gr(P, e.candidates[0]?.label ?? e.query, e.candidates), {
1252
1253
  kind: "choose-destination",
1253
1254
  candidateIds: e.candidates.map((e) => e.id)
1254
- }, (t) => hi(t, e.candidates));
1255
- if (e.kind === "choose-linked") return d(Ur(P, e.candidates), {
1255
+ }, (t) => vi(t, e.candidates));
1256
+ if (e.kind === "choose-linked") return d(Kr(P, e.candidates), {
1256
1257
  kind: "choose-destination",
1257
1258
  candidateIds: e.candidates.map((e) => e.id)
1258
- }, (t) => hi(t, e.candidates));
1259
+ }, (t) => vi(t, e.candidates));
1259
1260
  if (e.kind === "pick-from-list") {
1260
1261
  let t = e.candidates !== null && e.candidates.every((e) => e !== null) ? e.candidates : null;
1261
- return d(Zr(P), t ? {
1262
+ return d(ei(P), t ? {
1262
1263
  kind: "choose-destination",
1263
1264
  candidateIds: t.map((e) => e.id)
1264
1265
  } : e.candidateIds.length > 0 ? {
1265
1266
  kind: "choose-destination",
1266
1267
  candidateIds: [...e.candidateIds]
1267
- } : Pi({
1268
+ } : Li({
1268
1269
  destinationId: "",
1269
1270
  path: "",
1270
1271
  alreadyHere: !1,
@@ -1273,9 +1274,9 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1273
1274
  status: "refused",
1274
1275
  reason: "not-routable"
1275
1276
  }
1276
- }), t ? (e) => hi(e, t) : void 0);
1277
+ }), t ? (e) => vi(e, t) : void 0);
1277
1278
  }
1278
- if (e.kind === "link-not-openable") return d(Gr(P), Pi({
1279
+ if (e.kind === "link-not-openable") return d(Jr(P), Li({
1279
1280
  destinationId: "",
1280
1281
  path: "",
1281
1282
  alreadyHere: !1,
@@ -1288,7 +1289,7 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1288
1289
  if (e.kind === "open-record") {
1289
1290
  let r;
1290
1291
  try {
1291
- let { options: t, navItems: n } = Y.current, i = t.entityRoutes ?? [], a = _i(n);
1292
+ let { options: t, navItems: n } = Y.current, i = t.entityRoutes ?? [], a = bi(n);
1292
1293
  r = (t.records ?? []).flatMap((t) => {
1293
1294
  let n = i.find((e) => e.id === t.entityRouteId), r = e.request.adapterIds.length === 0 || e.request.adapterIds.includes(t.id);
1294
1295
  return n && r && (n.visibleWith === void 0 || a.has(n.visibleWith)) ? [{
@@ -1301,18 +1302,18 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1301
1302
  }
1302
1303
  if (r.length === 0) return !1;
1303
1304
  let i = w.getState().activeConversationId, a = N();
1304
- uc.current = a, fc(!0);
1305
+ gc.current = a, vc(!0);
1305
1306
  let o = () => {
1306
- uc.current === a && (uc.current = null, X.current && fc(!1));
1307
+ gc.current === a && (gc.current = null, X.current && vc(!1));
1307
1308
  };
1308
1309
  return (async () => {
1309
1310
  let a = { kind: "none" }, c = !0;
1310
1311
  try {
1311
- a = await gi({
1312
+ a = await yi({
1312
1313
  name: e.request.name,
1313
1314
  usable: r,
1314
- nounOf: (e) => Wr(P, e.noun),
1315
- timeoutMs: ca
1315
+ nounOf: (e) => qr(P, e.noun),
1316
+ timeoutMs: da
1316
1317
  }), c = w.getState().conversations.some((e) => e.id === i);
1317
1318
  } catch {
1318
1319
  a = { kind: "none" };
@@ -1321,7 +1322,7 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1321
1322
  }
1322
1323
  if (!X.current) return;
1323
1324
  if (a.kind === "none") {
1324
- Yc.current(t, [], {
1325
+ tl.current(t, [], {
1325
1326
  fromPerson: !0,
1326
1327
  ...n === void 0 ? {} : { voiceSessionId: n },
1327
1328
  localRecordsChecked: !0
@@ -1342,16 +1343,16 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1342
1343
  return;
1343
1344
  }
1344
1345
  let l = a.candidates[0];
1345
- d(a.why === "kinds" ? $r(P, a.nouns, a.candidates) : Qr(P, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
1346
+ d(a.why === "kinds" ? ni(P, a.nouns, a.candidates) : ti(P, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
1346
1347
  kind: "choose-destination",
1347
1348
  candidateIds: a.candidates.map((e) => e.id)
1348
- }, (e) => hi(e, a.candidates));
1349
+ }, (e) => vi(e, a.candidates));
1349
1350
  })().catch(() => void 0), !0;
1350
1351
  }
1351
1352
  if (e.kind === "back") {
1352
- let e = ji.top();
1353
+ let e = Pi.top();
1353
1354
  if (!e) return !1;
1354
- let t = zr(Y.current.navItems), n = Fi(t, e.fromPath);
1355
+ let t = Hr(Y.current.navItems), n = Ri(t, e.fromPath);
1355
1356
  return f({
1356
1357
  target: e.fromPath,
1357
1358
  destinationId: n?.id ?? "",
@@ -1359,27 +1360,27 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1359
1360
  via: "back",
1360
1361
  pageLabel: () => n?.label ?? null,
1361
1362
  onArrived: () => {
1362
- ji.top() === e && ji.pop();
1363
+ Pi.top() === e && Pi.pop();
1363
1364
  }
1364
1365
  });
1365
1366
  }
1366
1367
  let ee, m = e.destination;
1367
1368
  if (e.via === "offer") {
1368
- let t = bc(e.offerId, e.destination.label);
1369
- if (!t.ok) return d(t.copy ?? Jr(P), {
1369
+ let t = Ec(e.offerId, e.destination.label);
1370
+ if (!t.ok) return d(t.copy ?? Zr(P), {
1370
1371
  kind: "write-reply",
1371
1372
  line: t.reason === "unavailable" ? "offer.notAvailable" : "offer.expired"
1372
1373
  });
1373
1374
  ee = {
1374
1375
  trigger: e.trigger,
1375
1376
  offerId: e.offerId
1376
- }, m = zr(Y.current.navItems).find((e) => e.id === t.target.id) ?? {
1377
+ }, m = Hr(Y.current.navItems).find((e) => e.id === t.target.id) ?? {
1377
1378
  id: t.target.id,
1378
1379
  label: t.target.label,
1379
1380
  path: t.target.path
1380
1381
  };
1381
1382
  }
1382
- return Ir(m, window.location.pathname + window.location.search, zr(Y.current.navItems)) ? d(Kr(P, m.label, !0), Pi({
1383
+ return zr(m, window.location.pathname + window.location.search, Hr(Y.current.navItems)) ? d(Yr(P, m.label, !0), Li({
1383
1384
  destinationId: m.id,
1384
1385
  path: m.path,
1385
1386
  alreadyHere: !0,
@@ -1396,54 +1397,54 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1396
1397
  });
1397
1398
  }, [
1398
1399
  W,
1399
- _s,
1400
- Ac,
1401
- Hc,
1402
- lc,
1400
+ Cs,
1401
+ Ic,
1402
+ Jc,
1403
+ hc,
1403
1404
  V,
1404
- oo,
1405
- Xs,
1406
- Uc,
1405
+ lo,
1406
+ nc,
1407
+ Yc,
1408
+ ic,
1409
+ mc,
1407
1410
  Qs,
1408
- cc,
1409
- Ks,
1410
1411
  P,
1411
- bc,
1412
- Sc,
1413
- _c
1414
- ]), Gc = D(async (e) => {
1415
- $o.current = !0, ts(!0);
1412
+ Ec,
1413
+ Oc,
1414
+ Cc
1415
+ ]), Zc = D(async (e) => {
1416
+ as.current = !0, ss(!0);
1416
1417
  try {
1417
1418
  await K.declineForReply(e.conversationId, e.reason, e.origin);
1418
1419
  } finally {
1419
- $o.current = !1, X.current && ts(!1);
1420
+ as.current = !1, X.current && ss(!1);
1420
1421
  }
1421
1422
  if (e.commandText !== null) {
1422
- let t = Nc(e.commandText, e.options.voiceSessionId);
1423
- if (t && Wc(t, e.content, e.options.voiceSessionId)) return;
1423
+ let t = zc(e.commandText, e.options.voiceSessionId);
1424
+ if (t && Xc(t, e.content, e.options.voiceSessionId)) return;
1424
1425
  }
1425
- await Yc.current(e.content, e.attachments, e.options);
1426
+ await tl.current(e.content, e.attachments, e.options);
1426
1427
  }, [
1427
- Nc,
1428
- Wc,
1428
+ zc,
1429
+ Xc,
1429
1430
  K
1430
1431
  ]), Q = D(async (n, r = [], i = {}) => {
1431
- let a = i.voiceSessionId !== void 0, o = w.getState(), s = !1, c = fs.current;
1432
- if (a && mr(c)) {
1433
- let e = yr(c, o.activeConversationId, bs());
1432
+ let a = i.voiceSessionId !== void 0, o = w.getState(), s = !1, c = vs.current;
1433
+ if (a && _r(c)) {
1434
+ let e = Sr(c, o.activeConversationId, Es());
1434
1435
  if (e.kind === "gone") return;
1435
1436
  let t = i.voiceEntry ?? e;
1436
- t.kind === "adopt" && _s(t.conversationId), s = t.kind === "own", i = {
1437
+ t.kind === "adopt" && Cs(t.conversationId), s = t.kind === "own", i = {
1437
1438
  ...i,
1438
1439
  voiceEntry: t
1439
1440
  };
1440
1441
  }
1441
1442
  let l = s ? null : o.activeConversationId, u = s ? null : o.activeConversationId ?? H;
1442
1443
  if (u) {
1443
- if (On(o.processingByConversationId[u]?.status)) {
1444
+ if (jn(o.processingByConversationId[u]?.status)) {
1444
1445
  if (i.avatarTabAsk !== void 0) return;
1445
1446
  let e = o.processingByConversationId[u]?.messageId ?? null;
1446
- e && i.correctsInFlightTurn === !0 && !zs.current.has(e) && Hs(), e && zs.current.has(e) && (Bs.current = {
1447
+ e && i.correctsInFlightTurn === !0 && !Gs.current.has(e) && Js(), e && Gs.current.has(e) && (Ks.current = {
1447
1448
  conversationId: u,
1448
1449
  content: n,
1449
1450
  attachments: r,
@@ -1451,40 +1452,40 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1451
1452
  });
1452
1453
  return;
1453
1454
  }
1454
- if (ws.current.has(u)) return;
1455
+ if (As.current.has(u)) return;
1455
1456
  }
1456
- if (Qo.current || Er() !== null || $o.current || uc.current !== null) return;
1457
- let d = i.targetConversationId, f = qi(), p = (e) => Hi(e) || Vi(e, f);
1457
+ if (is.current || kr() !== null || as.current || gc.current !== null) return;
1458
+ let d = i.targetConversationId, f = Xi(), p = (e) => Gi(e) || Wi(e, f);
1458
1459
  if (d !== void 0) {
1459
1460
  let e = o.conversations.find((e) => e.id === d);
1460
1461
  if (o.activeConversationId !== d || !e || e.mode !== o.mode || p(e)) return;
1461
1462
  }
1462
1463
  if (i.avatarTabAsk !== void 0) {
1463
1464
  let e = l ? o.conversations.find((e) => e.id === l) : void 0, t = e && !p(e) ? e : void 0;
1464
- if (qe({
1465
- auto: o.autoRouting && Zo.current && d === void 0,
1465
+ if (Xe({
1466
+ auto: o.autoRouting && rs.current && d === void 0,
1466
1467
  selectedMode: o.mode,
1467
1468
  conversation: t ? {
1468
1469
  mode: t.mode,
1469
1470
  routedBy: t.routedBy,
1470
- hasHistory: Bi(t)
1471
+ hasHistory: Ui(t)
1471
1472
  } : null,
1472
- modeWrites: (e) => Uo.current.find((t) => t.id === e)?.writeCapable === !0 || gt(e)
1473
+ modeWrites: (e) => Yo.current.find((t) => t.id === e)?.writeCapable === !0 || yt(e)
1473
1474
  }) !== null) return;
1474
1475
  }
1475
1476
  if (i.fromPerson && i.writeReplyBound === void 0) {
1476
- let e = d ?? l ?? null, t = i.voiceSessionId === void 0 ? "typed" : "spoken", a = Lc(e, i.voiceSessionId), o = se({
1477
+ let e = d ?? l ?? null, t = i.voiceSessionId === void 0 ? "typed" : "spoken", a = Uc(e, i.voiceSessionId), o = se({
1477
1478
  text: n,
1478
- locale: t === "spoken" ? Ja.input.code : V,
1479
+ locale: t === "spoken" ? Za.input.code : V,
1479
1480
  origin: t,
1480
1481
  hasAttachments: r.length > 0 || i.focus !== void 0,
1481
1482
  live: K.liveFor(e),
1482
- matchesLocalCommand: (e) => Nc(e, i.voiceSessionId) !== null,
1483
+ matchesLocalCommand: (e) => zc(e, i.voiceSessionId) !== null,
1483
1484
  offer: a.state,
1484
- offerAssent: a.state !== "none" && ti({
1485
+ offerAssent: a.state !== "none" && ii({
1485
1486
  text: n,
1486
1487
  uiLocale: V,
1487
- inputLocale: Ja.input.code,
1488
+ inputLocale: Za.input.code,
1488
1489
  commandLocales: Y.current.options.commandLocales,
1489
1490
  manifest: Y.current.options.commandManifest,
1490
1491
  leaveGuard: Y.current.options.leaveGuard
@@ -1492,14 +1493,14 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1492
1493
  });
1493
1494
  if (o.kind === "accept_offer") {
1494
1495
  let e = a.accept;
1495
- if (e && Wc({
1496
+ if (e && Xc({
1496
1497
  kind: "navigate",
1497
1498
  destination: e.destination,
1498
1499
  via: "offer",
1499
1500
  offerId: e.offerId,
1500
1501
  trigger: "yes"
1501
1502
  }, n, i.voiceSessionId, s, i.avatarTabAsk)) {
1502
- Zs(i.avatarTabAsk);
1503
+ rc(i.avatarTabAsk);
1503
1504
  return;
1504
1505
  }
1505
1506
  o = {
@@ -1516,11 +1517,11 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1516
1517
  };
1517
1518
  }
1518
1519
  if (o.kind === "local_reply") {
1519
- e && Rc(e, n, o.line, o.values, i.voiceSessionId, i.avatarTabAsk);
1520
+ e && Wc(e, n, o.line, o.values, i.voiceSessionId, i.avatarTabAsk);
1520
1521
  return;
1521
1522
  }
1522
1523
  let c = o.kind === "local" ? o.fallback : o.bound, u = o.declineAll;
1523
- if (u !== null && e) return i.avatarTabAsk === void 0 ? Gc({
1524
+ if (u !== null && e) return i.avatarTabAsk === void 0 ? Zc({
1524
1525
  conversationId: e,
1525
1526
  reason: u,
1526
1527
  origin: t,
@@ -1539,52 +1540,52 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1539
1540
  }
1540
1541
  let ee = i.writeReplyBound?.promptText ?? n;
1541
1542
  if (i.fromPerson && r.length === 0 && i.focus === void 0 && i.writeReplyBound?.localCommands !== !1) {
1542
- let e = Nc(n, i.voiceSessionId, i.localRecordsChecked === !0);
1543
- if (e && Wc(e, n, i.voiceSessionId, s, i.avatarTabAsk)) {
1544
- Zs(i.avatarTabAsk);
1543
+ let e = zc(n, i.voiceSessionId, i.localRecordsChecked === !0);
1544
+ if (e && Xc(e, n, i.voiceSessionId, s, i.avatarTabAsk)) {
1545
+ rc(i.avatarTabAsk);
1545
1546
  return;
1546
1547
  }
1547
1548
  }
1548
- let m = l ? o.conversations.find((e) => e.id === l) : void 0, h = p(m) ? void 0 : m, g = o.autoRouting && Zo.current && d === void 0 ? pe({
1549
+ let m = l ? o.conversations.find((e) => e.id === l) : void 0, h = p(m) ? void 0 : m, g = o.autoRouting && rs.current && d === void 0 ? pe({
1549
1550
  intent: i.avatarTabAsk === void 0 ? i.autoIntent ?? ue(n) : "read",
1550
1551
  dictated: a,
1551
- voiceProposalBound: a && Ra("api-calls") && Jn(o.acknowledgedWriteModes, "api-calls"),
1552
+ voiceProposalBound: a && Va("api-calls") && Zn(o.acknowledgedWriteModes, "api-calls"),
1552
1553
  conversation: h ? {
1553
1554
  mode: h.mode,
1554
1555
  routedBy: h.routedBy,
1555
- hasHistory: Bi(h)
1556
+ hasHistory: Ui(h)
1556
1557
  } : null
1557
1558
  }) : null;
1558
- if (g && Uo.current.find((e) => e.id === g.mode)?.writeCapable && !Jn(o.acknowledgedWriteModes, g.mode)) {
1559
- Qo.current = {
1559
+ if (g && Yo.current.find((e) => e.id === g.mode)?.writeCapable && !Zn(o.acknowledgedWriteModes, g.mode)) {
1560
+ is.current = {
1560
1561
  content: n,
1561
1562
  attachments: r,
1562
1563
  options: i
1563
- }, is(g.mode);
1564
+ }, us(g.mode);
1564
1565
  return;
1565
1566
  }
1566
1567
  let _ = g ? g.mode : o.mode, te, ne, v = d ?? (s ? null : H), re = v ? w.getState().conversations.find((e) => e.id === v) : void 0, ie = g?.action === "escalate" && h ? {
1567
1568
  mode: h.mode,
1568
1569
  backendSessionId: h.backendSessionId ?? null
1569
1570
  } : null;
1570
- if (g) g.action === "new" || !h ? v = ro(void 0, _, { routedBy: "auto" }) : (v = h.id, vo(v, _));
1571
+ if (g) g.action === "new" || !h ? v = oo(void 0, _, { routedBy: "auto" }) : (v = h.id, xo(v, _));
1571
1572
  else {
1572
1573
  let e = o.autoRouting ? { routedBy: "auto" } : void 0;
1573
- !v || p(re) || re && re.mode !== _ && Bi(re) ? v = ro(void 0, _, e) : re && re.mode !== _ && (e ? vo(v, _) : to(v, _));
1574
+ !v || p(re) || re && re.mode !== _ && Ui(re) ? v = oo(void 0, _, e) : re && re.mode !== _ && (e ? xo(v, _) : io(v, _));
1574
1575
  }
1575
1576
  if (!v) return;
1576
- a && fs.current !== void 0 && v !== o.activeConversationId && _s(v), i.approvalFollowUp || (xs.current[v] = r);
1577
+ a && vs.current !== void 0 && v !== o.activeConversationId && Cs(v), i.approvalFollowUp || (Ds.current[v] = r);
1577
1578
  let ae = () => w.getState().conversations.some((e) => e.id === v), y = T(), b = {
1578
- accessToken: za(),
1579
- workspaceToken: Ba(),
1579
+ accessToken: Ha(),
1580
+ workspaceToken: Ua(),
1580
1581
  userId: B,
1581
- organizationId: Vt()
1582
+ organizationId: Wt()
1582
1583
  }, le = (e, t) => {
1583
- !ae() && y && st(e, y, t, _, {
1584
- accessToken: za(),
1585
- workspaceToken: Ba(),
1584
+ !ae() && y && ut(e, y, t, _, {
1585
+ accessToken: Ha(),
1586
+ workspaceToken: Ua(),
1586
1587
  userId: B,
1587
- organizationId: Vt()
1588
+ organizationId: Wt()
1588
1589
  });
1589
1590
  }, fe = {
1590
1591
  id: N(),
@@ -1592,17 +1593,17 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1592
1593
  content: n,
1593
1594
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1594
1595
  metadata: {
1595
- ...r.length ? { attachments: r.map(vn) } : {},
1596
+ ...r.length ? { attachments: r.map(xn) } : {},
1596
1597
  ...i.focus ? { askAbout: i.focus } : {},
1597
1598
  ...i.approvalFollowUp ? {
1598
1599
  approvalFollowUp: !0,
1599
1600
  approvedReplyId: i.approvalFollowUp.approvedReplyId
1600
1601
  } : {},
1601
- ...lr(i.voiceSessionId)
1602
+ ...fr(i.voiceSessionId)
1602
1603
  }
1603
1604
  };
1604
1605
  W(v, fe);
1605
- let me = i.fromPerson === !0 && r.length === 0 && i.focus === void 0 && i.approvalFollowUp === void 0 && ee === n ? Di(n, a ? Ja.input.code : V) : null, he = {
1606
+ let me = i.fromPerson === !0 && r.length === 0 && i.focus === void 0 && i.approvalFollowUp === void 0 && ee === n ? Ai(n, a ? Za.input.code : V) : null, he = {
1606
1607
  location: window.location.pathname + window.location.search,
1607
1608
  conversationId: w.getState().activeConversationId,
1608
1609
  workspaceId: T(),
@@ -1614,38 +1615,38 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1614
1615
  content: "",
1615
1616
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1616
1617
  metadata: {
1617
- lang: Za,
1618
- ...lr(i.voiceSessionId)
1618
+ lang: eo,
1619
+ ...fr(i.voiceSessionId)
1619
1620
  }
1620
- }), sn(x, {
1621
+ }), un(x, {
1621
1622
  channel: a ? "voice" : "chat",
1622
1623
  mode: _,
1623
1624
  product: L,
1624
- language: Za,
1625
- device: ln(),
1625
+ language: eo,
1626
+ device: fn(),
1626
1627
  routedByAuto: !!g
1627
- }, i.voiceTiming), E(x, "accepted"), so(v, "provisioning", x, null), Dr(x), i.avatarTabAsk !== void 0 && Qs(i.avatarTabAsk, {
1628
+ }, i.voiceTiming), E(x, "accepted"), uo(v, "provisioning", x, null), Ar(x), i.avatarTabAsk !== void 0 && ic(i.avatarTabAsk, {
1628
1629
  conversationId: v,
1629
1630
  questionId: fe.id,
1630
1631
  replyId: x
1631
1632
  });
1632
1633
  let ge = () => {
1633
- let e = kn({
1634
+ let e = Mn({
1634
1635
  turnId: x,
1635
- abortRequested: zs.current.has(x),
1636
+ abortRequested: Gs.current.has(x),
1636
1637
  activeTurnId: w.getState().processingByConversationId[v]?.messageId ?? null,
1637
1638
  conversationExists: ae()
1638
1639
  });
1639
1640
  return e.abandon && ye(), e;
1640
- }, _e = (e, t, n, r, a = !1, o = Za) => {
1641
- ao(v, x, { content: Et(e) }), oo(v, x, {
1641
+ }, _e = (e, t, n, r, a = !1, o = eo) => {
1642
+ co(v, x, { content: kt(e) }), lo(v, x, {
1642
1643
  lang: o,
1643
1644
  ...t?.length ? { artifacts: t } : {},
1644
1645
  ...t?.length || n || r ? { mode: _ } : {},
1645
1646
  ...n ? { sessionId: n } : {},
1646
1647
  ...r ? { sandboxId: r } : {},
1647
1648
  ...a ? { incomplete: !0 } : {},
1648
- ...lr(i.voiceSessionId)
1649
+ ...fr(i.voiceSessionId)
1649
1650
  });
1650
1651
  }, ve = { session: null }, S = {
1651
1652
  speech: null,
@@ -1656,94 +1657,94 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1656
1657
  }, be = () => {
1657
1658
  ye(), S.stream?.close(), S.stream = null, S.render = null;
1658
1659
  }, xe = !1, Se = (e = !1) => {
1659
- xe && (xe = !1, kt.abort(x, e));
1660
+ xe && (xe = !1, Mt.abort(x, e));
1660
1661
  }, Ce = new e(), we = () => {}, Te = async (e = 1, o = !1) => {
1661
1662
  E(x, "attemptStarted");
1662
1663
  let s = null, c = null, l = !1;
1663
1664
  try {
1664
- let { sandboxId: e, sessionId: u, sessionIsNew: d, readAhead: f, sandboxIsNew: p, sandboxProbed: m, sandboxAdopted: h, deadSandboxProbe: g, sessionPreopened: re, knownFloor: ie } = await js(v, x, _, y, b, {
1665
- isAbandoned: () => kn({
1665
+ let { sandboxId: e, sessionId: u, sessionIsNew: d, readAhead: f, sandboxIsNew: p, sandboxProbed: m, sandboxAdopted: h, deadSandboxProbe: g, sessionPreopened: re, knownFloor: ie } = await Ls(v, x, _, y, b, {
1666
+ isAbandoned: () => Mn({
1666
1667
  turnId: x,
1667
- abortRequested: zs.current.has(x),
1668
+ abortRequested: Gs.current.has(x),
1668
1669
  activeTurnId: w.getState().processingByConversationId[v]?.messageId ?? null,
1669
1670
  conversationExists: ae()
1670
1671
  }).abandon,
1671
1672
  ...o ? { verifySession: !0 } : {}
1672
1673
  });
1673
1674
  if (s = e, we(), we = t(e, () => {
1674
- zs.current.add(x), Mt(x), kt.abort(x);
1675
- }), E(x, "runtimeReady"), cn(x, {
1675
+ Gs.current.add(x), Ft(x), Mt.abort(x);
1676
+ }), E(x, "runtimeReady"), dn(x, {
1676
1677
  runtime: p ? "cold" : h ? "adopted" : m ? "probed" : re ? "preopened" : d ? "new-session" : "warm",
1677
1678
  deadSandboxProbe: g
1678
- }), cn(x, { session: re ? "preopened" : d ? "created" : "reused" }), c = u, ve.session = {
1679
+ }), dn(x, { session: re ? "preopened" : d ? "created" : "reused" }), c = u, ve.session = {
1679
1680
  sandboxId: e,
1680
1681
  sessionId: u
1681
1682
  }, F) {
1682
1683
  let e = ge();
1683
1684
  if (e.abandon) {
1684
- e.clearProcessing && co(v);
1685
+ e.clearProcessing && fo(v);
1685
1686
  return;
1686
1687
  }
1687
1688
  }
1688
- if (Yn(_, te, w.getState().acknowledgedWriteModes, {
1689
+ if (Qn(_, te, w.getState().acknowledgedWriteModes, {
1689
1690
  dictated: a,
1690
- confirmsWrites: gt(_),
1691
- proposalBound: Ra(_, e)
1692
- }) === "voice-in-write-mode") throw new Wt("voice-in-write-mode", "Voice in a write mode");
1693
- let se = Wi({
1691
+ confirmsWrites: yt(_),
1692
+ proposalBound: Va(_, e)
1693
+ }) === "voice-in-write-mode") throw new qt("voice-in-write-mode", "Voice in a write mode");
1694
+ let se = qi({
1694
1695
  conversation: w.getState().conversations.find((e) => e.id === v),
1695
1696
  content: n,
1696
1697
  sessionIsNew: d,
1697
1698
  sendingMode: _,
1698
1699
  sendingModeConfig: te,
1699
- modes: Uo.current,
1700
- answerText: (e) => Xe(e).text
1700
+ modes: Yo.current,
1701
+ answerText: (e) => $e(e).text
1701
1702
  });
1702
- if (be(), Kn()) {
1703
- let t = Gn({
1704
- mint: () => ht(e, y, u, _, b),
1703
+ if (be(), Yn()) {
1704
+ let t = Jn({
1705
+ mint: () => vt(e, y, u, _, b),
1705
1706
  mark: (e) => E(x, e)
1706
1707
  });
1707
- S.stream = t, Vn() && i.voiceSessionId !== void 0 && !ne.accumulatesNarration && (S.speech = Hn({
1708
+ S.stream = t, Wn() && i.voiceSessionId !== void 0 && !ne.accumulatesNarration && (S.speech = Gn({
1708
1709
  append: (e, t) => {
1709
- ge().abandon || (E(x, "speechQueued"), xe = !0, kt.append(x, {
1710
+ ge().abandon || (E(x, "speechQueued"), xe = !0, Mt.append(x, {
1710
1711
  conversationId: v,
1711
1712
  channel: "voice",
1712
1713
  voiceSessionId: i.voiceSessionId,
1713
1714
  text: t,
1714
- lang: Za,
1715
+ lang: eo,
1715
1716
  final: !1
1716
1717
  }, e));
1717
1718
  },
1718
- retract: () => kt.retract(x)
1719
- })), S.render = Un({
1719
+ retract: () => Mt.retract(x)
1720
+ })), S.render = Kn({
1720
1721
  onLiveState: (e, t) => S.speech?.invalidate(e, t),
1721
1722
  onRendered: (e, t, n) => S.speech?.update(e, t, n),
1722
1723
  stream: t,
1723
1724
  conversationId: v,
1724
1725
  messageId: x,
1725
- build: (e, t) => Et(Pt(e, t, { accumulateNarration: ne.accumulatesNarration }).content),
1726
+ build: (e, t) => kt(Lt(e, t, { accumulateNarration: ne.accumulatesNarration }).content),
1726
1727
  onFirstDelta: () => E(x, "firstDelta"),
1727
1728
  onFirstVisible: () => E(x, "firstOutput")
1728
1729
  });
1729
1730
  }
1730
- let ue = ie ?? await Lt(() => pt(e, y, u, _, b, { limit: 50 }), d, Ft(f, e, u));
1731
- ks(v, x, "streaming", "thinking");
1732
- let de = Na?.(), pe = ce(w.getState().sandboxWriteCapabilities[e]), Se = Y.current, Te = xi(e, u), Ee = Se.options.uiCatalogue ? vi(zr(Se.navItems), {
1731
+ let ue = ie ?? await Bt(() => gt(e, y, u, _, b, { limit: 50 }), d, Rt(f, e, u));
1732
+ Fs(v, x, "streaming", "thinking");
1733
+ let de = Ia?.(), pe = ce(w.getState().sandboxWriteCapabilities[e]), Se = Y.current, Te = wi(e, u), Ee = Se.options.uiCatalogue ? xi(Hr(Se.navItems), {
1733
1734
  permissionsSettled: Se.navPermissionsSettled,
1734
1735
  simulating: Se.navSimulating,
1735
- sentBefore: bi(Te)
1736
- }) : null, De = w.getState().sandboxWriteCapabilities[e]?.clientTools === !0 ? Tt({ writeCapable: te?.writeCapable === !0 || _ === "api-calls" }) : null, Oe = De?.manifest ?? [], ke = {
1736
+ sentBefore: Ci(Te)
1737
+ }) : null, De = w.getState().sandboxWriteCapabilities[e]?.clientTools === !0 ? Ot({ writeCapable: te?.writeCapable === !0 || _ === "api-calls" }) : null, Oe = De?.manifest ?? [], ke = {
1737
1738
  conversationId: v,
1738
1739
  writeReply: pe === "proposal-v1" ? i.writeReplyBound?.writeReply ?? null : null,
1739
1740
  ...Ee ? { uiCatalogue: Ee } : {},
1740
1741
  ...Oe.length > 0 ? { clientTools: Oe } : {}
1741
- }, { prompt: Ae, parts: je } = yn({
1742
- content: ra(se ? `${se}${ee}` : ee, i.focus),
1742
+ }, { prompt: Ae, parts: je } = Sn({
1743
+ content: oa(se ? `${se}${ee}` : ee, i.focus),
1743
1744
  attachments: r,
1744
- limits: _n(te),
1745
- wrapPrompt: (e) => Pa?.(_, e, Ya, Xa, a, { writeApproval: pe }) ?? e,
1746
- requestBytes: (t, n) => vt({
1745
+ limits: bn(te),
1746
+ wrapPrompt: (e) => La?.(_, e, Qa, $a, a, { writeApproval: pe }) ?? e,
1747
+ requestBytes: (t, n) => xt({
1747
1748
  sandboxId: e,
1748
1749
  workspaceId: y,
1749
1750
  sessionId: u,
@@ -1754,18 +1755,18 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1754
1755
  authContext: b,
1755
1756
  ...ke
1756
1757
  })
1757
- }), Me = hn(je), Ne = Me > 0;
1758
- l = mn(r) > Me;
1758
+ }), Me = vn(je), Ne = Me > 0;
1759
+ l = _n(r) > Me;
1759
1760
  let Pe = ge();
1760
1761
  if (Pe.abandon) {
1761
- Pe.clearProcessing && co(v);
1762
+ Pe.clearProcessing && fo(v);
1762
1763
  return;
1763
1764
  }
1764
1765
  let Fe = (t) => Ce.dispatch({
1765
1766
  prompt: Ae,
1766
1767
  isAbandoned: () => ge().abandon,
1767
- readMessages: (t) => pt(e, y, u, _, b, { sinceMs: t }),
1768
- send: () => bt(e, y, u, Ae, _, de, b, t?.length ? {
1768
+ readMessages: (t) => gt(e, y, u, _, b, { sinceMs: t }),
1769
+ send: () => Ct(e, y, u, Ae, _, de, b, t?.length ? {
1769
1770
  parts: t,
1770
1771
  ...ke
1771
1772
  } : ke)
@@ -1773,12 +1774,12 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1773
1774
  try {
1774
1775
  await Fe(je);
1775
1776
  } catch (e) {
1776
- if (ie !== null && !o && Ln(e)) throw new In();
1777
- if (!Ce.canFailover() || !je || !En(e)) throw e;
1777
+ if (ie !== null && !o && Bn(e)) throw new zn();
1778
+ if (!Ce.canFailover() || !je || !kn(e)) throw e;
1778
1779
  await Fe(void 0), l ||= Ne;
1779
1780
  }
1780
- Ee && yi(Te);
1781
- let Ie = w.getState().sandboxWriteCapabilities[e], Le = Se.options.uiOffers === !0 && wi(Ie) ? B : null, Re = !!Le;
1781
+ Ee && Si(Te);
1782
+ let Ie = w.getState().sandboxWriteCapabilities[e], Le = Se.options.uiOffers === !0 && Di(Ie) ? B : null, Re = !!Le;
1782
1783
  Le && Z.recordTurn({
1783
1784
  replyId: x,
1784
1785
  conversationId: v,
@@ -1789,97 +1790,97 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1789
1790
  actorId: Le,
1790
1791
  floorMs: ue
1791
1792
  });
1792
- let ze = De && Oe.length > 0 ? wt({
1793
+ let ze = De && Oe.length > 0 ? Dt({
1793
1794
  tools: De.tools,
1794
- post: (t, n) => _t(e, y, u, t, n, _, b)
1795
+ post: (t, n) => bt(e, y, u, t, n, _, b)
1795
1796
  }) : null, Be = ze ? (e) => ze.receive(e) : void 0, Ve = Re ? (e, t) => {
1796
- Z.receive(x, e, t, performance.now()) && _c();
1797
- } : void 0, He = (e) => ao(v, x, { content: e }), Ue = (e) => l ? `${e}\n\n${P("attachments.imagesNotSent", "_Your photo was too large to include with this message, so the answer above is from the text and the file link only. Try a smaller or more tightly cropped photo._")}` : e;
1797
+ Z.receive(x, e, t, performance.now()) && Cc();
1798
+ } : void 0, He = (e) => co(v, x, { content: e }), Ue = (e) => l ? `${e}\n\n${P("attachments.imagesNotSent", "_Your photo was too large to include with this message, so the answer above is from the text and the file link only. Try a smaller or more tightly cropped photo._")}` : e;
1798
1799
  E(x, "promptSent");
1799
- let We = null, Ge = !1, Ke = Nt, C = Pt([], ue);
1800
+ let We = null, Ge = !1, Ke = It, C = Lt([], ue);
1800
1801
  S.render?.arm(ue);
1801
- let qe = Date.now() + ne.streamBudgetMs, Je = Date.now(), Ye = Date.now(), Ze, Qe = Dt(), $e = (e) => {
1802
- Ze = e;
1803
- }, et = Wn(() => pt(e, y, u, _, b, {
1802
+ let qe = Date.now() + ne.streamBudgetMs, Je = Date.now(), Ye = Date.now(), Xe, Ze = At(), Qe = (e) => {
1803
+ Xe = e;
1804
+ }, et = qn(() => gt(e, y, u, _, b, {
1804
1805
  limit: 50,
1805
1806
  sinceMs: ue,
1806
1807
  surfaceTurnTerminal: !0,
1807
1808
  surfaceUiOffers: Ve,
1808
1809
  surfaceClientToolRequests: Be,
1809
- surfaceSessionBusy: $e
1810
+ surfaceSessionBusy: Qe
1810
1811
  })), tt = S.stream?.onIdle(() => et.startExtra());
1811
1812
  try {
1812
1813
  for (; Date.now() < qe;) {
1813
1814
  le(e, u);
1814
1815
  let t = ge();
1815
1816
  if (t.abandon) {
1816
- t.clearProcessing && co(v);
1817
+ t.clearProcessing && fo(v);
1817
1818
  return;
1818
1819
  }
1819
1820
  let n = Date.now(), r = await et.next();
1820
- Re && Z.observeMessages(x, r) && _c(), C = Pt(r, ue, { accumulateNarration: ne.accumulatesNarration });
1821
- let i = Ot(Qe, C.done, Ze, Date.now());
1821
+ Re && Z.observeMessages(x, r) && Cc(), C = Lt(r, ue, { accumulateNarration: ne.accumulatesNarration });
1822
+ let i = jt(Ze, C.done, Xe, Date.now());
1822
1823
  if (i !== C.done && (C = {
1823
1824
  ...C,
1824
1825
  done: i
1825
- }), ao(v, x, { content: Et(C.content) }), C.hasRenderableOutput ? Ge || (Ge = !0, We !== null && E(x, "lastQuietPoll", We), E(x, "firstOutput")) : We = dn(), ne.accumulatesNarration) C.hasText && E(x, "firstText");
1826
+ }), co(v, x, { content: kt(C.content) }), C.hasRenderableOutput ? Ge || (Ge = !0, We !== null && E(x, "lastQuietPoll", We), E(x, "firstOutput")) : We = mn(), ne.accumulatesNarration) C.hasText && E(x, "firstText");
1826
1827
  else {
1827
- let e = Bt(Ke, C, dn());
1828
+ let e = Ut(Ke, C, mn());
1828
1829
  Ke = e.tracker, e.confirmedAt !== null && E(x, "firstText", e.confirmedAt);
1829
1830
  }
1830
- if (C.pendingWrite && !oe(w.getState().sandboxWriteCapabilities[e]) && oo(v, x, { pendingWrite: C.pendingWrite }), C.done && (S.stream ? cn(x, {
1831
+ if (C.pendingWrite && !oe(w.getState().sandboxWriteCapabilities[e]) && lo(v, x, { pendingWrite: C.pendingWrite }), C.done && (S.stream ? dn(x, {
1831
1832
  transport: S.stream.reachedOpen ? "sse" : "poll",
1832
- live: Bn(S.stream.live)
1833
- }) : cn(x, {
1833
+ live: Un(S.stream.live)
1834
+ }) : dn(x, {
1834
1835
  transport: "poll",
1835
1836
  live: "none"
1836
1837
  }), ye()), C.done) {
1837
- E(x, "answerDone"), Ss.current.markVerified(e), ne.continuesInBackground || It(e, u, r);
1838
+ E(x, "answerDone"), Os.current.markVerified(e), ne.continuesInBackground || zt(e, u, r);
1838
1839
  break;
1839
1840
  }
1840
- if (S.render?.refresh(r), Date.now() - Je > 3e4 && (zn(e, y, b), Je = Date.now()), !et.hasPending()) {
1841
- let e = Math.max(0, Pn(Date.now() - Ye) - (Date.now() - n));
1841
+ if (S.render?.refresh(r), Date.now() - Je > 3e4 && (Hn(e, y, b), Je = Date.now()), !et.hasPending()) {
1842
+ let e = Math.max(0, Ln(Date.now() - Ye) - (Date.now() - n));
1842
1843
  S.stream ? await S.stream.waitWake(e) : await new Promise((t) => setTimeout(t, e));
1843
1844
  }
1844
1845
  }
1845
1846
  } finally {
1846
1847
  ze?.dispose();
1847
1848
  }
1848
- if (tt?.(), be(), C.done || (cn(x, { outcome: "timedOut" }), C = {
1849
+ if (tt?.(), be(), C.done || (dn(x, { outcome: "timedOut" }), C = {
1849
1850
  ...C,
1850
- content: qn(C.content, _, P, te)
1851
+ content: Xn(C.content, _, P, te)
1851
1852
  }), (C.done || xe) && i.voiceSessionId !== void 0 && !ge().abandon) {
1852
- let e = Et(Ue(C.content));
1853
- (e.trim() || xe) && ((l || !C.done) && He(e), E(x, "speechQueued"), xe = !0, kt.publish(x, {
1853
+ let e = kt(Ue(C.content));
1854
+ (e.trim() || xe) && ((l || !C.done) && He(e), E(x, "speechQueued"), xe = !0, Mt.publish(x, {
1854
1855
  conversationId: v,
1855
1856
  channel: "voice",
1856
1857
  voiceSessionId: i.voiceSessionId,
1857
1858
  text: e,
1858
- lang: Za,
1859
+ lang: eo,
1859
1860
  final: !0
1860
1861
  }));
1861
1862
  }
1862
- let nt = ne.producesArtifacts ? await ft(e, y, u, _, b).then((e) => e).catch(() => []) : void 0;
1863
- C.usedTools !== void 0 && cn(x, { usedTools: C.usedTools }), l && (C = {
1863
+ let nt = ne.producesArtifacts ? await ht(e, y, u, _, b).then((e) => e).catch(() => []) : void 0;
1864
+ C.usedTools !== void 0 && dn(x, { usedTools: C.usedTools }), l && (C = {
1864
1865
  ...C,
1865
1866
  content: Ue(C.content)
1866
1867
  });
1867
1868
  let rt = !C.done;
1868
- _e(C.content, nt, u, e, rt), C.tokens && (ao(v, x, { tokens: C.tokens }), Ia && Sn({
1869
+ _e(C.content, nt, u, e, rt), C.tokens && (co(v, x, { tokens: C.tokens }), za && Tn({
1869
1870
  workspaceId: y,
1870
1871
  sessionId: u,
1871
1872
  messageId: C.messageId,
1872
1873
  model: C.model,
1873
1874
  tokens: C.tokens
1874
- }, Ia, { ledger: bn("panel", L) }).then((e) => {
1875
- e.ok && Ut(L);
1875
+ }, za, { ledger: Cn("panel", L) }).then((e) => {
1876
+ e.ok && Kt(L);
1876
1877
  })), C.done || le(e, u);
1877
1878
  let it = ge();
1878
1879
  if (it.abandon) {
1879
- it.clearProcessing && co(v);
1880
+ it.clearProcessing && fo(v);
1880
1881
  return;
1881
1882
  }
1882
- E(x, "complete"), cn(x, { outcome: "answered" }), so(v, "complete", x, null), zi.recordCommittedEntries(v, [fe.id, x], "TURN", y), xe = !1, Re && me && C.done && Dc({
1883
+ E(x, "complete"), dn(x, { outcome: "answered" }), uo(v, "complete", x, null), Hi.recordCommittedEntries(v, [fe.id, x], "TURN", y), xe = !1, Re && me && C.done && Nc({
1883
1884
  replyId: x,
1884
1885
  conversationId: v,
1885
1886
  voiceSessionId: i.voiceSessionId,
@@ -1887,140 +1888,140 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
1887
1888
  atSend: he
1888
1889
  });
1889
1890
  } catch (t) {
1890
- let n = t instanceof In;
1891
- n || Ss.current.invalidate(s ?? w.getState().sandboxesByMode[_]?.sandboxId ?? null);
1892
- let r = kn({
1891
+ let n = t instanceof zn;
1892
+ n || Os.current.invalidate(s ?? w.getState().sandboxesByMode[_]?.sandboxId ?? null);
1893
+ let r = Mn({
1893
1894
  turnId: x,
1894
- abortRequested: zs.current.has(x),
1895
+ abortRequested: Gs.current.has(x),
1895
1896
  activeTurnId: w.getState().processingByConversationId[v]?.messageId ?? null,
1896
1897
  conversationExists: ae()
1897
1898
  });
1898
1899
  if (ye(), s && c && le(s, c), r.abandon) {
1899
- r.clearProcessing && co(v);
1900
+ r.clearProcessing && fo(v);
1900
1901
  return;
1901
1902
  }
1902
- if (n) return we(), uo(v), be(), un(x), Te(e, !0);
1903
- if (e === 1 && Ce.canFailover() && Dn(t)) {
1903
+ if (n) return we(), mo(v), be(), pn(x), Te(e, !0);
1904
+ if (e === 1 && Ce.canFailover() && An(t)) {
1904
1905
  we();
1905
1906
  let e = s ?? w.getState().sandboxesByMode[_]?.sandboxId ?? null;
1906
- return e && (Cs.current.add(e), Ss.current.invalidate(e)), uo(v), po(_), io(v, x, ""), oo(v, x, { pendingWrite: void 0 }), e && K.retireSandbox(e), be(), Se(!0), un(x), Te(2);
1907
+ return e && (ks.current.add(e), Os.current.invalidate(e)), mo(v), go(_), so(v, x, ""), lo(v, x, { pendingWrite: void 0 }), e && K.retireSandbox(e), be(), Se(!0), pn(x), Te(2);
1907
1908
  }
1908
1909
  throw t;
1909
1910
  }
1910
1911
  }, Ee = v;
1911
- ws.current.add(Ee);
1912
- let De = Fn();
1913
- Rn();
1912
+ As.current.add(Ee);
1913
+ let De = Rn();
1914
+ Vn();
1914
1915
  try {
1915
1916
  if (!y) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
1916
1917
  code: "UNAUTHENTICATED",
1917
1918
  authFailure: "WORKSPACE_CONTEXT_MISSING"
1918
1919
  } });
1919
- let e = await Zn(_, () => Uo.current.find((e) => e.id === _), Ho);
1920
+ let e = await er(_, () => Yo.current.find((e) => e.id === _), Jo);
1920
1921
  te = e.config, ne = e.capabilities;
1921
1922
  let t = te, n = ge();
1922
1923
  if (n.abandon) {
1923
- n.clearProcessing && co(v);
1924
+ n.clearProcessing && fo(v);
1924
1925
  return;
1925
1926
  }
1926
- let r = Yn(_, t, w.getState().acknowledgedWriteModes, {
1927
+ let r = Qn(_, t, w.getState().acknowledgedWriteModes, {
1927
1928
  dictated: a,
1928
- confirmsWrites: gt(_),
1929
- proposalBound: Ra(_)
1929
+ confirmsWrites: yt(_),
1930
+ proposalBound: Va(_)
1930
1931
  });
1931
- if (r) throw new Wt(r, r === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
1932
- let i = bn("panel", L);
1933
- if (Ia && await wn(i, y), Ia && xn(i, y)) {
1934
- let e = await Cn(i, y, Ia);
1935
- if (!e.ok) throw Tn(e.kind);
1932
+ if (r) throw new qt(r, r === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
1933
+ let i = Cn("panel", L);
1934
+ if (za && await Dn(i, y), za && wn(i, y)) {
1935
+ let e = await En(i, y, za);
1936
+ if (!e.ok) throw On(e.kind);
1936
1937
  let t = ge();
1937
1938
  if (t.abandon) {
1938
- t.clearProcessing && co(v);
1939
+ t.clearProcessing && fo(v);
1939
1940
  return;
1940
1941
  }
1941
1942
  }
1942
1943
  E(x, "cleared"), await Te();
1943
1944
  } catch (e) {
1944
- if (Ss.current.invalidate(w.getState().sandboxesByMode[_]?.sandboxId ?? null), !ae()) {
1945
- co(v);
1945
+ if (Os.current.invalidate(w.getState().sandboxesByMode[_]?.sandboxId ?? null), !ae()) {
1946
+ fo(v);
1946
1947
  return;
1947
1948
  }
1948
- let t = ve.session?.sandboxId ?? null, n = Gt(e, { confirmsNoAction: Kt({
1949
+ let t = ve.session?.sandboxId ?? null, n = Jt(e, { confirmsNoAction: Yt({
1949
1950
  mode: _,
1950
1951
  capabilities: t ? w.getState().sandboxWriteCapabilities[t] : null
1951
1952
  }) });
1952
- cn(x, { outcome: n.kind === "temporary" ? "failed" : "refused" }), n.offersUpgrade && Ht(L, "sandbox");
1953
- let r = qt(n, P, { locale: V });
1954
- so(v, "error", x, r.headline), ao(v, x, { content: r.text }), oo(v, x, {
1953
+ dn(x, { outcome: n.kind === "temporary" ? "failed" : "refused" }), n.offersUpgrade && Gt(L, "sandbox");
1954
+ let r = Xt(n, P, { locale: V });
1955
+ uo(v, "error", x, r.headline), co(v, x, { content: r.text }), lo(v, x, {
1955
1956
  lang: r.translated ? V : "en",
1956
- ...lr(i.voiceSessionId)
1957
+ ...fr(i.voiceSessionId)
1957
1958
  });
1958
1959
  } finally {
1959
- we(), ws.current.delete(Ee), cn(x, { outcome: "stopped" }), E(x, "complete"), Se(), be();
1960
+ we(), As.current.delete(Ee), dn(x, { outcome: "stopped" }), E(x, "complete"), Se(), be();
1960
1961
  let e = w.getState(), t = de(ie, _, e.conversations.find((e) => e.id === Ee), (t) => !!e.sandboxesByMode[t]?.sandboxId);
1961
- t && (vo(Ee, t.mode), t.backendSessionId && lo(Ee, t.backendSessionId)), ve.session && ae() && K.afterTurn({
1962
+ t && (xo(Ee, t.mode), t.backendSessionId && po(Ee, t.backendSessionId)), ve.session && ae() && K.afterTurn({
1962
1963
  ...ve.session,
1963
1964
  conversationId: Ee
1964
1965
  }, x);
1965
- let n = Bs.current;
1966
- Bs.current = null, n && n.conversationId === Ee && ae() && Yc.current(n.content, n.attachments, n.options), De();
1966
+ let n = Ks.current;
1967
+ Ks.current = null, n && n.conversationId === Ee && ae() && tl.current(n.content, n.attachments, n.options), De();
1967
1968
  }
1968
1969
  }, [
1969
1970
  H,
1970
1971
  W,
1971
- Pa,
1972
- uo,
1973
- po,
1974
- Qa,
1975
- ro,
1976
- js,
1972
+ La,
1973
+ mo,
1974
+ go,
1975
+ to,
1976
+ oo,
1977
+ Ls,
1977
1978
  K,
1978
- Hs,
1979
- Rc,
1980
- Gc,
1981
- V,
1982
- Ja,
1983
- Ra,
1984
- Na,
1985
- za,
1986
- Ba,
1987
- ao,
1988
- L,
1989
- Ho,
1990
- Ia,
1991
- Xa,
1979
+ Js,
1980
+ Wc,
1981
+ Zc,
1992
1982
  V,
1993
1983
  Za,
1994
- Ya,
1995
- vo,
1996
- Wc,
1997
- Nc,
1998
- _s,
1999
- bs,
2000
- lo,
2001
- to,
2002
- so,
1984
+ Va,
1985
+ Ia,
1986
+ Ha,
1987
+ Ua,
2003
1988
  co,
2004
- P,
2005
- ks,
1989
+ L,
1990
+ Jo,
1991
+ za,
1992
+ $a,
1993
+ V,
1994
+ eo,
1995
+ Qa,
1996
+ xo,
1997
+ Xc,
1998
+ zc,
1999
+ Cs,
2000
+ Es,
2001
+ po,
2006
2002
  io,
2003
+ uo,
2004
+ fo,
2005
+ P,
2006
+ Fs,
2007
+ so,
2007
2008
  B,
2008
2009
  Z,
2009
- _c,
2010
- Lc,
2011
- Dc,
2012
- Qs,
2013
- Zs,
2010
+ Cc,
2011
+ Uc,
2012
+ Nc,
2013
+ ic,
2014
+ rc,
2014
2015
  F
2015
- ]), Kc = D((e, t) => {
2016
+ ]), Qc = D((e, t) => {
2016
2017
  Q(e, [], t ? { autoIntent: t } : {});
2017
- }, [Q]), qc = et(), Jc = D(() => {
2018
- let e = [...yo.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
2018
+ }, [Q]), $c = rt(), el = D(() => {
2019
+ let e = [...So.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
2019
2020
  if (!e || e.metadata?.approvalFollowUp) return;
2020
- let t = H ? xs.current[H] ?? [] : [], n = na(e.metadata?.askAbout) ?? void 0, r = n ? { focus: n } : {};
2021
- if (t.some((e) => rt(e, Date.now()))) {
2021
+ let t = H ? Ds.current[H] ?? [] : [], n = aa(e.metadata?.askAbout) ?? void 0, r = n ? { focus: n } : {};
2022
+ if (t.some((e) => ot(e, Date.now()))) {
2022
2023
  let n = H ?? void 0;
2023
- it(t, qc).then((t) => {
2024
+ st(t, $c).then((t) => {
2024
2025
  Q(e.content, t, {
2025
2026
  ...n === void 0 ? {} : { targetConversationId: n },
2026
2027
  ...r
@@ -2028,274 +2029,274 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
2028
2029
  });
2029
2030
  } else Q(e.content, t, r);
2030
2031
  }, [
2031
- bo,
2032
+ Co,
2032
2033
  Q,
2033
2034
  H,
2034
- qc
2035
- ]), Yc = A(Q);
2035
+ $c
2036
+ ]), tl = A(Q);
2036
2037
  O(() => {
2037
- Yc.current = Q;
2038
+ tl.current = Q;
2038
2039
  }, [Q]);
2039
- let Xc = k(() => {
2040
- if (So) return null;
2041
- for (let e = bo.length - 1; e >= 0; --e) {
2042
- let t = bo[e];
2040
+ let nl = k(() => {
2041
+ if (To) return null;
2042
+ for (let e = Co.length - 1; e >= 0; --e) {
2043
+ let t = Co[e];
2043
2044
  if (t?.role !== "assistant") continue;
2044
- if (t.id === ac) return null;
2045
- if (!cr(t) || zs.current.has(t.id) || jt(t.id)) continue;
2046
- let n = Qn(t, xo, P);
2045
+ if (t.id === dc) return null;
2046
+ if (!dr(t) || Gs.current.has(t.id) || Pt(t.id)) continue;
2047
+ let n = tr(t, wo, P);
2047
2048
  if (n.kind !== "output") return null;
2048
- let r = Xe(n.text).text.trim();
2049
- return r ? Cr(t, r, xo) : null;
2049
+ let r = $e(n.text).text.trim();
2050
+ return r ? Er(t, r, wo) : null;
2050
2051
  }
2051
2052
  return null;
2052
2053
  }, [
2053
- bo,
2054
- So,
2055
- xo,
2056
- ac,
2054
+ Co,
2055
+ To,
2056
+ wo,
2057
+ dc,
2057
2058
  P
2058
- ]), Zc = k(() => Xc ? nr(Xc.text) : null, [Xc]), Qc = k(() => yo.chat.filter((e) => e.id !== ac), [yo.chat, ac]), $c = k(() => I ? yo.all.filter((e) => e.id !== ac) : Qc, [
2059
+ ]), rl = k(() => nl ? ar(nl.text) : null, [nl]), il = k(() => So.chat.filter((e) => e.id !== dc), [So.chat, dc]), al = k(() => I ? So.all.filter((e) => e.id !== dc) : il, [
2059
2060
  I,
2060
- yo.all,
2061
- ac,
2062
- Qc
2063
- ]), [el, tl] = j(null), nl = w((e) => ot(e)?.sandboxId ?? null), rl = kr(Qc, {
2061
+ So.all,
2062
+ dc,
2063
+ il
2064
+ ]), [ol, sl] = j(null), cl = w((e) => lt(e)?.sandboxId ?? null), ll = Mr(il, {
2064
2065
  sessionId: G?.backendSessionId,
2065
- sandboxId: nl,
2066
+ sandboxId: cl,
2066
2067
  nowMs: Date.now()
2067
- }), il = Ar(Qc), al = (e) => {
2068
+ }), ul = Nr(il), dl = (e) => {
2068
2069
  if (ae(e.metadata).length > 0) return !0;
2069
2070
  let t = e.metadata?.sandboxId;
2070
- return oe(t ? To[t] : null);
2071
- }, ol = (e) => {
2071
+ return oe(t ? Oo[t] : null);
2072
+ }, fl = (e) => {
2072
2073
  let t = ae(e.metadata);
2073
2074
  return t.length === 0 || !H ? null : /* @__PURE__ */ M(d, {
2074
2075
  refs: t,
2075
2076
  conversationId: H,
2076
2077
  panel: K,
2077
- entries: Eo,
2078
- capabilitiesOf: (e) => To[e],
2079
- turnInFlight: So,
2078
+ entries: ko,
2079
+ capabilitiesOf: (e) => Oo[e],
2080
+ turnInFlight: To,
2080
2081
  tr: P,
2081
- onReview: Oo.review,
2082
- retiredSandboxes: Do,
2082
+ onReview: jo.review,
2083
+ retiredSandboxes: Ao,
2083
2084
  onReapply: () => void Q(P("writeProposal.reapplyPrompt", "That change wasn't saved because it changed after you read it. Fetch the latest version and reapply only your change on top of it."))
2084
2085
  });
2085
- }, sl = (e) => {
2086
+ }, pl = (e) => {
2086
2087
  if (!H) return null;
2087
2088
  let t = Z.liveOffersFor(e, {
2088
2089
  registry: {
2089
- destinations: zr(ec),
2090
- permissionsSettled: tc,
2091
- simulating: nc
2090
+ destinations: Hr(oc),
2091
+ permissionsSettled: sc,
2092
+ simulating: cc
2092
2093
  },
2093
2094
  actorId: B,
2094
2095
  conversationId: H,
2095
2096
  perfNow: performance.now()
2096
2097
  }), n = t[0];
2097
- return n ? /* @__PURE__ */ M(Ai, {
2098
+ return n ? /* @__PURE__ */ M(Ni, {
2098
2099
  offers: t.map(({ offer: e, target: t }) => ({
2099
2100
  offerId: e.offerId,
2100
2101
  label: t.label,
2101
2102
  path: t.path
2102
2103
  })),
2103
- hint: t.length === 1 && z === "proposal-v1" ? Ti(n.offer, Z.turnFor(e)) : "link",
2104
- onOpen: Ec
2104
+ hint: t.length === 1 && z === "proposal-v1" ? Oi(n.offer, Z.turnFor(e)) : "link",
2105
+ onOpen: Mc
2105
2106
  }, n.offer.offerId) : null;
2106
- }, cl = (e) => e.role === "assistant" ? sl(e.id) : null;
2107
+ }, ml = (e) => e.role === "assistant" ? pl(e.id) : null;
2107
2108
  O(() => {
2108
2109
  let e = Z.nextExpiryInMs(performance.now());
2109
2110
  if (e === null) return;
2110
- let t = window.setTimeout(_c, e + 1);
2111
+ let t = window.setTimeout(Cc, e + 1);
2111
2112
  return () => window.clearTimeout(t);
2112
2113
  }, [
2113
2114
  Z,
2114
- hc,
2115
- _c
2115
+ xc,
2116
+ Cc
2116
2117
  ]);
2117
- let ll = Oo.dialog.view ? Eo[Oo.dialog.view.proposalId] : void 0, ul = rl?.expiresAtMs ?? null;
2118
+ let hl = jo.dialog.view ? ko[jo.dialog.view.proposalId] : void 0, gl = ll?.expiresAtMs ?? null;
2118
2119
  O(() => {
2119
- if (ul === null) return;
2120
- let e = window.setTimeout(() => Rs((e) => e + 1), Math.max(0, ul - Date.now()));
2120
+ if (gl === null) return;
2121
+ let e = window.setTimeout(() => Ws((e) => e + 1), Math.max(0, gl - Date.now()));
2121
2122
  return () => window.clearTimeout(e);
2122
- }, [ul, Ls]);
2123
- let dl = k(() => yo.voice.filter((e) => e.id !== ac && (e.role === "user" || e.role === "assistant")).map((e) => ({
2123
+ }, [gl, Us]);
2124
+ let _l = k(() => So.voice.filter((e) => e.id !== dc && (e.role === "user" || e.role === "assistant")).map((e) => ({
2124
2125
  id: e.id,
2125
2126
  role: e.role,
2126
- text: tr(e, xo, P),
2127
- sessionId: ur(e),
2127
+ text: ir(e, wo, P),
2128
+ sessionId: pr(e),
2128
2129
  timestamp: e.timestamp
2129
2130
  })).filter((e) => e.text.length > 0), [
2130
- yo.voice,
2131
- xo,
2132
- ac,
2131
+ So.voice,
2132
+ wo,
2133
+ dc,
2133
2134
  P
2134
- ]), fl = D(() => {
2135
- if (dl.length === 0) return;
2135
+ ]), vl = D(() => {
2136
+ if (_l.length === 0) return;
2136
2137
  let e = /* @__PURE__ */ new Date();
2137
- or(ir(dl, {
2138
+ lr(sr(_l, {
2138
2139
  title: P("voiceSession.transcript", "Voice conversation"),
2139
2140
  savedAt: P("voiceSession.savedAt", "Saved"),
2140
2141
  session: P("voiceSession.sessionLabel", "Session"),
2141
2142
  earlier: P("voiceSession.earlierLabel", "Earlier"),
2142
2143
  you: P("voiceSession.speakerYou", "You"),
2143
2144
  assistant: P("voiceSession.speakerAssistant", "Assistant")
2144
- }, e), ar(L, e), "text/markdown");
2145
+ }, e), cr(L, e), "text/markdown");
2145
2146
  }, [
2146
2147
  L,
2147
- dl,
2148
+ _l,
2148
2149
  P
2149
- ]), pl = $e({ perFileChars: ns }), ml = A(pl);
2150
- ml.current = pl;
2151
- let [hl, gl] = j(null), _l = hl === null ? null : P("attachments.voiceDropped", "{{count}} attachment(s) couldn't be saved and weren't sent.", { count: hl });
2150
+ ]), yl = nt({ perFileChars: cs }), bl = A(yl);
2151
+ bl.current = yl;
2152
+ let [xl, Sl] = j(null), Cl = xl === null ? null : P("attachments.voiceDropped", "{{count}} attachment(s) couldn't be saved and weren't sent.", { count: xl });
2152
2153
  O(() => {
2153
- if (hl === null) return;
2154
- let e = window.setTimeout(() => gl(null), da);
2154
+ if (xl === null) return;
2155
+ let e = window.setTimeout(() => Sl(null), ma);
2155
2156
  return () => window.clearTimeout(e);
2156
- }, [hl]);
2157
- let vl = A(/* @__PURE__ */ new Set()), yl = A(() => !1), bl = D((e, t, n, r) => {
2158
- let i = fs.current, a = xr(i), o = () => {
2157
+ }, [xl]);
2158
+ let wl = A(/* @__PURE__ */ new Set()), Tl = A(() => !1), El = D((e, t, n, r) => {
2159
+ let i = vs.current, a = wr(i), o = () => {
2159
2160
  let e = w.getState();
2160
- return hr({
2161
- sessionLive: yl.current(t),
2161
+ return vr({
2162
+ sessionLive: Tl.current(t),
2162
2163
  boundAtSubmit: i,
2163
2164
  activeConversationId: e.activeConversationId,
2164
2165
  boundConversationExists: e.conversations.some((e) => e.id === a)
2165
2166
  });
2166
2167
  }, s = () => {
2167
- let i = ml.current;
2168
- nt({
2168
+ let i = bl.current;
2169
+ at({
2169
2170
  draft: i,
2170
2171
  maySend: o,
2171
- budgetMs: tt,
2172
+ budgetMs: it,
2172
2173
  sendTurn: (i) => {
2173
2174
  let a = {
2174
2175
  ...n,
2175
- handedOver: dn()
2176
+ handedOver: mn()
2176
2177
  };
2177
- Yc.current(e, i, {
2178
+ tl.current(e, i, {
2178
2179
  fromPerson: !0,
2179
2180
  voiceSessionId: t,
2180
2181
  voiceTiming: a,
2181
2182
  ...r.correction ? { correctsInFlightTurn: !0 } : {}
2182
2183
  });
2183
2184
  },
2184
- announceDropped: (e) => gl(e)
2185
+ announceDropped: (e) => Sl(e)
2185
2186
  });
2186
2187
  };
2187
- if (o() && Ic.current(e, t)) {
2188
- Yc.current(e, [], {
2188
+ if (o() && Hc.current(e, t)) {
2189
+ tl.current(e, [], {
2189
2190
  fromPerson: !0,
2190
2191
  voiceSessionId: t,
2191
2192
  voiceTiming: {
2192
2193
  ...n,
2193
- handedOver: dn()
2194
+ handedOver: mn()
2194
2195
  }
2195
2196
  });
2196
2197
  return;
2197
2198
  }
2198
- if (!ml.current.isBusy) {
2199
+ if (!bl.current.isBusy) {
2199
2200
  s();
2200
2201
  return;
2201
2202
  }
2202
- let c = Date.now(), l = vl.current, u = window.setInterval(() => {
2203
- let e = ml.current.isBusy;
2204
- ml.current.isCommitting || e && Date.now() - c < ua || (window.clearInterval(u), l.delete(u), s());
2203
+ let c = Date.now(), l = wl.current, u = window.setInterval(() => {
2204
+ let e = bl.current.isBusy;
2205
+ bl.current.isCommitting || e && Date.now() - c < pa || (window.clearInterval(u), l.delete(u), s());
2205
2206
  }, 200);
2206
2207
  l.add(u);
2207
- }, []), xl = A(() => void 0), $ = Ze({
2208
- onSubmit: bl,
2209
- latestReply: Xc,
2210
- language: o(Ka, V).tag,
2211
- graceMs: Ha,
2212
- onSupersede: Us,
2213
- handsFreeStreamNoticeAccepted: Wa,
2214
- onAcceptHandsFreeStreamNotice: Ga,
2215
- handsFreeInterrupt: Ua,
2208
+ }, []), Dl = A(() => void 0), $ = et({
2209
+ onSubmit: El,
2210
+ latestReply: nl,
2211
+ language: o(Ya, V).tag,
2212
+ graceMs: Ga,
2213
+ onSupersede: Ys,
2214
+ handsFreeStreamNoticeAccepted: qa,
2215
+ onAcceptHandsFreeStreamNotice: Ja,
2216
+ handsFreeInterrupt: Ka,
2216
2217
  onBargeIn: () => {
2217
- xl.current(), Hs();
2218
+ Dl.current(), Js();
2218
2219
  }
2219
2220
  });
2220
- yl.current = $.isCurrentSession;
2221
- let Sl = ps ? dl.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : dl, Cl = $.answerLocally;
2221
+ Tl.current = $.isCurrentSession;
2222
+ let Ol = ys ? _l.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : _l, kl = $.answerLocally;
2222
2223
  O(() => {
2223
- zc.current = Cl;
2224
- }, [Cl]);
2225
- let wl = $.active, Tl = k(() => v(Object.values(Eo), H, Do), [
2226
- Eo,
2224
+ Gc.current = kl;
2225
+ }, [kl]);
2226
+ let Al = $.active, jl = k(() => v(Object.values(ko), H, Ao), [
2227
+ ko,
2227
2228
  H,
2228
- Do
2229
- ]), [El, Dl] = j(null);
2229
+ Ao
2230
+ ]), [Ml, Nl] = j(null);
2230
2231
  O(() => {
2231
- wl || Dl(null);
2232
- }, [wl]);
2233
- let Ol = Oo.review, kl = D(() => {
2234
- let e = Tl[Tl.length - 1];
2232
+ Al || Nl(null);
2233
+ }, [Al]);
2234
+ let Pl = jo.review, Fl = D(() => {
2235
+ let e = jl[jl.length - 1];
2235
2236
  if (!e) return;
2236
2237
  let { view: t } = e;
2237
- f(t) && m(t, To[e.session.sandboxId]).offerConfirm ? Ol(t) : Dl(t.proposalId);
2238
+ f(t) && m(t, Oo[e.session.sandboxId]).offerConfirm ? Pl(t) : Nl(t.proposalId);
2238
2239
  }, [
2239
- Tl,
2240
- To,
2241
- Ol
2242
- ]), Al = wl ? _(Tl) : null, jl = El ? Eo[El] : void 0, Ml = wl && jl && jl.session.conversationId === H ? {
2240
+ jl,
2241
+ Oo,
2242
+ Pl
2243
+ ]), Il = Al ? _(jl) : null, Ll = Ml ? ko[Ml] : void 0, Rl = Al && Ll && Ll.session.conversationId === H ? {
2243
2244
  content: /* @__PURE__ */ M(d, {
2244
2245
  refs: [{
2245
- proposalId: jl.view.proposalId,
2246
- sandboxId: jl.session.sandboxId,
2247
- sessionId: jl.session.sessionId
2246
+ proposalId: Ll.view.proposalId,
2247
+ sandboxId: Ll.session.sandboxId,
2248
+ sessionId: Ll.session.sessionId
2248
2249
  }],
2249
- conversationId: jl.session.conversationId,
2250
+ conversationId: Ll.session.conversationId,
2250
2251
  panel: K,
2251
- entries: Eo,
2252
- capabilitiesOf: (e) => To[e],
2253
- turnInFlight: So,
2252
+ entries: ko,
2253
+ capabilitiesOf: (e) => Oo[e],
2254
+ turnInFlight: To,
2254
2255
  tr: P,
2255
- onReview: Ol,
2256
- retiredSandboxes: Do
2256
+ onReview: Pl,
2257
+ retiredSandboxes: Ao
2257
2258
  }),
2258
2259
  closeLabel: re(P, h.trayClose),
2259
- onClose: () => Dl(null)
2260
- } : null, Nl = Oo.asking, Pl = kc?.asking === !0, Fl = Ac?.asking === !0, Il = di(), Ll = $.holdListening, Rl = k(() => wl || J ? null : { run: () => ss ? { status: "already" } : (ds(!0), { status: "done" }) }, [
2261
- wl,
2260
+ onClose: () => Nl(null)
2261
+ } : null, zl = jo.asking, Bl = Fc?.asking === !0, Vl = Ic?.asking === !0, Hl = mi(), Ul = $.holdListening, Wl = k(() => Al || J ? null : { run: () => ps ? { status: "already" } : (_s(!0), { status: "done" }) }, [
2262
+ Al,
2262
2263
  J,
2263
- ss,
2264
- ds
2264
+ ps,
2265
+ _s
2265
2266
  ]);
2266
- li("assistant.transcript", Rl);
2267
- let zl = k(() => wl ? null : { run: () => {
2267
+ fi("assistant.transcript", Wl);
2268
+ let Gl = k(() => Al ? null : { run: () => {
2268
2269
  let e = w.getState(), t = e.conversations.find((t) => t.id === e.activeConversationId);
2269
2270
  return t && t.messages.length === 0 ? { status: "already" } : (e.createConversation(), { status: "done" });
2270
- } }, [wl]);
2271
- li("assistant.conversation.new", zl), O(() => {
2272
- Ll(wl && (Nl || Pl || Fl || Il));
2271
+ } }, [Al]);
2272
+ fi("assistant.conversation.new", Gl), O(() => {
2273
+ Ul(Al && (zl || Bl || Vl || Hl));
2273
2274
  }, [
2274
- wl,
2275
- Nl,
2276
- Pl,
2277
- Fl,
2278
- Il,
2279
- Ll
2275
+ Al,
2276
+ zl,
2277
+ Bl,
2278
+ Vl,
2279
+ Hl,
2280
+ Ul
2280
2281
  ]);
2281
- let Bl = A(null), Vl = $.announce;
2282
+ let Kl = A(null), ql = $.announce;
2282
2283
  O(() => {
2283
- if (!wl) {
2284
- Bl.current = null;
2284
+ if (!Al) {
2285
+ Kl.current = null;
2285
2286
  return;
2286
2287
  }
2287
- let e = Bl.current;
2288
- if (e === null) Bl.current = new Set(Object.keys(Eo));
2289
- else for (let { view: t, session: n } of ne(Tl, e)) {
2288
+ let e = Kl.current;
2289
+ if (e === null) Kl.current = new Set(Object.keys(ko));
2290
+ else for (let { view: t, session: n } of ne(jl, e)) {
2290
2291
  e.add(t.proposalId);
2291
- let r = To[n.sandboxId];
2292
+ let r = Oo[n.sandboxId];
2292
2293
  if (!g({
2293
2294
  mode: "api-calls",
2294
2295
  productWriteApproval: z,
2295
2296
  capabilities: r
2296
2297
  })) continue;
2297
2298
  let i = ie(t, m(t, r).offerConfirm, P), a = t.proposalId;
2298
- Vl({
2299
+ ql({
2299
2300
  id: `write-readback:${a}`,
2300
2301
  text: i.text,
2301
2302
  lang: i.translated ? V : "en",
@@ -2303,566 +2304,570 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
2303
2304
  });
2304
2305
  }
2305
2306
  }, [
2306
- wl,
2307
- Tl,
2308
- Eo,
2309
- To,
2307
+ Al,
2308
+ jl,
2309
+ ko,
2310
+ Oo,
2310
2311
  z,
2311
2312
  P,
2312
2313
  V,
2313
- Vl,
2314
+ ql,
2314
2315
  K
2315
2316
  ]);
2316
- let Hl = A(!1);
2317
+ let Jl = A(!1);
2317
2318
  O(() => {
2318
- Hl.current = $.active;
2319
- }, [$.active]), O(() => Ji((e) => {
2320
- if (!Hl.current) return !1;
2321
- let t = fs.current;
2319
+ Jl.current = $.active;
2320
+ }, [$.active]), O(() => Zi((e) => {
2321
+ if (!Jl.current) return !1;
2322
+ let t = vs.current;
2322
2323
  return typeof t == "string" ? t === e : w.getState().activeConversationId === e;
2323
2324
  }), []);
2324
- let Ul = $.start, Wl = D(() => {
2325
- let e = w.getState().activeConversationId, t = vr(bs());
2326
- _s(br(t, e)), Ms(!0, t.kind === "own"), Ul();
2325
+ let Yl = $.start, Xl = D(() => {
2326
+ let e = w.getState().activeConversationId, t = xr(Es());
2327
+ Cs(Cr(t, e)), Rs(!0, t.kind === "own"), Yl();
2327
2328
  }, [
2328
- _s,
2329
- Ms,
2330
- bs,
2331
- Ul
2332
- ]), Gl = k(() => er(G?.messages ?? []), [G?.messages]), Kl = $n(yo.voice, xo, P), ql = $n(Gl, xo, P) > 0, Jl = D(() => {
2329
+ Cs,
2330
+ Rs,
2331
+ Es,
2332
+ Yl
2333
+ ]), Zl = k(() => rr(G?.messages ?? []), [G?.messages]), Ql = nr(So.voice, wo, P), $l = nr(Zl, wo, P) > 0, eu = D(() => {
2333
2334
  let e = w.getState().activeConversationId;
2334
- if (!e || dl.length === 0) return;
2335
- let t = new Set(Gl.map((e) => e.id)), n = N();
2335
+ if (!e || _l.length === 0) return;
2336
+ let t = new Set(Zl.map((e) => e.id)), n = N();
2336
2337
  W(e, {
2337
2338
  id: n,
2338
2339
  role: "system",
2339
- content: rr(dl.filter((e) => t.has(e.id)), {
2340
+ content: or(_l.filter((e) => t.has(e.id)), {
2340
2341
  intro: P("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
2341
2342
  nothing: P("voiceSession.continuedNothing", "Continued from a voice conversation."),
2342
2343
  more: (e) => P("voiceSession.continuedMore", "…and {{count}} more", { count: e })
2343
2344
  }),
2344
2345
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2345
- metadata: { continuedVoiceTurns: Kl }
2346
- }), zi.recordCommittedEntries(e, [n], "NOTE", T()), ds(!1), $.end(), ls(), Da?.();
2346
+ metadata: { continuedVoiceTurns: Ql }
2347
+ }), Hi.recordCommittedEntries(e, [n], "NOTE", T()), _s(!1), $.end(), hs(), Aa?.();
2347
2348
  }, [
2348
- dl,
2349
- Kl,
2350
- Gl,
2349
+ _l,
2350
+ Ql,
2351
+ Zl,
2351
2352
  W,
2352
2353
  P,
2353
2354
  $,
2354
- ds,
2355
- ls,
2356
- Da
2357
- ]), Yl = A({
2355
+ _s,
2356
+ hs,
2357
+ Aa
2358
+ ]), tu = A({
2358
2359
  conversationId: null,
2359
2360
  count: 0
2360
2361
  });
2361
2362
  O(() => {
2362
- $.active && (Yl.current = {
2363
+ $.active && (tu.current = {
2363
2364
  conversationId: H,
2364
- count: Kl
2365
+ count: Ql
2365
2366
  });
2366
2367
  }, [$.active]);
2367
- let [Xl, Zl] = j({}), [Ql, $l] = j({}), eu = A(null), tu = $.active;
2368
+ let [nu, ru] = j({}), [iu, au] = j({}), ou = A(null), su = $.active;
2368
2369
  O(() => {
2369
2370
  if (!I) return;
2370
- if (tu) {
2371
- eu.current ??= {
2371
+ if (su) {
2372
+ ou.current ??= {
2372
2373
  startedAt: Date.now(),
2373
2374
  sessionId: null
2374
2375
  };
2375
2376
  return;
2376
2377
  }
2377
- let e = eu.current;
2378
- eu.current = null;
2378
+ let e = ou.current;
2379
+ ou.current = null;
2379
2380
  let t = e?.sessionId;
2380
2381
  if (e && t) {
2381
2382
  let n = Math.max(1, Math.round((Date.now() - e.startedAt) / 1e3));
2382
- $l((e) => ({
2383
+ au((e) => ({
2383
2384
  ...e,
2384
2385
  [t]: n
2385
2386
  }));
2386
2387
  }
2387
- }, [I, tu]);
2388
- let nu = $.isCurrentSession;
2388
+ }, [I, su]);
2389
+ let cu = $.isCurrentSession;
2389
2390
  O(() => {
2390
- let e = eu.current;
2391
+ let e = ou.current;
2391
2392
  if (!I || !e || e.sessionId) return;
2392
- let t = dl.find((e) => e.sessionId !== void 0 && nu(e.sessionId));
2393
+ let t = _l.find((e) => e.sessionId !== void 0 && cu(e.sessionId));
2393
2394
  t?.sessionId && (e.sessionId = t.sessionId);
2394
2395
  }, [
2395
2396
  I,
2396
- dl,
2397
- nu
2397
+ _l,
2398
+ cu
2398
2399
  ]);
2399
- let ru = $.session.phase, iu = $c[$c.length - 1], au = I && $.active && (ru === "thinking" || ru === "speaking") && iu?.role === "assistant" && cr(iu) ? iu.id : null, ou = $.spokenChunks, su = au !== null && qs === au && ou ? pr(iu?.content ?? "", ou.chunks.slice(0, ou.index + 1).join(" ").length) : null, [cu, lu] = j({});
2400
- au !== null && su !== null && su.length > (cu[au]?.length ?? 0) && lu({
2401
- ...cu,
2402
- [au]: su
2400
+ let lu = $.session.phase, uu = al[al.length - 1], du = I && $.active && (lu === "thinking" || lu === "speaking") && uu?.role === "assistant" && dr(uu) ? uu.id : null, fu = $.spokenChunks, pu = du !== null && $s === du && fu ? gr(uu?.content ?? "", fu.chunks.slice(0, fu.index + 1).join(" ").length) : null, [mu, hu] = j({});
2401
+ du !== null && pu !== null && pu.length > (mu[du]?.length ?? 0) && hu({
2402
+ ...mu,
2403
+ [du]: pu
2403
2404
  });
2404
- let uu = au === null ? null : cu[au] ?? "", du = D(() => {
2405
- if (au === null || uu === null || !H) return;
2405
+ let gu = du === null ? null : mu[du] ?? "", _u = D(() => {
2406
+ if (du === null || gu === null || !H) return;
2406
2407
  let e = w.getState();
2407
- if (uu === "") {
2408
- e.mergeMessageMetadata(H, au, { voiceNotSpoken: !0 });
2408
+ if (gu === "") {
2409
+ e.mergeMessageMetadata(H, du, { voiceNotSpoken: !0 });
2409
2410
  return;
2410
2411
  }
2411
- if (qs !== au) return;
2412
- let t = uu;
2413
- Zl((e) => ({
2412
+ if ($s !== du) return;
2413
+ let t = gu;
2414
+ ru((e) => ({
2414
2415
  ...e,
2415
- [au]: t
2416
- })), e.mergeMessageMetadata(H, au, {
2416
+ [du]: t
2417
+ })), e.mergeMessageMetadata(H, du, {
2417
2418
  voiceInterrupted: !0,
2418
2419
  voiceSpokenText: t
2419
2420
  });
2420
2421
  }, [
2421
- au,
2422
- uu,
2422
+ du,
2423
+ gu,
2423
2424
  H,
2424
- qs
2425
+ $s
2425
2426
  ]);
2426
2427
  O(() => {
2427
- xl.current = du;
2428
- }, [du]);
2429
- let fu = (e, t, n) => {
2430
- if (!cr(e)) return;
2431
- let r = ur(e), i = n[t + 1], a = $.active && r !== void 0 && nu(r), o = (!i || !cr(i) || ur(i) !== r) && !a ? /* @__PURE__ */ M(dr, { seconds: r ? Ql[r] : void 0 }) : null;
2432
- if (e.role === "user") return { below: /* @__PURE__ */ sa(oa, { children: [/* @__PURE__ */ M(fr, { mark: "spoken" }), o] }) };
2428
+ Dl.current = _u;
2429
+ }, [_u]);
2430
+ let vu = (e, t, n) => {
2431
+ if (!dr(e)) return;
2432
+ let r = pr(e), i = n[t + 1], a = $.active && r !== void 0 && cu(r), o = (!i || !dr(i) || pr(i) !== r) && !a ? /* @__PURE__ */ M(mr, { seconds: r ? iu[r] : void 0 }) : null;
2433
+ if (e.role === "user") return { below: /* @__PURE__ */ ua(la, { children: [/* @__PURE__ */ M(hr, { mark: "spoken" }), o] }) };
2433
2434
  if (e.role !== "assistant") return o ? { below: o } : void 0;
2434
- let s = Xl[e.id] ?? (e.metadata?.voiceInterrupted ? e.metadata.voiceSpokenText : void 0);
2435
+ let s = nu[e.id] ?? (e.metadata?.voiceInterrupted ? e.metadata.voiceSpokenText : void 0);
2435
2436
  if (s !== void 0) return {
2436
2437
  content: s,
2437
- below: /* @__PURE__ */ sa(oa, { children: [/* @__PURE__ */ M(fr, { mark: "interrupted" }), o] })
2438
+ below: /* @__PURE__ */ ua(la, { children: [/* @__PURE__ */ M(hr, { mark: "interrupted" }), o] })
2438
2439
  };
2439
- if (e.id === au && uu !== null) return { content: uu };
2440
- let c = a || r !== void 0 && Ql[r] !== void 0;
2441
- return e.content.trim() !== "" && (c ? cu[e.id] !== void 0 : !e.metadata?.voiceNotSpoken) ? { below: /* @__PURE__ */ sa(oa, { children: [/* @__PURE__ */ M(fr, { mark: "spokenAloud" }), o] }) } : o ? { below: o } : void 0;
2442
- }, pu = D(() => {
2443
- let e = Yl.current, t = e.conversationId === H ? e.count : 0, n = Kl > t;
2444
- $.end(), n && ds(!0), du();
2440
+ if (e.id === du && gu !== null) return { content: gu };
2441
+ let c = a || r !== void 0 && iu[r] !== void 0;
2442
+ return e.content.trim() !== "" && (c ? mu[e.id] !== void 0 : !e.metadata?.voiceNotSpoken) ? { below: /* @__PURE__ */ ua(la, { children: [/* @__PURE__ */ M(hr, { mark: "spokenAloud" }), o] }) } : o ? { below: o } : void 0;
2443
+ }, yu = D(() => {
2444
+ let e = tu.current, t = e.conversationId === H ? e.count : 0, n = Ql > t;
2445
+ $.end(), n && _s(!0), _u();
2445
2446
  }, [
2446
2447
  H,
2447
- Kl,
2448
+ Ql,
2448
2449
  $,
2449
- ds,
2450
- du
2450
+ _s,
2451
+ _u
2451
2452
  ]);
2452
2453
  O(() => {
2453
- ya && Os || !$.active || $.end();
2454
+ Sa && Ps || !$.active || $.end();
2454
2455
  }, [
2455
- ya,
2456
- Os,
2456
+ Sa,
2457
+ Ps,
2457
2458
  $
2458
2459
  ]);
2459
- let [mu, hu] = j(ma), gu = Ge({
2460
+ let [bu, xu] = j(_a), Su = qe({
2460
2461
  available: $.available,
2461
- allowedInMode: Os,
2462
- readOnly: jo,
2463
- busy: So || Is !== null || No || dc,
2464
- committing: mu.committing,
2465
- dictating: mu.dictating
2466
- }), _u = We();
2467
- ia(() => {
2468
- Ta?.({ live: $.active });
2469
- }, [Ta, $.active]);
2470
- let vu = A(!1), yu = D(() => {
2471
- vu.current = !0, Ea?.({ review: !0 });
2472
- }, [Ea]);
2462
+ allowedInMode: Ps,
2463
+ readOnly: Po,
2464
+ busy: To || Hs !== null || Io || _c,
2465
+ committing: bu.committing,
2466
+ dictating: bu.dictating
2467
+ }), Cu = C();
2468
+ sa(() => {
2469
+ Oa?.({ live: $.active });
2470
+ }, [Oa, $.active]);
2471
+ let wu = A(!1), Tu = D(() => {
2472
+ wu.current = !0, ka?.({ review: !0 });
2473
+ }, [ka]);
2473
2474
  O(() => {
2474
- !Ma && vu.current && (vu.current = !1, ke(cd.current));
2475
- }, [Ma]);
2476
- let bu = $.active;
2475
+ !Fa && wu.current && (wu.current = !1, je(md.current));
2476
+ }, [Fa]);
2477
+ let Eu = $.active;
2477
2478
  O(() => {
2478
- if (!bu) ys.current = !1, vs.current = null;
2479
- else if (ps) {
2480
- let e = fs.current;
2481
- mr(e) && (vs.current = e.openAtStart), ys.current = !0;
2482
- } else ys.current && (ys.current = !1, F && De({
2479
+ if (!Eu) Ts.current = !1, ws.current = null;
2480
+ else if (ys) {
2481
+ let e = vs.current;
2482
+ _r(e) && (ws.current = e.openAtStart), Ts.current = !0;
2483
+ } else Ts.current && (Ts.current = !1, F && ke({
2483
2484
  pending: "own",
2484
- openAtStart: vs.current
2485
- }, fs.current) && gs(!0));
2485
+ openAtStart: ws.current
2486
+ }, vs.current) && Ss(!0));
2486
2487
  }, [
2487
- ps,
2488
- bu,
2488
+ ys,
2489
+ Eu,
2489
2490
  F
2490
- ]), hs && !$.active && gs(!1);
2491
- let [xu, Su] = j(null);
2491
+ ]), xs && !$.active && Ss(!1);
2492
+ let [Du, Ou] = j(null);
2492
2493
  O(() => {
2493
- xu !== null && (J && xu.conversationId === H || Su(null));
2494
+ Du !== null && (J && Du.conversationId === H || Ou(null));
2494
2495
  }, [
2495
2496
  J,
2496
2497
  H,
2497
- xu
2498
+ Du
2498
2499
  ]);
2499
- let Cu = xu !== null && qs === xu.replyId, wu = A(!1), Tu = D(() => {
2500
- wu.current = !0, Cu && Js(), Wl();
2500
+ let ku = Du !== null && $s === Du.replyId, Au = A(!1), ju = D(() => {
2501
+ Au.current = !0, ku && ec(), Xl();
2501
2502
  }, [
2502
- Wl,
2503
- Cu,
2504
- Js
2505
- ]), Eu = D(() => {
2506
- Cu && Js(), Wl();
2503
+ Xl,
2504
+ ku,
2505
+ ec
2506
+ ]), Mu = D(() => {
2507
+ ku && ec(), Xl();
2507
2508
  }, [
2508
- Wl,
2509
- Cu,
2510
- Js
2509
+ Xl,
2510
+ ku,
2511
+ ec
2511
2512
  ]);
2512
2513
  O(() => {
2513
- $.active || (wu.current = !1);
2514
+ $.active || (Au.current = !1);
2514
2515
  }, [$.active]), O(() => {
2515
- !J && wu.current && (wu.current = !1, $.active && pu());
2516
+ !J && Au.current && (Au.current = !1, $.active && yu());
2516
2517
  }, [
2517
2518
  J,
2518
2519
  $.active,
2519
- pu
2520
+ yu
2520
2521
  ]), O(() => {
2521
- J && ds(!1);
2522
- }, [J, ds]);
2523
- let Du = k(() => ({
2522
+ J && _s(!1);
2523
+ }, [J, _s]);
2524
+ let Nu = k(() => ({
2524
2525
  live: $.active,
2525
- blocked: gu === null ? null : _u.voiceStartBlocked(gu),
2526
- impossible: Ke(gu),
2527
- start: F ? Eu : Tu
2526
+ blocked: Su === null ? null : Cu.voiceStartBlocked(Su),
2527
+ impossible: Je(Su),
2528
+ start: F ? Mu : ju
2528
2529
  }), [
2529
2530
  $.active,
2530
- gu,
2531
- _u,
2531
+ Su,
2532
+ Cu,
2532
2533
  F,
2533
- Eu,
2534
- Tu
2535
- ]), [Ou, ku] = j("mini"), [Au, ju] = j(!1), Mu = Ma && $.active && (Au || J);
2536
- Mu !== Au && ju(Mu);
2537
- let Nu = F && !I && $.active && !J && (!Ma || Au), Pu = ya && q.covered !== !0 && !($.active && Ou !== "mini") && !(ss && !$.active) && !(Nl || Pl || Fl || Il), Fu = cs?.ask, Iu = aa(Fu?.subscribe ?? ga, Fu?.getSnapshot ?? _a, Fu?.getSnapshot ?? _a), Lu = C({
2534
+ Mu,
2535
+ ju
2536
+ ]), [Pu, Fu] = j("mini"), [Iu, Lu] = j(!1), Ru = Fa && $.active && (Iu || J);
2537
+ Ru !== Iu && Lu(Ru);
2538
+ let zu = F && !I && $.active && !J && (!Fa || Iu), Bu = Sa && q.covered !== !0 && !($.active && Pu !== "mini") && !(ps && !$.active) && !(zl || Bl || Vl || Hl), Vu = ms?.ask, Hu = ca(Vu?.subscribe ?? ya, Vu?.getSnapshot ?? ba, Vu?.getSnapshot ?? ba), Uu = Ye({
2538
2539
  voiceLive: $.active,
2539
- readOnly: jo,
2540
- writes: qe({
2541
- auto: Xo,
2540
+ readOnly: Po,
2541
+ writes: Xe({
2542
+ auto: ns,
2542
2543
  selectedMode: U,
2543
- conversation: G && !jo ? {
2544
+ conversation: G && !Po ? {
2544
2545
  mode: G.mode,
2545
2546
  routedBy: G.routedBy,
2546
- hasHistory: Bi(G)
2547
+ hasHistory: Ui(G)
2547
2548
  } : null,
2548
- modeWrites: (e) => R.find((t) => t.id === e)?.writeCapable === !0 || gt(e)
2549
+ modeWrites: (e) => R.find((t) => t.id === e)?.writeCapable === !0 || yt(e)
2549
2550
  }),
2550
- avatar: Iu,
2551
- busy: So || Is !== null || No || dc || rs !== null || es,
2552
- committing: mu.committing
2553
- }), Ru = A(Lu);
2554
- ia(() => {
2555
- Ru.current = Lu;
2556
- }, [Lu]);
2557
- let zu = D((e) => {
2551
+ avatar: Hu,
2552
+ busy: To || Hs !== null || Io || _c || ls !== null || os,
2553
+ committing: bu.committing
2554
+ }), Wu = A(Uu);
2555
+ sa(() => {
2556
+ Wu.current = Uu;
2557
+ }, [Uu]);
2558
+ let Gu = D((e) => {
2558
2559
  let t = e.trim();
2559
- if (t === "" || Ru.current !== null) return { accepted: !1 };
2560
- Cu && Js();
2560
+ if (t === "" || Wu.current !== null) return { accepted: !1 };
2561
+ ku && ec();
2561
2562
  let n = {
2562
2563
  token: N(),
2563
2564
  exchange: null,
2564
2565
  handled: !1
2565
2566
  };
2566
- Ys.current = n;
2567
+ tc.current = n;
2567
2568
  try {
2568
2569
  Q(t, [], {
2569
2570
  fromPerson: !0,
2570
2571
  avatarTabAsk: n.token,
2571
2572
  localRecordsChecked: !0,
2572
- ...Xo ? { autoIntent: "read" } : {}
2573
+ ...ns ? { autoIntent: "read" } : {}
2573
2574
  });
2574
2575
  } finally {
2575
- Ys.current = null;
2576
+ tc.current = null;
2576
2577
  }
2577
2578
  let r = n.exchange;
2578
2579
  return r === null ? n.handled ? {
2579
2580
  accepted: !0,
2580
2581
  recorded: !1
2581
- } : { accepted: !1 } : (Su(r), {
2582
+ } : { accepted: !1 } : (Ou(r), {
2582
2583
  accepted: !0,
2583
2584
  recorded: !0,
2584
2585
  ...r
2585
2586
  });
2586
2587
  }, [
2587
- Xo,
2588
+ ns,
2588
2589
  Q,
2589
- Js,
2590
- Cu
2591
- ]), [Bu] = j(() => Ye()), Vu = k(() => ({
2592
- blocker: Lu,
2593
- line: Je(Lu, gu),
2594
- send: zu,
2595
- last: xu,
2596
- navigatingReplyId: pc,
2597
- draft: Bu
2590
+ ec,
2591
+ ku
2592
+ ]), [Ku] = j(() => Qe()), qu = k(() => ({
2593
+ blocker: Uu,
2594
+ line: Ze(Uu, Su),
2595
+ send: Gu,
2596
+ last: Du,
2597
+ navigatingReplyId: yc,
2598
+ draft: Ku
2598
2599
  }), [
2599
- Lu,
2600
- gu,
2601
- zu,
2602
- xu,
2603
- pc,
2604
- Bu
2605
- ]), Hu = q.setReplyEscape, Uu = J && Pu && Cu;
2600
+ Uu,
2601
+ Su,
2602
+ Gu,
2603
+ Du,
2604
+ yc,
2605
+ Ku
2606
+ ]), Ju = q.setReplyEscape, Yu = J && Bu && ku;
2606
2607
  O(() => {
2607
- if (Hu && Uu) return Hu(Js), () => Hu(null);
2608
+ if (Ju && Yu) return Ju(ec), () => Ju(null);
2608
2609
  }, [
2609
- Hu,
2610
- Uu,
2611
- Js
2610
+ Ju,
2611
+ Yu,
2612
+ ec
2612
2613
  ]), O(() => {
2613
- let e = fs.current, t = xr(e), n = w.getState(), r = _r({
2614
+ let e = vs.current, t = wr(e), n = w.getState(), r = br({
2614
2615
  sessionLive: $.active,
2615
2616
  bound: e,
2616
2617
  activeConversationId: n.activeConversationId,
2617
2618
  boundConversationExists: n.conversations.some((e) => e.id === t)
2618
2619
  });
2619
- _s(r.bound), r.end && $.end();
2620
+ Cs(r.bound), r.end && $.end();
2620
2621
  }, [
2621
2622
  $,
2622
2623
  H,
2623
- Qa,
2624
- _s
2624
+ to,
2625
+ Cs
2625
2626
  ]), O(() => {
2626
- let e = gr(Sr.read(), {
2627
+ let e = yr(Tr.read(), {
2627
2628
  activeConversationId: H,
2628
- chatTurnCount: Qc.length,
2629
- voiceTurnCount: dl.length,
2629
+ chatTurnCount: il.length,
2630
+ voiceTurnCount: _l.length,
2630
2631
  sessionLive: $.active,
2631
- sessionBoundTo: fs.current,
2632
- turnInFlight: So
2632
+ sessionBoundTo: vs.current,
2633
+ turnInFlight: To
2633
2634
  });
2634
- Sr.write(e.state), e.open && ds(!0);
2635
+ Tr.write(e.state), e.open && _s(!0);
2635
2636
  }, [
2636
2637
  H,
2637
- Qc.length,
2638
- dl.length,
2638
+ il.length,
2639
+ _l.length,
2639
2640
  $.active,
2640
- So,
2641
- ds
2641
+ To,
2642
+ _s
2642
2643
  ]), O(() => {
2643
2644
  if (!$.active) {
2644
- ml.current.clear(), gl(null), Bs.current = null;
2645
- for (let e of vl.current) window.clearInterval(e);
2646
- vl.current.clear();
2645
+ bl.current.clear(), Sl(null), Ks.current = null;
2646
+ for (let e of wl.current) window.clearInterval(e);
2647
+ wl.current.clear();
2647
2648
  }
2648
2649
  }, [$.active]), O(() => {
2649
- let e = vl.current;
2650
+ let e = wl.current;
2650
2651
  return () => {
2651
2652
  for (let t of e) window.clearInterval(t);
2652
2653
  e.clear();
2653
2654
  };
2654
2655
  }, []), O(() => {
2655
2656
  let e = w.getState().consumePendingPrompt();
2656
- return e && Yc.current(e), w.subscribe((e, t) => {
2657
+ return e && tl.current(e), w.subscribe((e, t) => {
2657
2658
  if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
2658
2659
  let e = w.getState().consumePendingPrompt();
2659
- e && Yc.current(e);
2660
+ e && tl.current(e);
2660
2661
  }
2661
2662
  });
2662
2663
  }, []);
2663
- let Wu = D((e) => {
2664
+ let Xu = D((e) => {
2664
2665
  let t = H ? w.getState().conversations.find((e) => e.id === H) : void 0;
2665
- if (t && t.mode !== e && K.withdraw(t.id, "mode_switched"), t && Bi(t)) {
2666
+ if (t && t.mode !== e && K.withdraw(t.id, "mode_switched"), t && Ui(t)) {
2666
2667
  if (t.mode !== e) {
2667
- let t = qi(), n = w.getState().conversations.find((n) => n.mode === e && Ui(n, t) && !w.getState().processingByConversationId[n.id]);
2668
- n ? no(n.id) : ro(void 0, e);
2668
+ let t = Xi(), n = w.getState().conversations.find((n) => n.mode === e && Ki(n, t) && !w.getState().processingByConversationId[n.id]);
2669
+ n ? ao(n.id) : oo(void 0, e);
2669
2670
  }
2670
- } else H && to(H, e);
2671
+ } else H && io(H, e);
2671
2672
  let n = w.getState().activeConversationId;
2672
- n ? to(n, e) : _o(!1), eo(e);
2673
+ n ? io(n, e) : bo(!1), ro(e);
2673
2674
  }, [
2674
2675
  H,
2676
+ oo,
2677
+ ao,
2678
+ bo,
2679
+ io,
2675
2680
  ro,
2676
- no,
2677
- _o,
2678
- to,
2679
- eo,
2680
2681
  K
2681
- ]), Gu = D(() => {
2682
+ ]), Zu = D(() => {
2682
2683
  let e = w.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
2683
2684
  if (!t) {
2684
- _o(!0), eo(b);
2685
+ bo(!0), ro(b);
2685
2686
  return;
2686
2687
  }
2687
2688
  if (t.routedBy === "auto") {
2688
- _o(!0);
2689
+ bo(!0);
2689
2690
  return;
2690
2691
  }
2691
- if (!Bi(t)) {
2692
- vo(t.id, b);
2692
+ if (!Ui(t)) {
2693
+ xo(t.id, b);
2693
2694
  return;
2694
2695
  }
2695
2696
  K.withdraw(t.id, "mode_switched");
2696
- let n = qi(), r = e.conversations.find((t) => t.routedBy === "auto" && Ui(t, n) && !e.processingByConversationId[t.id]);
2697
- r ? (no(r.id), vo(r.id, b)) : ro(void 0, b, { routedBy: "auto" });
2697
+ let n = Xi(), r = e.conversations.find((t) => t.routedBy === "auto" && Ki(t, n) && !e.processingByConversationId[t.id]);
2698
+ r ? (ao(r.id), xo(r.id, b)) : oo(void 0, b, { routedBy: "auto" });
2698
2699
  }, [
2700
+ oo,
2701
+ xo,
2702
+ ao,
2703
+ bo,
2699
2704
  ro,
2700
- vo,
2701
- no,
2702
- _o,
2703
- eo,
2704
2705
  K
2705
- ]), Ku = D((e) => {
2706
- R.find((t) => t.id === e)?.writeCapable && !Jn(w.getState().acknowledgedWriteModes, e) ? is(e) : Wu(e);
2707
- }, [Wu, R]), qu = D(() => {
2708
- let e = rs;
2709
- if (is(null), !e) return;
2710
- let t = Qo.current;
2711
- Qo.current = null, t ? (ho(e), Q(t.content, t.attachments, t.options)) : (ho(e), Wu(e));
2706
+ ]), Qu = D((e) => {
2707
+ R.find((t) => t.id === e)?.writeCapable && !Zn(w.getState().acknowledgedWriteModes, e) ? us(e) : Xu(e);
2708
+ }, [Xu, R]), $u = D(() => {
2709
+ let e = ls;
2710
+ if (us(null), !e) return;
2711
+ let t = is.current;
2712
+ is.current = null, t ? (vo(e), Q(t.content, t.attachments, t.options)) : (vo(e), Xu(e));
2712
2713
  }, [
2713
- rs,
2714
- ho,
2715
- Wu,
2714
+ ls,
2715
+ vo,
2716
+ Xu,
2716
2717
  Q
2717
- ]), Ju = rs === null ? void 0 : R.find((e) => e.id === rs) ?? { id: rs }, Yu = D(() => {
2718
- is(null);
2719
- let e = Qo.current;
2720
- Qo.current = null, e && Q(e.content, e.attachments, {
2718
+ ]), ed = ls === null ? void 0 : R.find((e) => e.id === ls) ?? { id: ls }, td = D(() => {
2719
+ us(null);
2720
+ let e = is.current;
2721
+ is.current = null, e && Q(e.content, e.attachments, {
2721
2722
  ...e.options,
2722
2723
  autoIntent: "read"
2723
2724
  });
2724
- }, [Q]), Xu = D(() => Hs(), [Hs]), [Zu, Qu] = j(null), $u = D(() => {
2725
- let e = w.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0, n = Ps.current;
2725
+ }, [Q]), nd = D(() => Js(), [Js]), [rd, id] = j(null), ad = D(() => {
2726
+ let e = w.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0, n = Bs.current;
2726
2727
  return {
2727
2728
  state: e,
2728
2729
  conversation: t ? {
2729
2730
  mode: t.mode,
2730
- hasHistory: Bi(t),
2731
+ hasHistory: Ui(t),
2731
2732
  routedByAuto: t.routedBy === "auto"
2732
2733
  } : null,
2733
2734
  waitingCount: t ? K.liveFor(t.id).count : 0,
2734
2735
  hasDraft: n !== null && (n.text.trim() !== "" || n.hasAttachments)
2735
2736
  };
2736
- }, [K]), ed = Xo ? P("modeSelector.auto", "Auto") : void 0, td = D((e) => {
2737
- if (rs !== null) return;
2738
- let { state: t, conversation: n, waitingCount: r, hasDraft: i } = $u(), a = R.find((t) => t.id === e), o = Ae({
2737
+ }, [K]), od = ns ? P("modeSelector.auto", "Auto") : void 0, sd = D((e) => {
2738
+ if (ls !== null) return;
2739
+ let { state: t, conversation: n, waitingCount: r, hasDraft: i } = ad(), a = R.find((t) => t.id === e), o = Me({
2739
2740
  target: {
2740
2741
  kind: "mode",
2741
2742
  mode: e,
2742
- consentRequired: !!a?.writeCapable && !Jn(t.acknowledgedWriteModes, e)
2743
+ consentRequired: !!a?.writeCapable && !Zn(t.acknowledgedWriteModes, e)
2743
2744
  },
2744
2745
  conversation: n,
2745
2746
  waitingCount: r,
2746
2747
  hasDraft: i
2747
2748
  });
2748
- o.needsDialog ? Qu({
2749
+ o.needsDialog ? id({
2749
2750
  open: !0,
2750
2751
  target: {
2751
2752
  kind: "mode",
2752
2753
  mode: e
2753
2754
  },
2754
2755
  plan: o,
2755
- targetName: we(P, a ?? { id: e }),
2756
- currentName: ed
2757
- }) : Wu(e);
2756
+ targetName: Ee(P, a ?? { id: e }),
2757
+ currentName: od
2758
+ }) : Xu(e);
2758
2759
  }, [
2759
- ed,
2760
- $u,
2761
- rs,
2762
- Wu,
2760
+ od,
2761
+ ad,
2762
+ ls,
2763
+ Xu,
2763
2764
  R,
2764
2765
  P
2765
- ]), nd = D(() => {
2766
- if (rs !== null) return;
2767
- let { conversation: e, waitingCount: t, hasDraft: n } = $u(), r = Ae({
2766
+ ]), cd = D(() => {
2767
+ if (ls !== null) return;
2768
+ let { conversation: e, waitingCount: t, hasDraft: n } = ad(), r = Me({
2768
2769
  target: { kind: "auto" },
2769
2770
  conversation: e,
2770
2771
  waitingCount: t,
2771
2772
  hasDraft: n
2772
2773
  });
2773
- r.needsDialog ? Qu({
2774
+ r.needsDialog ? id({
2774
2775
  open: !0,
2775
2776
  target: { kind: "auto" },
2776
2777
  plan: r,
2777
2778
  targetName: P("modeSelector.auto", "Auto")
2778
- }) : Gu();
2779
+ }) : Zu();
2779
2780
  }, [
2780
- Gu,
2781
- $u,
2782
- rs,
2781
+ Zu,
2782
+ ad,
2783
+ ls,
2783
2784
  P
2784
- ]), rd = D(() => {
2785
- let e = Zu;
2786
- e?.open && (Qu({
2785
+ ]), ld = D(() => {
2786
+ let e = rd;
2787
+ e?.open && (id({
2787
2788
  ...e,
2788
2789
  open: !1
2789
- }), e.target.kind === "auto" ? Gu() : (e.plan.consent && ho(e.target.mode), Wu(e.target.mode)));
2790
+ }), e.target.kind === "auto" ? Zu() : (e.plan.consent && vo(e.target.mode), Xu(e.target.mode)));
2790
2791
  }, [
2791
- ho,
2792
- Gu,
2792
+ vo,
2793
2793
  Zu,
2794
- Wu
2795
- ]), id = D(() => {
2796
- Qu((e) => e && {
2794
+ rd,
2795
+ Xu
2796
+ ]), ud = D(() => {
2797
+ id((e) => e && {
2797
2798
  ...e,
2798
2799
  open: !1
2799
2800
  });
2800
- }, []), ad = Zu ? {
2801
- consent: Zu.plan.consent,
2802
- withdrawnCount: Zu.plan.withdrawnCount,
2803
- movesToNewConversation: Zu.plan.movesToNewConversation,
2804
- draftKept: Zu.plan.draftKept,
2805
- targetName: Zu.targetName,
2806
- ...Zu.currentName === void 0 ? {} : { currentName: Zu.currentName }
2807
- } : void 0, od = Zu?.target.kind === "mode" ? Zu.target.mode : null, sd = od === null ? void 0 : R.find((e) => e.id === od) ?? { id: od }, cd = A(null), ld = k(() => {
2801
+ }, []), dd = rd ? {
2802
+ consent: rd.plan.consent,
2803
+ withdrawnCount: rd.plan.withdrawnCount,
2804
+ movesToNewConversation: rd.plan.movesToNewConversation,
2805
+ draftKept: rd.plan.draftKept,
2806
+ targetName: rd.targetName,
2807
+ ...rd.currentName === void 0 ? {} : { currentName: rd.currentName }
2808
+ } : void 0, fd = rd?.target.kind === "mode" ? rd.target.mode : null, pd = fd === null ? void 0 : R.find((e) => e.id === fd) ?? { id: fd }, md = A(null), hd = k(() => {
2808
2809
  if (!F) return 0;
2809
- let e = new Set($c.flatMap((e) => ae(e.metadata).map((e) => e.proposalId)));
2810
- return Oe(Eo, H, Do, e);
2810
+ let e = new Set(al.flatMap((e) => ae(e.metadata).map((e) => e.proposalId)));
2811
+ return Ae(ko, H, Ao, e);
2811
2812
  }, [
2812
2813
  F,
2813
- $c,
2814
+ al,
2814
2815
  H,
2815
- Eo,
2816
- Do
2817
- ]), ud = D(() => {
2818
- ke(cd.current);
2819
- }, []), dd = I && ka && $c.length === 0 && !No && !Po && !G?.sync?.hasOlder, fd = dd ? /* @__PURE__ */ M("div", {
2820
- ref: Aa,
2816
+ ko,
2817
+ Ao
2818
+ ]), gd = D(() => {
2819
+ je(md.current);
2820
+ }, []), _d = I && Ma && He({
2821
+ empty: al.length === 0,
2822
+ historyPending: Io || Lo,
2823
+ hasOlder: G?.sync?.hasOlder === !0
2824
+ }), vd = _d ? /* @__PURE__ */ M("div", {
2825
+ ref: Na,
2821
2826
  className: "w-full shrink-0",
2822
2827
  "data-testid": "assistant-page-start-above"
2823
- }) : $c.length === 0 && (No || Po) ? /* @__PURE__ */ M(_e, {
2824
- state: No ? "loading" : "failed",
2825
- onRetry: Wo
2826
- }) : $c.length === 0 && G?.sync?.hasOlder ? /* @__PURE__ */ M("div", {
2828
+ }) : al.length === 0 && (Io || Lo) ? /* @__PURE__ */ M(_e, {
2829
+ state: Io ? "loading" : "failed",
2830
+ onRetry: Xo
2831
+ }) : al.length === 0 && G?.sync?.hasOlder ? /* @__PURE__ */ M("div", {
2827
2832
  className: "flex min-h-0 flex-1 flex-col",
2828
- children: /* @__PURE__ */ M(S, {
2829
- onShowEarlier: Go,
2830
- disabled: No
2833
+ children: /* @__PURE__ */ M(ye, {
2834
+ onShowEarlier: Zo,
2835
+ disabled: Io
2831
2836
  })
2832
- }) : $c.length === 0 ? /* @__PURE__ */ M(me, {
2837
+ }) : al.length === 0 ? /* @__PURE__ */ M(me, {
2833
2838
  mode: U,
2834
- onSuggestionClick: Kc,
2835
- explainsAuto: Xo,
2836
- suggestions: Xo && U === "assistant" ? le(R.find((e) => e.id === "assistant")?.suggestions ?? [], R.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
2837
- }) : /* @__PURE__ */ sa("div", {
2839
+ onSuggestionClick: Qc,
2840
+ explainsAuto: ns,
2841
+ suggestions: ns && U === "assistant" ? le(R.find((e) => e.id === "assistant")?.suggestions ?? [], R.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
2842
+ }) : /* @__PURE__ */ ua("div", {
2838
2843
  className: "flex min-h-0 flex-1 flex-col",
2839
- children: [G?.sync?.hasOlder ? /* @__PURE__ */ M(S, {
2840
- onShowEarlier: Go,
2841
- disabled: No
2844
+ children: [G?.sync?.hasOlder ? /* @__PURE__ */ M(ye, {
2845
+ onShowEarlier: Zo,
2846
+ disabled: Io
2842
2847
  }) : null, /* @__PURE__ */ M(c, {
2843
- onApprovePendingWrite: Ws,
2844
- approvingWriteRef: Is,
2845
- approvableMessageId: rl?.messageId ?? null,
2846
- retryableMessageId: il,
2847
- messages: $c,
2848
- decorate: I ? fu : void 0,
2849
- processing: xo ?? null,
2850
- streamingMessageId: Co,
2851
- failedMessageId: wo,
2852
- onRetry: Is === null ? Jc : void 0,
2853
- renderWriteProposals: ol,
2854
- hidesLegacyWriteCard: al,
2855
- renderUiOffers: cl,
2856
- onStopTurn: F ? void 0 : Xu,
2857
- stopTurnLabel: F ? void 0 : Oa
2848
+ onApprovePendingWrite: Xs,
2849
+ approvingWriteRef: Hs,
2850
+ approvableMessageId: ll?.messageId ?? null,
2851
+ retryableMessageId: ul,
2852
+ messages: al,
2853
+ decorate: I ? vu : void 0,
2854
+ processing: wo ?? null,
2855
+ streamingMessageId: Eo,
2856
+ failedMessageId: Do,
2857
+ onRetry: Hs === null ? el : void 0,
2858
+ renderWriteProposals: fl,
2859
+ hidesLegacyWriteCard: dl,
2860
+ renderUiOffers: ml,
2861
+ onStopTurn: F ? void 0 : nd,
2862
+ stopTurnLabel: F ? void 0 : ja
2858
2863
  })]
2859
2864
  });
2860
- return /* @__PURE__ */ sa("div", {
2861
- ref: cd,
2865
+ return /* @__PURE__ */ ua("div", {
2866
+ ref: md,
2862
2867
  className: "relative flex flex-1 flex-col overflow-hidden",
2863
- style: dd ? va : void 0,
2868
+ style: _d ? xa : void 0,
2864
2869
  children: [
2865
- /* @__PURE__ */ sa("div", {
2870
+ /* @__PURE__ */ ua("div", {
2866
2871
  className: "contents",
2867
2872
  inert: $.active && !I || J || void 0,
2868
2873
  ...q.ids ? F ? { id: q.ids.chatPanel } : {
@@ -2871,126 +2876,129 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
2871
2876
  "aria-labelledby": q.ids.chatTab
2872
2877
  } : {},
2873
2878
  children: [
2874
- Ro === null ? null : /* @__PURE__ */ M(ge, { onDismiss: () => Lo(Ro) }),
2875
- dl.length > 0 && !$.active && !I ? /* @__PURE__ */ M(he, {
2876
- count: dl.length,
2877
- onOpenTranscript: () => ds(!0)
2879
+ Vo === null ? Wo === null ? null : /* @__PURE__ */ M(ve, {
2880
+ limit: Wo.limit,
2881
+ onDismiss: () => Ji.getState().notePinLimit(void 0)
2882
+ }) : /* @__PURE__ */ M(ge, { onDismiss: () => Bo(Vo) }),
2883
+ _l.length > 0 && !$.active && !I ? /* @__PURE__ */ M(he, {
2884
+ count: _l.length,
2885
+ onOpenTranscript: () => _s(!0)
2878
2886
  }) : null,
2879
- fd,
2880
- jo ? /* @__PURE__ */ M(ve, { onStartNew: () => ro() }) : null,
2881
- Mo && H ? /* @__PURE__ */ M(x, { onUnarchive: () => zi.updateConversation(H, { archived: !1 }) }) : null,
2882
- Bc === null ? null : /* @__PURE__ */ M(ye, {
2887
+ vd,
2888
+ Po ? /* @__PURE__ */ M(S, { onStartNew: () => oo() }) : null,
2889
+ Fo && H ? /* @__PURE__ */ M(x, { onUnarchive: () => Hi.updateConversation(H, { archived: !1 }) }) : null,
2890
+ Kc === null ? null : /* @__PURE__ */ M(xe, {
2883
2891
  tr: P,
2884
- onDismiss: () => Vc(null)
2892
+ onDismiss: () => qc(null)
2885
2893
  }),
2886
- $c.length > 0 && (No || Po) ? /* @__PURE__ */ M(_e, {
2887
- state: No ? "loading" : "failed",
2888
- onRetry: Wo,
2894
+ al.length > 0 && (Io || Lo) ? /* @__PURE__ */ M(_e, {
2895
+ state: Io ? "loading" : "failed",
2896
+ onRetry: Xo,
2889
2897
  compact: !0
2890
2898
  }) : null,
2891
- /* @__PURE__ */ M(Ce, {
2892
- onStartVoiceSession: $.available && Os ? Wl : void 0,
2899
+ /* @__PURE__ */ M(Te, {
2900
+ onStartVoiceSession: $.available && Ps ? Xl : void 0,
2893
2901
  onSend: (e, t) => {
2894
- let n = ta.getState().actions.take();
2902
+ let n = ia.getState().actions.take();
2895
2903
  Q(e, t, {
2896
2904
  fromPerson: !0,
2897
2905
  ...n ? { focus: n } : {}
2898
2906
  });
2899
2907
  },
2900
- onDraftChange: Pc,
2901
- inputRef: F ? Sa : void 0,
2902
- viewSwitch: F && !I && q.ids && q.compact && !Nu ? /* @__PURE__ */ M(Le, {
2908
+ onDraftChange: Bc,
2909
+ inputRef: F ? Ta : void 0,
2910
+ viewSwitch: F && !I && q.ids && q.compact && !zu ? /* @__PURE__ */ M(ze, {
2903
2911
  selected: q.compact.view,
2904
2912
  onSelect: q.compact.selectView,
2905
2913
  ids: q.ids,
2906
2914
  instance: "chat"
2907
2915
  }) : void 0,
2908
- aboveCard: ld > 0 ? /* @__PURE__ */ M(Ee, {
2909
- count: ld,
2910
- onReview: Ma && Ea ? yu : ud,
2911
- opensFull: Ma && Ea !== void 0
2916
+ aboveCard: hd > 0 ? /* @__PURE__ */ M(Oe, {
2917
+ count: hd,
2918
+ onReview: Fa && ka ? Tu : gd,
2919
+ opensFull: Fa && ka !== void 0
2912
2920
  }) : void 0,
2913
- disabled: So || Is !== null || No || dc,
2914
- readOnly: jo,
2921
+ disabled: To || Hs !== null || Io || _c,
2922
+ readOnly: Po,
2915
2923
  placeholder: U === "api-calls" ? P("chatArea.placeholderActions", "What would you like me to do?") : P("chatArea.placeholderGeneral", "Ask me anything…"),
2916
2924
  mode: U,
2917
- writeAccessDenied: ba === "denied" && !!Ts?.writeCapable,
2918
- availableModes: Jo,
2919
- attachmentCharsPerFile: ns,
2920
- onModeChange: F ? td : Ku,
2921
- auto: Yo ? {
2922
- active: Xo,
2923
- onSelect: F ? nd : Gu
2925
+ writeAccessDenied: Ca === "denied" && !!js?.writeCapable,
2926
+ availableModes: es,
2927
+ attachmentCharsPerFile: cs,
2928
+ onModeChange: F ? sd : Qu,
2929
+ auto: ts ? {
2930
+ active: ns,
2931
+ onSelect: F ? cd : Zu
2924
2932
  } : void 0,
2925
- suspendDictation: J || F && !ya,
2926
- entrance: I && dd,
2927
- onVoiceStateChange: q.ids || Ma ? hu : void 0,
2928
- modeReadOnly: Ma || void 0,
2933
+ suspendDictation: J || F && !Sa,
2934
+ entrance: I && _d,
2935
+ onVoiceStateChange: q.ids || Fa ? xu : void 0,
2936
+ modeReadOnly: Fa || void 0,
2929
2937
  voiceSessionActive: F ? $.active : void 0,
2930
2938
  concealed: I && $.active,
2931
- presentation: xa,
2932
- turnInFlight: So,
2933
- turnId: So ? xo?.messageId ?? null : null,
2934
- onStop: F ? Xu : void 0,
2935
- modeDisabledReason: So ? "replying" : "busy"
2939
+ presentation: wa,
2940
+ turnInFlight: To,
2941
+ turnId: To ? wo?.messageId ?? null : null,
2942
+ onStop: F ? nd : void 0,
2943
+ modeDisabledReason: To ? "replying" : "busy"
2936
2944
  }),
2937
- I ? /* @__PURE__ */ sa(oa, { children: [dd && !$.active ? /* @__PURE__ */ M("div", {
2938
- ref: ja,
2945
+ I ? /* @__PURE__ */ ua(la, { children: [_d && !$.active ? /* @__PURE__ */ M("div", {
2946
+ ref: Pa,
2939
2947
  className: "w-full shrink-0",
2940
2948
  "data-testid": "assistant-page-start-below"
2941
2949
  }) : null, /* @__PURE__ */ M("div", {
2942
- ref: tl,
2950
+ ref: sl,
2943
2951
  className: "contents",
2944
2952
  "data-testid": "assistant-page-voice-slot"
2945
2953
  })] }) : null,
2946
- F ? /* @__PURE__ */ M(Me, { children: /* @__PURE__ */ M(Ne, {
2954
+ F ? /* @__PURE__ */ M(Pe, { children: /* @__PURE__ */ M(Fe, {
2947
2955
  productKey: L,
2948
- enabled: !!Ia,
2956
+ enabled: !!za,
2949
2957
  testId: "assistant-ai-credit-balance"
2950
- }) }) : /* @__PURE__ */ sa(oa, { children: [/* @__PURE__ */ M(Ne, {
2958
+ }) }) : /* @__PURE__ */ ua(la, { children: [/* @__PURE__ */ M(Fe, {
2951
2959
  productKey: L,
2952
- enabled: !!Ia,
2960
+ enabled: !!za,
2953
2961
  className: "px-3 pt-1 text-center",
2954
2962
  testId: "assistant-ai-credit-balance"
2955
- }), /* @__PURE__ */ M(je, { className: "px-3 pb-2 pt-1" })] })
2963
+ }), /* @__PURE__ */ M(Ne, { className: "px-3 pb-2 pt-1" })] })
2956
2964
  ]
2957
2965
  }),
2958
- ss && !$.active ? /* @__PURE__ */ M(Se, {
2959
- turns: dl,
2960
- onClose: () => ds(!1),
2961
- onSave: fl,
2962
- onContinueInChat: ql ? Jl : void 0,
2966
+ ps && !$.active ? /* @__PURE__ */ M(we, {
2967
+ turns: _l,
2968
+ onClose: () => _s(!1),
2969
+ onSave: vl,
2970
+ onContinueInChat: $l ? eu : void 0,
2963
2971
  closeOnEscape: !0,
2964
- onShowEarlier: G?.sync?.hasOlder ? Go : void 0,
2965
- showEarlierDisabled: No,
2966
- renderAfterTurn: sl
2972
+ onShowEarlier: G?.sync?.hasOlder ? Zo : void 0,
2973
+ showEarlierDisabled: Io,
2974
+ renderAfterTurn: pl
2967
2975
  }) : null,
2968
- Nu && q.ids && q.compact ? /* @__PURE__ */ M(Re, {
2976
+ zu && q.ids && q.compact ? /* @__PURE__ */ M(Be, {
2969
2977
  ids: q.ids,
2970
2978
  compact: q.compact
2971
- }) : J && cs && q.ids ? F && q.compact && cs.CompactView ? /* @__PURE__ */ M(Ie, {
2972
- tab: cs,
2973
- CompactView: cs.CompactView,
2979
+ }) : J && ms && q.ids ? F && q.compact && ms.CompactView ? /* @__PURE__ */ M(Re, {
2980
+ tab: ms,
2981
+ CompactView: ms.CompactView,
2974
2982
  ids: q.ids,
2975
2983
  compact: q.compact,
2976
- shown: Pu,
2977
- voice: Du,
2984
+ shown: Bu,
2985
+ voice: Nu,
2978
2986
  ...$.active ? { mute: {
2979
2987
  muted: $.session.muted,
2980
2988
  toggle: $.toggleMute
2981
2989
  } } : {},
2982
- ...Fu ? { ask: Vu } : {},
2983
- footer: /* @__PURE__ */ M(Me, {})
2984
- }) : /* @__PURE__ */ M(Fe, {
2985
- tab: cs,
2990
+ ...Vu ? { ask: qu } : {},
2991
+ footer: /* @__PURE__ */ M(Pe, {})
2992
+ }) : /* @__PURE__ */ M(Le, {
2993
+ tab: ms,
2986
2994
  id: q.ids.avatarPanel,
2987
2995
  labelledBy: q.ids.avatarTab,
2988
2996
  leaveHintId: q.ids.leaveHint,
2989
- shown: Pu,
2990
- voice: Du,
2991
- ...Fu ? { ask: Vu } : {}
2997
+ shown: Bu,
2998
+ voice: Nu,
2999
+ ...Vu ? { ask: qu } : {}
2992
3000
  }) : null,
2993
- $.active && /* @__PURE__ */ M(Pe, {
3001
+ $.active && /* @__PURE__ */ M(Ie, {
2994
3002
  session: $.session,
2995
3003
  notice: $.notice,
2996
3004
  privacyNotice: $.handsFree.privacyNotice,
@@ -3002,66 +3010,66 @@ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ v
3002
3010
  correcting: $.correcting,
3003
3011
  onLetMeFinish: $.letMeFinish,
3004
3012
  onImDone: $.imDone,
3005
- turns: Sl,
3013
+ turns: Ol,
3006
3014
  spokenChunks: $.spokenChunks,
3007
- attachments: pl.attachments,
3008
- onAttachFiles: pl.addFiles,
3009
- onRemoveAttachment: pl.remove,
3010
- onRetryAttachment: pl.retry,
3011
- canAttachMore: pl.canAddMore,
3012
- preparingAttachments: pl.preparingCount,
3013
- attachmentsLocked: pl.isCommitting,
3014
- attachmentNotice: _l,
3015
- onSaveTranscript: fl,
3016
- onContinueInChat: Jl,
3015
+ attachments: yl.attachments,
3016
+ onAttachFiles: yl.addFiles,
3017
+ onRemoveAttachment: yl.remove,
3018
+ onRetryAttachment: yl.retry,
3019
+ canAttachMore: yl.canAddMore,
3020
+ preparingAttachments: yl.preparingCount,
3021
+ attachmentsLocked: yl.isCommitting,
3022
+ attachmentNotice: Cl,
3023
+ onSaveTranscript: vl,
3024
+ onContinueInChat: eu,
3017
3025
  onInterrupt: () => {
3018
- du(), $.interrupt(), Hs();
3026
+ _u(), $.interrupt(), Js();
3019
3027
  },
3020
- spoken: Zc,
3028
+ spoken: rl,
3021
3029
  onToggleMute: $.toggleMute,
3022
- onEnd: pu,
3023
- proposalChip: Al ? Ma && Ea ? {
3030
+ onEnd: yu,
3031
+ proposalChip: Il ? Fa && ka ? {
3024
3032
  label: P("waitingChange.reviewInFull", "Review in full assistant"),
3025
- status: te(Al, P),
3026
- onOpen: Ea
3033
+ status: te(Il, P),
3034
+ onOpen: ka
3027
3035
  } : {
3028
- label: te(Al, P),
3029
- onOpen: kl
3036
+ label: te(Il, P),
3037
+ onOpen: Fl
3030
3038
  } : null,
3031
- proposalTray: Ma ? null : Ml,
3032
- renderAfterTurn: sl,
3033
- onViewChange: q.ids ? ku : void 0,
3034
- ...Ma ? { view: J || Au ? "mini" : "compact" } : I ? {
3039
+ proposalTray: Fa ? null : Rl,
3040
+ renderAfterTurn: pl,
3041
+ onViewChange: q.ids ? Fu : void 0,
3042
+ ...Fa ? { view: J || Iu ? "mini" : "compact" } : I ? {
3035
3043
  view: "page",
3036
- pageSlot: el
3044
+ pageSlot: ol
3037
3045
  } : {},
3038
- startedCue: F ? hs ? P("window.voiceStartedCue", "Started a voice conversation. Your chat is in History.") : null : void 0
3046
+ startedCue: F ? xs ? P("window.voiceStartedCue", "Started a voice conversation. Your chat is in History.") : null : void 0
3039
3047
  }),
3040
3048
  /* @__PURE__ */ M(l, {
3041
- open: rs !== null,
3042
- mode: Ju,
3043
- currentMode: Ts ?? { id: U },
3044
- onConfirm: qu,
3045
- onCancel: Yu
3049
+ open: ls !== null,
3050
+ mode: ed,
3051
+ currentMode: js ?? { id: U },
3052
+ onConfirm: $u,
3053
+ onCancel: td
3046
3054
  }),
3047
3055
  F ? /* @__PURE__ */ M(l, {
3048
- open: Zu?.open === !0,
3049
- mode: sd,
3050
- currentMode: Ts ?? { id: U },
3051
- switchPlan: ad,
3052
- onConfirm: rd,
3053
- onCancel: id
3056
+ open: rd?.open === !0,
3057
+ mode: pd,
3058
+ currentMode: js ?? { id: U },
3059
+ switchPlan: dd,
3060
+ onConfirm: ld,
3061
+ onCancel: ud
3054
3062
  }) : null,
3055
3063
  /* @__PURE__ */ M(u, {
3056
- ...Oo.dialog,
3057
- view: ll?.view ?? Oo.dialog.view,
3058
- serverNow: ll?.serverNow ?? NaN,
3059
- arrivedAt: ll?.arrivedAt ?? NaN,
3060
- capabilities: ll ? To[ll.session.sandboxId] : null,
3061
- turnInFlight: So,
3064
+ ...jo.dialog,
3065
+ view: hl?.view ?? jo.dialog.view,
3066
+ serverNow: hl?.serverNow ?? NaN,
3067
+ arrivedAt: hl?.arrivedAt ?? NaN,
3068
+ capabilities: hl ? Oo[hl.session.sandboxId] : null,
3069
+ turnInFlight: To,
3062
3070
  tr: P
3063
3071
  })
3064
3072
  ]
3065
3073
  });
3066
3074
  };
3067
- export { ya as AssistantChatArea };
3075
+ export { Sa as AssistantChatArea };