{"version":3,"file":"useAIConversationState.mjs","names":[],"sources":["../../../../../../src/plugins/AIComponents/Conversation/controller/useAIConversationState.ts"],"sourcesContent":["import { useStateStore } from '../../../../store';\nimport type { AIMessage } from '../types';\nimport type {\n  AIConversationController,\n  AIConversationControllerState,\n} from './AIConversationController';\n\n/**\n * Follows what `selector` picks of a conversation's state, such as its `status` or `error`: the\n * component renders again when it changes. Keep `selector` outside the component, so it stays the\n * same between renders.\n */\nexport const useAIConversationState = <\n  Message extends AIMessage,\n  Selected extends Readonly<Record<string, unknown>>,\n>(\n  conversation: AIConversationController<Message>,\n  selector: (state: AIConversationControllerState<Message>) => Selected,\n) => useStateStore(conversation.state, selector);\n"],"mappings":";;;;;;;AAYA,IAAa,0BAIX,cACA,aACG,cAAc,aAAa,OAAO,QAAQ"}