@burdenoff/fe-libs 2026.1029.2 → 2026.1029.4

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