@burdenoff/fe-libs 2026.1004.6 → 2026.1004.7

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.
@@ -8,156 +8,156 @@ import { useAssistantTr as a } from "../i18n.js";
8
8
  import { useAssistantNavigate as o } from "./AssistantMarkdownRenderer.js";
9
9
  import { isAssistantModeId as s } from "../modeIds.js";
10
10
  import { AUTO_READ_MODE as c, autoSuggestions as l, classifyAssistantIntent as u, escalationToUndo as d, isAutoRoutingOffered as f, resolveAutoRoute as p } from "../autoRouting.js";
11
- import { getHistoryStamp as m, setHistoryBusyProbe as h } from "../history/stampRegistry.js";
12
- import { beginApprovalInFlight as ee, endApprovalInFlight as g, getApprovalInFlight as _, markLiveTurn as te, newestModelReplyId as v, resolveApprovablePendingWrite as y, resolveRetryableMessageId as b, subscribeApprovalInFlight as ne } from "../liveTurns.js";
13
- import { isWriteModeAcknowledged as re, writeModeSendRefusalReason as ie } from "../writeModeConsent.js";
14
- import { resolveActiveModeSandbox as ae, useAssistantStore as x } from "../store.js";
15
- import { abortAssistantTurn as oe, approvePendingWrite as S, createAssistantSandbox as se, createAssistantSession as ce, extendAssistantSandboxTTL as le, findExistingSandboxWithStatus as ue, getAssistantArtifacts as de, getAssistantMessages as fe, getAssistantSession as C, modeRequiresConfirmWrites as pe, promptGatewayRequestBytes as me, releaseSupersededAssistantSandboxes as he, sendAssistantPromptAsync as ge, waitForAssistantServiceReady as _e, waitForSandboxRunning as ve, writeApprovalModeOf as w } from "../api.js";
16
- import { sanitize as ye } from "../progress.js";
17
- import { AssistantSendRefusal as be, classifyTurnFailure as xe, turnConfirmsNoAction as Se, turnOutcomeCopy as Ce } from "../turnOutcome.js";
18
- import { assistantUsageLedger as we, hasPendingUsageReports as Te, reportUsageWithRetry as Ee, retryPendingUsageReports as De, usageSendRefusal as Oe } from "../usageReporting.js";
19
- import { withIncompleteTurnNotice as ke } from "../streamBudget.js";
20
- import { chatTurns as Ae, isVoiceTurn as je, voiceMarker as T, voiceSessionIdOf as Me } from "../voice/turnVisibility.js";
21
- import { speechFeed as Ne } from "../speech/speechFeed.js";
22
- import { isTurnSuperseded as Pe, markTurnSuperseded as Fe } from "../voice/supersededTurns.js";
23
- import { buildContinuedFromVoiceNote as E, buildVoiceTranscriptMarkdown as Ie, voiceTranscriptFilename as Le } from "../voice/voiceTranscript.js";
24
- import { pollDelayMs as Re } from "../voice/assistantPollSchedule.js";
25
- import { toCaptionText as ze } from "../voice/captionText.js";
26
- import { resolveAssistantLanguage as Be } from "../voice/languages.js";
27
- import { resolveLanguagePair as Ve } from "../voice/languagePair.js";
28
- import { INITIAL_TRANSCRIPT_AUTO_OPEN as He, isAwaitingOwnConversation as Ue, maySendSpokenTurn as We, planTranscriptAutoOpen as Ge, planVoiceSessionBinding as Ke, planVoiceSessionStart as qe, planVoiceSpokenEntry as Je, voiceBindingAtStart as Ye, voiceBindingConversationId as Xe } from "../voice/voiceReopen.js";
29
- import { countInlineImageCandidates as Ze, countInlinedImageParts as Qe, getSendableAttachments as $e, largestInlineCharsPerFile as et, resolveAssistantInlineLimits as tt, toMessageAttachment as nt } from "../attachments.js";
30
- import { WRITE_PROPOSAL_VOICE_COPY as rt, isVoiceProposalBound as it, voiceProposalChip as at, voiceProposalChipText as ot, voiceReadbacksDue as st, voiceWaitingProposals as ct, writeProposalVoiceLine as lt, writeProposalVoiceReadback as ut } from "../writeProposalVoice.js";
31
- import { createAdminModeAccessGate as dt, resolveAssistantSendModeAfterAccess as ft } from "../adminModeSendGate.js";
32
- import { buildBoundedAttachmentTurn as pt } from "../attachmentTurn.js";
33
- import { isTurnInFlight as mt, planAbandonedTurn as ht, planTurnAbort as gt } from "../turnState.js";
34
- import { getAssistantDisplayContent as _t } from "../displayContent.js";
35
- import { NO_FIRST_TEXT as vt, buildAssistantProgress as yt, readAheadFor as bt, snapshotReplyFloor as xt, startSessionReadAhead as St, trackFirstText as Ct } from "../turnProgress.js";
36
- import { parseToolActivity as wt } from "./AssistantToolActivity.js";
37
- import { countSpokenTurns as Tt, spokenMessagesSinceContinueNote as Et, spokenTurnText as Dt } from "../spokenTurns.js";
38
- import { beginTurn as Ot, describeTurn as D, detectTurnDevice as kt, markTurn as O, restartAttempt as At, turnClockMs as jt } from "../turnTimeline.js";
39
- import { useAssistantSpeech as Mt } from "./AssistantSpeechProvider.js";
40
- import { useVoiceSession as Nt } from "./useVoiceSession.js";
41
- import { getOrganizationId as Pt, getWorkspaceId as k } from "../context.js";
42
- import { isMultimodalBodyRejection as Ft, isRecoverableAssistantError as It } from "../transportErrors.js";
43
- import { createReadinessTracker as Lt, planAfterTransportFailure as Rt, planTrustedSandboxFailure as zt } from "../sandboxReadiness.js";
44
- import { writeProposalConfirmState as Bt } from "./writeProposalPresentation.js";
45
- import { writeProposalUsesDialog as Vt } from "./AssistantWriteProposalCard.js";
46
- import { AssistantWriteConfirmDialog as Ht } from "./AssistantWriteConfirmDialog.js";
47
- import { useWriteProposalConfirm as Ut } from "./useWriteProposalConfirm.js";
48
- import { AssistantWriteProposalSlot as Wt } from "./AssistantWriteProposalSlot.js";
49
- import { readWriteProposalRefs as Gt, writeProposalsEnabledFor as Kt } from "../writeProposalDiscovery.js";
50
- import { planWriteReply as qt, promptWriteApproval as Jt } from "../writeReplySend.js";
51
- import { useWriteProposals as Yt } from "./useWriteProposals.js";
52
- import { AssistantSpokenTurnsNotice as Xt } from "./AssistantSpokenTurnsNotice.js";
53
- import { AssistantHistoryArchivedNotice as Zt, AssistantHistoryDeletedNotice as Qt, AssistantHistoryLoadState as $t, AssistantHistoryReadOnlyBanner as en, AssistantHistoryShowEarlier as tn } from "./AssistantHistoryNotices.js";
54
- import { VoiceTranscriptDrawer as nn } from "./voice/VoiceTranscriptDrawer.js";
55
- import { downloadFile as rn } from "../exportConversation.js";
56
- import { conversationHasHistory as an, isOtherScopeHistoryConversation as on, isReadOnlyHistoryConversation as sn, isReusableHistoryDraft as cn } from "../history/historyList.js";
57
- import { useAssistantHistoryStatus as ln } from "../history/historyStatus.js";
58
- import { assistantHistory as un } from "../history/historyEngine.js";
59
- import { AssistantEmptyState as dn } from "./AssistantEmptyState.js";
60
- import { AssistantNothingToDeleteNotice as fn } from "./AssistantDeleteConversationDialog.js";
61
- import { assistantHistoryIsOn as pn } from "./conversationDelete.js";
62
- import { useConversationDeleteDialog as mn } from "./conversationDeleteDialog.js";
63
- import { backDoneCopy as hn, chooseDestinationCopy as gn, chooseLinkedCopy as _n, entityNounText as vn, linkNotOpenableCopy as yn, navigationCommandCopy as bn, navigationOutcomeCopy as xn, pickFromListCopy as Sn, recordChoiceCopy as Cn, recordKindsCopy as wn, themeCommandCopy as Tn } from "../localUiCommandCopy.js";
64
- import { appControlCopy as En } from "../appControls/copy.js";
65
- import { useControlConfirmDialog as Dn } from "./controlConfirmDialog.js";
66
- import { resolveConversationDeleteTarget as On } from "../conversationDeleteCommand.js";
67
- import { resumeContextFor as kn } from "../history/historyResume.js";
68
- import { useHistoryRowControlsFor as An } from "../history/useHistoryRowControls.js";
69
- import { AssistantMessageList as jn } from "./AssistantMessageList.js";
70
- import { AssistantVoiceSession as Mn } from "./voice/AssistantVoiceSession.js";
71
- import { useAssistantApiAccess as Nn } from "../useAssistantApiAccess.js";
72
- import { useConversationTurns as Pn } from "../useConversationTurns.js";
73
- import { sendAssistantTurnTimings as Fn, startTurnTimingReporting as In } from "../turnTimingReporter.js";
74
- import { QuarantineSet as Ln, WarmCancelled as Rn, claimPreopenedSession as zn, consumeWarm as Bn, preopenKey as Vn, preopenWanted as Hn, prewarmTarget as Un, settleWarmBeforeSend as Wn, startPreopen as Gn, startWarm as Kn, warmState as qn } from "../prewarm.js";
75
- import { isThereRequest as Jn, parseChoice as Yn } from "../uiActions/deixis.js";
76
- import { navEntryIds as Xn } from "../uiActions/resolveTarget.js";
77
- import { planRecordResolution as Zn } from "../uiActions/recordNames.js";
78
- import { isAlreadyThere as Qn, matchLocalUiCommand as $n, navDestinations as er, normaliseUtterance as tr, planThemeChange as nr } from "../localUiCommands.js";
79
- import { runNavigation as rr } from "../uiActions/navigationOutcome.js";
80
- import { assistantBackStack as ir, isBackRunnable as ar } from "../uiActions/backStack.js";
81
- import { buildNavigateAction as or, destinationForPath as sr, labelForPath as cr, newestAssistantOnSurface as lr } from "../uiActions/navigateAction.js";
82
- import { buildNavigationContext as ur, latestReplyOnSurface as dr, rememberPresentedList as fr } from "../uiActions/linkContext.js";
83
- import { buildUiCatalogue as pr } from "../uiActions/uiCatalogue.js";
84
- import { readControlSnapshot as mr } from "../appControls/snapshot.js";
85
- import { planAppControl as hr } from "../appControls/plan.js";
86
- import { dispatchAssistantQuotaExhausted as gr, notifyAiCreditsUpdated as _r } from "../aiCredits.js";
87
- import { useAssistantAttachments as vr } from "../useAssistantAttachments.js";
88
- import { AssistantComposer as yr } from "./composer/AssistantComposer.js";
89
- import { isProdRuntime as br } from "../env.js";
90
- import { AssistantApiCallsConsentDialog as xr } from "./AssistantApiCallsConsentDialog.js";
91
- import { useVisibleNavItems as Sr } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
92
- import { useCallback as A, useEffect as j, useMemo as M, useRef as N, useState as Cr, useSyncExternalStore as wr } from "react";
93
- import { jsx as P, jsxs as Tr } from "react/jsx-runtime";
11
+ import { getHistoryStamp as ee, setHistoryBusyProbe as m } from "../history/stampRegistry.js";
12
+ import { beginApprovalInFlight as te, endApprovalInFlight as h, getApprovalInFlight as g, markLiveTurn as ne, newestModelReplyId as _, resolveApprovablePendingWrite as v, resolveRetryableMessageId as y, subscribeApprovalInFlight as re } from "../liveTurns.js";
13
+ import { isWriteModeAcknowledged as ie, writeModeSendRefusalReason as ae } from "../writeModeConsent.js";
14
+ import { resolveActiveModeSandbox as oe, useAssistantStore as b } from "../store.js";
15
+ import { abortAssistantTurn as se, approvePendingWrite as x, createAssistantSandbox as ce, createAssistantSession as le, extendAssistantSandboxTTL as ue, findExistingSandboxWithStatus as de, getAssistantArtifacts as fe, getAssistantMessages as pe, getAssistantSession as S, modeRequiresConfirmWrites as me, promptGatewayRequestBytes as he, releaseSupersededAssistantSandboxes as ge, sendAssistantPromptAsync as _e, waitForAssistantServiceReady as ve, waitForSandboxRunning as ye, writeApprovalModeOf as C } from "../api.js";
16
+ import { sanitize as be } from "../progress.js";
17
+ import { AssistantSendRefusal as xe, classifyTurnFailure as Se, turnConfirmsNoAction as Ce, turnOutcomeCopy as we } from "../turnOutcome.js";
18
+ import { assistantUsageLedger as Te, hasPendingUsageReports as Ee, reportUsageWithRetry as De, retryPendingUsageReports as Oe, usageSendRefusal as ke } from "../usageReporting.js";
19
+ import { withIncompleteTurnNotice as Ae } from "../streamBudget.js";
20
+ import { chatTurns as je, isVoiceTurn as Me, voiceMarker as w, voiceSessionIdOf as Ne } from "../voice/turnVisibility.js";
21
+ import { speechFeed as Pe } from "../speech/speechFeed.js";
22
+ import { isTurnSuperseded as Fe, markTurnSuperseded as Ie } from "../voice/supersededTurns.js";
23
+ import { buildContinuedFromVoiceNote as T, buildVoiceTranscriptMarkdown as Le, voiceTranscriptFilename as Re } from "../voice/voiceTranscript.js";
24
+ import { pollDelayMs as ze } from "../voice/assistantPollSchedule.js";
25
+ import { toCaptionText as Be } from "../voice/captionText.js";
26
+ import { resolveAssistantLanguage as Ve } from "../voice/languages.js";
27
+ import { resolveLanguagePair as He } from "../voice/languagePair.js";
28
+ import { INITIAL_TRANSCRIPT_AUTO_OPEN as Ue, isAwaitingOwnConversation as We, maySendSpokenTurn as Ge, planTranscriptAutoOpen as Ke, planVoiceSessionBinding as qe, planVoiceSessionStart as Je, planVoiceSpokenEntry as Ye, voiceBindingAtStart as Xe, voiceBindingConversationId as Ze } from "../voice/voiceReopen.js";
29
+ import { countInlineImageCandidates as Qe, countInlinedImageParts as $e, getSendableAttachments as et, largestInlineCharsPerFile as tt, resolveAssistantInlineLimits as nt, toMessageAttachment as rt } from "../attachments.js";
30
+ import { WRITE_PROPOSAL_VOICE_COPY as it, isVoiceProposalBound as at, voiceProposalChip as ot, voiceProposalChipText as st, voiceReadbacksDue as ct, voiceWaitingProposals as lt, writeProposalVoiceLine as ut, writeProposalVoiceReadback as dt } from "../writeProposalVoice.js";
31
+ import { createAdminModeAccessGate as ft, resolveAssistantSendModeAfterAccess as pt } from "../adminModeSendGate.js";
32
+ import { buildBoundedAttachmentTurn as mt } from "../attachmentTurn.js";
33
+ import { isTurnInFlight as ht, planAbandonedTurn as gt, planTurnAbort as _t } from "../turnState.js";
34
+ import { getAssistantDisplayContent as vt } from "../displayContent.js";
35
+ import { NO_FIRST_TEXT as yt, buildAssistantProgress as bt, readAheadFor as xt, snapshotReplyFloor as St, startSessionReadAhead as Ct, trackFirstText as wt } from "../turnProgress.js";
36
+ import { parseToolActivity as Tt } from "./AssistantToolActivity.js";
37
+ import { countSpokenTurns as Et, spokenMessagesSinceContinueNote as Dt, spokenTurnText as Ot } from "../spokenTurns.js";
38
+ import { beginTurn as kt, describeTurn as E, detectTurnDevice as At, markTurn as D, restartAttempt as jt, turnClockMs as Mt } from "../turnTimeline.js";
39
+ import { useAssistantSpeech as Nt } from "./AssistantSpeechProvider.js";
40
+ import { useVoiceSession as Pt } from "./useVoiceSession.js";
41
+ import { getOrganizationId as Ft, getWorkspaceId as O } from "../context.js";
42
+ import { isMultimodalBodyRejection as It, isRecoverableAssistantError as Lt } from "../transportErrors.js";
43
+ import { createReadinessTracker as Rt, planAfterTransportFailure as zt, planTrustedSandboxFailure as Bt } from "../sandboxReadiness.js";
44
+ import { writeProposalConfirmState as Vt } from "./writeProposalPresentation.js";
45
+ import { writeProposalUsesDialog as Ht } from "./AssistantWriteProposalCard.js";
46
+ import { AssistantWriteConfirmDialog as Ut } from "./AssistantWriteConfirmDialog.js";
47
+ import { useWriteProposalConfirm as Wt } from "./useWriteProposalConfirm.js";
48
+ import { AssistantWriteProposalSlot as Gt } from "./AssistantWriteProposalSlot.js";
49
+ import { readWriteProposalRefs as Kt, writeProposalsEnabledFor as qt } from "../writeProposalDiscovery.js";
50
+ import { planWriteReply as Jt, promptWriteApproval as Yt } from "../writeReplySend.js";
51
+ import { useWriteProposals as Xt } from "./useWriteProposals.js";
52
+ import { AssistantSpokenTurnsNotice as Zt } from "./AssistantSpokenTurnsNotice.js";
53
+ import { AssistantHistoryArchivedNotice as Qt, AssistantHistoryDeletedNotice as $t, AssistantHistoryLoadState as en, AssistantHistoryReadOnlyBanner as tn, AssistantHistoryShowEarlier as nn } from "./AssistantHistoryNotices.js";
54
+ import { VoiceTranscriptDrawer as rn } from "./voice/VoiceTranscriptDrawer.js";
55
+ import { downloadFile as an } from "../exportConversation.js";
56
+ import { conversationHasHistory as on, isOtherScopeHistoryConversation as sn, isReadOnlyHistoryConversation as cn, isReusableHistoryDraft as ln } from "../history/historyList.js";
57
+ import { useAssistantHistoryStatus as un } from "../history/historyStatus.js";
58
+ import { assistantHistory as dn } from "../history/historyEngine.js";
59
+ import { AssistantEmptyState as fn } from "./AssistantEmptyState.js";
60
+ import { AssistantNothingToDeleteNotice as pn } from "./AssistantDeleteConversationDialog.js";
61
+ import { assistantHistoryIsOn as mn } from "./conversationDelete.js";
62
+ import { useConversationDeleteDialog as hn } from "./conversationDeleteDialog.js";
63
+ import { backDoneCopy as gn, chooseDestinationCopy as _n, chooseLinkedCopy as vn, entityNounText as yn, linkNotOpenableCopy as bn, navigationCommandCopy as xn, navigationOutcomeCopy as Sn, pickFromListCopy as Cn, recordChoiceCopy as wn, recordKindsCopy as Tn, themeCommandCopy as En } from "../localUiCommandCopy.js";
64
+ import { appControlCopy as Dn } from "../appControls/copy.js";
65
+ import { useControlConfirmDialog as On } from "./controlConfirmDialog.js";
66
+ import { resolveConversationDeleteTarget as kn } from "../conversationDeleteCommand.js";
67
+ import { resumeContextFor as An } from "../history/historyResume.js";
68
+ import { useHistoryRowControlsFor as jn } from "../history/useHistoryRowControls.js";
69
+ import { AssistantMessageList as Mn } from "./AssistantMessageList.js";
70
+ import { AssistantVoiceSession as Nn } from "./voice/AssistantVoiceSession.js";
71
+ import { useAssistantApiAccess as Pn } from "../useAssistantApiAccess.js";
72
+ import { useConversationTurns as Fn } from "../useConversationTurns.js";
73
+ import { sendAssistantTurnTimings as In, startTurnTimingReporting as Ln } from "../turnTimingReporter.js";
74
+ import { QuarantineSet as Rn, WarmCancelled as zn, claimPreopenedSession as Bn, consumeWarm as Vn, preopenKey as Hn, preopenWanted as Un, prewarmTarget as Wn, settleWarmBeforeSend as Gn, startPreopen as Kn, startWarm as qn, warmState as Jn } from "../prewarm.js";
75
+ import { isThereRequest as Yn, parseChoice as Xn } from "../uiActions/deixis.js";
76
+ import { navEntryIds as Zn } from "../uiActions/resolveTarget.js";
77
+ import { lookupNamedRecords as Qn } from "../uiActions/recordNames.js";
78
+ import { isAlreadyThere as $n, matchLocalUiCommand as er, navDestinations as tr, normaliseUtterance as nr, planThemeChange as rr } from "../localUiCommands.js";
79
+ import { runNavigation as ir } from "../uiActions/navigationOutcome.js";
80
+ import { assistantBackStack as ar, isBackRunnable as or } from "../uiActions/backStack.js";
81
+ import { buildNavigateAction as sr, destinationForPath as cr, labelForPath as lr, newestAssistantOnSurface as ur } from "../uiActions/navigateAction.js";
82
+ import { buildNavigationContext as dr, latestReplyOnSurface as fr, rememberPresentedList as pr } from "../uiActions/linkContext.js";
83
+ import { buildUiCatalogue as mr } from "../uiActions/uiCatalogue.js";
84
+ import { readControlSnapshot as hr } from "../appControls/snapshot.js";
85
+ import { planAppControl as gr } from "../appControls/plan.js";
86
+ import { dispatchAssistantQuotaExhausted as _r, notifyAiCreditsUpdated as vr } from "../aiCredits.js";
87
+ import { useAssistantAttachments as yr } from "../useAssistantAttachments.js";
88
+ import { AssistantComposer as br } from "./composer/AssistantComposer.js";
89
+ import { isProdRuntime as xr } from "../env.js";
90
+ import { AssistantApiCallsConsentDialog as Sr } from "./AssistantApiCallsConsentDialog.js";
91
+ import { useVisibleNavItems as Cr } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
92
+ import { useCallback as k, useEffect as A, useMemo as j, useRef as M, useState as wr, useSyncExternalStore as Tr } from "react";
93
+ import { jsx as N, jsxs as Er } from "react/jsx-runtime";
94
94
  //#region src/shared/assistant/ui/AssistantChatArea.tsx
95
- var Er = 2500, Dr = 600, Or = 2e4, kr = 1e4, Ar = 6e3;
96
- function F() {
95
+ var Dr = 2500, Or = 600, kr = 2e4, Ar = 1e4, jr = 6e3;
96
+ function P() {
97
97
  return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
98
98
  }
99
- var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
100
- let I = a(), { product: L, modes: R, gatherPageContext: Nr, buildPrompt: Pr, reportTurnTimings: Fr, reportTokenUsage: Ir, localUiCommands: Lr } = i(), z = w(i().writeApproval), Rr = A((e, t) => {
101
- let n = x.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
102
- return it({
99
+ var Mr = ({ visible: Mr = !0, writeAccess: Nr = "unknown" }) => {
100
+ let F = a(), { product: I, modes: L, gatherPageContext: Pr, buildPrompt: Fr, reportTurnTimings: Ir, reportTokenUsage: Lr, localUiCommands: Rr } = i(), R = C(i().writeApproval), zr = k((e, t) => {
101
+ let n = b.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
102
+ return at({
103
103
  mode: e,
104
- productWriteApproval: z,
104
+ productWriteApproval: R,
105
105
  capabilities: r ? n.sandboxWriteCapabilities[r] : null
106
106
  });
107
- }, [z]), { getAccessToken: B, getWorkspaceToken: zr, userId: V } = n(), { locale: H } = t(), Br = x((e) => e.voiceGraceMs), Vr = x((e) => e.assistantLanguage), Hr = x((e) => e.replyLanguage), Ur = M(() => Ve(Vr, Hr, H), [
108
- Vr,
107
+ }, [R]), { getAccessToken: z, getWorkspaceToken: Br, userId: B } = n(), { locale: V } = t(), Vr = b((e) => e.voiceGraceMs), Hr = b((e) => e.assistantLanguage), Ur = b((e) => e.replyLanguage), Wr = j(() => He(Hr, Ur, V), [
109
108
  Hr,
110
- H
111
- ]), Wr = Ur.reply.english, Gr = Ur.replyIsExplicit, Kr = Ur.reply.code, { conversations: qr, activeConversationId: U, mode: W, processingByConversationId: Jr, setMode: Yr, setConversationMode: Xr, setActiveConversation: Zr, createConversation: Qr, addMessage: G, updateMessage: $r, patchMessage: ei, mergeMessageMetadata: ti, setConversationProcessing: ni, clearConversationProcessing: ri, setBackendSessionId: ii, clearBackendSessionId: ai, setSandbox: oi, clearSandbox: si, acknowledgedWriteModes: ci, acknowledgeWriteMode: li, autoRouting: ui, setAutoRouting: di, routeConversation: fi } = x(), pi = qr.find((e) => e.id === U), mi = Pn(pi), hi = mi.all, K = U ? Jr[U] : void 0, gi = mt(K?.status), _i = gi ? K?.messageId ?? null : null, vi = K?.status === "error" ? K.messageId : null, yi = x((e) => e.sandboxWriteCapabilities), { panel: q, entries: bi, retiredSandboxes: xi } = Yt({
112
- tr: I,
113
- productWriteApproval: z
114
- }), Si = Ut({
109
+ Ur,
110
+ V
111
+ ]), Gr = Wr.reply.english, Kr = Wr.replyIsExplicit, qr = Wr.reply.code, { conversations: Jr, activeConversationId: H, mode: U, processingByConversationId: Yr, setMode: Xr, setConversationMode: Zr, setActiveConversation: Qr, createConversation: W, addMessage: G, updateMessage: $r, patchMessage: ei, mergeMessageMetadata: ti, setConversationProcessing: ni, clearConversationProcessing: ri, setBackendSessionId: ii, clearBackendSessionId: ai, setSandbox: oi, clearSandbox: si, acknowledgedWriteModes: ci, acknowledgeWriteMode: li, autoRouting: ui, setAutoRouting: di, routeConversation: fi } = b(), pi = Jr.find((e) => e.id === H), mi = Fn(pi), hi = mi.all, K = H ? Yr[H] : void 0, gi = ht(K?.status), _i = gi ? K?.messageId ?? null : null, vi = K?.status === "error" ? K.messageId : null, yi = b((e) => e.sandboxWriteCapabilities), { panel: q, entries: bi, retiredSandboxes: xi } = Xt({
112
+ tr: F,
113
+ productWriteApproval: R
114
+ }), Si = Wt({
115
115
  approve: (e, t) => q.approve(e, t),
116
116
  decline: (e, t, n) => q.decline(e, t, n),
117
117
  presented: (e, t) => q.presented(e, t)
118
- }), Ci = Si.dismiss, wi = N(null);
119
- j(() => {
118
+ }), Ci = Si.dismiss, wi = M(null);
119
+ A(() => {
120
120
  Ci();
121
121
  let e = wi.current;
122
- wi.current = U, e && e !== U && q.withdraw(e, "conversation_closed"), U && q.openConversation(U);
122
+ wi.current = H, e && e !== H && q.withdraw(e, "conversation_closed"), H && q.openConversation(H);
123
123
  }, [
124
- U,
124
+ H,
125
125
  q,
126
126
  Ci
127
127
  ]);
128
- let Ti = sn(pi), Ei = An(pi)?.archivedAt != null, Di = ln((e) => U !== null && U in e.loadingIds), Oi = ln((e) => U !== null && U in e.loadErrorIds), ki = ln((e) => e.remoteDelete), [Ai, ji] = Cr(() => ln.getState().remoteDelete?.at ?? null), Mi = ki?.wasActive === !0 && ki.at !== Ai ? ki.at : null;
129
- j(() => {
128
+ let Ti = cn(pi), Ei = jn(pi)?.archivedAt != null, Di = un((e) => H !== null && H in e.loadingIds), Oi = un((e) => H !== null && H in e.loadErrorIds), ki = un((e) => e.remoteDelete), [Ai, ji] = wr(() => un.getState().remoteDelete?.at ?? null), Mi = ki?.wasActive === !0 && ki.at !== Ai ? ki.at : null;
129
+ A(() => {
130
130
  if (Mi === null) return;
131
- let e = window.setTimeout(() => ji(Mi), kr);
131
+ let e = window.setTimeout(() => ji(Mi), Ar);
132
132
  return () => window.clearTimeout(e);
133
133
  }, [Mi]);
134
- let { canUseApiCalls: Ni, loading: Pi } = Nn(k(), V), Fi = N(dt({
134
+ let { canUseApiCalls: Ni, loading: Pi } = Pn(O(), B), Fi = M(ft({
135
135
  loading: Pi,
136
136
  canUseAdminModes: Ni
137
- })).current, Ii = N(R);
138
- j(() => {
139
- Ii.current = R;
140
- }, [R]);
137
+ })).current, Ii = M(L);
138
+ A(() => {
139
+ Ii.current = L;
140
+ }, [L]);
141
141
  let Li = () => {
142
- let e = x.getState().activeConversationId;
143
- e && un.openConversation(e, { modes: Ii.current });
142
+ let e = b.getState().activeConversationId;
143
+ e && dn.openConversation(e, { modes: Ii.current });
144
144
  }, Ri = () => {
145
- let e = x.getState().activeConversationId;
146
- e && un.loadEarlier(e);
147
- }, zi = N(B);
148
- j(() => {
149
- zi.current = B;
150
- }, [B]);
151
- let Bi = !!L && Fr !== !1;
152
- j(() => {
153
- if (Bi) return In({ send: (e) => Fn(e, {
154
- workspaceId: k(),
145
+ let e = b.getState().activeConversationId;
146
+ e && dn.loadEarlier(e);
147
+ }, zi = M(z);
148
+ A(() => {
149
+ zi.current = z;
150
+ }, [z]);
151
+ let Bi = !!I && Ir !== !1;
152
+ A(() => {
153
+ if (Bi) return Ln({ send: (e) => In(e, {
154
+ workspaceId: O(),
155
155
  authContext: {
156
156
  accessToken: zi.current(),
157
- organizationId: Pt()
157
+ organizationId: Ft()
158
158
  }
159
159
  }) });
160
- }, [Bi]), j(() => {
160
+ }, [Bi]), A(() => {
161
161
  Fi.update({
162
162
  loading: Pi,
163
163
  canUseAdminModes: Ni
@@ -166,174 +166,174 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
166
166
  Fi,
167
167
  Pi,
168
168
  Ni
169
- ]), j(() => () => {
169
+ ]), A(() => () => {
170
170
  Fi.abandon();
171
171
  }, [Fi]);
172
- let Vi = M(() => R.filter((e) => !e.requiresAdmin || Ni), [R, Ni]), Hi = f(Vi), Ui = ui && Hi, Wi = N(Hi);
173
- j(() => {
172
+ let Vi = j(() => L.filter((e) => !e.requiresAdmin || Ni), [L, Ni]), Hi = f(Vi), Ui = ui && Hi, Wi = M(Hi);
173
+ A(() => {
174
174
  Wi.current = Hi;
175
175
  }, [Hi]);
176
- let Gi = N(null), Ki = N(!1), qi = et(R), [Ji, Yi] = Cr(null), [Xi, Zi] = Cr(null), Qi = Xi !== null && Xi === U, $i = A((e) => {
177
- Zi(e ? x.getState().activeConversationId : null);
176
+ let Gi = M(null), Ki = M(!1), qi = tt(L), [Ji, Yi] = wr(null), [Xi, Zi] = wr(null), Qi = Xi !== null && Xi === H, $i = k((e) => {
177
+ Zi(e ? b.getState().activeConversationId : null);
178
178
  }, []);
179
- j(() => {
180
- Zi((e) => e !== null && e !== U ? null : e);
181
- }, [U]);
182
- let ea = N(void 0), [ta, na] = Cr(!1), ra = A((e) => {
183
- ea.current = e, na(Ue(e));
184
- }, []), ia = A(() => {
185
- let e = x.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
179
+ A(() => {
180
+ Zi((e) => e !== null && e !== H ? null : e);
181
+ }, [H]);
182
+ let ea = M(void 0), [ta, na] = wr(!1), ra = k((e) => {
183
+ ea.current = e, na(We(e));
184
+ }, []), ia = k(() => {
185
+ let e = b.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
186
186
  return !t || !n ? null : {
187
187
  id: t,
188
- reusableDraft: cn(n, m()),
188
+ reusableDraft: ln(n, ee()),
189
189
  liveProposals: q.liveFor(t).count,
190
- turnInFlight: mt(e.processingByConversationId[t]?.status)
190
+ turnInFlight: ht(e.processingByConversationId[t]?.status)
191
191
  };
192
- }, [q]), aa = N({}), J = N(Lt()), Y = N(new Ln()), oa = N(/* @__PURE__ */ new Set()), sa = M(() => R.find((e) => e.id === W), [R, W]), ca = x((e) => {
193
- let t = e.sandboxesByMode[W]?.sandboxId;
192
+ }, [q]), aa = M({}), J = M(Rt()), Y = M(new Rn()), oa = M(/* @__PURE__ */ new Set()), sa = j(() => L.find((e) => e.id === U), [L, U]), ca = b((e) => {
193
+ let t = e.sandboxesByMode[U]?.sandboxId;
194
194
  return t ? e.sandboxWriteCapabilities[t] : void 0;
195
- }), la = sa !== void 0 && it({
196
- mode: W,
197
- productWriteApproval: z,
195
+ }), la = sa !== void 0 && at({
196
+ mode: U,
197
+ productWriteApproval: R,
198
198
  capabilities: ca
199
- }), ua = W === "assistant" || sa !== void 0 && !sa.writeCapable && !pe(W) || la;
200
- j(() => {
201
- if (W !== "assistant" && sa?.writeCapable && !re(ci, W)) {
202
- Yr("assistant");
199
+ }), ua = U === "assistant" || sa !== void 0 && !sa.writeCapable && !me(U) || la;
200
+ A(() => {
201
+ if (U !== "assistant" && sa?.writeCapable && !ie(ci, U)) {
202
+ Xr("assistant");
203
203
  return;
204
204
  }
205
- Pi || (!sa || sa.requiresAdmin && !Ni) && W !== "assistant" && Yr("assistant");
205
+ Pi || (!sa || sa.requiresAdmin && !Ni) && U !== "assistant" && Xr("assistant");
206
206
  }, [
207
- W,
207
+ U,
208
208
  sa,
209
209
  Ni,
210
210
  Pi,
211
- Yr,
211
+ Xr,
212
212
  ci
213
213
  ]);
214
- let da = A((e, t, n, r) => {
214
+ let da = k((e, t, n, r) => {
215
215
  ni(e, n, t, null, r);
216
- }, [ni]), fa = A(async (e, t, n, r, i, a = null) => {
216
+ }, [ni]), fa = k(async (e, t, n, r, i, a = null) => {
217
217
  let o = (e, t) => {
218
218
  r && da(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
219
219
  }, c = (e) => {
220
- r && O(r.assistantMessageId, e);
220
+ r && D(r.assistantMessageId, e);
221
221
  }, l = () => {
222
222
  c("bootAdopted"), a?.beginBoot();
223
- }, u = () => a !== null && (a.signal.aborted || k() !== t), d = () => {
224
- if (u()) throw new Rn("cancelled");
225
- }, f = x.getState().sandboxesByMode[e]?.sandboxId ?? null, p = !1, m = !1, h = !1, ee = !1, g = !1, _ = async (r) => {
223
+ }, u = () => a !== null && (a.signal.aborted || O() !== t), d = () => {
224
+ if (u()) throw new zn("cancelled");
225
+ }, f = b.getState().sandboxesByMode[e]?.sandboxId ?? null, p = !1, ee = !1, m = !1, te = !1, h = !1, g = async (r) => {
226
226
  if (i && !Y.current.has(r) && J.current.isFresh(r)) return p = !0, !0;
227
- h = !0;
227
+ m = !0;
228
228
  let o = !1;
229
229
  try {
230
- await ve(r, t, n, 3e5), await _e(r, t, e, n, 9e4, () => {
230
+ await ye(r, t, n, 3e5), await ve(r, t, e, n, 9e4, () => {
231
231
  o = !0, l();
232
232
  });
233
233
  } catch {
234
- if (u()) throw new Rn("cancelled");
235
- return J.current.invalidate(r), Y.current.add(r), a?.dead.push(r), g = !0, !1;
234
+ if (u()) throw new zn("cancelled");
235
+ return J.current.invalidate(r), Y.current.add(r), a?.dead.push(r), h = !0, !1;
236
236
  }
237
- return d(), J.current.markVerified(r), o && (ee = !0), !0;
237
+ return d(), J.current.markVerified(r), o && (te = !0), !0;
238
238
  };
239
- if (f && (oi(e, f, "provisioning"), o("provisioning", "reusingEnvironment"), await _(f) || (oi(e, null, "provisioning"), f = null)), !f) {
239
+ if (f && (oi(e, f, "provisioning"), o("provisioning", "reusingEnvironment"), await g(f) || (oi(e, null, "provisioning"), f = null)), !f) {
240
240
  o("provisioning", "lookingForEnvironment");
241
- let r = await ue(t, L, e, br(), n, Y.current, z);
241
+ let r = await de(t, I, e, xr(), n, Y.current, R);
242
242
  d();
243
243
  let i = r?.id ?? null;
244
244
  if (i) {
245
245
  oi(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
246
246
  let t = r?.status === "PROVISIONING" || r?.status === "PENDING";
247
- t && l(), await _(i) ? (f = i, t && (ee = !0)) : oi(e, null, "provisioning");
247
+ t && l(), await g(i) ? (f = i, t && (te = !0)) : oi(e, null, "provisioning");
248
248
  }
249
249
  }
250
250
  if (!f) {
251
- if (a && !a.mayCreate) throw new Rn("no-create");
252
- if (c("provisionStarted"), e === "api-calls" && !B()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
251
+ if (a && !a.mayCreate) throw new zn("no-create");
252
+ if (c("provisionStarted"), e === "api-calls" && !z()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
253
253
  o("provisioning", "startingEnvironment"), oi(e, null, "provisioning");
254
- let r = a ? [] : await he(t, L, e, br(), n, Y.current, z);
254
+ let r = a ? [] : await ge(t, I, e, xr(), n, Y.current, R);
255
255
  if (r.length > 0) {
256
256
  let e = new Set(r);
257
257
  for (let e of r) J.current.invalidate(e), Y.current.add(e);
258
- let t = x.getState().sandboxesByMode;
258
+ let t = b.getState().sandboxesByMode;
259
259
  for (let [n, r] of Object.entries(t)) s(n) && r?.sandboxId && e.has(r.sandboxId) && si(n);
260
260
  }
261
261
  c("createRequested");
262
262
  let i = a?.beginCreate();
263
263
  try {
264
- f = await se(L, e, t, br(), Dr, n, { writeApproval: z });
264
+ f = await ce(I, e, t, xr(), Or, n, { writeApproval: R });
265
265
  } finally {
266
266
  i?.();
267
267
  }
268
- m = !0, d(), oi(e, f, "provisioning"), await ve(f, t, n, 3e5), d(), c("sandboxRunning"), await _e(f, t, e, n, 9e4), d(), c("serviceReady"), J.current.markVerified(f);
268
+ ee = !0, d(), oi(e, f, "provisioning"), await ye(f, t, n, 3e5), d(), c("sandboxRunning"), await ve(f, t, e, n, 9e4), d(), c("serviceReady"), J.current.markVerified(f);
269
269
  }
270
270
  return oi(e, f, "running"), {
271
271
  sandboxId: f,
272
- sandboxIsNew: m,
273
- sandboxProbed: h,
274
- sandboxAdopted: ee,
275
- deadSandboxProbe: g,
272
+ sandboxIsNew: ee,
273
+ sandboxProbed: m,
274
+ sandboxAdopted: te,
275
+ deadSandboxProbe: h,
276
276
  trustedFromCache: p
277
277
  };
278
278
  }, [
279
279
  si,
280
- B,
281
- L,
282
280
  z,
281
+ I,
282
+ R,
283
283
  oi,
284
284
  da
285
- ]), pa = A(async function e(t, n, r, i, a, o = {}) {
286
- let s = await Wn(i, r, (e) => da(t, n, "provisioning", e), () => O(n, "prewarmJoined"));
285
+ ]), pa = k(async function e(t, n, r, i, a, o = {}) {
286
+ let s = await Gn(i, r, (e) => da(t, n, "provisioning", e), () => D(n, "prewarmJoined"));
287
287
  for (let e of s.dead) J.current.invalidate(e), Y.current.add(e);
288
- s.verified && !Y.current.has(s.verified) && J.current.markVerified(s.verified), s.joined && D(n, { prewarm: s.joined });
288
+ s.verified && !Y.current.has(s.verified) && J.current.markVerified(s.verified), s.joined && E(n, { prewarm: s.joined });
289
289
  let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await fa(r, i, a, {
290
290
  conversationId: t,
291
291
  assistantMessageId: n
292
- }, o.trustCache !== !1), m = Bn(i, r, c);
293
- !s.waited && m && D(n, { prewarm: "hit" });
294
- let h = x.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, ee = !1, g = null;
295
- if (h) {
296
- let e = St(c, h, (e, t) => fe(e, i, t, r, a, { limit: 50 }));
292
+ }, o.trustCache !== !1), ee = Vn(i, r, c);
293
+ !s.waited && ee && E(n, { prewarm: "hit" });
294
+ let m = b.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, te = !1, h = null;
295
+ if (m) {
296
+ let e = Ct(c, m, (e, t) => pe(e, i, t, r, a, { limit: 50 }));
297
297
  try {
298
- let t = await C(c, i, h, r, a);
298
+ let t = await S(c, i, m, r, a);
299
299
  if (t.mode !== r) throw Error(`Session mode mismatch: expected ${r}, received ${t.mode}`);
300
- g = e;
300
+ h = e;
301
301
  } catch {
302
- ai(t), h = null;
302
+ ai(t), m = null;
303
303
  }
304
304
  }
305
- let _ = !1;
306
- if (!h) {
307
- let e = zn(Vn({
305
+ let g = !1;
306
+ if (!m) {
307
+ let e = Bn(Hn({
308
308
  workspaceId: i,
309
309
  mode: r,
310
310
  sandboxId: c,
311
- userId: V
311
+ userId: B
312
312
  }), Date.now());
313
313
  if (e) {
314
314
  "pending" in e && da(t, n, "connecting", "preparingSession");
315
315
  let o = "sessionId" in e ? e.sessionId : await e.pending;
316
316
  if (o && !Y.current.has(c)) try {
317
- (await C(c, i, o, r, a)).mode === r && (h = o, _ = !0, ii(t, h), ee = !0);
317
+ (await S(c, i, o, r, a)).mode === r && (m = o, g = !0, ii(t, m), te = !0);
318
318
  } catch {}
319
319
  }
320
320
  }
321
- if (!h) {
321
+ if (!m) {
322
322
  da(t, n, "connecting", "preparingSession");
323
323
  let s;
324
324
  try {
325
- s = await ce(c, i, r, a);
325
+ s = await le(c, i, r, a);
326
326
  } catch (s) {
327
327
  if (p) {
328
328
  J.current.invalidate(c);
329
- let l = zt(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
330
- if (l === "check-network" && (l = await Rt(() => ue(i, L, r, br(), a, Y.current, z))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
331
- p || D(n, { cacheProofFailed: !0 }), l === "replace" && (Y.current.add(c), ai(t), si(r), q.retireSandbox(c));
329
+ let l = Bt(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
330
+ if (l === "check-network" && (l = await zt(() => de(i, I, r, xr(), a, Y.current, R))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
331
+ p || E(n, { cacheProofFailed: !0 }), l === "replace" && (Y.current.add(c), ai(t), si(r), q.retireSandbox(c));
332
332
  let s = await e(t, n, r, i, a, {
333
333
  ...o,
334
334
  trustCache: !1
335
335
  });
336
- return p && (s.deadSandboxProbe || s.sandboxId !== c) && D(n, { cacheProofFailed: !0 }), {
336
+ return p && (s.deadSandboxProbe || s.sandboxId !== c) && E(n, { cacheProofFailed: !0 }), {
337
337
  ...s,
338
338
  sandboxProbed: s.sandboxProbed || u,
339
339
  sandboxAdopted: s.sandboxAdopted || d,
@@ -343,33 +343,33 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
343
343
  }
344
344
  throw s;
345
345
  }
346
- h = s.sessionId, ii(t, h), ee = !0;
346
+ m = s.sessionId, ii(t, m), te = !0;
347
347
  }
348
348
  return {
349
349
  sandboxId: c,
350
- sessionId: h,
351
- sessionIsNew: ee,
352
- readAhead: g,
350
+ sessionId: m,
351
+ sessionIsNew: te,
352
+ readAhead: h,
353
353
  sandboxIsNew: l,
354
354
  sandboxProbed: u,
355
355
  sandboxAdopted: d,
356
356
  deadSandboxProbe: f,
357
- sessionPreopened: _
357
+ sessionPreopened: g
358
358
  };
359
359
  }, [
360
360
  fa,
361
361
  ai,
362
362
  si,
363
- L,
364
- z,
363
+ I,
364
+ R,
365
365
  ii,
366
366
  da,
367
- V,
367
+ B,
368
368
  q
369
- ]), ma = A((e, t = !1) => {
370
- let n = k();
369
+ ]), ma = k((e, t = !1) => {
370
+ let n = O();
371
371
  if (!n) return;
372
- let r = x.getState(), i = Date.now(), a = Un({
372
+ let r = b.getState(), i = Date.now(), a = Wn({
373
373
  autoRouting: r.autoRouting,
374
374
  autoOffered: Wi.current,
375
375
  active: !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0,
@@ -379,17 +379,17 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
379
379
  acknowledgedWriteModes: r.acknowledgedWriteModes,
380
380
  adminAccess: Fi.read(),
381
381
  dictated: e,
382
- voiceProposalBound: (e) => Rr(e),
383
- turnInFlight: Object.values(r.processingByConversationId).some((e) => mt(e?.status)),
384
- ...qn(n),
382
+ voiceProposalBound: (e) => zr(e),
383
+ turnInFlight: Object.values(r.processingByConversationId).some((e) => ht(e?.status)),
384
+ ...Jn(n),
385
385
  now: i
386
386
  });
387
387
  if (!a) return;
388
- let o = Kn(n, a, i), s = {
389
- accessToken: B(),
390
- workspaceToken: zr(),
391
- userId: V,
392
- organizationId: Pt()
388
+ let o = qn(n, a, i), s = {
389
+ accessToken: z(),
390
+ workspaceToken: Br(),
391
+ userId: B,
392
+ organizationId: Ft()
393
393
  };
394
394
  fa(a.mode, n, s, null, !0, o).then((e) => {
395
395
  if (o.finish({
@@ -398,25 +398,25 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
398
398
  didWork: !e.trustedFromCache && (e.sandboxIsNew || e.sandboxProbed || e.sandboxAdopted),
399
399
  booted: e.sandboxIsNew || e.sandboxAdopted,
400
400
  dead: o.dead
401
- }), o.signal.aborted || k() !== n || Y.current.has(e.sandboxId)) return;
402
- let r = x.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = m();
403
- Hn({
401
+ }), o.signal.aborted || O() !== n || Y.current.has(e.sandboxId)) return;
402
+ let r = b.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = ee();
403
+ Un({
404
404
  active: i ? {
405
405
  mode: i.mode,
406
406
  backendSessionId: i.backendSessionId,
407
- continuable: !sn(i) && !on(i, c),
408
- hasHistory: an(i)
407
+ continuable: !cn(i) && !sn(i, c),
408
+ hasHistory: on(i)
409
409
  } : void 0,
410
410
  mode: a.mode
411
- }) && Gn(Vn({
411
+ }) && Kn(Hn({
412
412
  workspaceId: n,
413
413
  mode: a.mode,
414
414
  sandboxId: e.sandboxId,
415
- userId: V
416
- }), () => ce(e.sandboxId, n, a.mode, s).then((e) => e.sessionId), Date.now());
415
+ userId: B
416
+ }), () => le(e.sandboxId, n, a.mode, s).then((e) => e.sessionId), Date.now());
417
417
  }, (e) => {
418
- if (!(e instanceof Rn) && !o.signal.aborted && k() === n) {
419
- let e = x.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
418
+ if (!(e instanceof zn) && !o.signal.aborted && O() === n) {
419
+ let e = b.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
420
420
  e && (J.current.invalidate(e), Y.current.add(e), o.dead.push(e), si(a.mode));
421
421
  }
422
422
  o.finish({
@@ -430,41 +430,41 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
430
430
  fa,
431
431
  Fi,
432
432
  si,
433
+ z,
434
+ Br,
433
435
  B,
434
- zr,
435
- V,
436
- Rr
437
- ]), ha = A(() => ma(!1), [ma]), ga = wr(ne, _, _)?.reference ?? null, [_a, va] = Cr(0), ya = N(/* @__PURE__ */ new Set()), ba = N(null), xa = A(() => {
438
- let e = x.getState(), t = e.activeConversationId;
436
+ zr
437
+ ]), ha = k(() => ma(!1), [ma]), ga = Tr(re, g, g)?.reference ?? null, [_a, va] = wr(0), ya = M(/* @__PURE__ */ new Set()), ba = M(null), xa = k(() => {
438
+ let e = b.getState(), t = e.activeConversationId;
439
439
  if (!t) return null;
440
- let n = e.processingByConversationId[t], r = mt(n?.status) ? n?.messageId ?? null : null;
441
- if (!gt({
440
+ let n = e.processingByConversationId[t], r = ht(n?.status) ? n?.messageId ?? null : null;
441
+ if (!_t({
442
442
  interruptedTurnId: r,
443
443
  activeTurnId: r,
444
444
  alreadyRequested: r ? ya.current.has(r) : !1
445
445
  }).send || !r) return null;
446
446
  ya.current.add(r);
447
- let i = ae(e), a = k(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
448
- return !i || !a || !o || oe(i.sandboxId, a, o, i.mode, {
449
- accessToken: B(),
450
- workspaceToken: zr(),
451
- userId: V,
452
- organizationId: Pt()
447
+ let i = oe(e), a = O(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
448
+ return !i || !a || !o || se(i.sandboxId, a, o, i.mode, {
449
+ accessToken: z(),
450
+ workspaceToken: Br(),
451
+ userId: B,
452
+ organizationId: Ft()
453
453
  }), r;
454
454
  }, [
455
- V,
456
455
  B,
457
- zr
458
- ]), Sa = A(() => {
456
+ z,
457
+ Br
458
+ ]), Sa = k(() => {
459
459
  let e = xa();
460
- return e && (Fe(e), Ne.abort(e)), e;
461
- }, [xa]), Ca = A(() => {
462
- let e = x.getState().activeConversationId;
460
+ return e && (Ie(e), Pe.abort(e)), e;
461
+ }, [xa]), Ca = k(() => {
462
+ let e = b.getState().activeConversationId;
463
463
  Sa(), e && q.declineForReply(e, "corrected", "spoken");
464
- }, [Sa, q]), wa = A(async (e) => {
465
- let t = x.getState(), n = ae(t), r = k(), i = t.activeConversationId;
466
- if (!n || !r || !i || Kt(t.sandboxWriteCapabilities[n.sandboxId])) return;
467
- let a = t.conversations.find((e) => e.id === i), o = a ? y(Ae(a.messages), {
464
+ }, [Sa, q]), wa = k(async (e) => {
465
+ let t = b.getState(), n = oe(t), r = O(), i = t.activeConversationId;
466
+ if (!n || !r || !i || qt(t.sandboxWriteCapabilities[n.sandboxId])) return;
467
+ let a = t.conversations.find((e) => e.id === i), o = a ? v(je(a.messages), {
468
468
  sessionId: a.backendSessionId,
469
469
  sandboxId: n.sandboxId,
470
470
  nowMs: Date.now()
@@ -477,48 +477,48 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
477
477
  conversationId: i,
478
478
  reference: e
479
479
  };
480
- if (!ee(s)) return;
480
+ if (!te(s)) return;
481
481
  try {
482
- await S(n.sandboxId, r, e, n.mode, {
483
- accessToken: B(),
484
- workspaceToken: zr(),
485
- userId: V,
486
- organizationId: Pt()
482
+ await x(n.sandboxId, r, e, n.mode, {
483
+ accessToken: z(),
484
+ workspaceToken: Br(),
485
+ userId: B,
486
+ organizationId: Ft()
487
487
  });
488
488
  } catch (e) {
489
- g(s), G(i, {
490
- id: F(),
489
+ h(s), G(i, {
490
+ id: P(),
491
491
  role: "system",
492
492
  content: e instanceof Error ? e.message : "The change could not be approved.",
493
493
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
494
494
  });
495
495
  return;
496
496
  }
497
- g(s), ti(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
498
- let c = x.getState(), l = c.conversations.find((e) => e.id === i);
499
- c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || ae(c)?.sandboxId !== n.sandboxId || mt(c.processingByConversationId[i]?.status) || v(Ae(l.messages)) !== o.messageId || $a.current(I("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
497
+ h(s), ti(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
498
+ let c = b.getState(), l = c.conversations.find((e) => e.id === i);
499
+ c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || oe(c)?.sandboxId !== n.sandboxId || ht(c.processingByConversationId[i]?.status) || _(je(l.messages)) !== o.messageId || $a.current(F("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
500
500
  approvalFollowUp: { approvedReplyId: o.messageId },
501
501
  targetConversationId: i
502
502
  });
503
503
  }, [
504
- V,
504
+ B,
505
505
  G,
506
506
  ti,
507
- I
508
- ]), Ta = e(), { speakFinishedReply: Ea } = Mt(), Da = o(), { items: Oa, permissionsSettled: ka, simulating: Aa } = Sr(), ja = N({
507
+ F
508
+ ]), Ta = e(), { speakFinishedReply: Ea } = Nt(), Da = o(), { items: Oa, permissionsSettled: ka, simulating: Aa } = Cr(), ja = M({
509
509
  theme: Ta,
510
510
  navigate: Da,
511
511
  navItems: Oa,
512
- options: Lr ?? {},
512
+ options: Rr ?? {},
513
513
  navPermissionsSettled: ka,
514
514
  navSimulating: Aa
515
515
  });
516
- j(() => {
516
+ A(() => {
517
517
  ja.current = {
518
518
  theme: Ta,
519
519
  navigate: Da,
520
520
  navItems: Oa,
521
- options: Lr ?? {},
521
+ options: Rr ?? {},
522
522
  navPermissionsSettled: ka,
523
523
  navSimulating: Aa
524
524
  };
@@ -526,47 +526,47 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
526
526
  Ta,
527
527
  Da,
528
528
  Oa,
529
- Lr,
529
+ Rr,
530
530
  ka,
531
531
  Aa
532
532
  ]);
533
- let Ma = N(!0);
534
- j(() => (Ma.current = !0, () => {
533
+ let Ma = M(!0);
534
+ A(() => (Ma.current = !0, () => {
535
535
  Ma.current = !1;
536
536
  }), []);
537
- let Na = N(null), [Pa, Fa] = Cr(!1), Ia = A((e) => {
538
- let t = x.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
539
- return n ? ar(ir, window.location.pathname, lr(n.messages, e)) : !1;
540
- }, []), La = A((e, t, n = !1) => {
541
- let { navItems: r, options: i } = ja.current, a = er(r), o = null, s = tr(e);
542
- if (Jn(s) || Yn(s) !== null) {
543
- let e = x.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), s = n ? dr(n.messages, t) : null, c = n ? e.processingByConversationId[n.id] ?? null : null, l = c !== null && c.messageId === s?.id && mt(c.status);
544
- n && s && !l && (o = ur({
537
+ let Na = M(null), [Pa, Fa] = wr(!1), Ia = k((e) => {
538
+ let t = b.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
539
+ return n ? or(ar, window.location.pathname, ur(n.messages, e)) : !1;
540
+ }, []), La = k((e, t, n = !1) => {
541
+ let { navItems: r, options: i } = ja.current, a = tr(r), o = null, s = nr(e);
542
+ if (Yn(s) || Xn(s) !== null) {
543
+ let e = b.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), s = n ? fr(n.messages, t) : null, c = n ? e.processingByConversationId[n.id] ?? null : null, l = c !== null && c.messageId === s?.id && ht(c.status);
544
+ n && s && !l && (o = dr({
545
545
  reply: s,
546
- text: Dt(s, c, I),
546
+ text: Ot(s, c, F),
547
547
  resolve: {
548
548
  destinations: a,
549
549
  entityRoutes: i.entityRoutes,
550
- visibleNavIds: Xn(r),
551
- nounLabel: (e) => vn(I, e)
550
+ visibleNavIds: Zn(r),
551
+ nounLabel: (e) => yn(F, e)
552
552
  }
553
553
  }));
554
554
  }
555
- return $n(e, a, {
555
+ return er(e, a, {
556
556
  ...i,
557
- locale: t === void 0 ? H : Ur.input.code
557
+ locale: t === void 0 ? V : Wr.input.code
558
558
  }, {
559
559
  backRunnable: Ia(t),
560
560
  navigation: o,
561
561
  skipRecords: n,
562
- controls: mr()
562
+ controls: hr()
563
563
  });
564
564
  }, [
565
565
  Ia,
566
- Ur,
567
- H,
568
- I
569
- ]), Ra = A((e, t) => {
566
+ Wr,
567
+ V,
568
+ F
569
+ ]), Ra = k((e, t) => {
570
570
  let n = La(e, t);
571
571
  if (!n) return !1;
572
572
  let { theme: r, navigate: i } = ja.current;
@@ -579,18 +579,18 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
579
579
  case "link-not-openable":
580
580
  case "back": return i !== null;
581
581
  case "conversation-delete": return !1;
582
- case "app-control": return hr(n.request, { voiceLive: t !== void 0 || Mo.current }) !== null;
582
+ case "app-control": return gr(n.request, { voiceLive: t !== void 0 || Mo.current }) !== null;
583
583
  case "open-record": return !1;
584
584
  }
585
- }, [La]), za = N(Ra);
586
- j(() => {
585
+ }, [La]), za = M(Ra);
586
+ A(() => {
587
587
  za.current = Ra;
588
588
  }, [Ra]);
589
- let Ba = A((e, t, n, r, i) => {
590
- let a = I(n.key, n.fallback, r), o = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), s = {
589
+ let Ba = k((e, t, n, r, i) => {
590
+ let a = F(n.key, n.fallback, r), o = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), s = {
591
591
  kind: "write-reply",
592
592
  line: n.key
593
- }, c = (/* @__PURE__ */ new Date()).toISOString(), l = F();
593
+ }, c = (/* @__PURE__ */ new Date()).toISOString(), l = P();
594
594
  G(e, {
595
595
  id: l,
596
596
  role: "user",
@@ -598,64 +598,64 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
598
598
  timestamp: c,
599
599
  metadata: {
600
600
  localAction: s,
601
- ...T(i)
601
+ ...w(i)
602
602
  }
603
603
  });
604
- let u = F();
604
+ let u = P();
605
605
  G(e, {
606
606
  id: u,
607
607
  role: "assistant",
608
608
  content: a,
609
609
  timestamp: c,
610
610
  metadata: {
611
- lang: a === o ? "en" : H,
611
+ lang: a === o ? "en" : V,
612
612
  localAction: s,
613
- ...T(i)
613
+ ...w(i)
614
614
  }
615
- }), un.recordCommittedEntries(e, [l, u], "LOCAL_COMMAND", k()), Ea(e, u);
615
+ }), dn.recordCommittedEntries(e, [l, u], "LOCAL_COMMAND", O()), Ea(e, u);
616
616
  }, [
617
617
  G,
618
- H,
618
+ V,
619
619
  Ea,
620
- I
621
- ]), Va = mn(), Ha = Dn(), Ua = Va?.request ?? null, Wa = N(() => void 0), [Ga, Ka] = Cr(null);
622
- j(() => {
620
+ F
621
+ ]), Va = hn(), Ha = On(), Ua = Va?.request ?? null, Wa = M(() => void 0), [Ga, Ka] = wr(null);
622
+ A(() => {
623
623
  if (Ga === null) return;
624
- let e = window.setTimeout(() => Ka(null), Ar);
624
+ let e = window.setTimeout(() => Ka(null), jr);
625
625
  return () => window.clearTimeout(e);
626
626
  }, [Ga]);
627
- let qa = A(() => {
628
- let e = x.getState();
629
- return Qr(void 0, e.autoRouting && Wi.current ? c : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
630
- }, [Qr]), Ja = A((e) => {
627
+ let qa = k(() => {
628
+ let e = b.getState();
629
+ return W(void 0, e.autoRouting && Wi.current ? c : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
630
+ }, [W]), Ja = k((e) => {
631
631
  if (!Ua) return !1;
632
- let t = e !== void 0, n = x.getState(), r = On({
632
+ let t = e !== void 0, n = b.getState(), r = kn({
633
633
  spoken: t,
634
634
  bound: ea.current,
635
635
  activeConversationId: n.activeConversationId,
636
636
  conversations: n.conversations,
637
- historyOn: pn()
637
+ historyOn: mn()
638
638
  });
639
639
  if (r && Ua(r), t) {
640
- let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? I("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : I("deleteConversation.nothing", "There is no conversation to delete.");
640
+ let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? F("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : F("deleteConversation.nothing", "There is no conversation to delete.");
641
641
  Wa.current({
642
- id: `conversation-delete:${F()}`,
642
+ id: `conversation-delete:${P()}`,
643
643
  text: t,
644
- lang: t === e ? "en" : H
644
+ lang: t === e ? "en" : V
645
645
  });
646
646
  } else r || Ka(Date.now());
647
647
  return !0;
648
648
  }, [
649
649
  Ua,
650
- H,
651
- I
652
- ]), Ya = A((e, t, n, r = !1) => {
650
+ V,
651
+ F
652
+ ]), Ya = k((e, t, n, r = !1) => {
653
653
  if (e.kind === "conversation-delete") return Ja(n);
654
654
  let { theme: i, navigate: a } = ja.current, o = null, s = () => {
655
- let e = (r ? null : o ?? x.getState().activeConversationId) ?? qa();
655
+ let e = (r ? null : o ?? b.getState().activeConversationId) ?? qa();
656
656
  return r && ra(e), e;
657
657
  }, c = (e, r) => {
658
- let i = F();
658
+ let i = P();
659
659
  return G(e, {
660
660
  id: i,
661
661
  role: "user",
@@ -663,37 +663,37 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
663
663
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
664
664
  metadata: {
665
665
  localAction: r,
666
- ...T(n)
666
+ ...w(n)
667
667
  }
668
668
  }), i;
669
669
  }, l = (e, t, r, i, a, o) => {
670
- let s = F();
670
+ let s = P();
671
671
  return G(e, {
672
672
  id: s,
673
673
  role: "assistant",
674
674
  content: r.text,
675
675
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
676
676
  metadata: {
677
- lang: r.translated ? H : "en",
677
+ lang: r.translated ? V : "en",
678
678
  localAction: i,
679
- ...T(n)
679
+ ...w(n)
680
680
  }
681
- }), un.recordCommittedEntries(e, [t, s], "LOCAL_COMMAND", a), o && Ea(e, s), s;
681
+ }), dn.recordCommittedEntries(e, [t, s], "LOCAL_COMMAND", a), o && Ea(e, s), s;
682
682
  }, u = (e, t, n) => {
683
- let r = s(), i = l(r, c(r, t), e, t, k(), !0);
683
+ let r = s(), i = l(r, c(r, t), e, t, O(), !0);
684
684
  return n?.(i), !0;
685
685
  }, d = (e) => {
686
- let t = s(), n = k(), r = window.location.pathname, i = c(t, or({
686
+ let t = s(), n = O(), r = window.location.pathname, i = c(t, sr({
687
687
  destinationId: e.destinationId,
688
688
  path: e.registryPath,
689
689
  alreadyHere: !1,
690
690
  via: e.via
691
- })), o = F();
691
+ })), o = P();
692
692
  Na.current = o, Fa(!0);
693
693
  let u = (a) => {
694
694
  try {
695
- if (!x.getState().conversations.some((e) => e.id === t)) return;
696
- let o = er(ja.current.navItems), s = a.status === "arrived" || a.status === "redirected" ? a.landedPath : null, c = or({
695
+ if (!b.getState().conversations.some((e) => e.id === t)) return;
696
+ let o = tr(ja.current.navItems), s = a.status === "arrived" || a.status === "redirected" ? a.landedPath : null, c = sr({
697
697
  destinationId: e.destinationId,
698
698
  path: e.registryPath,
699
699
  alreadyHere: !1,
@@ -701,9 +701,9 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
701
701
  outcome: a
702
702
  });
703
703
  ti(t, i, { localAction: c });
704
- let u = l(t, i, e.via === "back" && a.status === "arrived" ? hn(I, e.pageLabel()) : xn(I, a, {
704
+ let u = l(t, i, e.via === "back" && a.status === "arrived" ? gn(F, e.pageLabel()) : Sn(F, a, {
705
705
  page: e.pageLabel(),
706
- landed: s === null ? null : cr(o, s),
706
+ landed: s === null ? null : lr(o, s),
707
707
  path: e.target
708
708
  }), c, n, Ma.current);
709
709
  a.status === "arrived" && e.onArrived?.({
@@ -715,7 +715,7 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
715
715
  Na.current === o && (Na.current = null, Ma.current && Fa(!1));
716
716
  }
717
717
  };
718
- return rr(a, e.target, {
718
+ return ir(a, e.target, {
719
719
  readPath: () => window.location.pathname + window.location.search,
720
720
  now: () => Date.now(),
721
721
  schedule: (e, t) => {
@@ -723,7 +723,7 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
723
723
  },
724
724
  isShellLess: () => !Ma.current
725
725
  }).then(u, () => u({ status: "unconfirmed" })), !0;
726
- }, f = ({ replyId: e, fromPath: t, landedPath: n }) => ir.push({
726
+ }, f = ({ replyId: e, fromPath: t, landedPath: n }) => ar.push({
727
727
  fromPath: t,
728
728
  toPath: n,
729
729
  replyMessageId: e,
@@ -731,27 +731,27 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
731
731
  });
732
732
  if (e.kind === "theme") {
733
733
  if (!i) return !1;
734
- let t = nr(e.request, {
734
+ let t = rr(e.request, {
735
735
  mode: i.mode,
736
736
  resolvedTheme: i.resolvedTheme
737
737
  });
738
738
  if (!t.alreadyApplied) try {
739
739
  i.setMode(t.mode);
740
740
  } catch {}
741
- return u(Tn(I, t, e.request.kind === "family"), {
741
+ return u(En(F, t, e.request.kind === "family"), {
742
742
  kind: "theme",
743
743
  mode: t.mode,
744
744
  alreadyApplied: t.alreadyApplied
745
745
  });
746
746
  }
747
747
  if (e.kind === "app-control") {
748
- let t = hr(e.request, { voiceLive: n !== void 0 || Mo.current });
748
+ let t = gr(e.request, { voiceLive: n !== void 0 || Mo.current });
749
749
  if (!t) return !1;
750
750
  let r = (e) => ({
751
751
  kind: "app-control",
752
752
  control: t.control,
753
753
  outcome: e.outcome
754
- }), i = (e) => u(En(I, e.reply), r(e));
754
+ }), i = (e) => u(Dn(F, e.reply), r(e));
755
755
  if (t.kind === "reply") return i(t.run);
756
756
  if (t.kind === "run") {
757
757
  let e = t.run();
@@ -760,46 +760,46 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
760
760
  let a = Ha;
761
761
  if (!a) return !1;
762
762
  let o = null;
763
- return u(En(I, t.ask.reply), r(t.ask), (e) => {
764
- o = x.getState().conversations.find((t) => t.messages.some((t) => t.id === e))?.id ?? null;
763
+ return u(Dn(F, t.ask.reply), r(t.ask), (e) => {
764
+ o = b.getState().conversations.find((t) => t.messages.some((t) => t.id === e))?.id ?? null;
765
765
  }), a.request({
766
766
  prompt: t.prompt,
767
767
  onConfirm: () => {
768
- let e = t.confirmed(), i = o, a = i !== null && x.getState().conversations.some((e) => e.id === i);
768
+ let e = t.confirmed(), i = o, a = i !== null && b.getState().conversations.some((e) => e.id === i);
769
769
  if (!i || !a) return;
770
- let s = En(I, e.reply);
770
+ let s = Dn(F, e.reply);
771
771
  G(i, {
772
- id: F(),
772
+ id: P(),
773
773
  role: "assistant",
774
774
  content: s.text,
775
775
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
776
776
  metadata: {
777
- lang: s.translated ? H : "en",
777
+ lang: s.translated ? V : "en",
778
778
  localAction: r(e),
779
- ...T(n)
779
+ ...w(n)
780
780
  }
781
781
  });
782
782
  }
783
783
  }), !0;
784
784
  }
785
785
  if (!a) return !1;
786
- if (e.kind === "choose-destination") return u(gn(I, e.candidates[0]?.label ?? e.query, e.candidates), {
786
+ if (e.kind === "choose-destination") return u(_n(F, e.candidates[0]?.label ?? e.query, e.candidates), {
787
787
  kind: "choose-destination",
788
788
  candidateIds: e.candidates.map((e) => e.id)
789
- }, (t) => fr(t, e.candidates));
790
- if (e.kind === "choose-linked") return u(_n(I, e.candidates), {
789
+ }, (t) => pr(t, e.candidates));
790
+ if (e.kind === "choose-linked") return u(vn(F, e.candidates), {
791
791
  kind: "choose-destination",
792
792
  candidateIds: e.candidates.map((e) => e.id)
793
- }, (t) => fr(t, e.candidates));
793
+ }, (t) => pr(t, e.candidates));
794
794
  if (e.kind === "pick-from-list") {
795
795
  let t = e.candidates !== null && e.candidates.every((e) => e !== null) ? e.candidates : null;
796
- return u(Sn(I), t ? {
796
+ return u(Cn(F), t ? {
797
797
  kind: "choose-destination",
798
798
  candidateIds: t.map((e) => e.id)
799
799
  } : e.candidateIds.length > 0 ? {
800
800
  kind: "choose-destination",
801
801
  candidateIds: [...e.candidateIds]
802
- } : or({
802
+ } : sr({
803
803
  destinationId: "",
804
804
  path: "",
805
805
  alreadyHere: !1,
@@ -808,9 +808,9 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
808
808
  status: "refused",
809
809
  reason: "not-routable"
810
810
  }
811
- }), t ? (e) => fr(e, t) : void 0);
811
+ }), t ? (e) => pr(e, t) : void 0);
812
812
  }
813
- if (e.kind === "link-not-openable") return u(yn(I), or({
813
+ if (e.kind === "link-not-openable") return u(bn(F), sr({
814
814
  destinationId: "",
815
815
  path: "",
816
816
  alreadyHere: !1,
@@ -821,52 +821,51 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
821
821
  }
822
822
  }));
823
823
  if (e.kind === "open-record") {
824
- let { options: r, navItems: i } = ja.current, a = r.entityRoutes ?? [], s = Xn(i), c = (r.records ?? []).flatMap((t) => {
825
- let n = a.find((e) => e.id === t.entityRouteId), r = e.request.adapterIds.length === 0 || e.request.adapterIds.includes(t.id);
826
- return n && r && (n.visibleWith === void 0 || s.has(n.visibleWith)) ? [{
827
- adapter: t,
828
- route: n
829
- }] : [];
830
- });
831
- if (c.length === 0) return !1;
832
- let l = x.getState().activeConversationId, p = F();
833
- Na.current = p, Fa(!0);
834
- let m = () => {
835
- Na.current === p && (Na.current = null, Ma.current && Fa(!1));
824
+ let r;
825
+ try {
826
+ let { options: t, navItems: n } = ja.current, i = t.entityRoutes ?? [], a = Zn(n);
827
+ r = (t.records ?? []).flatMap((t) => {
828
+ let n = i.find((e) => e.id === t.entityRouteId), r = e.request.adapterIds.length === 0 || e.request.adapterIds.includes(t.id);
829
+ return n && r && (n.visibleWith === void 0 || a.has(n.visibleWith)) ? [{
830
+ adapter: t,
831
+ route: n
832
+ }] : [];
833
+ });
834
+ } catch {
835
+ return !1;
836
+ }
837
+ if (r.length === 0) return !1;
838
+ let i = b.getState().activeConversationId, a = P();
839
+ Na.current = a, Fa(!0);
840
+ let s = () => {
841
+ Na.current === a && (Na.current = null, Ma.current && Fa(!1));
836
842
  };
837
843
  return (async () => {
838
- let t = new AbortController(), n, r = new Promise((e) => {
839
- n = setTimeout(() => {
840
- t.abort(), e(null);
841
- }, Er);
842
- });
844
+ let a = { kind: "none" }, c = !0;
843
845
  try {
844
- return await Promise.all(c.map(async ({ adapter: n, route: i }) => {
845
- let a = await Promise.race([n.find(e.request.name, t.signal).catch(() => null), r]);
846
- return {
847
- adapter: n,
848
- route: i,
849
- noun: vn(I, n.noun),
850
- matches: a ?? []
851
- };
852
- }));
846
+ a = await Qn({
847
+ name: e.request.name,
848
+ usable: r,
849
+ nounOf: (e) => yn(F, e.noun),
850
+ timeoutMs: Dr
851
+ }), c = b.getState().conversations.some((e) => e.id === i);
852
+ } catch {
853
+ a = { kind: "none" };
853
854
  } finally {
854
- clearTimeout(n);
855
+ s();
855
856
  }
856
- })().then((r) => {
857
- if (!Ma.current) return m();
858
- let i = Zn(e.request.name, r), a = x.getState().conversations.some((e) => e.id === l);
859
- if (i.kind === "none") {
860
- m(), $a.current(t, [], {
857
+ if (!Ma.current) return;
858
+ if (a.kind === "none") {
859
+ $a.current(t, [], {
861
860
  fromPerson: !0,
862
861
  ...n === void 0 ? {} : { voiceSessionId: n },
863
862
  localRecordsChecked: !0
864
863
  });
865
864
  return;
866
865
  }
867
- if (l !== null && !a) return m();
868
- if (o = l, m(), i.kind === "open") {
869
- let { destination: e } = i;
866
+ if (i !== null && !c) return;
867
+ if (o = i, a.kind === "open") {
868
+ let { destination: e } = a;
870
869
  d({
871
870
  target: e.path,
872
871
  destinationId: e.id,
@@ -877,17 +876,17 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
877
876
  });
878
877
  return;
879
878
  }
880
- let s = i.candidates[0];
881
- u(i.why === "kinds" ? wn(I, i.nouns, i.candidates) : Cn(I, i.nouns[0] ?? "", s?.label ?? e.request.name, i.candidates), {
879
+ let l = a.candidates[0];
880
+ u(a.why === "kinds" ? Tn(F, a.nouns, a.candidates) : wn(F, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
882
881
  kind: "choose-destination",
883
- candidateIds: i.candidates.map((e) => e.id)
884
- }, (e) => fr(e, i.candidates));
885
- }, () => m()), !0;
882
+ candidateIds: a.candidates.map((e) => e.id)
883
+ }, (e) => pr(e, a.candidates));
884
+ })().catch(() => void 0), !0;
886
885
  }
887
886
  if (e.kind === "back") {
888
- let e = ir.top();
887
+ let e = ar.top();
889
888
  if (!e) return !1;
890
- let t = sr(er(ja.current.navItems), e.fromPath);
889
+ let t = cr(tr(ja.current.navItems), e.fromPath);
891
890
  return d({
892
891
  target: e.fromPath,
893
892
  destinationId: t?.id ?? "",
@@ -895,12 +894,12 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
895
894
  via: "back",
896
895
  pageLabel: () => t?.label ?? null,
897
896
  onArrived: () => {
898
- ir.top() === e && ir.pop();
897
+ ar.top() === e && ar.pop();
899
898
  }
900
899
  });
901
900
  }
902
901
  let { destination: p } = e;
903
- return Qn(p, window.location.pathname + window.location.search, er(ja.current.navItems)) ? u(bn(I, p.label, !0), or({
902
+ return $n(p, window.location.pathname + window.location.search, tr(ja.current.navItems)) ? u(xn(F, p.label, !0), sr({
904
903
  destinationId: p.id,
905
904
  path: p.path,
906
905
  alreadyHere: !0,
@@ -918,12 +917,12 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
918
917
  ra,
919
918
  Ha,
920
919
  qa,
921
- H,
920
+ V,
922
921
  ti,
923
922
  Ja,
924
923
  Ea,
925
- I
926
- ]), Xa = A(async (e) => {
924
+ F
925
+ ]), Xa = k(async (e) => {
927
926
  Ki.current = !0;
928
927
  try {
929
928
  await q.declineForReply(e.conversationId, e.reason, e.origin);
@@ -939,10 +938,10 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
939
938
  La,
940
939
  Ya,
941
940
  q
942
- ]), X = A(async (e, t = [], n = {}) => {
943
- let r = n.voiceSessionId !== void 0, i = x.getState(), a = !1, o = ea.current;
944
- if (r && Ue(o)) {
945
- let e = Je(o, i.activeConversationId, ia());
941
+ ]), X = k(async (e, t = [], n = {}) => {
942
+ let r = n.voiceSessionId !== void 0, i = b.getState(), a = !1, o = ea.current;
943
+ if (r && We(o)) {
944
+ let e = Ye(o, i.activeConversationId, ia());
946
945
  if (e.kind === "gone") return;
947
946
  let t = n.voiceEntry ?? e;
948
947
  t.kind === "adopt" && ra(t.conversationId), a = t.kind === "own", n = {
@@ -950,9 +949,9 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
950
949
  voiceEntry: t
951
950
  };
952
951
  }
953
- let s = a ? null : i.activeConversationId, c = a ? null : i.activeConversationId ?? U;
952
+ let s = a ? null : i.activeConversationId, c = a ? null : i.activeConversationId ?? H;
954
953
  if (c) {
955
- if (mt(i.processingByConversationId[c]?.status)) {
954
+ if (ht(i.processingByConversationId[c]?.status)) {
956
955
  let r = i.processingByConversationId[c]?.messageId ?? null;
957
956
  r && n.correctsInFlightTurn === !0 && !ya.current.has(r) && Sa(), r && ya.current.has(r) && (ba.current = {
958
957
  conversationId: c,
@@ -964,16 +963,16 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
964
963
  }
965
964
  if (oa.current.has(c)) return;
966
965
  }
967
- if (Gi.current || _() !== null || Ki.current || Na.current !== null) return;
968
- let l = n.targetConversationId, f = m(), h = (e) => sn(e) || on(e, f);
966
+ if (Gi.current || g() !== null || Ki.current || Na.current !== null) return;
967
+ let l = n.targetConversationId, f = ee(), m = (e) => cn(e) || sn(e, f);
969
968
  if (l !== void 0) {
970
969
  let e = i.conversations.find((e) => e.id === l);
971
- if (i.activeConversationId !== l || !e || e.mode !== i.mode || h(e)) return;
970
+ if (i.activeConversationId !== l || !e || e.mode !== i.mode || m(e)) return;
972
971
  }
973
972
  if (n.fromPerson && n.writeReplyBound === void 0) {
974
- let r = l ?? s ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", a = qt({
973
+ let r = l ?? s ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", a = Jt({
975
974
  text: e,
976
- locale: i === "spoken" ? Ur.input.code : H,
975
+ locale: i === "spoken" ? Wr.input.code : V,
977
976
  origin: i,
978
977
  hasAttachments: t.length > 0,
979
978
  live: q.liveFor(r),
@@ -1001,367 +1000,367 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1001
1000
  writeReplyBound: o
1002
1001
  };
1003
1002
  }
1004
- let ee = n.writeReplyBound?.promptText ?? e;
1003
+ let te = n.writeReplyBound?.promptText ?? e;
1005
1004
  if (n.fromPerson && t.length === 0 && n.writeReplyBound?.localCommands !== !1) {
1006
1005
  let t = La(e, n.voiceSessionId, n.localRecordsChecked === !0);
1007
1006
  if (t && Ya(t, e, n.voiceSessionId, a)) return;
1008
1007
  }
1009
- let g = s ? i.conversations.find((e) => e.id === s) : void 0, v = h(g) ? void 0 : g, y = i.autoRouting && Wi.current && l === void 0 ? p({
1008
+ let h = s ? i.conversations.find((e) => e.id === s) : void 0, _ = m(h) ? void 0 : h, v = i.autoRouting && Wi.current && l === void 0 ? p({
1010
1009
  intent: n.autoIntent ?? u(e),
1011
1010
  dictated: r,
1012
- voiceProposalBound: r && Rr("api-calls") && re(i.acknowledgedWriteModes, "api-calls"),
1013
- conversation: v ? {
1014
- mode: v.mode,
1015
- routedBy: v.routedBy,
1016
- hasHistory: an(v)
1011
+ voiceProposalBound: r && zr("api-calls") && ie(i.acknowledgedWriteModes, "api-calls"),
1012
+ conversation: _ ? {
1013
+ mode: _.mode,
1014
+ routedBy: _.routedBy,
1015
+ hasHistory: on(_)
1017
1016
  } : null
1018
1017
  }) : null;
1019
- if (y && Ii.current.find((e) => e.id === y.mode)?.writeCapable && !re(i.acknowledgedWriteModes, y.mode)) {
1018
+ if (v && Ii.current.find((e) => e.id === v.mode)?.writeCapable && !ie(i.acknowledgedWriteModes, v.mode)) {
1020
1019
  Gi.current = {
1021
1020
  content: e,
1022
1021
  attachments: t,
1023
1022
  options: n
1024
- }, Yi(y.mode);
1023
+ }, Yi(v.mode);
1025
1024
  return;
1026
1025
  }
1027
- let b = y ? y.mode : i.mode, ne, ae, S = l ?? (a ? null : U), se = S ? x.getState().conversations.find((e) => e.id === S) : void 0, ce = y?.action === "escalate" && v ? {
1028
- mode: v.mode,
1029
- backendSessionId: v.backendSessionId ?? null
1026
+ let y = v ? v.mode : i.mode, re, oe, x = l ?? (a ? null : H), ce = x ? b.getState().conversations.find((e) => e.id === x) : void 0, le = v?.action === "escalate" && _ ? {
1027
+ mode: _.mode,
1028
+ backendSessionId: _.backendSessionId ?? null
1030
1029
  } : null;
1031
- if (y) y.action === "new" || !v ? S = Qr(void 0, b, { routedBy: "auto" }) : (S = v.id, fi(S, b));
1030
+ if (v) v.action === "new" || !_ ? x = W(void 0, y, { routedBy: "auto" }) : (x = _.id, fi(x, y));
1032
1031
  else {
1033
1032
  let e = i.autoRouting ? { routedBy: "auto" } : void 0;
1034
- !S || h(se) || se && se.mode !== b && an(se) ? S = Qr(void 0, b, e) : se && se.mode !== b && (e ? fi(S, b) : Xr(S, b));
1033
+ !x || m(ce) || ce && ce.mode !== y && on(ce) ? x = W(void 0, y, e) : ce && ce.mode !== y && (e ? fi(x, y) : Zr(x, y));
1035
1034
  }
1036
- if (!S) return;
1037
- r && ea.current !== void 0 && S !== i.activeConversationId && ra(S), n.approvalFollowUp || (aa.current[S] = t);
1038
- let ue = () => x.getState().conversations.some((e) => e.id === S), C = k(), he = {
1039
- accessToken: B(),
1040
- workspaceToken: zr(),
1041
- userId: V,
1042
- organizationId: Pt()
1043
- }, _e = (e, t) => {
1044
- ue() || !C || oe(e, C, t, b, {
1045
- accessToken: B(),
1046
- workspaceToken: zr(),
1047
- userId: V,
1048
- organizationId: Pt()
1035
+ if (!x) return;
1036
+ r && ea.current !== void 0 && x !== i.activeConversationId && ra(x), n.approvalFollowUp || (aa.current[x] = t);
1037
+ let de = () => b.getState().conversations.some((e) => e.id === x), S = O(), ge = {
1038
+ accessToken: z(),
1039
+ workspaceToken: Br(),
1040
+ userId: B,
1041
+ organizationId: Ft()
1042
+ }, ve = (e, t) => {
1043
+ de() || !S || se(e, S, t, y, {
1044
+ accessToken: z(),
1045
+ workspaceToken: Br(),
1046
+ userId: B,
1047
+ organizationId: Ft()
1049
1048
  });
1050
- }, ve = {
1051
- id: F(),
1049
+ }, ye = {
1050
+ id: P(),
1052
1051
  role: "user",
1053
1052
  content: e,
1054
1053
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1055
1054
  metadata: {
1056
- ...t.length ? { attachments: t.map(nt) } : {},
1055
+ ...t.length ? { attachments: t.map(rt) } : {},
1057
1056
  ...n.approvalFollowUp ? {
1058
1057
  approvalFollowUp: !0,
1059
1058
  approvedReplyId: n.approvalFollowUp.approvedReplyId
1060
1059
  } : {},
1061
- ...T(n.voiceSessionId)
1060
+ ...w(n.voiceSessionId)
1062
1061
  }
1063
1062
  };
1064
- G(S, ve);
1065
- let w = F();
1066
- G(S, {
1067
- id: w,
1063
+ G(x, ye);
1064
+ let C = P();
1065
+ G(x, {
1066
+ id: C,
1068
1067
  role: "assistant",
1069
1068
  content: "",
1070
1069
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1071
1070
  metadata: {
1072
- lang: Kr,
1073
- ...T(n.voiceSessionId)
1071
+ lang: qr,
1072
+ ...w(n.voiceSessionId)
1074
1073
  }
1075
- }), Ot(w, {
1074
+ }), kt(C, {
1076
1075
  channel: r ? "voice" : "chat",
1077
- mode: b,
1078
- product: L,
1079
- language: Kr,
1080
- device: kt(),
1081
- routedByAuto: !!y
1082
- }, n.voiceTiming), O(w, "accepted"), ni(S, "provisioning", w, null), te(w);
1083
- let Ae = () => ht({
1084
- turnId: w,
1085
- abortRequested: ya.current.has(w),
1086
- activeTurnId: x.getState().processingByConversationId[S]?.messageId ?? null,
1087
- conversationExists: ue()
1088
- }), je = (e, t, r, i, a = !1, o = Kr) => {
1089
- ei(S, w, { content: ye(e) }), ti(S, w, {
1076
+ mode: y,
1077
+ product: I,
1078
+ language: qr,
1079
+ device: At(),
1080
+ routedByAuto: !!v
1081
+ }, n.voiceTiming), D(C, "accepted"), ni(x, "provisioning", C, null), ne(C);
1082
+ let je = () => gt({
1083
+ turnId: C,
1084
+ abortRequested: ya.current.has(C),
1085
+ activeTurnId: b.getState().processingByConversationId[x]?.messageId ?? null,
1086
+ conversationExists: de()
1087
+ }), Me = (e, t, r, i, a = !1, o = qr) => {
1088
+ ei(x, C, { content: be(e) }), ti(x, C, {
1090
1089
  lang: o,
1091
1090
  ...t?.length ? { artifacts: t } : {},
1092
- ...t?.length || r || i ? { mode: b } : {},
1091
+ ...t?.length || r || i ? { mode: y } : {},
1093
1092
  ...r ? { sessionId: r } : {},
1094
1093
  ...i ? { sandboxId: i } : {},
1095
1094
  ...a ? { incomplete: !0 } : {},
1096
- ...T(n.voiceSessionId)
1095
+ ...w(n.voiceSessionId)
1097
1096
  });
1098
- }, Me = { session: null }, Pe = !1, Fe = () => {
1099
- Pe && (Pe = !1, Ne.abort(w));
1100
- }, E = async (i = 1) => {
1101
- O(w, "attemptStarted");
1097
+ }, Ne = { session: null }, Fe = !1, Ie = () => {
1098
+ Fe && (Fe = !1, Pe.abort(C));
1099
+ }, T = async (i = 1) => {
1100
+ D(C, "attemptStarted");
1102
1101
  let a = null, o = null, s = !1;
1103
1102
  try {
1104
- let { sandboxId: i, sessionId: c, sessionIsNew: l, readAhead: u, sandboxIsNew: d, sandboxProbed: f, sandboxAdopted: p, deadSandboxProbe: m, sessionPreopened: h } = await pa(S, w, b, C, he, { isAbandoned: () => ht({
1105
- turnId: w,
1106
- abortRequested: ya.current.has(w),
1107
- activeTurnId: x.getState().processingByConversationId[S]?.messageId ?? null,
1108
- conversationExists: ue()
1103
+ let { sandboxId: i, sessionId: c, sessionIsNew: l, readAhead: u, sandboxIsNew: d, sandboxProbed: f, sandboxAdopted: p, deadSandboxProbe: ee, sessionPreopened: m } = await pa(x, C, y, S, ge, { isAbandoned: () => gt({
1104
+ turnId: C,
1105
+ abortRequested: ya.current.has(C),
1106
+ activeTurnId: b.getState().processingByConversationId[x]?.messageId ?? null,
1107
+ conversationExists: de()
1109
1108
  }).abandon });
1110
- if (a = i, O(w, "runtimeReady"), D(w, {
1111
- runtime: d ? "cold" : p ? "adopted" : f ? "probed" : h ? "preopened" : l ? "new-session" : "warm",
1112
- deadSandboxProbe: m
1113
- }), o = c, Me.session = {
1109
+ if (a = i, D(C, "runtimeReady"), E(C, {
1110
+ runtime: d ? "cold" : p ? "adopted" : f ? "probed" : m ? "preopened" : l ? "new-session" : "warm",
1111
+ deadSandboxProbe: ee
1112
+ }), o = c, Ne.session = {
1114
1113
  sandboxId: i,
1115
1114
  sessionId: c
1116
- }, ie(b, ne, x.getState().acknowledgedWriteModes, {
1115
+ }, ae(y, re, b.getState().acknowledgedWriteModes, {
1117
1116
  dictated: r,
1118
- confirmsWrites: pe(b),
1119
- proposalBound: Rr(b, i)
1120
- }) === "voice-in-write-mode") throw new be("voice-in-write-mode", "Voice in a write mode");
1121
- let g = kn({
1122
- conversation: x.getState().conversations.find((e) => e.id === S),
1117
+ confirmsWrites: me(y),
1118
+ proposalBound: zr(y, i)
1119
+ }) === "voice-in-write-mode") throw new xe("voice-in-write-mode", "Voice in a write mode");
1120
+ let h = An({
1121
+ conversation: b.getState().conversations.find((e) => e.id === x),
1123
1122
  content: e,
1124
1123
  sessionIsNew: l,
1125
- sendingMode: b,
1126
- sendingModeConfig: ne,
1124
+ sendingMode: y,
1125
+ sendingModeConfig: re,
1127
1126
  modes: Ii.current,
1128
- answerText: (e) => wt(e).text
1129
- }), _ = await xt(() => fe(i, C, c, b, he, { limit: 50 }), l, bt(u, i, c));
1130
- da(S, w, "streaming", "thinking");
1131
- let te = Nr?.(), v = Jt(x.getState().sandboxWriteCapabilities[i]), y = ja.current, re = y.options.uiCatalogue ? pr(er(y.navItems), {
1132
- permissionsSettled: y.navPermissionsSettled,
1133
- simulating: y.navSimulating
1134
- }) : null, oe = {
1135
- conversationId: S,
1136
- writeReply: v === "proposal-v1" ? n.writeReplyBound?.writeReply ?? null : null,
1137
- ...re ? { uiCatalogue: re } : {}
1138
- }, { prompt: se, parts: ce } = pt({
1139
- content: g ? `${g}${ee}` : ee,
1127
+ answerText: (e) => Tt(e).text
1128
+ }), g = await St(() => pe(i, S, c, y, ge, { limit: 50 }), l, xt(u, i, c));
1129
+ da(x, C, "streaming", "thinking");
1130
+ let ne = Pr?.(), _ = Yt(b.getState().sandboxWriteCapabilities[i]), v = ja.current, ie = v.options.uiCatalogue ? mr(tr(v.navItems), {
1131
+ permissionsSettled: v.navPermissionsSettled,
1132
+ simulating: v.navSimulating
1133
+ }) : null, se = {
1134
+ conversationId: x,
1135
+ writeReply: _ === "proposal-v1" ? n.writeReplyBound?.writeReply ?? null : null,
1136
+ ...ie ? { uiCatalogue: ie } : {}
1137
+ }, { prompt: ce, parts: le } = mt({
1138
+ content: h ? `${h}${te}` : te,
1140
1139
  attachments: t,
1141
- limits: tt(ne),
1142
- wrapPrompt: (e) => Pr?.(b, e, Wr, Gr, r, { writeApproval: v }) ?? e,
1143
- requestBytes: (e, t) => me({
1140
+ limits: nt(re),
1141
+ wrapPrompt: (e) => Fr?.(y, e, Gr, Kr, r, { writeApproval: _ }) ?? e,
1142
+ requestBytes: (e, t) => he({
1144
1143
  sandboxId: i,
1145
- workspaceId: C,
1144
+ workspaceId: S,
1146
1145
  sessionId: c,
1147
- mode: b,
1146
+ mode: y,
1148
1147
  prompt: e,
1149
1148
  parts: t,
1150
- pageContext: te,
1151
- authContext: he,
1152
- ...oe
1149
+ pageContext: ne,
1150
+ authContext: ge,
1151
+ ...se
1153
1152
  })
1154
- }), xe = Qe(ce), Se = xe > 0;
1155
- s = Ze(t) > xe;
1156
- let Ce = Ae();
1157
- if (Ce.abandon) {
1158
- Ce.clearProcessing && ri(S);
1153
+ }), Se = $e(le), Ce = Se > 0;
1154
+ s = Qe(t) > Se;
1155
+ let we = je();
1156
+ if (we.abandon) {
1157
+ we.clearProcessing && ri(x);
1159
1158
  return;
1160
1159
  }
1161
1160
  try {
1162
- await ge(i, C, c, se, b, te, he, ce?.length ? {
1163
- parts: ce,
1164
- ...oe
1165
- } : oe);
1161
+ await _e(i, S, c, ce, y, ne, ge, le?.length ? {
1162
+ parts: le,
1163
+ ...se
1164
+ } : se);
1166
1165
  } catch (e) {
1167
- if (!ce || !Ft(e)) throw e;
1168
- await ge(i, C, c, se, b, te, he, oe), s ||= Se;
1166
+ if (!le || !It(e)) throw e;
1167
+ await _e(i, S, c, ce, y, ne, ge, se), s ||= Ce;
1169
1168
  }
1170
- let Te = (e) => ei(S, w, { content: e }), De = (e) => s ? `${e}\n\n${I("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;
1171
- O(w, "promptSent");
1172
- let Oe = null, T = !1, Fe = vt, E = yt([], _), Ie = Date.now() + ae.streamBudgetMs, Le = Date.now(), ze = Date.now();
1173
- for (; Date.now() < Ie;) {
1174
- _e(i, c);
1175
- let e = Ae();
1169
+ let Ee = (e) => ei(x, C, { content: e }), Oe = (e) => s ? `${e}\n\n${F("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;
1170
+ D(C, "promptSent");
1171
+ let ke = null, w = !1, Ie = yt, T = bt([], g), Le = Date.now() + oe.streamBudgetMs, Re = Date.now(), Be = Date.now();
1172
+ for (; Date.now() < Le;) {
1173
+ ve(i, c);
1174
+ let e = je();
1176
1175
  if (e.abandon) {
1177
- e.clearProcessing && ri(S);
1176
+ e.clearProcessing && ri(x);
1178
1177
  return;
1179
1178
  }
1180
- if (E = yt(await fe(i, C, c, b, he, {
1179
+ if (T = bt(await pe(i, S, c, y, ge, {
1181
1180
  limit: 50,
1182
- sinceMs: _,
1181
+ sinceMs: g,
1183
1182
  surfaceTurnTerminal: !0
1184
- }), _, { accumulateNarration: ae.accumulatesNarration }), ei(S, w, { content: ye(E.content) }), E.hasRenderableOutput ? T || (T = !0, Oe !== null && O(w, "lastQuietPoll", Oe), O(w, "firstOutput")) : Oe = jt(), ae.accumulatesNarration) E.hasText && O(w, "firstText");
1183
+ }), g, { accumulateNarration: oe.accumulatesNarration }), ei(x, C, { content: be(T.content) }), T.hasRenderableOutput ? w || (w = !0, ke !== null && D(C, "lastQuietPoll", ke), D(C, "firstOutput")) : ke = Mt(), oe.accumulatesNarration) T.hasText && D(C, "firstText");
1185
1184
  else {
1186
- let e = Ct(Fe, E, jt());
1187
- Fe = e.tracker, e.confirmedAt !== null && O(w, "firstText", e.confirmedAt);
1185
+ let e = wt(Ie, T, Mt());
1186
+ Ie = e.tracker, e.confirmedAt !== null && D(C, "firstText", e.confirmedAt);
1188
1187
  }
1189
- if (E.pendingWrite && !Kt(x.getState().sandboxWriteCapabilities[i]) && ti(S, w, { pendingWrite: E.pendingWrite }), E.done) {
1190
- O(w, "answerDone"), J.current.markVerified(i);
1188
+ if (T.pendingWrite && !qt(b.getState().sandboxWriteCapabilities[i]) && ti(x, C, { pendingWrite: T.pendingWrite }), T.done) {
1189
+ D(C, "answerDone"), J.current.markVerified(i);
1191
1190
  break;
1192
1191
  }
1193
- Date.now() - Le > 3e4 && (await le(i, C, 600, he).catch(() => void 0), Le = Date.now()), await new Promise((e) => setTimeout(e, Re(Date.now() - ze)));
1192
+ Date.now() - Re > 3e4 && (await ue(i, S, 600, ge).catch(() => void 0), Re = Date.now()), await new Promise((e) => setTimeout(e, ze(Date.now() - Be)));
1194
1193
  }
1195
- if (E.done && n.voiceSessionId !== void 0 && !Ae().abandon) {
1196
- let e = ye(De(E.content));
1197
- e.trim() && (s && Te(e), O(w, "speechQueued"), Pe = !0, Ne.publish(w, {
1198
- conversationId: S,
1194
+ if (T.done && n.voiceSessionId !== void 0 && !je().abandon) {
1195
+ let e = be(Oe(T.content));
1196
+ e.trim() && (s && Ee(e), D(C, "speechQueued"), Fe = !0, Pe.publish(C, {
1197
+ conversationId: x,
1199
1198
  channel: "voice",
1200
1199
  voiceSessionId: n.voiceSessionId,
1201
1200
  text: e,
1202
- lang: Kr,
1201
+ lang: qr,
1203
1202
  final: !0
1204
1203
  }));
1205
1204
  }
1206
- let Be = ae.producesArtifacts ? await de(i, C, c, b, he).then((e) => e).catch(() => []) : void 0;
1207
- E.usedTools !== void 0 && D(w, { usedTools: E.usedTools }), E.done || (D(w, { outcome: "timedOut" }), E = {
1208
- ...E,
1209
- content: ke(E.content, b, I, ne)
1210
- }), s && (E = {
1211
- ...E,
1212
- content: De(E.content)
1205
+ let Ve = oe.producesArtifacts ? await fe(i, S, c, y, ge).then((e) => e).catch(() => []) : void 0;
1206
+ T.usedTools !== void 0 && E(C, { usedTools: T.usedTools }), T.done || (E(C, { outcome: "timedOut" }), T = {
1207
+ ...T,
1208
+ content: Ae(T.content, y, F, re)
1209
+ }), s && (T = {
1210
+ ...T,
1211
+ content: Oe(T.content)
1213
1212
  });
1214
- let Ve = !E.done;
1215
- je(E.content, Be, c, i, Ve), E.tokens && (ei(S, w, { tokens: E.tokens }), (Ir ? await Ee({
1216
- workspaceId: C,
1213
+ let He = !T.done;
1214
+ Me(T.content, Ve, c, i, He), T.tokens && (ei(x, C, { tokens: T.tokens }), (Lr ? await De({
1215
+ workspaceId: S,
1217
1216
  sessionId: c,
1218
- messageId: E.messageId,
1219
- model: E.model,
1220
- tokens: E.tokens
1221
- }, Ir, { ledger: we("panel", L) }) : { ok: !0 }).ok && _r(L)), E.done || _e(i, c);
1222
- let He = Ae();
1223
- if (He.abandon) {
1224
- He.clearProcessing && ri(S);
1217
+ messageId: T.messageId,
1218
+ model: T.model,
1219
+ tokens: T.tokens
1220
+ }, Lr, { ledger: Te("panel", I) }) : { ok: !0 }).ok && vr(I)), T.done || ve(i, c);
1221
+ let Ue = je();
1222
+ if (Ue.abandon) {
1223
+ Ue.clearProcessing && ri(x);
1225
1224
  return;
1226
1225
  }
1227
- O(w, "complete"), D(w, { outcome: "answered" }), ni(S, "complete", w, null), un.recordCommittedEntries(S, [ve.id, w], "TURN", C), Pe = !1;
1226
+ D(C, "complete"), E(C, { outcome: "answered" }), ni(x, "complete", C, null), dn.recordCommittedEntries(x, [ye.id, C], "TURN", S), Fe = !1;
1228
1227
  } catch (e) {
1229
- J.current.invalidate(a ?? x.getState().sandboxesByMode[b]?.sandboxId ?? null);
1230
- let t = ht({
1231
- turnId: w,
1232
- abortRequested: ya.current.has(w),
1233
- activeTurnId: x.getState().processingByConversationId[S]?.messageId ?? null,
1234
- conversationExists: ue()
1228
+ J.current.invalidate(a ?? b.getState().sandboxesByMode[y]?.sandboxId ?? null);
1229
+ let t = gt({
1230
+ turnId: C,
1231
+ abortRequested: ya.current.has(C),
1232
+ activeTurnId: b.getState().processingByConversationId[x]?.messageId ?? null,
1233
+ conversationExists: de()
1235
1234
  });
1236
- if (a && o && _e(a, o), t.abandon) {
1237
- t.clearProcessing && ri(S);
1235
+ if (a && o && ve(a, o), t.abandon) {
1236
+ t.clearProcessing && ri(x);
1238
1237
  return;
1239
1238
  }
1240
- if (i === 1 && It(e)) {
1241
- let e = a ?? x.getState().sandboxesByMode[b]?.sandboxId ?? null;
1242
- return e && (Y.current.add(e), J.current.invalidate(e)), ai(S), si(b), $r(S, w, ""), ti(S, w, { pendingWrite: void 0 }), e && q.retireSandbox(e), Fe(), At(w), E(2);
1239
+ if (i === 1 && Lt(e)) {
1240
+ let e = a ?? b.getState().sandboxesByMode[y]?.sandboxId ?? null;
1241
+ return e && (Y.current.add(e), J.current.invalidate(e)), ai(x), si(y), $r(x, C, ""), ti(x, C, { pendingWrite: void 0 }), e && q.retireSandbox(e), Ie(), jt(C), T(2);
1243
1242
  }
1244
1243
  throw e;
1245
1244
  }
1246
- }, Ie = S;
1247
- oa.current.add(Ie);
1245
+ }, Le = x;
1246
+ oa.current.add(Le);
1248
1247
  try {
1249
- if (!C) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
1248
+ if (!S) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
1250
1249
  code: "UNAUTHENTICATED",
1251
1250
  authFailure: "WORKSPACE_CONTEXT_MISSING"
1252
1251
  } });
1253
- let e = await ft(b, () => Ii.current.find((e) => e.id === b), Fi);
1254
- ne = e.config, ae = e.capabilities;
1255
- let t = ne, n = Ae();
1252
+ let e = await pt(y, () => Ii.current.find((e) => e.id === y), Fi);
1253
+ re = e.config, oe = e.capabilities;
1254
+ let t = re, n = je();
1256
1255
  if (n.abandon) {
1257
- n.clearProcessing && ri(S);
1256
+ n.clearProcessing && ri(x);
1258
1257
  return;
1259
1258
  }
1260
- let i = ie(b, t, x.getState().acknowledgedWriteModes, {
1259
+ let i = ae(y, t, b.getState().acknowledgedWriteModes, {
1261
1260
  dictated: r,
1262
- confirmsWrites: pe(b),
1263
- proposalBound: Rr(b)
1261
+ confirmsWrites: me(y),
1262
+ proposalBound: zr(y)
1264
1263
  });
1265
- if (i) throw new be(i, i === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
1266
- let a = we("panel", L);
1267
- if (Ir && Te(a, C)) {
1268
- let e = await De(a, C, Ir);
1269
- if (!e.ok) throw Oe(e.kind);
1270
- let t = Ae();
1264
+ if (i) throw new xe(i, i === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
1265
+ let a = Te("panel", I);
1266
+ if (Lr && Ee(a, S)) {
1267
+ let e = await Oe(a, S, Lr);
1268
+ if (!e.ok) throw ke(e.kind);
1269
+ let t = je();
1271
1270
  if (t.abandon) {
1272
- t.clearProcessing && ri(S);
1271
+ t.clearProcessing && ri(x);
1273
1272
  return;
1274
1273
  }
1275
1274
  }
1276
- O(w, "cleared"), await E();
1275
+ D(C, "cleared"), await T();
1277
1276
  } catch (e) {
1278
- if (J.current.invalidate(x.getState().sandboxesByMode[b]?.sandboxId ?? null), !ue()) {
1279
- ri(S);
1277
+ if (J.current.invalidate(b.getState().sandboxesByMode[y]?.sandboxId ?? null), !de()) {
1278
+ ri(x);
1280
1279
  return;
1281
1280
  }
1282
- let t = Me.session?.sandboxId ?? null, r = xe(e, { confirmsNoAction: Se({
1283
- mode: b,
1284
- capabilities: t ? x.getState().sandboxWriteCapabilities[t] : null
1281
+ let t = Ne.session?.sandboxId ?? null, r = Se(e, { confirmsNoAction: Ce({
1282
+ mode: y,
1283
+ capabilities: t ? b.getState().sandboxWriteCapabilities[t] : null
1285
1284
  }) });
1286
- D(w, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade && gr(L, "sandbox");
1287
- let i = Ce(r, I, { locale: H });
1288
- ni(S, "error", w, i.headline), ei(S, w, { content: i.text }), ti(S, w, {
1289
- lang: i.translated ? H : "en",
1290
- ...T(n.voiceSessionId)
1285
+ E(C, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade && _r(I, "sandbox");
1286
+ let i = we(r, F, { locale: V });
1287
+ ni(x, "error", C, i.headline), ei(x, C, { content: i.text }), ti(x, C, {
1288
+ lang: i.translated ? V : "en",
1289
+ ...w(n.voiceSessionId)
1291
1290
  });
1292
1291
  } finally {
1293
- oa.current.delete(Ie), D(w, { outcome: "stopped" }), O(w, "complete"), Fe();
1294
- let e = x.getState(), t = d(ce, b, e.conversations.find((e) => e.id === Ie), (t) => !!e.sandboxesByMode[t]?.sandboxId);
1295
- t && (fi(Ie, t.mode), t.backendSessionId && ii(Ie, t.backendSessionId)), Me.session && ue() && q.afterTurn({
1296
- ...Me.session,
1297
- conversationId: Ie
1298
- }, w);
1292
+ oa.current.delete(Le), E(C, { outcome: "stopped" }), D(C, "complete"), Ie();
1293
+ let e = b.getState(), t = d(le, y, e.conversations.find((e) => e.id === Le), (t) => !!e.sandboxesByMode[t]?.sandboxId);
1294
+ t && (fi(Le, t.mode), t.backendSessionId && ii(Le, t.backendSessionId)), Ne.session && de() && q.afterTurn({
1295
+ ...Ne.session,
1296
+ conversationId: Le
1297
+ }, C);
1299
1298
  let n = ba.current;
1300
- ba.current = null, n && n.conversationId === Ie && ue() && $a.current(n.content, n.attachments, n.options);
1299
+ ba.current = null, n && n.conversationId === Le && de() && $a.current(n.content, n.attachments, n.options);
1301
1300
  }
1302
1301
  }, [
1303
- U,
1302
+ H,
1304
1303
  G,
1305
- Pr,
1304
+ Fr,
1306
1305
  ai,
1307
1306
  si,
1308
- qr,
1309
- Qr,
1307
+ Jr,
1308
+ W,
1310
1309
  pa,
1311
1310
  q,
1312
1311
  Sa,
1313
1312
  Ba,
1314
1313
  Xa,
1315
- H,
1316
- Ur,
1317
- Rr,
1318
- Nr,
1319
- B,
1314
+ V,
1315
+ Wr,
1320
1316
  zr,
1317
+ Pr,
1318
+ z,
1319
+ Br,
1321
1320
  ei,
1322
- L,
1321
+ I,
1323
1322
  Fi,
1324
- Ir,
1325
- Gr,
1326
- H,
1323
+ Lr,
1327
1324
  Kr,
1328
- Wr,
1325
+ V,
1326
+ qr,
1327
+ Gr,
1329
1328
  fi,
1330
1329
  Ya,
1331
1330
  La,
1332
1331
  ra,
1333
1332
  ia,
1334
1333
  ii,
1335
- Xr,
1334
+ Zr,
1336
1335
  ni,
1337
1336
  ri,
1338
- I,
1337
+ F,
1339
1338
  da,
1340
1339
  $r,
1341
- V
1342
- ]), Za = A((e, t) => {
1340
+ B
1341
+ ]), Za = k((e, t) => {
1343
1342
  X(e, [], t ? { autoIntent: t } : {});
1344
- }, [X]), Qa = A(() => {
1343
+ }, [X]), Qa = k(() => {
1345
1344
  let e = [...mi.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
1346
1345
  if (!e || e.metadata?.approvalFollowUp) return;
1347
- let t = U ? aa.current[U] ?? [] : [];
1346
+ let t = H ? aa.current[H] ?? [] : [];
1348
1347
  X(e.content, t);
1349
1348
  }, [
1350
1349
  hi,
1351
1350
  X,
1352
- U
1353
- ]), $a = N(X);
1354
- j(() => {
1351
+ H
1352
+ ]), $a = M(X);
1353
+ A(() => {
1355
1354
  $a.current = X;
1356
1355
  }, [X]);
1357
- let eo = M(() => {
1356
+ let eo = j(() => {
1358
1357
  if (gi) return null;
1359
1358
  for (let e = hi.length - 1; e >= 0; --e) {
1360
1359
  let t = hi[e];
1361
- if (t?.role !== "assistant" || !je(t) || ya.current.has(t.id) || Pe(t.id)) continue;
1362
- let n = _t(t, K, I);
1360
+ if (t?.role !== "assistant" || !Me(t) || ya.current.has(t.id) || Fe(t.id)) continue;
1361
+ let n = vt(t, K, F);
1363
1362
  if (n.kind !== "output") return null;
1364
- let r = wt(n.text).text.trim();
1363
+ let r = Tt(n.text).text.trim();
1365
1364
  return r ? {
1366
1365
  id: t.id,
1367
1366
  text: r
@@ -1372,66 +1371,66 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1372
1371
  hi,
1373
1372
  gi,
1374
1373
  K,
1375
- I
1376
- ]), to = M(() => eo ? ze(eo.text) : null, [eo]), no = mi.chat, ro = x((e) => ae(e)?.sandboxId ?? null), io = y(no, {
1374
+ F
1375
+ ]), to = j(() => eo ? Be(eo.text) : null, [eo]), no = mi.chat, ro = b((e) => oe(e)?.sandboxId ?? null), io = v(no, {
1377
1376
  sessionId: pi?.backendSessionId,
1378
1377
  sandboxId: ro,
1379
1378
  nowMs: Date.now()
1380
- }), ao = b(no), oo = (e) => {
1381
- if (Gt(e.metadata).length > 0) return !0;
1379
+ }), ao = y(no), oo = (e) => {
1380
+ if (Kt(e.metadata).length > 0) return !0;
1382
1381
  let t = e.metadata?.sandboxId;
1383
- return Kt(t ? yi[t] : null);
1382
+ return qt(t ? yi[t] : null);
1384
1383
  }, so = (e) => {
1385
- let t = Gt(e.metadata);
1386
- return t.length === 0 || !U ? null : /* @__PURE__ */ P(Wt, {
1384
+ let t = Kt(e.metadata);
1385
+ return t.length === 0 || !H ? null : /* @__PURE__ */ N(Gt, {
1387
1386
  refs: t,
1388
- conversationId: U,
1387
+ conversationId: H,
1389
1388
  panel: q,
1390
1389
  entries: bi,
1391
1390
  capabilitiesOf: (e) => yi[e],
1392
1391
  turnInFlight: gi,
1393
- tr: I,
1392
+ tr: F,
1394
1393
  onReview: Si.review,
1395
1394
  retiredSandboxes: xi
1396
1395
  });
1397
1396
  }, co = Si.dialog.view ? bi[Si.dialog.view.proposalId] : void 0, lo = io?.expiresAtMs ?? null;
1398
- j(() => {
1397
+ A(() => {
1399
1398
  if (lo === null) return;
1400
1399
  let e = window.setTimeout(() => va((e) => e + 1), Math.max(0, lo - Date.now()));
1401
1400
  return () => window.clearTimeout(e);
1402
1401
  }, [lo, _a]);
1403
- let Z = M(() => mi.voice.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
1402
+ let Z = j(() => mi.voice.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
1404
1403
  id: e.id,
1405
1404
  role: e.role,
1406
- text: Dt(e, K, I),
1407
- sessionId: Me(e),
1405
+ text: Ot(e, K, F),
1406
+ sessionId: Ne(e),
1408
1407
  timestamp: e.timestamp
1409
1408
  })).filter((e) => e.text.length > 0), [
1410
1409
  mi.voice,
1411
1410
  K,
1412
- I
1413
- ]), uo = A(() => {
1411
+ F
1412
+ ]), uo = k(() => {
1414
1413
  if (Z.length === 0) return;
1415
1414
  let e = /* @__PURE__ */ new Date();
1416
- rn(Ie(Z, {
1417
- title: I("voiceSession.transcript", "Voice conversation"),
1418
- savedAt: I("voiceSession.savedAt", "Saved"),
1419
- session: I("voiceSession.sessionLabel", "Session"),
1420
- earlier: I("voiceSession.earlierLabel", "Earlier"),
1421
- you: I("voiceSession.speakerYou", "You"),
1422
- assistant: I("voiceSession.speakerAssistant", "Assistant")
1423
- }, e), Le(L, e), "text/markdown");
1415
+ an(Le(Z, {
1416
+ title: F("voiceSession.transcript", "Voice conversation"),
1417
+ savedAt: F("voiceSession.savedAt", "Saved"),
1418
+ session: F("voiceSession.sessionLabel", "Session"),
1419
+ earlier: F("voiceSession.earlierLabel", "Earlier"),
1420
+ you: F("voiceSession.speakerYou", "You"),
1421
+ assistant: F("voiceSession.speakerAssistant", "Assistant")
1422
+ }, e), Re(I, e), "text/markdown");
1424
1423
  }, [
1425
- L,
1424
+ I,
1426
1425
  Z,
1427
- I
1428
- ]), fo = vr({ perFileChars: qi }), po = N(fo);
1426
+ F
1427
+ ]), fo = yr({ perFileChars: qi }), po = M(fo);
1429
1428
  po.current = fo;
1430
- let mo = N(/* @__PURE__ */ new Set()), ho = N(() => !1), Q = Nt({
1431
- onSubmit: A((e, t, n, r) => {
1432
- let i = ea.current, a = Xe(i), o = () => {
1433
- let o = po.current, s = x.getState();
1434
- if (!We({
1429
+ let mo = M(/* @__PURE__ */ new Set()), ho = M(() => !1), Q = Pt({
1430
+ onSubmit: k((e, t, n, r) => {
1431
+ let i = ea.current, a = Ze(i), o = () => {
1432
+ let o = po.current, s = b.getState();
1433
+ if (!Ge({
1435
1434
  sessionLive: ho.current(t),
1436
1435
  boundAtSubmit: i,
1437
1436
  activeConversationId: s.activeConversationId,
@@ -1440,9 +1439,9 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1440
1439
  o.clear();
1441
1440
  return;
1442
1441
  }
1443
- let c = $e(o.attachments), l = {
1442
+ let c = et(o.attachments), l = {
1444
1443
  ...n,
1445
- handedOver: jt()
1444
+ handedOver: Mt()
1446
1445
  };
1447
1446
  $a.current(e, c, {
1448
1447
  fromPerson: !0,
@@ -1452,8 +1451,8 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1452
1451
  }), o.clear();
1453
1452
  };
1454
1453
  if ((() => {
1455
- let e = x.getState();
1456
- return We({
1454
+ let e = b.getState();
1455
+ return Ge({
1457
1456
  sessionLive: ho.current(t),
1458
1457
  boundAtSubmit: i,
1459
1458
  activeConversationId: e.activeConversationId,
@@ -1465,7 +1464,7 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1465
1464
  voiceSessionId: t,
1466
1465
  voiceTiming: {
1467
1466
  ...n,
1468
- handedOver: jt()
1467
+ handedOver: Mt()
1469
1468
  }
1470
1469
  });
1471
1470
  return;
@@ -1475,33 +1474,33 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1475
1474
  return;
1476
1475
  }
1477
1476
  let s = Date.now(), c = mo.current, l = window.setInterval(() => {
1478
- po.current.isBusy && Date.now() - s < Or || (window.clearInterval(l), c.delete(l), o());
1477
+ po.current.isBusy && Date.now() - s < kr || (window.clearInterval(l), c.delete(l), o());
1479
1478
  }, 200);
1480
1479
  c.add(l);
1481
1480
  }, []),
1482
1481
  latestReply: eo,
1483
- language: Be(Vr, H).tag,
1484
- graceMs: Br,
1482
+ language: Ve(Hr, V).tag,
1483
+ graceMs: Vr,
1485
1484
  onSupersede: Ca
1486
1485
  });
1487
1486
  ho.current = Q.isCurrentSession;
1488
1487
  let go = ta ? Z.filter((e) => e.sessionId !== void 0 && Q.isCurrentSession(e.sessionId)) : Z, _o = Q.answerLocally;
1489
- j(() => {
1488
+ A(() => {
1490
1489
  Wa.current = _o;
1491
1490
  }, [_o]);
1492
- let $ = Q.active, vo = M(() => ct(Object.values(bi), U, xi), [
1491
+ let $ = Q.active, vo = j(() => lt(Object.values(bi), H, xi), [
1493
1492
  bi,
1494
- U,
1493
+ H,
1495
1494
  xi
1496
- ]), [yo, bo] = Cr(null);
1497
- j(() => {
1495
+ ]), [yo, bo] = wr(null);
1496
+ A(() => {
1498
1497
  $ || bo(null);
1499
1498
  }, [$]);
1500
- let xo = Si.review, So = A(() => {
1499
+ let xo = Si.review, So = k(() => {
1501
1500
  let e = vo[vo.length - 1];
1502
1501
  if (!e) return;
1503
1502
  let { view: t } = e;
1504
- if (Vt(t) && Bt(t, yi[e.session.sandboxId]).offerConfirm) {
1503
+ if (Ht(t) && Vt(t, yi[e.session.sandboxId]).offerConfirm) {
1505
1504
  xo(t);
1506
1505
  return;
1507
1506
  }
@@ -1510,8 +1509,8 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1510
1509
  vo,
1511
1510
  yi,
1512
1511
  xo
1513
- ]), Co = $ ? at(vo) : null, wo = yo ? bi[yo] : void 0, To = $ && wo && wo.session.conversationId === U ? {
1514
- content: /* @__PURE__ */ P(Wt, {
1512
+ ]), Co = $ ? ot(vo) : null, wo = yo ? bi[yo] : void 0, To = $ && wo && wo.session.conversationId === H ? {
1513
+ content: /* @__PURE__ */ N(Gt, {
1515
1514
  refs: [{
1516
1515
  proposalId: wo.view.proposalId,
1517
1516
  sandboxId: wo.session.sandboxId,
@@ -1522,21 +1521,21 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1522
1521
  entries: bi,
1523
1522
  capabilitiesOf: (e) => yi[e],
1524
1523
  turnInFlight: gi,
1525
- tr: I,
1524
+ tr: F,
1526
1525
  onReview: xo,
1527
1526
  retiredSandboxes: xi
1528
1527
  }),
1529
- closeLabel: lt(I, rt.trayClose),
1528
+ closeLabel: ut(F, it.trayClose),
1530
1529
  onClose: () => bo(null)
1531
1530
  } : null, Eo = Si.asking, Do = Va?.asking === !0, Oo = Ha?.asking === !0, ko = Q.holdListening;
1532
- r("assistant.transcript", M(() => $ ? null : { run: () => Qi ? { status: "already" } : ($i(!0), { status: "done" }) }, [
1531
+ r("assistant.transcript", j(() => $ ? null : { run: () => Qi ? { status: "already" } : ($i(!0), { status: "done" }) }, [
1533
1532
  $,
1534
1533
  Qi,
1535
1534
  $i
1536
- ])), r("assistant.conversation.new", M(() => $ ? null : { run: () => {
1537
- let e = x.getState(), t = e.conversations.find((t) => t.id === e.activeConversationId);
1535
+ ])), r("assistant.conversation.new", j(() => $ ? null : { run: () => {
1536
+ let e = b.getState(), t = e.conversations.find((t) => t.id === e.activeConversationId);
1538
1537
  return t && t.messages.length === 0 ? { status: "already" } : (e.createConversation(), { status: "done" });
1539
- } }, [$])), j(() => {
1538
+ } }, [$])), A(() => {
1540
1539
  ko($ && (Eo || Do || Oo));
1541
1540
  }, [
1542
1541
  $,
@@ -1545,8 +1544,8 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1545
1544
  Oo,
1546
1545
  ko
1547
1546
  ]);
1548
- let Ao = N(null), jo = Q.announce;
1549
- j(() => {
1547
+ let Ao = M(null), jo = Q.announce;
1548
+ A(() => {
1550
1549
  if (!$) {
1551
1550
  Ao.current = null;
1552
1551
  return;
@@ -1556,19 +1555,19 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1556
1555
  Ao.current = new Set(Object.keys(bi));
1557
1556
  return;
1558
1557
  }
1559
- for (let { view: t, session: n } of st(vo, e)) {
1558
+ for (let { view: t, session: n } of ct(vo, e)) {
1560
1559
  e.add(t.proposalId);
1561
1560
  let r = yi[n.sandboxId];
1562
- if (!it({
1561
+ if (!at({
1563
1562
  mode: "api-calls",
1564
- productWriteApproval: z,
1563
+ productWriteApproval: R,
1565
1564
  capabilities: r
1566
1565
  })) continue;
1567
- let i = ut(t, Bt(t, r).offerConfirm, I), a = t.proposalId;
1566
+ let i = dt(t, Vt(t, r).offerConfirm, F), a = t.proposalId;
1568
1567
  jo({
1569
1568
  id: `write-readback:${a}`,
1570
1569
  text: i.text,
1571
- lang: i.translated ? H : "en",
1570
+ lang: i.translated ? V : "en",
1572
1571
  stillWanted: () => q.entry(a)?.view.status === "pending"
1573
1572
  });
1574
1573
  }
@@ -1577,78 +1576,78 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1577
1576
  vo,
1578
1577
  bi,
1579
1578
  yi,
1580
- z,
1581
- I,
1582
- H,
1579
+ R,
1580
+ F,
1581
+ V,
1583
1582
  jo,
1584
1583
  q
1585
1584
  ]);
1586
- let Mo = N(!1);
1587
- j(() => {
1585
+ let Mo = M(!1);
1586
+ A(() => {
1588
1587
  Mo.current = Q.active;
1589
- }, [Q.active]), j(() => h((e) => {
1588
+ }, [Q.active]), A(() => m((e) => {
1590
1589
  if (!Mo.current) return !1;
1591
1590
  let t = ea.current;
1592
- return typeof t == "string" ? t === e : x.getState().activeConversationId === e;
1591
+ return typeof t == "string" ? t === e : b.getState().activeConversationId === e;
1593
1592
  }), []);
1594
- let No = Q.start, Po = A(() => {
1595
- let e = x.getState().activeConversationId, t = qe(ia());
1596
- ra(Ye(t, e)), ma(!0, t.kind === "own"), No();
1593
+ let No = Q.start, Po = k(() => {
1594
+ let e = b.getState().activeConversationId, t = Je(ia());
1595
+ ra(Xe(t, e)), ma(!0, t.kind === "own"), No();
1597
1596
  }, [
1598
1597
  ra,
1599
1598
  ma,
1600
1599
  ia,
1601
1600
  No
1602
- ]), Fo = M(() => Et(pi?.messages ?? []), [pi?.messages]), Io = Tt(mi.voice, K, I), Lo = Tt(Fo, K, I) > 0, Ro = A(() => {
1603
- let e = x.getState().activeConversationId;
1601
+ ]), Fo = j(() => Dt(pi?.messages ?? []), [pi?.messages]), Io = Et(mi.voice, K, F), Lo = Et(Fo, K, F) > 0, Ro = k(() => {
1602
+ let e = b.getState().activeConversationId;
1604
1603
  if (!e || Z.length === 0) return;
1605
- let t = new Set(Fo.map((e) => e.id)), n = F();
1604
+ let t = new Set(Fo.map((e) => e.id)), n = P();
1606
1605
  G(e, {
1607
1606
  id: n,
1608
1607
  role: "system",
1609
- content: E(Z.filter((e) => t.has(e.id)), {
1610
- intro: I("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
1611
- nothing: I("voiceSession.continuedNothing", "Continued from a voice conversation."),
1612
- more: (e) => I("voiceSession.continuedMore", "…and {{count}} more", { count: e })
1608
+ content: T(Z.filter((e) => t.has(e.id)), {
1609
+ intro: F("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
1610
+ nothing: F("voiceSession.continuedNothing", "Continued from a voice conversation."),
1611
+ more: (e) => F("voiceSession.continuedMore", "…and {{count}} more", { count: e })
1613
1612
  }),
1614
1613
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1615
1614
  metadata: { continuedVoiceTurns: Io }
1616
- }), un.recordCommittedEntries(e, [n], "NOTE", k()), $i(!1), Q.end();
1615
+ }), dn.recordCommittedEntries(e, [n], "NOTE", O()), $i(!1), Q.end();
1617
1616
  }, [
1618
1617
  Z,
1619
1618
  Io,
1620
1619
  Fo,
1621
1620
  G,
1622
- I,
1621
+ F,
1623
1622
  Q,
1624
1623
  $i
1625
- ]), zo = N({
1624
+ ]), zo = M({
1626
1625
  conversationId: null,
1627
1626
  count: 0
1628
1627
  });
1629
- j(() => {
1628
+ A(() => {
1630
1629
  Q.active && (zo.current = {
1631
- conversationId: U,
1630
+ conversationId: H,
1632
1631
  count: Io
1633
1632
  });
1634
1633
  }, [Q.active]);
1635
- let Bo = A(() => {
1636
- let e = zo.current, t = Io > (e.conversationId === U ? e.count : 0);
1634
+ let Bo = k(() => {
1635
+ let e = zo.current, t = Io > (e.conversationId === H ? e.count : 0);
1637
1636
  Q.end(), t && $i(!0);
1638
1637
  }, [
1639
- U,
1638
+ H,
1640
1639
  Io,
1641
1640
  Q,
1642
1641
  $i
1643
1642
  ]);
1644
- j(() => {
1645
- (!jr || !ua) && Q.active && Q.end();
1643
+ A(() => {
1644
+ (!Mr || !ua) && Q.active && Q.end();
1646
1645
  }, [
1647
- jr,
1646
+ Mr,
1648
1647
  ua,
1649
1648
  Q
1650
- ]), j(() => {
1651
- let e = ea.current, t = Xe(e), n = x.getState(), r = Ke({
1649
+ ]), A(() => {
1650
+ let e = ea.current, t = Ze(e), n = b.getState(), r = qe({
1652
1651
  sessionLive: Q.active,
1653
1652
  bound: e,
1654
1653
  activeConversationId: n.activeConversationId,
@@ -1657,14 +1656,14 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1657
1656
  ra(r.bound), r.end && Q.end();
1658
1657
  }, [
1659
1658
  Q,
1660
- U,
1661
- qr,
1659
+ H,
1660
+ Jr,
1662
1661
  ra
1663
1662
  ]);
1664
- let Vo = N(He);
1665
- j(() => {
1666
- let e = Ge(Vo.current, {
1667
- activeConversationId: U,
1663
+ let Vo = M(Ue);
1664
+ A(() => {
1665
+ let e = Ke(Vo.current, {
1666
+ activeConversationId: H,
1668
1667
  chatTurnCount: no.length,
1669
1668
  voiceTurnCount: Z.length,
1670
1669
  sessionLive: Q.active,
@@ -1673,82 +1672,82 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1673
1672
  });
1674
1673
  Vo.current = e.state, e.open && $i(!0);
1675
1674
  }, [
1676
- U,
1675
+ H,
1677
1676
  no.length,
1678
1677
  Z.length,
1679
1678
  Q.active,
1680
1679
  gi,
1681
1680
  $i
1682
- ]), j(() => {
1681
+ ]), A(() => {
1683
1682
  if (!Q.active) {
1684
1683
  po.current.clear(), ba.current = null;
1685
1684
  for (let e of mo.current) window.clearInterval(e);
1686
1685
  mo.current.clear();
1687
1686
  }
1688
- }, [Q.active]), j(() => {
1687
+ }, [Q.active]), A(() => {
1689
1688
  let e = mo.current;
1690
1689
  return () => {
1691
1690
  for (let t of e) window.clearInterval(t);
1692
1691
  e.clear();
1693
1692
  };
1694
- }, []), j(() => {
1695
- let e = x.getState().consumePendingPrompt();
1696
- return e && $a.current(e), x.subscribe((e, t) => {
1693
+ }, []), A(() => {
1694
+ let e = b.getState().consumePendingPrompt();
1695
+ return e && $a.current(e), b.subscribe((e, t) => {
1697
1696
  if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
1698
- let e = x.getState().consumePendingPrompt();
1697
+ let e = b.getState().consumePendingPrompt();
1699
1698
  e && $a.current(e);
1700
1699
  }
1701
1700
  });
1702
1701
  }, []);
1703
- let Ho = A((e) => {
1704
- let t = U ? x.getState().conversations.find((e) => e.id === U) : void 0;
1705
- if (t && t.mode !== e && q.withdraw(t.id, "mode_switched"), t && an(t)) {
1702
+ let Ho = k((e) => {
1703
+ let t = H ? b.getState().conversations.find((e) => e.id === H) : void 0;
1704
+ if (t && t.mode !== e && q.withdraw(t.id, "mode_switched"), t && on(t)) {
1706
1705
  if (t.mode !== e) {
1707
- let t = m(), n = x.getState().conversations.find((n) => n.mode === e && cn(n, t) && !x.getState().processingByConversationId[n.id]);
1708
- n ? Zr(n.id) : Qr(void 0, e);
1706
+ let t = ee(), n = b.getState().conversations.find((n) => n.mode === e && ln(n, t) && !b.getState().processingByConversationId[n.id]);
1707
+ n ? Qr(n.id) : W(void 0, e);
1709
1708
  }
1710
- } else U && Xr(U, e);
1711
- let n = x.getState().activeConversationId;
1712
- n ? Xr(n, e) : di(!1), Yr(e);
1709
+ } else H && Zr(H, e);
1710
+ let n = b.getState().activeConversationId;
1711
+ n ? Zr(n, e) : di(!1), Xr(e);
1713
1712
  }, [
1714
- U,
1713
+ H,
1714
+ W,
1715
1715
  Qr,
1716
- Zr,
1717
1716
  di,
1717
+ Zr,
1718
1718
  Xr,
1719
- Yr,
1720
1719
  q
1721
- ]), Uo = A(() => {
1722
- let e = x.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
1720
+ ]), Uo = k(() => {
1721
+ let e = b.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
1723
1722
  if (!t) {
1724
- di(!0), Yr(c);
1723
+ di(!0), Xr(c);
1725
1724
  return;
1726
1725
  }
1727
1726
  if (t.routedBy === "auto") {
1728
1727
  di(!0);
1729
1728
  return;
1730
1729
  }
1731
- if (!an(t)) {
1730
+ if (!on(t)) {
1732
1731
  fi(t.id, c);
1733
1732
  return;
1734
1733
  }
1735
1734
  q.withdraw(t.id, "mode_switched");
1736
- let n = m(), r = e.conversations.find((t) => t.routedBy === "auto" && cn(t, n) && !e.processingByConversationId[t.id]);
1737
- r ? (Zr(r.id), fi(r.id, c)) : Qr(void 0, c, { routedBy: "auto" });
1735
+ let n = ee(), r = e.conversations.find((t) => t.routedBy === "auto" && ln(t, n) && !e.processingByConversationId[t.id]);
1736
+ r ? (Qr(r.id), fi(r.id, c)) : W(void 0, c, { routedBy: "auto" });
1738
1737
  }, [
1739
- Qr,
1738
+ W,
1740
1739
  fi,
1741
- Zr,
1740
+ Qr,
1742
1741
  di,
1743
- Yr,
1742
+ Xr,
1744
1743
  q
1745
- ]), Wo = A((e) => {
1746
- if (R.find((t) => t.id === e)?.writeCapable && !re(x.getState().acknowledgedWriteModes, e)) {
1744
+ ]), Wo = k((e) => {
1745
+ if (L.find((t) => t.id === e)?.writeCapable && !ie(b.getState().acknowledgedWriteModes, e)) {
1747
1746
  Yi(e);
1748
1747
  return;
1749
1748
  }
1750
1749
  Ho(e);
1751
- }, [Ho, R]), Go = A(() => {
1750
+ }, [Ho, L]), Go = k(() => {
1752
1751
  let e = Ji;
1753
1752
  if (Yi(null), !e) return;
1754
1753
  let t = Gi.current;
@@ -1762,7 +1761,7 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1762
1761
  li,
1763
1762
  Ho,
1764
1763
  X
1765
- ]), Ko = Ji === null ? void 0 : R.find((e) => e.id === Ji) ?? { id: Ji }, qo = A(() => {
1764
+ ]), Ko = Ji === null ? void 0 : L.find((e) => e.id === Ji) ?? { id: Ji }, qo = k(() => {
1766
1765
  Yi(null);
1767
1766
  let e = Gi.current;
1768
1767
  Gi.current = null, e && X(e.content, e.attachments, {
@@ -1770,38 +1769,38 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1770
1769
  autoIntent: "read"
1771
1770
  });
1772
1771
  }, [X]);
1773
- return /* @__PURE__ */ Tr("div", {
1772
+ return /* @__PURE__ */ Er("div", {
1774
1773
  className: "relative flex flex-1 flex-col overflow-hidden",
1775
1774
  children: [
1776
- /* @__PURE__ */ Tr("div", {
1775
+ /* @__PURE__ */ Er("div", {
1777
1776
  className: "contents",
1778
1777
  inert: Q.active || void 0,
1779
1778
  children: [
1780
- Mi === null ? null : /* @__PURE__ */ P(Qt, { onDismiss: () => ji(Mi) }),
1781
- Z.length > 0 && !Q.active ? /* @__PURE__ */ P(Xt, {
1779
+ Mi === null ? null : /* @__PURE__ */ N($t, { onDismiss: () => ji(Mi) }),
1780
+ Z.length > 0 && !Q.active ? /* @__PURE__ */ N(Zt, {
1782
1781
  count: Z.length,
1783
1782
  onOpenTranscript: () => $i(!0)
1784
1783
  }) : null,
1785
- no.length === 0 && (Di || Oi) ? /* @__PURE__ */ P($t, {
1784
+ no.length === 0 && (Di || Oi) ? /* @__PURE__ */ N(en, {
1786
1785
  state: Di ? "loading" : "failed",
1787
1786
  onRetry: Li
1788
- }) : no.length === 0 && pi?.sync?.hasOlder ? /* @__PURE__ */ P("div", {
1787
+ }) : no.length === 0 && pi?.sync?.hasOlder ? /* @__PURE__ */ N("div", {
1789
1788
  className: "flex min-h-0 flex-1 flex-col",
1790
- children: /* @__PURE__ */ P(tn, {
1789
+ children: /* @__PURE__ */ N(nn, {
1791
1790
  onShowEarlier: Ri,
1792
1791
  disabled: Di
1793
1792
  })
1794
- }) : no.length === 0 ? /* @__PURE__ */ P(dn, {
1795
- mode: W,
1793
+ }) : no.length === 0 ? /* @__PURE__ */ N(fn, {
1794
+ mode: U,
1796
1795
  onSuggestionClick: Za,
1797
1796
  explainsAuto: Ui,
1798
- suggestions: Ui && W === "assistant" ? l(R.find((e) => e.id === "assistant")?.suggestions ?? [], R.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
1799
- }) : /* @__PURE__ */ Tr("div", {
1797
+ suggestions: Ui && U === "assistant" ? l(L.find((e) => e.id === "assistant")?.suggestions ?? [], L.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
1798
+ }) : /* @__PURE__ */ Er("div", {
1800
1799
  className: "flex min-h-0 flex-1 flex-col",
1801
- children: [pi?.sync?.hasOlder ? /* @__PURE__ */ P(tn, {
1800
+ children: [pi?.sync?.hasOlder ? /* @__PURE__ */ N(nn, {
1802
1801
  onShowEarlier: Ri,
1803
1802
  disabled: Di
1804
- }) : null, /* @__PURE__ */ P(jn, {
1803
+ }) : null, /* @__PURE__ */ N(Mn, {
1805
1804
  onApprovePendingWrite: wa,
1806
1805
  approvingWriteRef: ga,
1807
1806
  approvableMessageId: io?.messageId ?? null,
@@ -1815,26 +1814,26 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1815
1814
  hidesLegacyWriteCard: oo
1816
1815
  })]
1817
1816
  }),
1818
- Ti ? /* @__PURE__ */ P(en, { onStartNew: () => Qr() }) : null,
1819
- Ei && U ? /* @__PURE__ */ P(Zt, { onUnarchive: () => un.updateConversation(U, { archived: !1 }) }) : null,
1820
- Ga === null ? null : /* @__PURE__ */ P(fn, {
1821
- tr: I,
1817
+ Ti ? /* @__PURE__ */ N(tn, { onStartNew: () => W() }) : null,
1818
+ Ei && H ? /* @__PURE__ */ N(Qt, { onUnarchive: () => dn.updateConversation(H, { archived: !1 }) }) : null,
1819
+ Ga === null ? null : /* @__PURE__ */ N(pn, {
1820
+ tr: F,
1822
1821
  onDismiss: () => Ka(null)
1823
1822
  }),
1824
- no.length > 0 && (Di || Oi) ? /* @__PURE__ */ P($t, {
1823
+ no.length > 0 && (Di || Oi) ? /* @__PURE__ */ N(en, {
1825
1824
  state: Di ? "loading" : "failed",
1826
1825
  onRetry: Li,
1827
1826
  compact: !0
1828
1827
  }) : null,
1829
- /* @__PURE__ */ P(yr, {
1828
+ /* @__PURE__ */ N(br, {
1830
1829
  onStartVoiceSession: Q.available && ua ? Po : void 0,
1831
1830
  onSend: (e, t) => void X(e, t, { fromPerson: !0 }),
1832
1831
  onDraftStart: ha,
1833
1832
  disabled: gi || ga !== null || Di || Pa,
1834
1833
  readOnly: Ti,
1835
- placeholder: W === "api-calls" ? I("chatArea.placeholderActions", "What would you like me to do?") : I("chatArea.placeholderGeneral", "Ask me anything…"),
1836
- mode: W,
1837
- writeAccessDenied: Mr === "denied" && !!sa?.writeCapable,
1834
+ placeholder: U === "api-calls" ? F("chatArea.placeholderActions", "What would you like me to do?") : F("chatArea.placeholderGeneral", "Ask me anything…"),
1835
+ mode: U,
1836
+ writeAccessDenied: Nr === "denied" && !!sa?.writeCapable,
1838
1837
  availableModes: Vi,
1839
1838
  attachmentCharsPerFile: qi,
1840
1839
  onModeChange: Wo,
@@ -1845,7 +1844,7 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1845
1844
  })
1846
1845
  ]
1847
1846
  }),
1848
- Qi && !Q.active ? /* @__PURE__ */ P(nn, {
1847
+ Qi && !Q.active ? /* @__PURE__ */ N(rn, {
1849
1848
  turns: Z,
1850
1849
  onClose: () => $i(!1),
1851
1850
  onSave: uo,
@@ -1854,7 +1853,7 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1854
1853
  onShowEarlier: pi?.sync?.hasOlder ? Ri : void 0,
1855
1854
  showEarlierDisabled: Di
1856
1855
  }) : null,
1857
- Q.active && /* @__PURE__ */ P(Mn, {
1856
+ Q.active && /* @__PURE__ */ N(Nn, {
1858
1857
  session: Q.session,
1859
1858
  notice: Q.notice,
1860
1859
  capturing: Q.capturing,
@@ -1881,29 +1880,29 @@ var jr = ({ visible: jr = !0, writeAccess: Mr = "unknown" }) => {
1881
1880
  onToggleMute: Q.toggleMute,
1882
1881
  onEnd: Bo,
1883
1882
  proposalChip: Co ? {
1884
- label: ot(Co, I),
1883
+ label: st(Co, F),
1885
1884
  onOpen: So
1886
1885
  } : null,
1887
1886
  proposalTray: To
1888
1887
  }),
1889
- /* @__PURE__ */ P(xr, {
1888
+ /* @__PURE__ */ N(Sr, {
1890
1889
  open: Ji !== null,
1891
1890
  mode: Ko,
1892
- currentMode: sa ?? { id: W },
1891
+ currentMode: sa ?? { id: U },
1893
1892
  onConfirm: Go,
1894
1893
  onCancel: qo
1895
1894
  }),
1896
- /* @__PURE__ */ P(Ht, {
1895
+ /* @__PURE__ */ N(Ut, {
1897
1896
  ...Si.dialog,
1898
1897
  view: co?.view ?? Si.dialog.view,
1899
1898
  serverNow: co?.serverNow ?? NaN,
1900
1899
  arrivedAt: co?.arrivedAt ?? NaN,
1901
1900
  capabilities: co ? yi[co.session.sandboxId] : null,
1902
1901
  turnInFlight: gi,
1903
- tr: I
1902
+ tr: F
1904
1903
  })
1905
1904
  ]
1906
1905
  });
1907
1906
  };
1908
1907
  //#endregion
1909
- export { jr as AssistantChatArea };
1908
+ export { Mr as AssistantChatArea };