@burdenoff/fe-libs 2026.1118.1 → 2026.1118.3

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