export const __webpack_esm_id__=35197;export const __webpack_esm_ids__=[35197,57578];export const __webpack_esm_modules__={35197(e,E,t){t.d(E,{I:()=>_});var n=t(22723);function a(e){let E,t,a,A,C,T={},o=!1;const S=()=>(0,n.cloneDeep)(E),c=()=>(0,n.cloneDeep)(t),d=e=>{t=(0,n.cloneDeep)(e),L(_.CHAT_LIST_UPDATED,c())},i=e=>{t.appendChat(e),d(t)},s=()=>(0,n.cloneDeep)(a),D=e=>{a&&a.id===e.id||(a=(0,n.cloneDeep)(e),L(_.SELECT_CHAT,s()))},l=()=>(0,n.cloneDeep)(A),p=()=>(0,n.cloneDeep)(T),g=e=>!!T[e],N=()=>o,L=(E,t)=>{e.emitSync(E,(0,n.cloneDeep)(t))},U=(E,t)=>e.subscribeSync(E,e=>t(e));return{resetContext:()=>{E=void 0,t=void 0,a=void 0,A=void 0,T={},C=void 0,o=!1},emit:L,subscribe:U,getChats:c,updateChats:d,addChat:i,replaceChat:(e,E)=>{t.replaceChat(e,E),d(t)},createChat:e=>{i(e),D(e),L(_.CREATE_CHAT_SUCCESSFUL,e)},onChatsListChanged:e=>(t&&angular.isFunction(e)&&e(c()),U(_.CHAT_LIST_UPDATED,E=>e(E))),getSelectedChat:s,selectChat:D,deselectChat:()=>{a=void 0,L(_.SELECT_CHAT,s())},deleteChat:e=>{t.deleteChat(e),d(t)},onSelectedChatChanged:e=>(angular.isFunction(e)&&e(s()),U(_.SELECT_CHAT,E=>e(E))),updateSelectedChat:e=>{a&&a.id&&e&&a.id!==e.id||(a=(0,n.cloneDeep)(e),L(_.SELECTED_CHAT_UPDATED,s()))},onSelectedChatUpdated:e=>(a&&angular.isFunction(e)&&e(s()),U(_.SELECTED_CHAT_UPDATED,E=>e(E))),onLastMessageReceived:e=>(a&&angular.isFunction(e)&&e(s()),U(_.LAST_MESSAGE_RECEIVED,E=>e(E))),updateAgents:e=>{E=(0,n.cloneDeep)(e),L(_.AGENT_LIST_UPDATED,S())},onAgentsListChanged:e=>(E&&angular.isFunction(e)&&e(S()),U(_.AGENT_LIST_UPDATED,E=>e(E))),getAgents:S,getAgent:e=>{if(E)return(0,n.cloneDeep)(E.getAgent(e))},selectAgent:e=>{A=(0,n.cloneDeep)(e),L(_.AGENT_SELECTED,l())},getSelectedAgent:l,onSelectedAgentChanged:e=>(A&&angular.isFunction(e)&&e(l()),U(_.AGENT_SELECTED,E=>e(E))),getDefaultAgent:()=>(0,n.cloneDeep)(C),setDefaultAgent:e=>{C=e},setCanModifyAgent:e=>{o=(0,n.cloneDeep)(e),L(_.CAN_MODIFY_AGENT_UPDATED,N())},getCanModifyAgent:N,onCanUpdateAgentUpdated:e=>(angular.isFunction(e)&&e(N()),U(_.CAN_MODIFY_AGENT_UPDATED,E=>e(E))),hasExplainResponse:g,toggleExplainResponse:e=>{g(e)&&(T[e].expanded=!T[e].expanded,L(_.EXPLAIN_RESPONSE_CACHE_UPDATED,p()))},getExplainResponse:e=>(0,n.cloneDeep)(T[e]),addExplainResponseCache:e=>{T[e.answerId]=(0,n.cloneDeep)(e),L(_.EXPLAIN_RESPONSE_CACHE_UPDATED,p())},onExplainResponseCacheUpdated:e=>(angular.isFunction(e)&&e(p()),U(_.EXPLAIN_RESPONSE_CACHE_UPDATED,E=>e(E)))}}angular.module("graphdb.framework.ttyg.services.ttygcontext",[]).factory("TTYGContextService",a),a.$inject=["EventEmitterService","TTYGService"];const _={CREATE_CHAT:"createChat",CREATE_CHAT_SUCCESSFUL:"chatCreated",CREATE_CHAT_FAILURE:"chatCreationFailed",RENAME_CHAT:"renameChat",RENAME_CHAT_SUCCESSFUL:"chatRenamed",RENAME_CHAT_FAILURE:"chatRenamedFailure",SELECT_CHAT:"selectChat",SELECTED_CHAT_UPDATED:"selectChatUpdated",LAST_MESSAGE_RECEIVED:"lastMessageReceived",DELETING_CHAT:"deletingChat",DELETE_CHAT:"deleteChat",DELETE_CHAT_SUCCESSFUL:"chatDeleted",DELETE_CHAT_FAILURE:"chatDeletedFailure",CHAT_EXPORT:"chatExport",CHAT_EXPORT_SUCCESSFUL:"chatExportSuccess",CHAT_EXPORT_FAILURE:"chatExportFailure",CHAT_LIST_UPDATED:"chatListUpdated",ASK_QUESTION:"askQuestion",ASK_QUESTION_FAILURE:"askQuestionFailure",CONTINUE_CHAT_RUN:"continueChatRun",CANCEL_PENDING_QUESTION:"cancelPendingQuestion",PENDING_QUESTION_CANCELED_SUCCESSFUL:"pendingQuestionCanceledSuccessful",CANCEL_PENDING_QUESTION_FAILURE:"cancelPendingQuestionFailed",ASK_QUESTION_STARTING:"askQuestionStarting",LOAD_CHATS:"loadChats",LOAD_CHAT_SUCCESSFUL:"loadChatSuccess",LOAD_CHAT_FAILURE:"loadChatFailure",AGENT_LIST_UPDATED:"agentListUpdated",OPEN_AGENT_SETTINGS:"openAgentSettings",EDIT_AGENT:"editAgent",CLONE_AGENT:"cloneAgent",DELETE_AGENT:"deleteAgent",AGENT_DELETED:"agentDeleted",DELETING_AGENT:"deletingAgent",AGENT_SELECTED:"agentSelected",GO_TO_CREATE_SIMILARITY_VIEW:"goToCreateSimilarityView",GO_TO_CONNECTORS_VIEW:"goToConnectorsView",GO_TO_AUTOCOMPLETE_INDEX_VIEW:"goToAutocompleteIndexView",EXPLAIN_RESPONSE:"explainResponse",EXPLAIN_RESPONSE_CACHE_UPDATED:"explainResponseCacheUpdated",GO_TO_SPARQL_EDITOR:"openQueryInSparqlEditor",CAN_MODIFY_AGENT_UPDATED:"canModifyAgentUpdated",ASK_QUESTION_STATE_CHANGED:"askQuestionStateChanged"}}};
//# sourceMappingURL=35197.f20c9c481fd5f2e9d51c.bundle.js.map