@burdenoff/fe-libs 2026.1113.9 → 2026.1113.11

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