import { default as React } from 'react'; import { AICFOChatSubmissionSource } from '@zeniai/client-analytics'; import { AiCfoViewSelector, ChatSessionWithOrderedQuestionAnswers, ID, SyntheticAiCfoAnswer } from '@zeniai/client-epic-state'; import { AiCfoQuestionAnswerProps } from './components/AiCfoQuestionAnswer'; import { ResolvedSyntheticAiCfoCard, ResolvedSyntheticAiCfoPolicy } from './components/SyntheticAiCfoAnswerView'; export interface AiCfoSidePanelProps { aiCfoView: AiCfoViewSelector; isNewChatSession: boolean; showSampleQuestions: boolean; tableDownloadEndPoint: string; /** * When the app submits a question without `handleSubmit` (e.g. dashboard insight), copy into * local pending state so the loading state matches in-panel submit. */ aiCfoSidePanelQuestionToSubmit?: string | null; allSessionsWithOrderedQuestionAnswers?: ChatSessionWithOrderedQuestionAnswers[]; /** Tenant-wide users surfaced for the AI Card Creation owner picker. */ allUsers?: AiCfoQuestionAnswerProps["allUsers"]; autoSubmitEmailLinkQuestion?: boolean; cardPolicyCategorySearchOptions?: AiCfoQuestionAnswerProps["cardPolicyCategorySearchOptions"]; cardPolicyDocumentUploadErrorMessage?: AiCfoQuestionAnswerProps["cardPolicyDocumentUploadErrorMessage"]; cardPolicyDocumentUploadState?: AiCfoQuestionAnswerProps["cardPolicyDocumentUploadState"]; /** CES-owned `aiCardPolicyFormDraft`; forwarded to the card-policy form. */ cardPolicyFormDraft?: AiCfoQuestionAnswerProps["cardPolicyFormDraft"]; cardPolicyIsVendorSearchLoading?: AiCfoQuestionAnswerProps["cardPolicyIsVendorSearchLoading"]; cardPolicyLimitRowsConfig?: AiCfoQuestionAnswerProps["cardPolicyLimitRowsConfig"]; cardPolicyUploadedFileName?: AiCfoQuestionAnswerProps["cardPolicyUploadedFileName"]; cardPolicyVendorSearchOptions?: AiCfoQuestionAnswerProps["cardPolicyVendorSearchOptions"]; /** CES-owned `aiCardCreationFormDraft`; forwarded to the cards-creation form. */ cardsCreationFormDraft?: AiCfoQuestionAnswerProps["cardsCreationFormDraft"]; /** Credit-account cap for AI card-creation limit fields. */ cardsCreationMaxLimitAmount?: AiCfoQuestionAnswerProps["cardsCreationMaxLimitAmount"]; currentChatSessionId?: ID; currentTenant?: unknown; emailLinkQuestion?: string; events?: string[]; /** Chat-service export endpoint; absent means no download section is offered. */ exportDownloadEndPoint?: string; isEmptyChatWithSession?: boolean; isFileUploadEnabled?: boolean; /** Set while the create-cards / create-policy mutation is in flight. */ isInteractiveFormSubmitting?: AiCfoQuestionAnswerProps["isInteractiveFormSubmitting"]; /** Passed by connect() / drawer; not used by panel */ isOpen?: boolean; isUploadPromoVisible?: boolean; location?: unknown; navigate?: unknown; /** Debounced card-policy watch flush → `updateAiCardPolicyFormDraft`. */ onCardPolicyFormChange?: AiCfoQuestionAnswerProps["onCardPolicyFormChange"]; onCardPolicyFormSubmit?: AiCfoQuestionAnswerProps["onCardPolicyFormSubmit"]; onCardPolicyRemoveDocument?: AiCfoQuestionAnswerProps["onCardPolicyRemoveDocument"]; onCardPolicyUploadDocument?: AiCfoQuestionAnswerProps["onCardPolicyUploadDocument"]; onCardPolicyVendorSearchTextChange?: AiCfoQuestionAnswerProps["onCardPolicyVendorSearchTextChange"]; /** Debounced cards-creation watch flush → `updateAiCardCreationFormDraft`. */ onCardsCreationFormChange?: AiCfoQuestionAnswerProps["onCardsCreationFormChange"]; onCardsCreationFormSubmit?: AiCfoQuestionAnswerProps["onCardsCreationFormSubmit"]; /** While route suggested questions are loading from the API, chip skeletons render (Explore-style). */ suggestedQuestionsLoading?: boolean; /** * When set and non-empty (e.g. API suggested questions with fetch completed), used for the three * sample question cards instead of Statsig `default_message_list` / locale fallbacks. */ suggestedQuestionsOverride?: string[]; /** * Client-synthesized "Creating…" / "Created" answer bubbles for the * active chat session, in chronological order. Rendered after the * streamed Q&A pairs. Defaults to an empty list when omitted. */ syntheticAnswers?: SyntheticAiCfoAnswer[]; userId?: string; onCloseClick: () => void; onCopy: (content: string) => void; onNewChatClick: () => void; onStopSubmit: () => void; onSubmit: (input: string, source: AICFOChatSubmissionSource, files?: File[], index?: number) => void; onThumbsDown: (questionAnswerId: ID) => void; onThumbsUp: (questionAnswerId: ID) => void; onToggleCotCollapsed: (questionAnswerId: ID, isCollapsed: boolean) => void; onUpdateScrollYOffset: (scrollYOffset: number) => void; openOnboardingPage: () => void; togglePageView: () => void; updateCurrentInput: (input: string) => void; onEmailLinkQuestionProcessed?: () => void; onMenuClick?: () => void; onUploadPromoClose?: () => void; /** * Look up a newly-created card's preview tile data by `cardId`. Used by * the synthetic "Created cards" bubble to render the tile list. Optional * — when omitted, tiles fall back to showing just the card id. */ resolveCardTile?: (cardId: ID) => ResolvedSyntheticAiCfoCard | undefined; /** * Look up a newly-created card policy template's preview tile data by * `templateId`. Used by the synthetic "Created policy" bubble. */ resolvePolicyTile?: (templateId: ID) => ResolvedSyntheticAiCfoPolicy | undefined; setAiCfoSidePanelQuestionToSubmit?: (hint: string | null) => void; } declare const AiCfoSidePanel: React.FC; export default AiCfoSidePanel;