UNPKG

graphdb-workbench

Version:
3 lines 25.5 kB
/*! For license information please see 12358.736ea9c178c92655de3a.bundle.js.LICENSE.txt */ export const __webpack_id__=12358;export const __webpack_ids__=[3909,12358,42618,43319,62062,78508,81801,87054];export const __webpack_modules__={3909:()=>{function e(){return{restrict:"E",require:"ngModel",scope:{ngModel:"=",ngDisabled:"=",placeholder:"@"},templateUrl:"js/angular/core/templates/editable-content/editable-content.html",link:function(e,t,n,a){const o=t.find("div"),i=()=>{e.ngDisabled||e.$apply(()=>{o.html().length&&!o.text().trim().length&&o.empty(),a.$setViewValue(o[0].innerText)})};a.$render=()=>{o.html(a.$viewValue||"")};const r=e=>{e.preventDefault();const t=(e.originalEvent||e).clipboardData.getData("text/plain"),n=window.getSelection();if(!n.rangeCount)return;n.deleteFromDocument();const a=n.getRangeAt(0),o=document.createDocumentFragment(),i=t.split("\n");i.forEach((e,t)=>{o.appendChild(document.createTextNode(e)),t<i.length-1&&o.appendChild(document.createElement("br"))}),a.insertNode(o),n.collapseToEnd()};e.$on("$destroy",()=>{o.off("blur keyup change input",i),o.off("paste",r)}),o.on("blur keyup change input",i),o.on("paste",r)}}}angular.module("graphdb.framework.core.directives.editable-content",[]).directive("editableContent",e),e.$inject=[]},7928:(e,t,n)=>{n.r(t);var a=n(71920),o=n(76076);function i(e,t){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/no-agents-view.html",scope:{},link:n=>{n.canModifyAgent=!1,n.talkToGraphDocumentationLink=o.DocumentationUrlResolver.getDocumentationUrl(t.productShortVersion,"talk-to-graph.html"),n.onCreateAgent=()=>{e.emit(a.TTYGEventName.OPEN_AGENT_SETTINGS)};const i=[];i.push(e.onCanUpdateAgentUpdated(e=>{n.canModifyAgent=e})),n.$on("$destroy",()=>{i.forEach(e=>e())})}}}angular.module("graphdb.framework.ttyg.directives.no-agents-view",[]).directive("noAgentsView",i),i.$inject=["TTYGContextService","productInfo"]},12358:(e,t,n)=>{n.r(t),n(60039),n(13815),n(29350),n(44874),n(7928),n(62062),n(78508),n(95953),n(36665);var a=n(71920),o=(n(87054),n(70826)),i=n(28319),r=n(19402),s=n(51490),l=n(38940),c=n(11695),d=n(76752),g=n(43319),h=n(69937),m=n(81801),p=n(45458);function u(e,t,n,u,T,E,C,v,A,f,_,y,N,b,S){const G=[],I={filter_all:C.instant("ttyg.agent.btn.filter.all")};u.helpTemplateUrl="js/angular/ttyg/templates/chatInfo.html",u.isHelpVisible=!1,u.showChats=!0,u.showAgents=!1,u.chats=void 0,u.loadingChats=!1,u.loadingChat=!1,u.initialized=!1,u.agents=void 0,u.selectedAgent=void 0,u.loadingAgents=!1,u.reloadingAgents=!1,u.connectorID=void 0,u.canModifyAgent=!1,u.agentListFilterModel=[],u.activeRepositoryList=[],u.onopen=u.onclose=()=>angular.noop(),u.startNewChat=()=>{b.deselectChat()},u.toggleChatsListSidebar=()=>{u.showChats=!u.showChats},u.toggleAgentsListSidebar=()=>{u.showAgents=!u.showAgents},u.onToggleHelp=()=>{u.isHelpVisible=!u.isHelpVisible},u.onExportSelectedChat=()=>{D(b.getSelectedChat())};const R=()=>{const e=b.getDefaultAgent();return e?Promise.resolve(e):N.getDefaultAgent().then(e=>(b.setDefaultAgent(e),e))};u.onOpenNewAgentSettings=()=>{R().then(e=>{const t=(0,c.repositoryInfoMapper)(A.getActiveRepositoryObject());e.repositoryId=t.id;const n=(0,s.agentFormModelMapper)(new i.AgentModel({}),e,o.AGENT_OPERATION.CREATE);return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new g.AgentSettingsModal(t,u.activeRepositoryList,n,o.AGENT_OPERATION.CREATE)}},size:"lg"}}).then(e=>{v.open(e).result.then(L)}).catch(e=>{f.error(getError(e,0,o.TTYG_ERROR_MSG_LENGTH))})},u.onOpenAgentSettings=e=>{let t=e;t||(t=b.getSelectedAgent()),R().then(e=>{const n=(0,s.agentFormModelMapper)(t,e,o.AGENT_OPERATION.EDIT),a=(0,c.repositoryInfoMapper)(A.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new g.AgentSettingsModal(a,u.activeRepositoryList,n,o.AGENT_OPERATION.EDIT)}},size:"lg"}}).then(e=>{v.open(e).result.then(e=>{const t=b.getSelectedAgent();t&&e.id===t.id&&b.selectAgent(e),L()})}).catch(e=>{f.error(getError(e,0,o.TTYG_ERROR_MSG_LENGTH))})},u.onOpenCloneAgentSettings=e=>{R().then(t=>{const n=(0,s.agentFormModelMapper)(e,t,o.AGENT_OPERATION.CLONE);n.name=`clone-${n.name}`;const a=(0,c.repositoryInfoMapper)(A.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new g.AgentSettingsModal(a,u.activeRepositoryList,n,o.AGENT_OPERATION.CLONE)}},size:"lg"}}).then(e=>{v.open(e).result.then(e=>{const t=b.getSelectedAgent();t&&e.id===t.id&&b.selectAgent(e),L()})}).catch(e=>{f.error(getError(e,0,o.TTYG_ERROR_MSG_LENGTH))})};const w=()=>(u.loadingChats=!0,N.getConversations().then(e=>b.updateChats(e)).catch(e=>{f.error(getError(e,0,o.TTYG_ERROR_MSG_LENGTH)),k(new r.ChatsListModel)}).finally(()=>{u.loadingChats=!1})),L=()=>(u.reloadingAgents=!0,N.getAgents().then(e=>b.updateAgents(e)).catch(e=>{f.error(getError(e,0,o.TTYG_ERROR_MSG_LENGTH))}).finally(()=>{u.reloadingAgents=!1})),O=()=>{b.setCanModifyAgent(e.isRepoManager())},M=(e,t,n)=>{if(e.timestamp=n.timestamp,t.answers=t.answers||[],t.answers.push(...n.messages),b.updateSelectedChat(e),n.continueRunId)b.emit(a.TTYGEventName.CONTINUE_CHAT_RUN,new p.ContinueChatRun(t,n.continueRunId));else{const t=b.getChats();t.updateChatTimestamp(e.id,n.timestamp),t.updateChatName(e.id,n.chatName),e.name=n.name,b.updateChats(t),b.emit(a.TTYGEventName.LAST_MESSAGE_RECEIVED,e)}},Y=(e,t,n)=>{e.chatHistory.appendItem(t),M(e,t,n)},k=e=>{e.isEmpty()?u.showChats=!1:(u.showChats=!0,b.getSelectedChat()||S.getChatId()||b.selectChat(u.chats.getFirstChat()))},D=e=>{N.exportConversation(e.id).then(function({data:t,filename:n}){(0,d.saveAs)(t,n),b.emit(a.TTYGEventName.CHAT_EXPORT_SUCCESSFUL,e)}).catch(()=>{b.emit(a.TTYGEventName.CHAT_EXPORT_FAILURE),f.error(C.instant("ttyg.chat.messages.export_failure"))})},U=()=>{const e=A.getActiveRepository(),t=A.getLocalReadableGraphdbRepositories().map(t=>new i.AgentListFilterModel(t.id,t.id,t.id===e));u.agentListFilterModel=[new i.AgentListFilterModel(o.AGENTS_FILTER_ALL_KEY,I.filter_all),...t]},$=(e,t,n)=>{if(e!==A.getActiveRepository()){const a=A.getRepository(e);a&&_.openConfirmationModal({title:C.instant("common.confirm"),message:(0,h.Gz)(C.instant(t,{repositoryId:a.id})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},()=>{A.setRepository(a),F(n)})}else F(n)},F=e=>{t.open(e,"_blank")},H=e=>{t.open(`/sparql?query=${encodeURIComponent(e)}&execute=true`,"_blank")},x=()=>{const e=S.getChatId(),t=b.getChats();e&&t.getChat(e)&&b.selectChat(b.getChats().getChat(e))};G.push(u.$watch(u.getActiveRepositoryObject,e=>{e&&(u.activeRepositoryList=A.getLocalReadableGraphdbRepositories().map(e=>new l.SelectMenuOptionsModel({value:e.id,label:e.id,data:{repository:e}})),((e=!0)=>(u.loadingAgents=e,N.getAgents().then(e=>b.updateAgents(e)).catch(e=>{f.error(getError(e,0,o.TTYG_ERROR_MSG_LENGTH))}).finally(()=>{u.loadingAgents=!1})))().then(()=>(u.initialized=!0,U(),w())).then(x),O())})),G.push(b.onSelectedChatChanged(e=>{e&&e.id?N.getConversation(e.id).then(t=>{b.updateSelectedChat(t),S.saveChat(e)}).catch(t=>{t.status===m.status.NOT_FOUND&&((e=>{_.openModalAlert({title:C.instant("ttyg.chat.dialog.chat_is_missing.title"),message:C.instant("ttyg.chat.dialog.chat_is_missing.body")}).result.then(function(){b.deleteChat(e)})})(e),b.emit(a.TTYGEventName.LOAD_CHAT_FAILURE,e))}):e&&b.updateSelectedChat(e)})),G.push(b.onChatsListChanged(e=>{u.chats=e,k(e)})),G.push(b.onCanUpdateAgentUpdated(e=>{u.canModifyAgent=e})),G.push(b.subscribe(b.onAgentsListChanged(e=>{u.agents=e}))),G.push(b.subscribe(a.TTYGEventName.CREATE_CHAT,e=>{let t=b.getChats().getNonPersistedChat();t||(t=r.ChatModel.getEmptyChat(),b.addChat(t)),b.selectChat(t),N.createConversation(e).then(t=>{b.emit(a.TTYGEventName.CREATE_CHAT_SUCCESSFUL);const n=b.getSelectedChat();if(n&&!n.id){n.id=t.chatId,e.chatId=t.chatId;const a=b.getChats().getNonPersistedChat();b.replaceChat(n,a),S.saveChat(n),Y(n,e,t)}}).catch(e=>{b.emit(a.TTYGEventName.CREATE_CHAT_FAILURE),f.error(getError(e,0,o.TTYG_ERROR_MSG_LENGTH))})})),G.push(b.subscribe(a.TTYGEventName.RENAME_CHAT,e=>{N.renameConversation(e).then(()=>{b.emit(a.TTYGEventName.RENAME_CHAT_SUCCESSFUL),b.emit(a.TTYGEventName.LOAD_CHATS)}).catch(()=>{b.emit(a.TTYGEventName.RENAME_CHAT_FAILURE),f.error(C.instant("ttyg.chat.messages.rename_failure"))})})),G.push(b.subscribe(a.TTYGEventName.DELETE_CHAT,e=>{b.emit(a.TTYGEventName.DELETING_CHAT,{chatId:e.id,inProgress:!0}),N.deleteConversation(e.id).then(()=>{b.emit(a.TTYGEventName.DELETE_CHAT_SUCCESSFUL,e);const t=b.getChats();t.deleteChat(e),b.updateChats(t)}).catch(()=>{b.emit(a.TTYGEventName.DELETE_CHAT_FAILURE),f.error(C.instant("ttyg.chat.messages.delete_failure"))}).finally(()=>b.emit(a.TTYGEventName.DELETING_CHAT,{chatId:e.id,inProgress:!1}))})),G.push(b.subscribe(a.TTYGEventName.CHAT_EXPORT,D)),G.push(b.subscribe(a.TTYGEventName.ASK_QUESTION,e=>{N.askQuestion(e).then(t=>{const n=b.getSelectedChat();n&&n.id===e.chatId&&Y(n,e,t)}).catch(e=>{b.emit(a.TTYGEventName.ASK_QUESTION_FAILURE),f.error(getError(e,0,o.TTYG_ERROR_MSG_LENGTH))})})),G.push(b.subscribe(a.TTYGEventName.CONTINUE_CHAT_RUN,e=>{N.continueChatRun(e).then(t=>{const n=e.chatId,a=b.getSelectedChat();if(a&&a.id===n){const e=a.chatHistory.items,n=e[e.length-1];M(a,n,t)}}).catch(e=>{b.emit(a.TTYGEventName.ASK_QUESTION_FAILURE),f.error(getError(e,0,o.TTYG_ERROR_MSG_LENGTH))})})),G.push(b.subscribe(a.TTYGEventName.LOAD_CHATS,w)),G.push(b.subscribe(a.TTYGEventName.OPEN_AGENT_SETTINGS,u.onOpenNewAgentSettings)),G.push(b.subscribe(a.TTYGEventName.EDIT_AGENT,u.onOpenAgentSettings)),G.push(b.subscribe(a.TTYGEventName.CLONE_AGENT,u.onOpenCloneAgentSettings)),G.push(b.subscribe(a.TTYGEventName.DELETE_AGENT,e=>{b.emit(a.TTYGEventName.DELETING_AGENT,{agentId:e.id,inProgress:!0}),N.deleteAgent(e.id).then(()=>L()).then(()=>{b.emit(a.TTYGEventName.AGENT_DELETED,e),u.selectedAgent&&u.selectedAgent.id===e.id&&(u.selectedAgent=void 0)}).catch(e=>{f.error(getError(e,0,o.TTYG_ERROR_MSG_LENGTH))}).finally(()=>{b.emit(a.TTYGEventName.DELETING_AGENT,{agentId:e.id,inProgress:!1})})})),G.push(b.subscribe(a.TTYGEventName.AGENT_SELECTED,e=>{u.selectedAgent=e})),G.push(b.subscribe(a.TTYGEventName.GO_TO_CREATE_SIMILARITY_VIEW,e=>{$(e.repositoryId,"ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_similarity.body","similarity/index/create")})),G.push(b.subscribe(a.TTYGEventName.GO_TO_AUTOCOMPLETE_INDEX_VIEW,e=>{$(e.repositoryId,"ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_autocomplete_index.body","autocomplete")})),G.push(b.subscribe(a.TTYGEventName.GO_TO_CONNECTORS_VIEW,e=>{$(e.repositoryId,"ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_connectors.body","connectors")})),G.push(b.subscribe(a.TTYGEventName.GO_TO_SPARQL_EDITOR,e=>{if(e.repositoryId!==A.getActiveRepository()){const t=A.getRepository(e.repositoryId);t&&_.openConfirmation(C.instant("common.confirm"),(0,h.Gz)(C.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:e.repositoryId})),()=>{A.setRepository(t),H(e.query)})}else H(e.query)})),G.push(n.$on("$translateChangeSuccess",()=>{I.filter_all=C.instant("ttyg.agent.btn.filter.all"),U()})),G.push(n.$on("securityInit",O)),u.$on("$destroy",function(){G.forEach(e=>e()),b.resetContext()})}angular.module("graphdb.framework.ttyg.controllers.ttyg-view",["toastr","graphdb.framework.utils.localstorageadapter","graphdb.framework.core.services.ttyg-service","graphdb.framework.ttyg.services.ttygcontext","graphdb.framework.ttyg.services.ttygstorage","graphdb.framework.ttyg.directives.chat-list","graphdb.framework.ttyg.directives.chat-panel","graphdb.framework.ttyg.directives.agent-list","graphdb.framework.ttyg.directives.agent-select-menu","graphdb.framework.ttyg.directives.no-agents-view","graphdb.framework.ttyg.directives.show-tooltip-on-overflow","graphdb.framework.ttyg.controllers.agent-settings-modal","graphdb.framework.core.directives.help-info-popover"]).controller("TTYGViewCtrl",u),u.$inject=["$jwtAuth","$window","$rootScope","$scope","$http","$timeout","$translate","$uibModal","$repositories","toastr","ModalService","LocalStorageAdapter","TTYGService","TTYGContextService","TTYGStorageService"]},13815:(e,t,n)=>{n.r(t),n(64118),n(3909);var a=n(71920),o=n(36633),i=n(63415),r=n(98980),s=n(69937),l=n(19402);function c(e,t,n,c){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-panel.html",link:(e,c,d)=>{e.chat=void 0,e.selectedAgent=void 0,e.chatItem=void 0,e.askingChatItem=void 0,e.waitingForLastMessage=!1,e.loadingChat=!0,e.ask=()=>{e.chatItem.question.timestamp=Date.now(),e.askingChatItem=(0,r.cloneDeep)(e.chatItem),e.chatItem.chatId?h(e.chatItem):g(),e.chatItem=p(),T(),u()},e.regenerateQuestion=t=>{const n=p();n.setQuestionMessage(t.getQuestionMessage()),n.question.timestamp=Date.now(),e.askingChatItem=n,h(n),T()},e.onKeypressOnInput=t=>{e.askingChatItem||"Enter"!==t.key||t.shiftKey||t.ctrlKey||e.ask()},e.onAskHowDeliveredAnswer=()=>{const n=p();n.setQuestionMessage(t.instant("ttyg.chat_panel.btn.derive_answer.label")),n.question.timestamp=Date.now(),e.askingChatItem=(0,r.cloneDeep)(n),h(n),T()},e.getAgentName=e=>{const a=n.getAgent(e);return a?a.name:(0,s.Gz)(t.instant("ttyg.chat_panel.deleted_agent"))};const g=()=>{e.waitingForLastMessage=!0,n.emit(a.TTYGEventName.CREATE_CHAT,e.chatItem)},h=t=>{e.waitingForLastMessage=!0,n.emit(a.TTYGEventName.ASK_QUESTION,t)},m=()=>{e.chatItem=(0,r.cloneDeep)(e.askingChatItem),e.askingChatItem=void 0,e.waitingForLastMessage=!1},p=()=>{const t=new i.ChatItemModel;return t.question=new o.ChatMessageModel({role:o.CHAT_MESSAGE_ROLE.USER}),e.chat&&(t.chatId=e.chat.id),e.selectedAgent&&(t.agentId=e.selectedAgent.id),t},u=()=>{setTimeout(()=>{let e=document.querySelector(".question-input");e&&e.focus()})},T=()=>{setTimeout(()=>{const e=c.find(".chat-details")[0];e&&(e.scrollTop=e.scrollHeight)})},E=()=>{e.chat=l.ChatModel.getEmptyChat(),e.loadingChat=!1,e.chatItem=p(),e.askingChatItem=void 0,e.waitingForLastMessage=!1,u()},C=[];C.push(e.$watchCollection("chat.chatHistory.items",T)),C.push(n.onSelectedChatUpdated(t=>{if(e.chat=t,!t||!t.id&&e.askingChatItem)return;e.loadingChat=!1;let a=e.chatItem.question.message;if(e.chatItem=p(),e.chatItem.question.message=a,e.askingChatItem=void 0,e.chat){const t=e.chat.chatHistory.getLast();t&&t.agentId&&n.selectAgent(n.getAgent(t.agentId))}u()})),C.push(n.onLastMessageReceived(()=>{e.waitingForLastMessage=!1})),C.push(n.onSelectedAgentChanged(t=>{e.selectedAgent=t,e.selectedAgent&&e.chatItem&&(e.chatItem.agentId=e.selectedAgent.id),u()})),C.push(n.onSelectedChatChanged(t=>{t?(e.loadingChat=t&&t.id,e.chatItem=p(),u()):E()})),C.push(n.subscribe(a.TTYGEventName.LOAD_CHAT_FAILURE,()=>{e.loadingChat=!1,e.chatItem=p(),u()})),C.push(n.subscribe(a.TTYGEventName.ASK_QUESTION_FAILURE,m)),C.push(n.subscribe(a.TTYGEventName.CREATE_CHAT_FAILURE,m)),C.push(n.subscribe(a.TTYGEventName.DELETE_CHAT_SUCCESSFUL,t=>{e.chat&&t.id===e.chat.id&&E()})),e.$on("$destroy",()=>{C.forEach(e=>e())}),e.chat=l.ChatModel.getEmptyChat(),e.chatItem=p(),u()}}}angular.module("graphdb.framework.ttyg.directives.chat-panel",["graphdb.framework.ttyg.directives.chat-item-detail","graphdb.framework.core.directives.editable-content"]).directive("chatPanel",c),c.$inject=["toastr","$translate","TTYGContextService","$timeout"]},29350:(e,t,n)=>{n.r(t);var a=n(69937),o=n(71920);function i(e,t,n,i,r){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-list.html",scope:{agentList:"=",agentListFilterModel:"="},link:(i,s,l)=>{i.selectedAgent=void 0,i.selectedAgentsFilter=void 0,i.deletingAgent=void 0,i.onEditAgent=t=>{e.emit(o.TTYGEventName.EDIT_AGENT,t)},i.onExternalIntegration=e=>{r.open(e)},i.onCloneAgent=t=>{e.emit(o.TTYGEventName.CLONE_AGENT,t)},i.onDeleteAgent=i=>{const r=n.instant("ttyg.agent.delete_agent_modal.title"),s=(0,a.Gz)(n.instant("ttyg.agent.delete_agent_modal.body",{agentName:i.name}));t.openConfirmation(r,s,()=>e.emit(o.TTYGEventName.DELETE_AGENT,i))},i.onAgentsFilterChange=e=>{i.selectedAgentsFilter=e,i.selectedAgentsFilter&&i.agentList.filterByRepository(i.selectedAgentsFilter.key)};const c=()=>{const e=i.agentListFilterModel.find(e=>e.selected);i.selectedAgentsFilter=e||i.agentListFilterModel[0],i.onAgentsFilterChange(i.selectedAgentsFilter)},d=[];d.push(i.$watch("agentListFilterModel",c)),d.push(e.subscribe(o.TTYGEventName.DELETING_AGENT,e=>{i.deletingAgent=e})),d.push(e.onSelectedAgentChanged(e=>{i.selectedAgent=e})),i.$on("$destroy",()=>{d.forEach(e=>e())}),c()}}}n(84430),angular.module("graphdb.framework.ttyg.directives.agent-list",["graphdb.framework.ttyg.services.externalIntegrationModal"]).directive("agentList",i),i.$inject=["TTYGContextService","ModalService","$translate","$uibModal","ExternalIntegrationModalService"]},42618:()=>{function e(e){return{restrict:"E",scope:{fieldName:"@",source:"=",onSave:"&",onCancel:"&",onClick:"&",onDblclick:"&",isEditing:"="},templateUrl:"js/angular/core/directives/inline-editable-text/templates/inline-editable-text.template.html",link:function(t,n){t.editableModel={};const a=[];let o;t.onKeydown=e=>{"Enter"===e.key?(r(),t.editableModel.text!==t.text&&t.onSave({newText:t.editableModel.text,source:t.source})):"Escape"===e.key&&i()},t.onCancelEditing=()=>{i()},t.onSelect=()=>{o?(r(),t.onDblclick({source:t.source})):o=e(function(){t.onClick({source:t.source}),r()},250)};const i=()=>{r(),t.onCancel()},r=()=>{e.cancel(o),o=void 0};a.push(t.$watch("isEditing",a=>{a&&(t.editableModel.text=t.source[t.fieldName],e(()=>{const e=n.find("input")[0];e.focus(),e.select()},0))})),t.$on("$destroy",()=>{a.forEach(e=>e()),r()})}}}angular.module("graphdb.framework.core.directives.inline-editable-text",[]).directive("inlineEditableText",e),e.$inject=["$timeout"]},43319:(e,t,n)=>{n.r(t),n.d(t,{AgentSettingsModal:()=>a});class a{constructor(e,t,n,a){this.activeRepositoryInfo=e,this.activeRepositoryList=t,this.agentFormModel=n,this.operation=a}}},44874:(e,t,n)=>{n.r(t);var a=n(38940),o=n(71920);function i(e,t,n,i){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-select-menu.html",scope:{},link:n=>{n.agentOptionsList=[],n.selectedAgent=void 0,n.onAgentSelected=(a,s)=>{if(!s.isCompatible)return a.stopPropagation(),void a.preventDefault();if(r(s),n.selectedAgent=s,e.selectAgent(s),s.isRepositoryDeleted){const n=t.instant("ttyg.agent.agent_select_menu.configure_agent_modal.title"),a=t.instant("ttyg.agent.agent_select_menu.configure_agent_modal.body");i.openConfirmation(n,a,()=>e.emit(o.TTYGEventName.EDIT_AGENT,s))}};const r=e=>{n.agentOptionsList.forEach(t=>{t.selected=t.data.agent===e})},s=[];s.push(e.onAgentsListChanged(e=>{var t;t=e,n.agentOptionsList=t.agents.map(e=>new a.SelectMenuOptionsModel({value:e.id,label:e.name,data:{agent:e}}))})),s.push(e.subscribe(o.TTYGEventName.AGENT_DELETED,t=>{n.selectedAgent&&n.selectedAgent.id===t.id&&(n.selectedAgent.isDeleted=!0,e.selectAgent(n.selectedAgent))})),s.push(e.onSelectedAgentChanged(e=>{r(e),n.selectedAgent=e})),n.$on("$destroy",()=>{s.forEach(e=>e())})}}}angular.module("graphdb.framework.ttyg.directives.agent-select-menu",[]).directive("agentSelectMenu",i),i.$inject=["TTYGContextService","$translate","$sce","ModalService"]},60039:(e,t,n)=>{n.r(t),n(42618);var a=n(71920),o=n(65820),i=n(69937);function r(e,t,n,r){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-list.html",link:s=>{s.selectedChat=void 0,s.renamedChat=void 0,s.deletingChat=void 0,s.onSelectChatForRenaming=e=>{s.renamedChat=e},s.onSelectChat=t=>{if(!s.selectedChat||s.selectedChat.id!==t.id){const n=e.getChats().getNonPersistedChat();n&&e.deleteChat(n),e.selectChat(t),s.renamedChat=void 0}},s.onDeleteChat=o=>{const r=n.instant("ttyg.dialog.delete.title"),s=(0,i.Gz)(n.instant("ttyg.dialog.delete.body",{chatName:o.name}));t.openConfirmation(r,s,()=>e.emit(a.TTYGEventName.DELETE_CHAT,o))},s.onRenameChat=(t,n)=>{n.name=t,s.renamedChat=void 0,e.emit(a.TTYGEventName.RENAME_CHAT,n)},s.onExportChat=t=>{e.emit(a.TTYGEventName.CHAT_EXPORT,t)},s.onCancelChatRenaming=()=>{s.renamedChat=void 0},s.getHumanReadableChatGroupTimestamp=e=>(0,o.getHumanReadableTimestamp)(n,r,e);const l=e=>{s.selectedChat=e},c=[];c.push(e.onSelectedChatChanged(l)),c.push(e.onSelectedChatUpdated(l)),c.push(e.onChatsListChanged(e=>{s.chatList=e})),c.push(e.subscribe(a.TTYGEventName.DELETING_CHAT,e=>{s.deletingChat=e})),s.$on("$destroy",()=>{c.forEach(e=>e())})}}}angular.module("graphdb.framework.ttyg.directives.chat-list",["graphdb.framework.core.directives.inline-editable-text"]).directive("chatList",r),r.$inject=["TTYGContextService","ModalService","$translate","$filter"]},62062:()=>{angular.module("graphdb.framework.ttyg.directives.show-tooltip-on-overflow",[]).directive("showTooltipOnOverflow",function(){return{link:function(e,t){setTimeout(function(){const n=t[0].querySelector(".editable-text-element");n&&(n.scrollWidth>n.clientWidth?t.attr("title",e.chat.name):t.removeAttr("title"))},0)}}})},76752:function(e,t,n){var a,o=o||function(e){if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},a=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o=e.webkitRequestFileSystem,i=e.requestFileSystem||o||e.mozRequestFileSystem,r=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",l=0,c=function(t){var a=function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()};e.chrome?a():setTimeout(a,500)},d=function(e,t,n){for(var a=(t=[].concat(t)).length;a--;){var o=e["on"+t[a]];if("function"==typeof o)try{o.call(e,n||e)}catch(e){r(e)}}},g=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},h=function(t,r){t=g(t);var h,m,p,u=this,T=t.type,E=!1,C=function(){d(u,"writestart progress write writeend".split(" "))},v=function(){!E&&h||(h=n().createObjectURL(t)),m?m.location.href=h:null==e.open(h,"_blank")&&"undefined"!=typeof safari&&(e.location.href=h),u.readyState=u.DONE,C(),c(h)},A=function(e){return function(){if(u.readyState!==u.DONE)return e.apply(this,arguments)}},f={create:!0,exclusive:!1};if(u.readyState=u.INIT,r||(r="download"),a)return h=n().createObjectURL(t),a.href=h,a.download=r,void setTimeout(function(){var e,t;e=a,t=new MouseEvent("click"),e.dispatchEvent(t),C(),c(h),u.readyState=u.DONE});e.chrome&&T&&T!==s&&(p=t.slice||t.webkitSlice,t=p.call(t,0,t.size,s),E=!0),o&&"download"!==r&&(r+=".download"),(T===s||o)&&(m=e),i?(l+=t.size,i(e.TEMPORARY,l,A(function(e){e.root.getDirectory("saved",f,A(function(e){var n=function(){e.getFile(r,f,A(function(e){e.createWriter(A(function(n){n.onwriteend=function(t){m.location.href=e.toURL(),u.readyState=u.DONE,d(u,"writeend",t),c(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&v()},"writestart progress write abort".split(" ").forEach(function(e){n["on"+e]=u["on"+e]}),n.write(t),u.abort=function(){n.abort(),u.readyState=u.DONE},u.readyState=u.WRITING}),v)}),v)};e.getFile(r,{create:!1},A(function(e){e.remove(),n()}),A(function(e){e.code===e.NOT_FOUND_ERR?n():v()}))}),v)}),v)):v()},m=h.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t){return navigator.msSaveOrOpenBlob(g(e),t)}:(m.abort=function(){var e=this;e.readyState=e.DONE,d(e,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,function(e,t){return new h(e,t)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);e.exports?e.exports.saveAs=o:null!==n.amdD&&null!=n.amdO&&(void 0===(a=function(){return o}.apply(t,[]))||(e.exports=a))},78508:()=>{angular.module("graphdb.framework.core.directives.help-info-popover",[]).directive("helpInfoPopover",function(){return{restrict:"E",scope:{helpInfo:"="},templateUrl:"js/angular/ttyg/templates/modal/helpInfoPopoverTemplate.html",link:function(e,t){e.isPopoverOpen=!1;const n=()=>{e.$apply(()=>{e.isPopoverOpen=!0})},a=()=>{e.$apply(()=>{e.isPopoverOpen=!1})};t.on("mouseenter",n),t.on("mouseleave",a),e.$on("$destroy",function(){t.off("mouseenter",n),t.off("mouseleave",a)})}}})},81801:(e,t,n)=>{n.r(t),n.d(t,{status:()=>a});const a={BAD_REQUEST:400,UNAUTHORIZED:401,FORBIDDEN:403,NOT_FOUND:404,CONFLICT:409,INTERNAL_SERVER_ERROR:500,SERVICE_UNAVAILABLE:503}},87054:()=>{function e(e,t){const n={agent:{id:void 0},chat:{id:void 0}},a=()=>{let a=e.get(t.TTYG);return a||(a=n),a.agent||(a.agent={}),a.chat||(a.chat={}),a};return{saveAgent:function(n){const o=a();o.agent.id=n?n.id:void 0,e.set(t.TTYG,o)},getAgentId:function(){const e=a();if(e.agent)return e.agent.id},saveChat:function(n){const o=a();o.chat.id=n?n.id:void 0,e.set(t.TTYG,o)},getChatId:function(){const e=a();if(e.chat)return e.chat.id}}}angular.module("graphdb.framework.ttyg.services.ttygstorage",[]).factory("TTYGStorageService",e),e.$inject=["LocalStorageAdapter","LSKeys"]}}; //# sourceMappingURL=12358.736ea9c178c92655de3a.bundle.js.map