graphdb-workbench 3.2.0-TR4 → 3.2.0-TR5
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.
- package/dist/12358.d1b5130917702cb0dd25.bundle.js +3 -0
- package/dist/12358.d1b5130917702cb0dd25.bundle.js.map +1 -0
- package/dist/{12396.a1b7856e86d52282f34c.bundle.js → 12396.bb3eab12cf754ea62ada.bundle.js} +2 -2
- package/dist/{12396.a1b7856e86d52282f34c.bundle.js.map → 12396.bb3eab12cf754ea62ada.bundle.js.map} +1 -1
- package/dist/{15535.c58319cba275ee5baa90.bundle.js → 15535.18ede9f56483a38d1305.bundle.js} +2 -2
- package/dist/{15535.c58319cba275ee5baa90.bundle.js.map → 15535.18ede9f56483a38d1305.bundle.js.map} +1 -1
- package/dist/{16162.2dc986d04777c8ae9489.bundle.js → 16162.68c4cc2feee685642217.bundle.js} +2 -2
- package/dist/{16162.2dc986d04777c8ae9489.bundle.js.map → 16162.68c4cc2feee685642217.bundle.js.map} +1 -1
- package/dist/19402.151ce1287c14531436c3.bundle.js +2 -0
- package/dist/19402.151ce1287c14531436c3.bundle.js.map +1 -0
- package/dist/{20287.7cfc312df157f5bdea97.bundle.js → 20287.a67ba9468f3f83219558.bundle.js} +2 -2
- package/dist/{20287.7cfc312df157f5bdea97.bundle.js.map → 20287.a67ba9468f3f83219558.bundle.js.map} +1 -1
- package/dist/{21136.67a9bcf4bb0c201d3fd1.bundle.js → 21136.514ac00d21a54514a7b6.bundle.js} +2 -2
- package/dist/{21136.67a9bcf4bb0c201d3fd1.bundle.js.map → 21136.514ac00d21a54514a7b6.bundle.js.map} +1 -1
- package/dist/{21142.7f8327c28d939fa26009.bundle.js → 21142.5e08154738dc30c2aa36.bundle.js} +2 -2
- package/dist/{21142.7f8327c28d939fa26009.bundle.js.map → 21142.5e08154738dc30c2aa36.bundle.js.map} +1 -1
- package/dist/{21170.cecdf25699f68d4cf749.bundle.js → 21170.1122ab4c938b88301ba7.bundle.js} +2 -2
- package/dist/{21170.cecdf25699f68d4cf749.bundle.js.map → 21170.1122ab4c938b88301ba7.bundle.js.map} +1 -1
- package/dist/{21195.e2c1fc69631041b97f8e.bundle.js → 21195.4067ec470e04250ed006.bundle.js} +2 -2
- package/dist/{21195.e2c1fc69631041b97f8e.bundle.js.map → 21195.4067ec470e04250ed006.bundle.js.map} +1 -1
- package/dist/{25747.c3dc5503ad696af5d5a3.bundle.js → 25747.c6c83a72c5ff93451064.bundle.js} +2 -2
- package/dist/{25747.c3dc5503ad696af5d5a3.bundle.js.map → 25747.c6c83a72c5ff93451064.bundle.js.map} +1 -1
- package/dist/{27580.d038d43102a3e9eec97d.bundle.js → 27580.0219349c709de4b5a0f4.bundle.js} +2 -2
- package/dist/{27580.d038d43102a3e9eec97d.bundle.js.map → 27580.0219349c709de4b5a0f4.bundle.js.map} +1 -1
- package/dist/{31636.fc6eba63d6d985d31673.bundle.js → 31636.191bd3c9ed0e3fb62007.bundle.js} +2 -2
- package/dist/{31636.fc6eba63d6d985d31673.bundle.js.map → 31636.191bd3c9ed0e3fb62007.bundle.js.map} +1 -1
- package/dist/{32489.e9af1ec463e2d4136732.bundle.js → 32489.468bcab006cd04c016c7.bundle.js} +2 -2
- package/dist/{32489.e9af1ec463e2d4136732.bundle.js.map → 32489.468bcab006cd04c016c7.bundle.js.map} +1 -1
- package/dist/{34495.06c9997d58d0b0ba7152.bundle.js → 34495.9b2a1410b1782a381a1e.bundle.js} +2 -2
- package/dist/{34495.06c9997d58d0b0ba7152.bundle.js.map → 34495.9b2a1410b1782a381a1e.bundle.js.map} +1 -1
- package/dist/36665.6bc77ded61aedb454c6e.bundle.js +2 -0
- package/dist/36665.6bc77ded61aedb454c6e.bundle.js.map +1 -0
- package/dist/{38360.ca92a04a1afcf9cfea7f.bundle.js → 38360.3714f16105c232cbf498.bundle.js} +2 -2
- package/dist/{38360.ca92a04a1afcf9cfea7f.bundle.js.map → 38360.3714f16105c232cbf498.bundle.js.map} +1 -1
- package/dist/{38644.29dbfb38e4089efa6697.bundle.js → 38644.f34d9227543727bec695.bundle.js} +2 -2
- package/dist/{38644.29dbfb38e4089efa6697.bundle.js.map → 38644.f34d9227543727bec695.bundle.js.map} +1 -1
- package/dist/{38843.4b11f56e93f60fbe4e0a.bundle.js → 38843.1ed4c0d2657b5fb9ed8a.bundle.js} +2 -2
- package/dist/{38843.4b11f56e93f60fbe4e0a.bundle.js.map → 38843.1ed4c0d2657b5fb9ed8a.bundle.js.map} +1 -1
- package/dist/{39518.c577d83ed591fada064c.bundle.js → 39518.52135a04a886f95c5801.bundle.js} +2 -2
- package/dist/{39518.c577d83ed591fada064c.bundle.js.map → 39518.52135a04a886f95c5801.bundle.js.map} +1 -1
- package/dist/{39539.463ec29e136b100c0abe.bundle.js → 39539.351f1fe10b21f949a885.bundle.js} +2 -2
- package/dist/{39539.463ec29e136b100c0abe.bundle.js.map → 39539.351f1fe10b21f949a885.bundle.js.map} +1 -1
- package/dist/40516.7db0da5332b68a1cb0a4.bundle.js +2 -0
- package/dist/40516.7db0da5332b68a1cb0a4.bundle.js.map +1 -0
- package/dist/{41453.241761ce8ff75036e5e0.bundle.js → 41453.c082b58753e157b39bf9.bundle.js} +2 -2
- package/dist/{41453.241761ce8ff75036e5e0.bundle.js.map → 41453.c082b58753e157b39bf9.bundle.js.map} +1 -1
- package/dist/{42129.f67dc6029cdab567bf54.bundle.js → 42129.6877bc3354f3413916f2.bundle.js} +2 -2
- package/dist/{42129.f67dc6029cdab567bf54.bundle.js.map → 42129.6877bc3354f3413916f2.bundle.js.map} +1 -1
- package/dist/{44444.a1b29c2329c7d4a39cc5.bundle.js → 44444.2b282777f2e1424a03b1.bundle.js} +2 -2
- package/dist/{44444.a1b29c2329c7d4a39cc5.bundle.js.map → 44444.2b282777f2e1424a03b1.bundle.js.map} +1 -1
- package/dist/{55862.1c3f1e807c8a05b1b6ed.bundle.js → 55862.f591817372ceb94a4cd2.bundle.js} +2 -2
- package/dist/{55862.1c3f1e807c8a05b1b6ed.bundle.js.map → 55862.f591817372ceb94a4cd2.bundle.js.map} +1 -1
- package/dist/{58306.a45182d200e3f8793644.bundle.js → 58306.b82da84fcad5ac12087a.bundle.js} +2 -2
- package/dist/{58306.a45182d200e3f8793644.bundle.js.map → 58306.b82da84fcad5ac12087a.bundle.js.map} +1 -1
- package/dist/64118.b15383c12c5bdf6d907f.bundle.js +2 -0
- package/dist/64118.b15383c12c5bdf6d907f.bundle.js.map +1 -0
- package/dist/{67888.e21c0e4c70be6214fcd7.bundle.js → 67888.927a2d7905f79d2f5bb4.bundle.js} +2 -2
- package/dist/{67888.e21c0e4c70be6214fcd7.bundle.js.map → 67888.927a2d7905f79d2f5bb4.bundle.js.map} +1 -1
- package/dist/{72379.cb41e26c33271a25816e.bundle.js → 72379.d21e40131b7e44c75eba.bundle.js} +2 -2
- package/dist/{72379.cb41e26c33271a25816e.bundle.js.map → 72379.d21e40131b7e44c75eba.bundle.js.map} +1 -1
- package/dist/{73667.ad957853dba08fd3be30.bundle.js → 73667.0921baf2ddc28806feca.bundle.js} +2 -2
- package/dist/{73667.ad957853dba08fd3be30.bundle.js.map → 73667.0921baf2ddc28806feca.bundle.js.map} +1 -1
- package/dist/{73793.79a311b387e5db776506.bundle.js → 73793.f61f6800eea64549ae30.bundle.js} +2 -2
- package/dist/{73793.79a311b387e5db776506.bundle.js.map → 73793.f61f6800eea64549ae30.bundle.js.map} +1 -1
- package/dist/{75282.8be5dde957dc6452c86a.bundle.js → 75282.06a7373dccbf2b056731.bundle.js} +2 -2
- package/dist/{75282.8be5dde957dc6452c86a.bundle.js.map → 75282.06a7373dccbf2b056731.bundle.js.map} +1 -1
- package/dist/{75849.0f6bab8b5749be998286.bundle.js → 75849.6ae9e20cdb3fbe4018a4.bundle.js} +2 -2
- package/dist/{75849.0f6bab8b5749be998286.bundle.js.map → 75849.6ae9e20cdb3fbe4018a4.bundle.js.map} +1 -1
- package/dist/{78250.dd9bdc3db3ca0c84b25a.bundle.js → 78250.41373d9ae256b6730c8e.bundle.js} +2 -2
- package/dist/{78250.dd9bdc3db3ca0c84b25a.bundle.js.map → 78250.41373d9ae256b6730c8e.bundle.js.map} +1 -1
- package/dist/{79329.24a5e42cccee5055311a.bundle.js → 79329.936a7b8d31824b46a180.bundle.js} +2 -2
- package/dist/{79329.24a5e42cccee5055311a.bundle.js.map → 79329.936a7b8d31824b46a180.bundle.js.map} +1 -1
- package/dist/{82926.02f08566fe1f948d9e1f.bundle.js → 82926.3236f3a40da860eebf37.bundle.js} +2 -2
- package/dist/{82926.02f08566fe1f948d9e1f.bundle.js.map → 82926.3236f3a40da860eebf37.bundle.js.map} +1 -1
- package/dist/85609.4e7aa94beab1fc123db2.bundle.js +2 -0
- package/dist/85609.4e7aa94beab1fc123db2.bundle.js.map +1 -0
- package/dist/{9062.e1ad16e157f04b8c9dd8.bundle.js → 9062.ff0f38917b9553efad03.bundle.js} +2 -2
- package/dist/{9062.e1ad16e157f04b8c9dd8.bundle.js.map → 9062.ff0f38917b9553efad03.bundle.js.map} +1 -1
- package/dist/{99448.93e01a6a24e4a1cb0546.bundle.js → 99448.10fc24b7ebab10d3c7ce.bundle.js} +2 -2
- package/dist/{99448.93e01a6a24e4a1cb0546.bundle.js.map → 99448.10fc24b7ebab10d3c7ce.bundle.js.map} +1 -1
- package/dist/index.html +8 -8
- package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
- package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
- package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
- package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
- package/dist/js/angular/core/templates/search-resource-input.html +1 -1
- package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
- package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
- package/dist/js/angular/graphql/templates/graphql-playground.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
- package/dist/js/angular/security/templates/user.html +2 -2
- package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
- package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +2 -2
- package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
- package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
- package/dist/{legacyWorkbench.ecf6300fd72cfffbcdb6.js → legacyWorkbench.1e8b6faf7df3096cdb57.js} +3 -3
- package/dist/{legacyWorkbench.ecf6300fd72cfffbcdb6.js.map → legacyWorkbench.1e8b6faf7df3096cdb57.js.map} +1 -1
- package/dist/pages/aclmanagement.html +2 -2
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +1 -1
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +8 -8
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.html +1 -1
- package/dist/pages/login.html +1 -1
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +1 -1
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/not_found.html +1 -1
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +1 -1
- package/dist/pages/repository.html +1 -1
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-editor.html +1 -1
- package/dist/pages/sparql-template-create.html +1 -1
- package/dist/pages/ux-test1.html +2 -2
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger5/index.html +11 -11
- package/package.json +1 -1
- package/dist/12358.4be185f89eebea9c35bf.bundle.js +0 -3
- package/dist/12358.4be185f89eebea9c35bf.bundle.js.map +0 -1
- package/dist/19402.7f6ea977348338acc824.bundle.js +0 -2
- package/dist/19402.7f6ea977348338acc824.bundle.js.map +0 -1
- package/dist/36665.69d43b057bcfc55df3b5.bundle.js +0 -2
- package/dist/36665.69d43b057bcfc55df3b5.bundle.js.map +0 -1
- package/dist/40516.3cfaf1ff4704c038f944.bundle.js +0 -2
- package/dist/40516.3cfaf1ff4704c038f944.bundle.js.map +0 -1
- package/dist/64118.edc8ed6671017d09ff4e.bundle.js +0 -2
- package/dist/64118.edc8ed6671017d09ff4e.bundle.js.map +0 -1
- package/dist/85609.68438b4955212d5fcb84.bundle.js +0 -2
- package/dist/85609.68438b4955212d5fcb84.bundle.js.map +0 -1
- /package/dist/{12358.4be185f89eebea9c35bf.bundle.js.LICENSE.txt → 12358.d1b5130917702cb0dd25.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{legacyWorkbench.ecf6300fd72cfffbcdb6.js.LICENSE.txt → legacyWorkbench.1e8b6faf7df3096cdb57.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"12358.4be185f89eebea9c35bf.bundle.js","mappings":";4JAoBA,SAASA,IACL,MAAO,CACHC,SAAU,IACVC,QAAS,UACTC,MAAO,CACHC,QAAS,IACTC,WAAY,IACZC,YAAa,KAEjBC,YAAa,mEACbC,KAAM,SAASL,EAAOM,EAASC,EAAOC,GAMlC,MAAMC,EAAcH,EAAQI,KAAK,OAU3BC,EAAmBA,KAChBX,EAAME,YACPF,EAAMY,OAAO,KACLH,EAAYI,OAAOC,SAAWL,EAAYM,OAAOC,OAAOF,QAExDL,EAAYQ,QAEhBT,EAAYU,cAAcT,EAAY,GAAGU,cAQrDX,EAAYY,QAAU,KAClBX,EAAYI,KAAKL,EAAYa,YAAc,KAU/C,MAAMC,EAAgBC,IAClBA,EAAMC,iBAEN,MAAMT,GAAQQ,EAAME,eAAiBF,GAAOG,cAAcC,QAAQ,cAC5DC,EAAYC,OAAOC,eAEzB,IAAKF,EAAUG,WAAY,OAE3BH,EAAUI,qBACV,MAAMC,EAAQL,EAAUM,WAAW,GAC7BC,EAAWC,SAASC,yBACpBC,EAAQvB,EAAKwB,MAAM,MAEzBD,EAAME,QAAQ,CAACC,EAAMC,KACjBP,EAASQ,YAAYP,SAASQ,eAAeH,IACzCC,EAAQJ,EAAMxB,OAAS,GACvBqB,EAASQ,YAAYP,SAASS,cAAc,SAIpDZ,EAAMa,WAAWX,GACjBP,EAAUmB,iBAed/C,EAAMgD,IAAI,WALmBC,KACzBxC,EAAYyC,IAAI,0BAA2BvC,GAC3CF,EAAYyC,IAAI,QAAS5B,KAI7Bb,EAAY0C,GAAG,0BAA2BxC,GAC1CF,E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xc,EAAmByc,EAAqBC,GAE7C,MAAMC,EAAkB,CACpBvY,MAAO,CACHrB,QAAIrC,GAERmG,KAAM,CACF9D,QAAIrC,IAQNkc,EAAkBA,KACpB,IAAIC,EAAWJ,EAAoBK,IAAIJ,EAAOK,MAU9C,OATKF,IACDA,EAAWF,GAEVE,EAASzY,QACVyY,EAASzY,MAAQ,CAAC,GAEjByY,EAAShW,OACVgW,EAAShW,KAAO,CAAC,GAEdgW,GA+CX,MAAO,CACHxI,UAzCJ,SAAmBjQ,GACf,MAAMyY,EAAWD,IAEjBC,EAASzY,MAAMrB,GAAKqB,EAAQA,EAAMrB,QAAKrC,EACvC+b,EAAoBO,IAAIN,EAAOK,KAAMF,EACzC,EAqCIjI,WA/BJ,WACI,MAAMiI,EAAWD,IACjB,GAAIC,EAASzY,MACT,OAAOyY,EAASzY,MAAMrB,EAE9B,EA2BI8G,SArBJ,SAAkBhD,GACd,MAAMgW,EAAWD,IAEjBC,EAAShW,KAAK9D,GAAK8D,EAAOA,EAAK9D,QAAKrC,EACpC+b,EAAoBO,IAAIN,EAAOK,KAAMF,EACzC,EAiBInW,UAXJ,WACI,MAAMmW,EAAWD,IACjB,GAAIC,EAAShW,KACT,OAAOgW,EAAShW,KAAK9D,EAE7B,EAQJ,CArFAlF,QACKC,OAAO,8CAA+C,IACtDmf,QAAQ,qBAAsBjd,GAEnCA,EAAmBhC,QAAU,CAAC,sBAAuB,S","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/core/directives/editable-content/editable-content.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/directives/no-agents-view.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/controllers/ttyg-view.controller.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/directives/chat-panel.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/directives/agent-list.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/core/directives/inline-editable-text/inline-editable-text.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/model/agent-settings-modal.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/directives/agent-select-menu.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/directives/chat-list.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/directives/show-tooltip-on-overflow.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/lib/FileSaver-patch.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/directives/help-info-popover.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/http-status.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/ttyg-storage.service.js"],"sourcesContent":["/**\n * @ngdoc directive\n * @name editableContent\n * @module graphdb.framework.core.directives.editable-content\n * @restrict E\n * @description\n * A reusable contenteditable directive bound to an ngModel. It allows editable plain-text input and supports disabling and placeholder text.\n *\n * @param {string} ngModel - The model to bind contenteditable input to.\n * @param {boolean=} ngDisabled - Disables the contenteditable field when true.\n * @param {string=} placeholder - Placeholder text to show when input is empty.\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.core.directives.editable-content', modules)\n .directive('editableContent', editableContent);\n\neditableContent.$inject = [];\n\nfunction editableContent() {\n return {\n restrict: 'E',\n require: 'ngModel',\n scope: {\n ngModel: '=',\n ngDisabled: '=',\n placeholder: '@'\n },\n templateUrl: 'js/angular/core/templates/editable-content/editable-content.html',\n link: function(scope, element, attrs, ngModelCtrl) {\n\n // =========================\n // Private variables\n // =========================\n\n const editableDiv = element.find('div');\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Updates the bound ngModel with the current contenteditable value.\n * Also clears invalid HTML when only whitespace remains.\n */\n const updateModelValue = () => {\n if (!scope.ngDisabled) {\n scope.$apply(() => {\n if (editableDiv.html().length && !editableDiv.text().trim().length) {\n // Fixes a problem with the placeholder when type some word and delete it.\n editableDiv.empty();\n }\n ngModelCtrl.$setViewValue(editableDiv[0].innerText);\n });\n }\n };\n\n /**\n * Renders the model value into the contenteditable element.\n */\n ngModelCtrl.$render = () => {\n editableDiv.html(ngModelCtrl.$viewValue || '');\n };\n\n /**\n * Handles paste events in the contenteditable element by inserting plain text only.\n * Prevents the default paste behavior and manually inserts the clipboard text as plain text,\n * preserving line breaks by converting them to <br> elements.\n *\n * @param {Event} event - The paste event object containing clipboard data.\n */\n const pasteHandler = (event) => {\n event.preventDefault();\n\n const text = (event.originalEvent || event).clipboardData.getData('text/plain');\n const selection = window.getSelection();\n\n if (!selection.rangeCount) return;\n\n selection.deleteFromDocument();\n const range = selection.getRangeAt(0);\n const fragment = document.createDocumentFragment();\n const lines = text.split('\\n');\n\n lines.forEach((line, index) => {\n fragment.appendChild(document.createTextNode(line));\n if (index < lines.length - 1) {\n fragment.appendChild(document.createElement('br'));\n }\n });\n\n range.insertNode(fragment);\n selection.collapseToEnd();\n }\n\n // =========================\n // Subscriptions\n // =========================\n\n /**\n * Unsubscribes from all watchers and event listeners to prevent memory leaks.\n */\n const removeAllSubscribers = () => {\n editableDiv.off('blur keyup change input', updateModelValue);\n editableDiv.off('paste', pasteHandler);\n };\n\n scope.$on('$destroy', removeAllSubscribers);\n editableDiv.on('blur keyup change input', updateModelValue);\n editableDiv.on('paste', pasteHandler)\n }\n };\n}\n","import {TTYGEventName} from \"../services/ttyg-context.service\";\nimport {DocumentationUrlResolver} from \"../../utils/documentation-url-resolver\";\n\nangular\n .module('graphdb.framework.ttyg.directives.no-agents-view', [])\n .directive('noAgentsView', NoAgentsView);\n\nNoAgentsView.$inject = ['TTYGContextService', 'productInfo'];\n\nfunction NoAgentsView(TTYGContextService, productInfo) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/ttyg/templates/no-agents-view.html',\n scope: {\n },\n link: ($scope) => {\n\n // =========================\n // Public variables\n // =========================\n\n $scope.canModifyAgent = false;\n $scope.talkToGraphDocumentationLink = DocumentationUrlResolver.getDocumentationUrl(productInfo.productShortVersion, 'talk-to-graph.html');\n\n // =========================\n // Public functions\n // =========================\n\n $scope.onCreateAgent = () => {\n TTYGContextService.emit(TTYGEventName.OPEN_AGENT_SETTINGS);\n };\n\n // =========================\n // Private functions\n // =========================\n\n const onCanUpdateAgentUpdated = (canModifyAgent) => {\n $scope.canModifyAgent = canModifyAgent;\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n const onDestroy = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n subscriptions.push(TTYGContextService.onCanUpdateAgentUpdated(onCanUpdateAgentUpdated));\n $scope.$on('$destroy', onDestroy);\n }\n };\n}\n","import 'angular/ttyg/directives/chat-list.directive';\nimport 'angular/ttyg/directives/chat-panel.directive';\nimport 'angular/ttyg/directives/agent-list.directive';\nimport 'angular/ttyg/directives/agent-select-menu.directive';\nimport 'angular/ttyg/directives/no-agents-view.directive';\nimport 'angular/ttyg/directives/show-tooltip-on-overflow.directive';\nimport 'angular/ttyg/directives/help-info-popover.directive';\nimport 'angular/ttyg/controllers/agent-settings-modal.controller';\nimport 'angular/core/services/ttyg.service';\nimport 'angular/ttyg/services/ttyg-context.service';\nimport 'angular/ttyg/services/ttyg-storage.service';\nimport {TTYGEventName} from '../services/ttyg-context.service';\nimport {AGENT_OPERATION, AGENTS_FILTER_ALL_KEY, TTYG_ERROR_MSG_LENGTH} from '../services/constants';\nimport {AgentListFilterModel, AgentModel} from '../../models/ttyg/agents';\nimport {ChatModel, ChatsListModel} from '../../models/ttyg/chats';\nimport {agentFormModelMapper} from '../services/agents.mapper';\nimport {SelectMenuOptionsModel} from '../../models/form-fields';\nimport {repositoryInfoMapper} from '../../rest/mappers/repositories-mapper';\nimport {saveAs} from 'lib/FileSaver-patch';\nimport {AgentSettingsModal} from \"../model/agent-settings-modal\";\nimport {decodeHTML} from \"../../../../app\";\nimport {status as httpStatus} from \"../../models/http-status\";\nimport {ContinueChatRun} from \"../../models/ttyg/chat-answer\";\nimport {ChatMessageModel} from \"../../models/ttyg/chat-message\";\nimport {service, AuthenticationService} from \"@ontotext/workbench-api\";\n\nconst modules = [\n 'toastr',\n 'graphdb.framework.utils.localstorageadapter',\n 'graphdb.framework.core.services.ttyg-service',\n 'graphdb.framework.ttyg.services.ttygcontext',\n 'graphdb.framework.ttyg.services.ttygstorage',\n 'graphdb.framework.ttyg.directives.chat-list',\n 'graphdb.framework.ttyg.directives.chat-panel',\n 'graphdb.framework.ttyg.directives.agent-list',\n 'graphdb.framework.ttyg.directives.agent-select-menu',\n 'graphdb.framework.ttyg.directives.no-agents-view',\n 'graphdb.framework.ttyg.directives.show-tooltip-on-overflow',\n 'graphdb.framework.ttyg.controllers.agent-settings-modal',\n 'graphdb.framework.core.directives.help-info-popover',\n];\n\nangular\n .module('graphdb.framework.ttyg.controllers.ttyg-view', modules)\n .controller('TTYGViewCtrl', TTYGViewCtrl);\n\nTTYGViewCtrl.$inject = [\n '$jwtAuth',\n '$window',\n '$rootScope',\n '$scope',\n '$http',\n '$timeout',\n '$translate',\n '$uibModal',\n '$repositories',\n 'toastr',\n 'ModalService',\n 'LocalStorageAdapter',\n 'TTYGService',\n 'TTYGContextService',\n 'TTYGStorageService'];\n\nfunction TTYGViewCtrl(\n $jwtAuth,\n $window,\n $rootScope,\n $scope,\n $http,\n $timeout,\n $translate,\n $uibModal,\n $repositories,\n toastr,\n ModalService,\n LocalStorageAdapter,\n TTYGService,\n TTYGContextService,\n TTYGStorageService) {\n // =========================\n // Private variables\n // =========================\n\n const subscriptions = [];\n\n const labels = {\n filter_all: $translate.instant('ttyg.agent.btn.filter.all'),\n };\n\n /**\n * A promise that resolves when the active question cancellation completes,\n * or rejects if the cancellation fails.\n */\n let pendingQuestionCancelingPromise;\n\n /**\n * This is not translated, because the back-end sends it like this.\n * When the page is refreshed, any unnamed chat will be called \"New chat\",\n * regardless of the user selected language.\n * @type {string}\n */\n const newChatDefaultName = 'New chat';\n\n // =========================\n // Public variables\n // =========================\n\n $scope.helpTemplateUrl = \"js/angular/ttyg/templates/chatInfo.html\";\n\n /**\n * Controls the visibility of the help panel.\n * @type {boolean}\n */\n $scope.isHelpVisible = false;\n\n /**\n * Controls the visibility of the chats list sidebar. By default, it is visible unless there are no chats.\n * @type {boolean}\n */\n $scope.showChats = true;\n\n /**\n * Controls the visibility of the agents list sidebar.\n * @type {boolean}\n */\n $scope.showAgents = false;\n\n /**\n * Chats list.\n * @type {ChatsListModel|undefined}\n */\n $scope.chats = undefined;\n\n /**\n * Flag to control the visibility of the loader when loading chat list.\n * @type {boolean}\n */\n $scope.loadingChats = false;\n\n $scope.loadingChat = false;\n\n /**\n * Flag controls when component is initialized.\n * @type {boolean}\n */\n $scope.initialized = false;\n\n /**\n * Agents list model.\n * @type {AgentListModel|undefined}\n */\n $scope.agents = undefined;\n\n /**\n * The model of the selected agent.\n * @type {AgentModel|undefined}\n */\n $scope.selectedAgent = undefined;\n\n /**\n * Flag to control the visibility of the loader when loading agent list on initial page load.\n * @type {boolean}\n */\n $scope.loadingAgents = false;\n\n /**\n * Flag to control the visibility of the loader when reloading agent list.\n * @type {boolean}\n */\n $scope.reloadingAgents = false;\n\n $scope.connectorID = undefined;\n\n /**\n * A flag that determines whether buttons that modify an agent should be disabled.\n * @type {boolean}\n */\n $scope.canModifyAgent = false;\n\n /**\n * A list of available repository IDs as a model for the agent list filter.\n * @type {AgentListFilterModel[]}\n */\n $scope.agentListFilterModel = [];\n\n /**\n * A list with the active repositories that is used in child components.\n * @type {string[]}\n */\n $scope.activeRepositoryList = [];\n\n // =========================\n // Public functions\n // =========================\n\n // Needed by the slidepanel directive\n $scope.onopen = $scope.onclose = () => angular.noop();\n\n /**\n * Creates a new chat and selects it.\n */\n $scope.startNewChat = () => {\n if (!TTYGContextService.getChats().containsNewChats()) {\n TTYGContextService.deselectChat();\n }\n };\n\n /**\n * Toggles the visibility of the chats list sidebar.\n */\n $scope.toggleChatsListSidebar = () => {\n $scope.showChats = !$scope.showChats;\n };\n\n /**\n * Toggles the visibility of the agents list sidebar.\n */\n $scope.toggleAgentsListSidebar = () => {\n $scope.showAgents = !$scope.showAgents;\n };\n\n /**\n * Handles the help message toggle event.\n */\n $scope.onToggleHelp = () => {\n $scope.isHelpVisible = !$scope.isHelpVisible;\n };\n\n /**\n * Handles the export of a chat by calling the service and updating the chats list.\n */\n $scope.onExportSelectedChat = () => {\n onExportChat(TTYGContextService.getSelectedChat());\n };\n\n /**\n * Gets the default agent from the TTYGContextService or fetches it from the server if not available.\n *\n * @return {Promise<AgentModel>} A promise that resolves to the default agent.\n */\n const getDefaultAgent = () => {\n const defaultAgent = TTYGContextService.getDefaultAgent();\n if (defaultAgent) {\n return Promise.resolve(defaultAgent);\n } else {\n return TTYGService.getDefaultAgent()\n .then((response) => {\n TTYGContextService.setDefaultAgent(response);\n return response;\n });\n }\n };\n\n /**\n * Configures and opens the modal for creating a new agent.\n */\n $scope.onOpenNewAgentSettings = () => {\n getDefaultAgent()\n .then((agentDefaultValues) => {\n const activeRepositoryInfo = repositoryInfoMapper($repositories.getActiveRepositoryObject());\n agentDefaultValues.repositoryId = activeRepositoryInfo.id;\n const agentFormModel = agentFormModelMapper(new AgentModel({}), agentDefaultValues, AGENT_OPERATION.CREATE);\n return {\n templateUrl: 'js/angular/ttyg/templates/modal/agent-settings-modal.html',\n controller: 'AgentSettingsModalController',\n windowClass: 'agent-settings-modal',\n backdrop: 'static',\n resolve: {\n dialogModel: function() {\n return new AgentSettingsModal(\n activeRepositoryInfo,\n $scope.activeRepositoryList,\n agentFormModel,\n AGENT_OPERATION.CREATE,\n );\n },\n },\n size: 'lg',\n };\n })\n .then((options) => {\n $uibModal.open(options).result.then(reloadAgents);\n })\n .catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n });\n };\n\n /**\n * Handles the agent edit operation. If the agent is not provided it is assumed that we need to edit the selected\n * agent which can be obtained from the context service.\n * @param {AgentModel|undefined} agent\n */\n $scope.onOpenAgentSettings = (agent) => {\n let agentToEdit = agent;\n if (!agentToEdit) {\n agentToEdit = TTYGContextService.getSelectedAgent();\n }\n getDefaultAgent()\n .then((agentDefaultValues) => {\n const agentFormModel = agentFormModelMapper(agentToEdit, agentDefaultValues, AGENT_OPERATION.EDIT);\n const activeRepositoryInfo = repositoryInfoMapper($repositories.getActiveRepositoryObject());\n return {\n templateUrl: 'js/angular/ttyg/templates/modal/agent-settings-modal.html',\n controller: 'AgentSettingsModalController',\n windowClass: 'agent-settings-modal',\n backdrop: 'static',\n resolve: {\n dialogModel: function() {\n return new AgentSettingsModal(\n activeRepositoryInfo,\n $scope.activeRepositoryList,\n agentFormModel,\n AGENT_OPERATION.EDIT,\n );\n },\n },\n size: 'lg',\n };\n })\n .then((options) => {\n $uibModal.open(options).result.then(\n (updatedAgent) => {\n const hasSelectedAgent = TTYGContextService.getSelectedAgent();\n if (hasSelectedAgent && updatedAgent.id === hasSelectedAgent.id) {\n TTYGContextService.selectAgent(updatedAgent);\n }\n reloadAgents();\n });\n })\n .catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n });\n };\n\n /**\n * Opens the agent settings modal with the agent to clone.\n * @param {AgentModel} agentToClone\n */\n $scope.onOpenCloneAgentSettings = (agentToClone) => {\n getDefaultAgent()\n .then((agentDefaultValues) => {\n const agentFormModel = agentFormModelMapper(agentToClone, agentDefaultValues, AGENT_OPERATION.CLONE);\n agentFormModel.name = `clone-${agentFormModel.name}`;\n const activeRepositoryInfo = repositoryInfoMapper($repositories.getActiveRepositoryObject());\n return {\n templateUrl: 'js/angular/ttyg/templates/modal/agent-settings-modal.html',\n controller: 'AgentSettingsModalController',\n windowClass: 'agent-settings-modal',\n backdrop: 'static',\n resolve: {\n dialogModel: function() {\n return new AgentSettingsModal(\n activeRepositoryInfo,\n $scope.activeRepositoryList,\n agentFormModel,\n AGENT_OPERATION.CLONE,\n );\n },\n },\n size: 'lg',\n };\n }).then((options) => {\n $uibModal.open(options).result.then(\n (updatedAgent) => {\n const hasSelectedAgent = TTYGContextService.getSelectedAgent();\n if (hasSelectedAgent && updatedAgent.id === hasSelectedAgent.id) {\n TTYGContextService.selectAgent(updatedAgent);\n }\n reloadAgents();\n });\n }).catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n });\n };\n\n // =========================\n // Private functions\n // =========================\n\n const loadChats = () => {\n $scope.loadingChats = true;\n return TTYGService.getConversations()\n .then((chats) => {\n return TTYGContextService.updateChats(chats);\n })\n .catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n setupChatListPanel(new ChatsListModel());\n })\n .finally(() => {\n $scope.loadingChats = false;\n });\n };\n\n /**\n * Loads the agents list from the server and updates the context service.\n * @param {boolean} showLoader\n * @return {Promise<void>}\n */\n const loadAgents = (showLoader = true) => {\n $scope.loadingAgents = showLoader;\n return TTYGService.getAgents()\n .then((agents) => {\n return TTYGContextService.updateAgents(agents);\n })\n .catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n })\n .finally(() => {\n $scope.loadingAgents = false;\n });\n };\n\n /**\n * Reloads the agents list. Basically the same as loadAgents but this sets the reloadingAgents flag that cause only\n * the agents list panel to be masked by the loader.\n * @return {Promise<void>}\n */\n const reloadAgents = () => {\n $scope.reloadingAgents = true;\n return TTYGService.getAgents()\n .then((agents) => {\n return TTYGContextService.updateAgents(agents);\n })\n .catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n })\n .finally(() => {\n $scope.reloadingAgents = false;\n });\n };\n\n const updateCanModifyAgent = () => {\n TTYGContextService.setCanModifyAgent($jwtAuth.isRepoManager());\n };\n\n const getActiveRepositoryObjectHandler = (activeRepo) => {\n const authService = service(AuthenticationService);\n if (activeRepo && !authService.hasGqlRights(activeRepo)) {\n onInit();\n }\n };\n\n /**\n * @param {ChatItemModel} chatItem\n */\n const onCreateNewChat = (chatItem) => {\n TTYGService.createChat(chatItem).then((conversationId) => {\n const newChat = ChatModel.getNewChat();\n newChat.name = newChatDefaultName;\n newChat.id = conversationId;\n TTYGContextService.createChat(newChat);\n TTYGStorageService.saveChat(newChat);\n\n chatItem.chatId = conversationId;\n TTYGContextService.emit(TTYGEventName.ASK_QUESTION, chatItem);\n }).catch((error) => {\n TTYGContextService.emit(TTYGEventName.CREATE_CHAT_FAILURE);\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n });\n };\n\n /**\n * @param {ChatItemModel} chatItem\n */\n const onAskQuestion = (chatItem) => {\n TTYGContextService.emit(TTYGEventName.ASK_QUESTION_STARTING);\n // Reset the pending question cancellation promise to avoid interfering with the next question.\n // Currently, we can only ask a question for the selected chat, so it's safe to reset the promise here.\n pendingQuestionCancelingPromise = undefined;\n TTYGService.askQuestion(chatItem)\n .then((chatAnswer) => {\n const selectedChat = TTYGContextService.getSelectedChat();\n // If still the same chat selected\n if (selectedChat && selectedChat.id === chatItem.chatId) {\n if (selectedChat.isNew()) {\n selectedChat.new = false;\n const chats = TTYGContextService.getChats();\n chats.setChatAsOld(selectedChat.id);\n TTYGContextService.updateChats(chats);\n }\n // just process the messages\n updateChatAnswersFirstResponse(selectedChat, chatItem, chatAnswer);\n }\n })\n .catch((error) => {\n TTYGContextService.emit(TTYGEventName.ASK_QUESTION_FAILURE);\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n });\n };\n\n const onContinueChatRun = (continueData) => {\n TTYGService.continueChatRun(continueData)\n .then((chatAnswer) => {\n const chatId = continueData.chatId;\n const selectedChat = TTYGContextService.getSelectedChat();\n // If still the same chat selected\n if (selectedChat && selectedChat.id === chatId) {\n // just process the additional answers (with a recovered ChatItemModel)\n const items = selectedChat.chatHistory.items;\n const lastItem = items[items.length - 1];\n updateChatAnswers(selectedChat, lastItem, chatAnswer);\n }\n })\n .catch((error) => {\n // TODO failure event\n TTYGContextService.emit(TTYGEventName.ASK_QUESTION_FAILURE);\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n });\n };\n\n const updateChatAnswers = (selectedChat, chatItem, chatAnswer) => {\n selectedChat.timestamp = chatAnswer.timestamp;\n chatItem.answers = chatItem.answers || [];\n chatItem.answers.push(...chatAnswer.messages);\n TTYGContextService.updateSelectedChat(selectedChat);\n\n if (chatAnswer.continueRunId) {\n TTYGContextService.emit(TTYGEventName.CONTINUE_CHAT_RUN,\n new ContinueChatRun(chatItem, chatAnswer.continueRunId));\n } else {\n // Last message - update the timestamp and the name of the chat in the chat list\n const chats = TTYGContextService.getChats();\n // Updating the timestamp in the list gets the chat moved to the top.\n chats.updateChatTimestamp(selectedChat.id, chatAnswer.timestamp);\n // Strictly speaking the chat name update is needed only for new chats,\n // but it doesn't hurt for every chat.\n chats.updateChatName(selectedChat.id, chatAnswer.chatName);\n // and also in the chat - doesn't seem to matter atm\n selectedChat.name = chatAnswer.name;\n TTYGContextService.updateChats(chats);\n TTYGContextService.emit(TTYGEventName.LAST_MESSAGE_RECEIVED, selectedChat);\n }\n };\n\n const updateChatAnswersFirstResponse = (selectedChat, chatItem, chatAnswer) => {\n if (pendingQuestionCancelingPromise) {\n // If the answer is canceled, we need to wait for the cancellation to complete\n // and prepare a proper answer message that describes the reason for the cancellation.\n pendingQuestionCancelingPromise.then((cancelingResponse) => {\n const currentSelectedChat = TTYGContextService.getSelectedChat();\n // If selected chat is changed while waiting for the canceling response,\n // Skip the response processing.\n if (currentSelectedChat && currentSelectedChat.id !== chatItem.chatId) {\n return;\n }\n const message = new ChatMessageModel({\n message: cancelingResponse.data.message,\n status: cancelingResponse.data.runStatus,\n isTerminalState: true,\n tokenUsageInfo: chatAnswer.tokenUsageInfo,\n });\n\n message.addToChatAnswer(chatAnswer);\n selectedChat.chatHistory.appendItem(chatItem);\n updateChatAnswers(selectedChat, chatItem, chatAnswer);\n });\n } else {\n // If the answer is not canceled, we can process it immediately.\n selectedChat.chatHistory.appendItem(chatItem);\n updateChatAnswers(selectedChat, chatItem, chatAnswer);\n }\n };\n\n /**\n * Handles the renaming of a chat by calling the service and updating the chats list.\n * Events are fired for success and failure cases.\n * @param {ChatModel} chat - the chat to be renamed.\n */\n const onRenameChat = (chat) => {\n TTYGService.renameConversation(chat)\n .then(() => {\n TTYGContextService.emit(TTYGEventName.RENAME_CHAT_SUCCESSFUL);\n TTYGContextService.emit(TTYGEventName.LOAD_CHATS);\n })\n .catch(() => {\n TTYGContextService.emit(TTYGEventName.RENAME_CHAT_FAILURE);\n toastr.error($translate.instant('ttyg.chat.messages.rename_failure'));\n });\n };\n\n /**\n * Handles the change of the chats list.\n * When the list is empty, the chats list should be hidden.\n * When the list is not empty, the first chat should be selected\n * @param {ChatsListModel} chats - the new chats list.\n */\n const onChatsChanged = (chats) => {\n $scope.chats = chats;\n setupChatListPanel(chats);\n };\n\n const onCanUpdateAgentUpdated = (canModifyAgent) => {\n $scope.canModifyAgent = canModifyAgent;\n };\n\n /**\n * @param {ChatsListModel} chats - the new chats list.\n */\n const setupChatListPanel = (chats) => {\n if (chats.isEmpty()) {\n $scope.showChats = false;\n } else {\n $scope.showChats = true;\n if (!TTYGContextService.getSelectedChat() && !TTYGStorageService.getChatId()) {\n TTYGContextService.selectChat($scope.chats.getFirstChat());\n }\n }\n };\n\n /**\n * Handles the deletion of a chat by calling the service and updating the chats list.\n * Events are fired for success and failure cases.\n * @param {ChatModel} chat - the chat to be deleted.\n */\n const onDeleteChat = (chat) => {\n TTYGContextService.emit(TTYGEventName.DELETING_CHAT, {chatId: chat.id, inProgress: true});\n TTYGService.deleteConversation(chat.id)\n .then(() => {\n TTYGContextService.emit(TTYGEventName.DELETE_CHAT_SUCCESSFUL, chat);\n const chats = TTYGContextService.getChats();\n chats.deleteChat(chat);\n TTYGContextService.updateChats(chats);\n })\n .catch(() => {\n TTYGContextService.emit(TTYGEventName.DELETE_CHAT_FAILURE);\n toastr.error($translate.instant('ttyg.chat.messages.delete_failure'));\n })\n .finally(() => TTYGContextService.emit(TTYGEventName.DELETING_CHAT, {chatId: chat.id, inProgress: false}));\n };\n\n const onCancelPendingQuestion = (chatItem) => {\n const selectedChatId = chatItem.chatId || TTYGContextService.getSelectedChat().id;\n pendingQuestionCancelingPromise = TTYGService.cancelPendingQuestion(selectedChatId)\n .then((answer) => {\n TTYGContextService.emit(TTYGEventName.PENDING_QUESTION_CANCELED_SUCCESSFUL);\n return answer;\n })\n .catch((error) => {\n TTYGContextService.emit(TTYGEventName.CANCEL_PENDING_QUESTION_FAILURE);\n return error;\n });\n };\n\n /**\n * Handles the export of a chat by calling the service and updating the chats list.\n * @param {ChatModel} chat - the chat to be exported.\n */\n const onExportChat = (chat) => {\n TTYGService.exportConversation(chat.id)\n .then(function({data, filename}) {\n saveAs(data, filename);\n TTYGContextService.emit(TTYGEventName.CHAT_EXPORT_SUCCESSFUL, chat);\n })\n .catch(() => {\n TTYGContextService.emit(TTYGEventName.CHAT_EXPORT_FAILURE);\n toastr.error($translate.instant('ttyg.chat.messages.export_failure'));\n });\n };\n\n /**\n * Handles the change of the agents list.\n * @param {AgentListModel} agents - the new agents list.\n */\n const onAgentListChanged = (agents) => {\n $scope.agents = agents;\n };\n\n /**\n * Handles the deletion of an agent by calling the service and reloading the agents list.\n * @param {AgentModel} agent - the agent to be deleted.\n */\n const onDeleteAgent = (agent) => {\n TTYGContextService.emit(TTYGEventName.DELETING_AGENT, {agentId: agent.id, inProgress: true});\n TTYGService.deleteAgent(agent.id)\n .then(() => {\n return reloadAgents();\n })\n .then(() => {\n TTYGContextService.emit(TTYGEventName.AGENT_DELETED, agent);\n if ($scope.selectedAgent && $scope.selectedAgent.id === agent.id) {\n $scope.selectedAgent = undefined;\n }\n })\n .catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n })\n .finally(() => {\n TTYGContextService.emit(TTYGEventName.DELETING_AGENT, {agentId: agent.id, inProgress: false});\n });\n };\n\n /**\n * Creates a filter model for the agents list.\n */\n const buildAgentsFilterModel = () => {\n const currentRepository = $repositories.getActiveRepository();\n // TODO: this should be refreshed automatically when the repositories change\n const repositoryObjects = $repositories.getLocalReadableGraphdbRepositories()\n .map((repo) => (\n new AgentListFilterModel(repo.id, repo.id, repo.id === currentRepository)\n ));\n $scope.agentListFilterModel = [\n new AgentListFilterModel(AGENTS_FILTER_ALL_KEY, labels.filter_all),\n ...repositoryObjects,\n ];\n };\n\n const onSelectedChatChanged = (selectedChat) => {\n // Reset the pending question cancellation promise because the chat has changed,\n // and any previous promise is no longer relevant.\n pendingQuestionCancelingPromise = undefined;\n // If the selected chat is a chat and does not need to be loaded from the server.\n if (selectedChat && !selectedChat.isNew()) {\n TTYGService.getConversation(selectedChat.id)\n .then((chat) => {\n TTYGContextService.updateSelectedChat(chat);\n TTYGStorageService.saveChat(selectedChat);\n })\n .catch((error) => {\n // If the chat is not found and the server returns 404, then we notify the user\n // and remove the chat from the chat list. It's expected that the backend would\n // also remove it and next time the list is loaded the chat will no longer be there.\n if (error.status === httpStatus.NOT_FOUND) {\n notifyForMissingChat(selectedChat);\n TTYGContextService.emit(TTYGEventName.LOAD_CHAT_FAILURE, selectedChat);\n }\n });\n } else if (selectedChat) {\n TTYGContextService.updateSelectedChat(selectedChat);\n }\n };\n\n const notifyForMissingChat = (selectedChat) => {\n ModalService.openModalAlert({\n title: $translate.instant('ttyg.chat.dialog.chat_is_missing.title'),\n message: $translate.instant('ttyg.chat.dialog.chat_is_missing.body'),\n }).result\n .then(function() {\n TTYGContextService.deleteChat(selectedChat);\n });\n };\n\n /**\n * Handles the selection of an agent.\n * @param {AgentModel} agent\n */\n const onAgentSelected = (agent) => {\n $scope.selectedAgent = agent;\n };\n\n /**\n * Opens the create similarity view. It checks if the passed repository ID matches the one selected by the workbench.\n * If they do not match, a confirmation dialog is shown to inform the user that the selected repository\n * will be automatically changed upon confirmation.\n *\n * @param {{repositoryId: string}} payload - The payload containing the repository ID.\n */\n const onGoToCreateSimilarityView = (payload) => {\n goToView(payload.repositoryId, 'ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_similarity.body', 'similarity/index/create');\n };\n\n /**\n * Opens the \"Autocomplete index\" view. It checks if the passed repository ID matches the one selected by the workbench.\n * If they do not match, a confirmation dialog is shown to inform the user that the selected repository\n * will be automatically changed upon confirmation.\n *\n * @param {{repositoryId: string}} payload - The payload containing the repository ID.\n */\n const goToAutocompleteIndexView = (payload) => {\n goToView(payload.repositoryId, 'ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_autocomplete_index.body', 'autocomplete');\n };\n\n /**\n * Opens the connectors view. It checks if the passed repository ID matches the one selected by the workbench.\n * If they do not match, a confirmation dialog is shown to inform the user that the selected repository\n * will be automatically changed upon confirmation.\n *\n * @param {{repositoryId: string}} payload - The payload containing the repository ID.\n */\n const onGoToConnectorsView = (payload) => {\n goToView(payload.repositoryId, 'ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_connectors.body', 'connectors');\n };\n\n /**\n * Navigates to a specified view URL, potentially after switching the active repository.\n * If the target repository is different from the currently active one, a confirmation modal is shown.\n * Upon user confirmation, the repository is switched and the view is opened in a new browser tab.\n *\n * @param {string} repositoryId - The ID of the target repository to switch to.\n * @param {string} confirmMessageLabelKey - The translation key for the confirmation message to be shown in the modal.\n * @param {string} viewURL - The URL of the view to be opened in a new browser tab.\n */\n const goToView = (repositoryId, confirmMessageLabelKey, viewURL) => {\n if (repositoryId !== $repositories.getActiveRepository()) {\n const repository = $repositories.getRepository(repositoryId);\n if (repository) {\n ModalService.openConfirmationModal({\n title: $translate.instant('common.confirm'),\n message: decodeHTML($translate.instant(confirmMessageLabelKey, {repositoryId: repository.id})),\n confirmButtonKey: 'ttyg.chat_panel.btn.proceed.label',\n },\n () => {\n $repositories.setRepository(repository);\n openView(viewURL);\n });\n }\n } else {\n openView(viewURL);\n }\n };\n\n /**\n * Opens the specified URL in a new browser tab.\n *\n * @param {string} viewURL - The URL to open.\n */\n const openView = (viewURL) => {\n $window.open(viewURL, '_blank');\n };\n\n /**\n * Opens SPARQL editor view with passed query.\n * @param {{query: string, repositoryId: string}} payload\n */\n const onGoToSparqlEditorView = (payload) => {\n if (payload.repositoryId !== $repositories.getActiveRepository()) {\n const repository = $repositories.getRepository(payload.repositoryId);\n if (repository) {\n ModalService.openConfirmation(\n $translate.instant('common.confirm'),\n decodeHTML($translate.instant('ttyg.chat_panel.dialog.confirm_repository_change.body', {repositoryId: payload.repositoryId})),\n () => {\n $repositories.setRepository(repository);\n openInSparqlEditorInNewTab(payload.query);\n });\n }\n } else {\n openInSparqlEditorInNewTab(payload.query);\n }\n };\n\n const openInSparqlEditorInNewTab = (query) => {\n $window.open(`/sparql?query=${encodeURIComponent(query)}&execute=true`, '_blank');\n };\n\n /**\n * Loads a chat using the chat ID stored in the local storage and selects it.\n */\n const setCurrentChat = () => {\n const chatId = TTYGStorageService.getChatId();\n const chats = TTYGContextService.getChats();\n // If the chat ID is not stored in the local storage, there is no need to load it.\n // Also, if a chat id is found in the storage but is not present in the chat list, then it probably was deleted,\n // and it will be replaced with a new one on next selection.\n if (!chatId || !chats.getChat(chatId)) {\n return;\n }\n TTYGContextService.selectChat(TTYGContextService.getChats().getChat(chatId));\n };\n\n const updateLabels = () => {\n labels.filter_all = $translate.instant('ttyg.agent.btn.filter.all');\n // recreate the repository list to trigger the update in the view\n buildAgentsFilterModel();\n };\n\n const buildRepositoryList = () => {\n $scope.activeRepositoryList = $repositories.getLocalReadableGraphdbRepositories()\n .map((repo) => (\n new SelectMenuOptionsModel({\n value: repo.id,\n label: repo.id,\n data: {\n repository: repo,\n },\n })),\n );\n };\n\n\n // =========================\n // Subscriptions\n // =========================\n\n function cleanUp() {\n subscriptions.forEach((subscription) => subscription());\n TTYGContextService.resetContext();\n }\n\n subscriptions.push($scope.$watch($scope.getActiveRepositoryObject, getActiveRepositoryObjectHandler));\n subscriptions.push(TTYGContextService.onSelectedChatChanged(onSelectedChatChanged));\n subscriptions.push(TTYGContextService.onChatsListChanged(onChatsChanged));\n subscriptions.push(TTYGContextService.onCanUpdateAgentUpdated(onCanUpdateAgentUpdated));\n subscriptions.push(TTYGContextService.subscribe(TTYGContextService.onAgentsListChanged(onAgentListChanged)));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.CREATE_CHAT, onCreateNewChat));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.RENAME_CHAT, onRenameChat));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.DELETE_CHAT, onDeleteChat));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.CANCEL_PENDING_QUESTION, onCancelPendingQuestion));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.CHAT_EXPORT, onExportChat));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.ASK_QUESTION, onAskQuestion));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.CONTINUE_CHAT_RUN, onContinueChatRun));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.LOAD_CHATS, loadChats));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.OPEN_AGENT_SETTINGS, $scope.onOpenNewAgentSettings));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.EDIT_AGENT, $scope.onOpenAgentSettings));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.CLONE_AGENT, $scope.onOpenCloneAgentSettings));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.DELETE_AGENT, onDeleteAgent));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.AGENT_SELECTED, onAgentSelected));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.GO_TO_CREATE_SIMILARITY_VIEW, onGoToCreateSimilarityView));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.GO_TO_AUTOCOMPLETE_INDEX_VIEW, goToAutocompleteIndexView));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.GO_TO_CONNECTORS_VIEW, onGoToConnectorsView));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.GO_TO_SPARQL_EDITOR, onGoToSparqlEditorView));\n subscriptions.push($rootScope.$on('$translateChangeSuccess', updateLabels));\n subscriptions.push($rootScope.$on('securityInit', updateCanModifyAgent));\n $scope.$on('$destroy', cleanUp);\n\n // =========================\n // Initialization\n // =========================\n\n function onInit() {\n buildRepositoryList();\n loadAgents()\n .then(() => {\n $scope.initialized = true;\n buildAgentsFilterModel();\n return loadChats();\n })\n .then(setCurrentChat);\n updateCanModifyAgent();\n }\n}\n","import './chat-item-detail.directive';\nimport 'angular/core/directives/editable-content/editable-content';\nimport {TTYGEventName} from \"../services/ttyg-context.service\";\nimport {CHAT_MESSAGE_ROLE, ChatMessageModel} from \"../../models/ttyg/chat-message\";\nimport {ChatItemModel} from \"../../models/ttyg/chat-item\";\nimport {cloneDeep} from \"lodash\";\nimport {decodeHTML} from \"../../../../app\";\n\nconst modules = [\n 'graphdb.framework.ttyg.directives.chat-item-detail',\n 'graphdb.framework.core.directives.editable-content',\n];\n\nangular\n .module('graphdb.framework.ttyg.directives.chat-panel', modules)\n .directive('chatPanel', ChatPanelComponent);\n\nChatPanelComponent.$inject = ['toastr', '$translate', 'TTYGContextService'];\n\n/**\n * @ngdoc directive\n * @name graphdb.framework.ttyg.directives.chat-panel:chatPanel\n * @restrict E\n * @description\n *\n * This directive represents a chat panel component that allows users to interact with a chat. It provides functionality for asking questions,\n * regenerating chat content, and other interactive features.\n *\n * It encapsulates the logic and presentation for displaying and managing chat-related interactions.\n *\n * @example\n * <chat-panel></chat-panel>\n */\nfunction ChatPanelComponent(toastr, $translate, TTYGContextService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/ttyg/templates/chat-panel.html',\n link: ($scope, element, attrs) => {\n // =========================\n // Public variables\n // =========================\n\n /**\n * @type {ChatModel}\n */\n $scope.chat = undefined;\n\n /**\n * @type {AgentModel}\n */\n $scope.selectedAgent = undefined;\n\n /**\n * @type {ChatItemModel}\n */\n $scope.chatItem = undefined;\n\n /**\n * @type {ChatItemModel}\n */\n $scope.askingChatItem = undefined;\n\n /**\n * True while a question is being handled. It may involve multiple requests until it turns back to false.\n * @type {boolean}\n */\n $scope.waitingForLastMessage = false;\n\n /**\n * Flag that indicates that the chat is about to be changed.\n * @type {boolean}\n */\n $scope.loadingChat = true;\n\n $scope.showCancelButton = false;\n\n // =========================\n // Private variables\n // =========================\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Handles the ask question action.\n */\n $scope.ask = () => {\n $scope.chatItem.question.timestamp = Date.now();\n $scope.askingChatItem = cloneDeep($scope.chatItem);\n if (!$scope.chatItem.chatId) {\n createNewChat();\n } else {\n askQuestion($scope.chatItem);\n }\n $scope.chatItem = getEmptyChatItem();\n scrollToBottom();\n focusQuestionInput();\n };\n\n\n /**\n * Cancels a pending question tied to the current scope.\n * Hides cancel button.\n */\n $scope.cancelPendingQuestion = () => {\n $scope.showCancelButton = false;\n TTYGContextService.emit(TTYGEventName.CANCEL_PENDING_QUESTION, $scope.chatItem);\n };\n\n /**\n * Regenerates the answer for the provided chat item.\n *\n * @param {ChatItemModel} chatItem - The chat item that contains the question to be regenerated.\n */\n $scope.regenerateQuestion = (chatItem) => {\n const regenerateChatItem = getEmptyChatItem();\n regenerateChatItem.setQuestionMessage(chatItem.getQuestionMessage());\n regenerateChatItem.question.timestamp = Date.now();\n $scope.askingChatItem = regenerateChatItem;\n askQuestion(regenerateChatItem);\n scrollToBottom();\n };\n\n /**\n * Handles pressing the Enter key in the question input.\n * Will not trigger if `Shift` or `Ctrl` keys are pressed, or if Ask button is disabled.\n *\n * @param {KeyboardEvent} $event - The keyboard event triggered by the user interaction.\n */\n $scope.onKeypressOnInput = ($event) => {\n if (!$scope.askingChatItem && $event.key === 'Enter' && !$event.shiftKey && !$event.ctrlKey) {\n $scope.ask();\n }\n };\n\n $scope.onAskHowDeliveredAnswer = () => {\n const askHowDerivedAnswerChatItem = getEmptyChatItem();\n askHowDerivedAnswerChatItem.setQuestionMessage($translate.instant('ttyg.chat_panel.btn.derive_answer.label'));\n askHowDerivedAnswerChatItem.question.timestamp = Date.now();\n $scope.askingChatItem = cloneDeep(askHowDerivedAnswerChatItem);\n askQuestion(askHowDerivedAnswerChatItem);\n scrollToBottom();\n };\n\n /**\n * Finds out if agent with such id exists and returns its name or a default message for deleted agent.\n * @param {string} agentId\n * @return {string}\n */\n $scope.getAgentName = (agentId) => {\n const agent = TTYGContextService.getAgent(agentId);\n return agent ? agent.name : decodeHTML($translate.instant('ttyg.chat_panel.deleted_agent'));\n };\n\n // =========================\n // Private functions\n // =========================\n\n const createNewChat = () => {\n TTYGContextService.emit(TTYGEventName.CREATE_CHAT, $scope.chatItem);\n };\n\n const askQuestion = (chatItem) => {\n TTYGContextService.emit(TTYGEventName.ASK_QUESTION, chatItem);\n };\n\n const setAskingState = (isAsking) => {\n $scope.waitingForLastMessage = isAsking;\n $scope.showCancelButton = isAsking;\n };\n\n const onAskQuestionStarted = () => {\n setAskingState(true);\n };\n\n /**\n * Handles the update of the selected chat.\n * @param {ChatModel} chat - the new selected chat.\n */\n const onSelectedChatUpdated = (chat) => {\n $scope.chat = chat;\n if (!$scope.chat || $scope.chat.isNew()) {\n // Do nothing if the chat is new and a question is currently being asked.\n return;\n }\n $scope.loadingChat = false;\n const message = $scope.chatItem.question.message;\n $scope.chatItem = getEmptyChatItem();\n $scope.chatItem.question.message = message;\n $scope.askingChatItem = undefined;\n if ($scope.chat) {\n // TODO: Why on earth this is here? The chat changed handler is in the ttyg.view. Why doesn't it handle this\n // but we need to go through 2 more events to achieve the same result?\n const lastChatItem = $scope.chat.chatHistory.getLast();\n if (lastChatItem && lastChatItem.agentId) {\n TTYGContextService.selectAgent(TTYGContextService.getAgent(lastChatItem.agentId));\n }\n }\n focusQuestionInput();\n };\n\n const onLastMessageReceived = () => {\n setAskingState(false);\n };\n\n /**\n * Handles the failure of loading the chat and the server returns 404. This might happen if the chat does\n * not exist anymore because it was deleted by another user for example.\n */\n const onLoadChatFailure = () => {\n $scope.loadingChat = false;\n $scope.chatItem = getEmptyChatItem();\n focusQuestionInput();\n };\n\n const onSelectedChatChanged = (chat) => {\n if (chat) {\n // Skip the loading indication if it is a new chat that hasn't received an answer yet.\n $scope.loadingChat = !chat.isNew();\n $scope.chatItem = getEmptyChatItem();\n setAskingState(false);\n focusQuestionInput();\n } else {\n reset();\n }\n };\n\n const onQuestionFailure = () => {\n $scope.chatItem = cloneDeep($scope.askingChatItem);\n $scope.askingChatItem = undefined;\n setAskingState(false);\n };\n\n /**\n * Handles the change of the selected agent.\n * @param {AgentModel} agent - the new selected agent.\n */\n const onSelectedAgentChanged = (agent) => {\n $scope.selectedAgent = agent;\n if ($scope.selectedAgent && $scope.chatItem) {\n $scope.chatItem.agentId = $scope.selectedAgent.id;\n }\n focusQuestionInput();\n };\n\n const onChatDeleted = (deletedChat) => {\n if ($scope.chat && deletedChat.id === $scope.chat.id) {\n reset();\n }\n };\n\n const getEmptyChatItem = () => {\n const chatItem = new ChatItemModel();\n chatItem.question = new ChatMessageModel({role: CHAT_MESSAGE_ROLE.USER});\n\n if ($scope.chat) {\n chatItem.chatId = $scope.chat.id;\n }\n\n if ($scope.selectedAgent) {\n chatItem.agentId = $scope.selectedAgent.id;\n }\n\n return chatItem;\n };\n\n const focusQuestionInput = () => {\n // Moving focus to the end of the JS call stack with a timeout, because on first Agent select,\n // the dropdown .agent-option steals the focus, or the browser assigns it to the document <body>.\n setTimeout(() => {\n const inputElement = document.querySelector('.question-input');\n if (inputElement) {\n inputElement.focus();\n }\n });\n };\n\n const scrollToBottom = () => {\n // Call it in a timeout to ensure that Angular's digest cycle is finished and all elements are displayed.\n setTimeout(() => {\n const chatDetailsElement = element.find(\".chat-details\")[0];\n if (chatDetailsElement) {\n chatDetailsElement.scrollTop = chatDetailsElement.scrollHeight;\n }\n });\n };\n\n const reset = () => {\n $scope.chat = undefined;\n $scope.loadingChat = false;\n $scope.chatItem = getEmptyChatItem();\n $scope.askingChatItem = undefined;\n setAskingState(false);\n focusQuestionInput();\n };\n\n const init = () => {\n $scope.chatItem = getEmptyChatItem();\n focusQuestionInput();\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n subscriptions.push($scope.$watchCollection('chat.chatHistory.items', scrollToBottom));\n subscriptions.push(TTYGContextService.onSelectedChatUpdated(onSelectedChatUpdated));\n subscriptions.push(TTYGContextService.onLastMessageReceived(onLastMessageReceived));\n subscriptions.push(TTYGContextService.onSelectedAgentChanged(onSelectedAgentChanged));\n subscriptions.push(TTYGContextService.onSelectedChatChanged(onSelectedChatChanged));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.LOAD_CHAT_FAILURE, onLoadChatFailure));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.ASK_QUESTION_FAILURE, onQuestionFailure));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.CREATE_CHAT_FAILURE, onQuestionFailure));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.DELETE_CHAT_SUCCESSFUL, onChatDeleted));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.ASK_QUESTION_STARTING, onAskQuestionStarted));\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n\n // =========================\n // Initialization\n // =========================\n init();\n },\n };\n}\n","import {decodeHTML} from \"../../../../app\";\nimport {TTYGEventName} from \"../services/ttyg-context.service\";\nimport 'angular/ttyg/services/externalIntegrationModal.service';\n\nconst modules = [\n 'graphdb.framework.ttyg.services.externalIntegrationModal'\n];\n\nangular\n .module('graphdb.framework.ttyg.directives.agent-list', modules)\n .directive('agentList', AgentListComponent);\n\nAgentListComponent.$inject = ['TTYGContextService', 'ModalService', '$translate', '$uibModal', 'ExternalIntegrationModalService'];\n\nfunction AgentListComponent(TTYGContextService, ModalService, $translate, $uibModal, ExternalIntegrationModalService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/ttyg/templates/agent-list.html',\n scope: {\n agentList: '=',\n agentListFilterModel: '='\n },\n link: ($scope, element, attrs) => {\n\n // =========================\n // Public variables\n // =========================\n\n /**\n * Selected agent.\n * @type {AgentModel|undefined}\n */\n $scope.selectedAgent = undefined;\n\n /**\n * The selected agents filter.\n * @type {{key: string, label: string}|undefined}\n */\n $scope.selectedAgentsFilter = undefined;\n\n /**\n * An event instance holding the agent to be deleted and if the progress is ongoing.\n * @type {agentId: string, inProgress: boolean}\n */\n $scope.deletingAgent = undefined;\n\n // =========================\n // Private variables\n // =========================\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Triggers the agent edit process.\n * @param {AgentModel} agent\n */\n $scope.onEditAgent = (agent) => {\n TTYGContextService.emit(TTYGEventName.EDIT_AGENT, agent);\n };\n\n /**\n * Opens a modal to copy the external integration for a given agent.\n *\n * Used when the agent is already provided.\n *\n * @function\n * @param {AgentModel} agent - The agent for which to configure the integration.\n */\n $scope.onExternalIntegration = (agent) => {\n ExternalIntegrationModalService.open(agent);\n };\n\n /**\n * Triggers the agent clone process.\n * @param {AgentModel} agent\n */\n $scope.onCloneAgent = (agent) => {\n TTYGContextService.emit(TTYGEventName.CLONE_AGENT, agent);\n };\n\n /**\n * Triggers the agent delete process.\n * @param {AgentModel} agent\n */\n $scope.onDeleteAgent = (agent) => {\n const title = $translate.instant('ttyg.agent.delete_agent_modal.title');\n const confirmDeleteMessage = decodeHTML($translate.instant('ttyg.agent.delete_agent_modal.body', {agentName: agent.name}));\n ModalService.openConfirmation(title, confirmDeleteMessage, () => TTYGContextService.emit(TTYGEventName.DELETE_AGENT, agent));\n };\n\n /**\n * Filters the agents based on the selected repository.\n * @param {AgentListFilterModel} selectedFilter\n */\n $scope.onAgentsFilterChange = (selectedFilter) => {\n $scope.selectedAgentsFilter = selectedFilter;\n if ($scope.selectedAgentsFilter) {\n $scope.agentList.filterByRepository($scope.selectedAgentsFilter.key);\n }\n };\n\n // =========================\n // Private functions\n // =========================\n\n const updateSelectedAgentsFilter = () => {\n const selectedFilter = $scope.agentListFilterModel.find((filter) => filter.selected);\n $scope.selectedAgentsFilter = selectedFilter || $scope.agentListFilterModel[0];\n $scope.onAgentsFilterChange($scope.selectedAgentsFilter);\n };\n\n /**\n * Handles the progress of deletion of an agent.\n * @param {{agentId: string, inProgress: boolean}} event\n */\n const onDeletingAgent = (event) => {\n $scope.deletingAgent = event;\n };\n\n /**\n * Handles the selection of an agent.\n * @param {AgentModel} agent\n */\n const onSelectedAgentChanged = (agent) => {\n $scope.selectedAgent = agent;\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n const subscriptions = [];\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n subscriptions.push($scope.$watch('agentListFilterModel', updateSelectedAgentsFilter));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.DELETING_AGENT, onDeletingAgent));\n subscriptions.push(TTYGContextService.onSelectedAgentChanged(onSelectedAgentChanged));\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n\n // =========================\n // Initialization\n // =========================\n\n function initialize() {\n updateSelectedAgentsFilter();\n }\n initialize();\n }\n };\n}\n","/**\n * @ngdoc directive\n * @name graphdb.framework.core.directives:inlineEditableText\n * @restrict E\n * @description\n * A directive for inline editing of text fields. It provides a simple interface to display text,\n * switch to an editable input field on double-click, and save or cancel changes.\n *\n * The directive allows for customizable save, cancel, click, and double-click actions.\n *\n * @param {string} fieldName - The name of the field in the source object to be edited.\n * @param {Object} source - The object containing the field to be edited.\n * @param {function} onSave - The function to be called when saving the edited text.\n * It passes an object with the new text and the source object.\n * @param {function} onCancel - The function to be called when editing is canceled.\n * @param {function} onClick - The function to be called on single-click.\n * @param {function} onDblclick - The function to be called on double-click.\n * @param {boolean} isEditing - A flag indicating whether the text is currently being edited.\n *\n * @example\n * <inline-editable-text\n * field-name=\"name\"\n * source=\"item\"\n * on-save=\"saveFunction(newText, source)\"\n * on-cancel=\"cancelFunction()\"\n * on-click=\"clickFunction(source)\"\n * on-dblclick=\"dblClickFunction(source)\"\n * is-editing=\"item.isEditing\">\n * </inline-editable-text>\n *\n * @requires $timeout\n */\nangular\n .module('graphdb.framework.core.directives.inline-editable-text', [])\n .directive('inlineEditableText', InlineEditableText);\n\nInlineEditableText.$inject = ['$timeout'];\n\nfunction InlineEditableText($timeout) {\n return {\n restrict: 'E',\n scope: {\n /**\n * {@type {text}}\n */\n fieldName: '@',\n source: '=',\n onSave: '&',\n onCancel: '&',\n onClick: '&',\n onDblclick: '&',\n isEditing: '='\n },\n templateUrl: 'js/angular/core/directives/inline-editable-text/templates/inline-editable-text.template.html',\n link: function (scope, element) {\n\n // =========================\n // Public variables\n // =========================\n scope.editableModel = {};\n\n // =========================\n // Private variables\n // =========================\n const subscriptions = [];\n let clickTimeout;\n\n // =========================\n // Public functions\n // =========================\n scope.onKeydown = (event) => {\n if (event.key === 'Enter') {\n cancelClickTimeout();\n if (scope.editableModel.text !== scope.text) {\n scope.onSave({newText:scope.editableModel.text, source: scope.source});\n }\n } else if (event.key === 'Escape') {\n cancelEditing();\n }\n };\n\n scope.onCancelEditing = () => {\n cancelEditing();\n };\n\n scope.onSelect = () => {\n if (clickTimeout) {\n cancelClickTimeout();\n scope.onDblclick({source: scope.source});\n } else {\n clickTimeout = $timeout(function () {\n scope.onClick({source: scope.source});\n cancelClickTimeout();\n }, 250);\n }\n };\n\n // =========================\n // Private functions\n // =========================\n const cancelEditing = () => {\n cancelClickTimeout();\n scope.onCancel();\n };\n\n const cancelClickTimeout = () => {\n $timeout.cancel(clickTimeout);\n clickTimeout = undefined;\n };\n\n const focusEditElement = () => {\n // Focus and select the text in the input field\n $timeout(() => {\n const inputElement = element.find('input')[0];\n inputElement.focus();\n inputElement.select();\n }, 0);\n };\n\n // =========================\n // Subscription handlers\n // =========================\n const onIsEditChanged = (newVal) => {\n if (newVal) {\n scope.editableModel.text = scope.source[scope.fieldName];\n focusEditElement();\n }\n };\n\n // =========================\n // Subscriptions\n // =========================\n subscriptions.push(scope.$watch('isEditing', onIsEditChanged));\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n cancelClickTimeout();\n };\n\n // Deregister the watcher when the scope/directive is destroyed\n scope.$on('$destroy', removeAllSubscribers);\n }\n };\n}\n","/**\n * A model for the agent settings modal configuration.\n */\nexport class AgentSettingsModal {\n /**\n * Constructor.\n * @param {RepositoryInfoModel} activeRepositoryInfo\n * @param {string[]} activeRepositoryList\n * @param {AgentFormModel} agentFormModel\n * @param {'create'|'edit'|'clone'} operation\n */\n constructor(\n activeRepositoryInfo,\n activeRepositoryList,\n agentFormModel,\n operation\n ) {\n this.activeRepositoryInfo = activeRepositoryInfo;\n this.activeRepositoryList = activeRepositoryList;\n this.agentFormModel = agentFormModel;\n this.operation = operation;\n }\n}\n","import {SelectMenuOptionsModel} from \"../../models/form-fields\";\nimport {TTYGEventName} from \"../services/ttyg-context.service\";\n\nconst modules = [\n];\n\nangular\n .module('graphdb.framework.ttyg.directives.agent-select-menu', modules)\n .directive('agentSelectMenu', AgentSelectMenuComponent);\n\nAgentSelectMenuComponent.$inject = ['TTYGContextService', '$translate', '$sce', 'ModalService', 'TTYGStorageService'];\n\nfunction AgentSelectMenuComponent(TTYGContextService, $translate, $sce, ModalService, TTYGStorageService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/ttyg/templates/agent-select-menu.html',\n scope: {\n },\n link: ($scope) => {\n\n // =========================\n // Public variables\n // =========================\n\n $scope.agentOptionsList = [];\n\n /**\n * Selected agent ID.\n * @type {AgentModel|undefined}\n */\n $scope.selectedAgent = undefined;\n\n // =========================\n // Private variables\n // =========================\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Handles the agent selection.\n * @param {Event} $event - The DOM event triggered by the selection.\n * @param {AgentModel} agent - The selected agent instance.\n */\n $scope.onAgentSelected = ($event, agent) => {\n if (!agent.isCompatible) {\n // Prevents the dropdown from closing if the selected agent is not compatible\n // by stopping event propagation and preventing the default action.\n $event.stopPropagation();\n $event.preventDefault();\n return;\n }\n markAsSelected(agent);\n TTYGStorageService.saveAgent(agent);\n $scope.selectedAgent = agent;\n TTYGContextService.selectAgent(agent);\n if (agent.isRepositoryDeleted) {\n const title = $translate.instant('ttyg.agent.agent_select_menu.configure_agent_modal.title');\n const confirmMessage = $translate.instant('ttyg.agent.agent_select_menu.configure_agent_modal.body');\n ModalService.openConfirmation(title, confirmMessage,\n () => TTYGContextService.emit(TTYGEventName.EDIT_AGENT, agent)\n );\n }\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Marks the given agent as selected and deselects the rest.\n * @param {AgentModel} agent\n */\n const markAsSelected = (agent) => {\n $scope.agentOptionsList.forEach((agentOption) => {\n agentOption.selected = agentOption.data.agent === agent;\n });\n };\n\n /**\n * Handles the agent list change event.\n * @param {AgentListModel} agents\n */\n const onAgentListChanged = (agents) => {\n buildAgentOptionsModel(agents);\n selectLastUsedOrDefaultAgent();\n };\n\n /**\n * Function to select the most recently used agent (according to local store) or selects the first in the list\n * if no recent agent is available.\n *\n * @function\n */\n const selectLastUsedOrDefaultAgent = () => {\n let selectedAgent;\n const storedAgentId = TTYGStorageService.getAgentId();\n\n if (storedAgentId) {\n // If saved in the LocalStore, the user has selected it, so select it here\n $scope.agentOptionsList.forEach((agent) => {\n if (agent.data.agent.id === storedAgentId) {\n selectedAgent = agent.data.agent\n }\n });\n }\n\n // Otherwise, select the first in the option list\n if (!selectedAgent && $scope.agentOptionsList[0]) {\n selectedAgent = $scope.agentOptionsList[0].data.agent;\n }\n onSelectedAgentChanged(selectedAgent);\n TTYGContextService.selectAgent(selectedAgent);\n }\n\n /**\n * Handles the agent deleted event.\n * @param {AgentModel} deletedAgent - the deleted agent\n */\n const onAgentDeleted = (deletedAgent) => {\n if ($scope.selectedAgent && $scope.selectedAgent.id === deletedAgent.id) {\n $scope.selectedAgent.isDeleted = true;\n TTYGContextService.selectAgent($scope.selectedAgent);\n }\n };\n\n /**\n * Handles the selection of an agent. When an agent is selected by the user from this menu, the agent is then\n * saved in the local storage. When the TTYG view is initialized, the selected agent is retrieved from the\n * local and its details loaded through the API. Then this component is updated to reflect the selected agent.\n * @param {AgentModel} agent\n */\n const onSelectedAgentChanged = (agent) => {\n markAsSelected(agent);\n $scope.selectedAgent = agent;\n };\n\n /**\n * Builds the agent options model which is used to display the agents in the select menu.\n * @param {AgentListModel} agentsListModel\n */\n const buildAgentOptionsModel = (agentsListModel) => {\n $scope.agentOptionsList = agentsListModel.agents.map((agent) => {\n return new SelectMenuOptionsModel({\n value: agent.id,\n label: agent.name,\n data: {\n agent: agent\n }\n });\n });\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n const subscriptions = [];\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n subscriptions.push(TTYGContextService.onAgentsListChanged(onAgentListChanged));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.AGENT_DELETED, onAgentDeleted));\n subscriptions.push(TTYGContextService.onSelectedAgentChanged(onSelectedAgentChanged));\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n\n // =========================\n // Initialization\n // =========================\n\n function initialize() {\n // buildAgentOptionsModel();\n }\n initialize();\n }\n };\n}\n","import 'angular/core/directives/inline-editable-text/inline-editable-text.directive';\nimport {TTYGEventName} from \"../services/ttyg-context.service\";\nimport {getHumanReadableTimestamp} from \"../services/ttyg.utils\";\nimport {decodeHTML} from \"../../../../app\";\n\nconst modules = [\n 'graphdb.framework.core.directives.inline-editable-text'\n];\n\nangular\n .module('graphdb.framework.ttyg.directives.chat-list', modules)\n .directive('chatList', ChatListComponent);\n\nChatListComponent.$inject = ['TTYGContextService', 'ModalService', '$translate', '$filter'];\n\nfunction ChatListComponent(TTYGContextService, ModalService, $translate, $filter) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/ttyg/templates/chat-list.html',\n link: ($scope) => {\n\n // =========================\n // Public variables\n // =========================\n\n $scope.selectedChat = undefined;\n $scope.renamedChat = undefined;\n $scope.deletingChat = undefined;\n\n // =========================\n // Private variables\n // =========================\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Handles the selection of a chat for renaming.\n * @param {ChatModel} chat\n */\n $scope.onSelectChatForRenaming = (chat) => {\n $scope.renamedChat = chat;\n };\n\n /**\n * Handles the selection of a chat.\n * @param {ChatModel} chat\n */\n $scope.onSelectChat = (chat) => {\n if (!$scope.selectedChat || $scope.selectedChat.id !== chat.id) {\n const nonPersistedChat = TTYGContextService.getChats().getNonPersistedChat();\n if (nonPersistedChat) {\n TTYGContextService.deleteChat(nonPersistedChat);\n }\n TTYGContextService.selectChat(chat);\n $scope.renamedChat = undefined;\n }\n };\n\n /**\n * Handles the deletion of a chat.\n * @param {ChatModel} chat\n */\n $scope.onDeleteChat = (chat) => {\n const title = $translate.instant('ttyg.dialog.delete.title');\n const confirmDeleteMessage = decodeHTML($translate.instant('ttyg.dialog.delete.body', {chatName: chat.name}));\n ModalService.openConfirmation(title, confirmDeleteMessage, () => TTYGContextService.emit(TTYGEventName.DELETE_CHAT, chat));\n };\n\n /**\n * Handles the renaming of a chat.\n * @param {string} newName - the new name of the chat\n * @param {ChatModel} chat\n */\n $scope.onRenameChat = (newName, chat) => {\n chat.name = newName;\n $scope.renamedChat = undefined;\n TTYGContextService.emit(TTYGEventName.RENAME_CHAT, chat);\n };\n\n /**\n * Handles the export of a chat.\n * @param {ChatModel} chat\n */\n $scope.onExportChat = (chat) => {\n TTYGContextService.emit(TTYGEventName.CHAT_EXPORT, chat);\n };\n\n /**\n * Handles the cancelation of the chat renaming.\n */\n $scope.onCancelChatRenaming = () => {\n $scope.renamedChat = undefined;\n };\n\n $scope.getHumanReadableChatGroupTimestamp = (timestamp) => {\n return getHumanReadableTimestamp($translate, $filter, timestamp);\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Handles the change of the selected chat.\n * @param {ChatModel} chat\n */\n const onSelectedChatChanged = (chat) => {\n $scope.selectedChat = chat;\n };\n\n /**\n * Handles the change of the chats list.\n * @param {ChatsListModel} chatList\n */\n const onChatsListChanged = (chatList) => {\n $scope.chatList = chatList;\n };\n\n /**\n * Handles the progress of deletion of a chat.\n * @param {{chatId: string, inProgress: boolean}} event\n */\n const onDeletingChat = (event) => {\n $scope.deletingChat = event;\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n subscriptions.push(TTYGContextService.onSelectedChatChanged(onSelectedChatChanged));\n subscriptions.push(TTYGContextService.onSelectedChatUpdated(onSelectedChatChanged));\n subscriptions.push(TTYGContextService.onChatsListChanged(onChatsListChanged));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.DELETING_CHAT, onDeletingChat));\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n\n // =========================\n // Initialization\n // =========================\n\n function initialize() {\n }\n initialize();\n }\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.ttyg.directives.show-tooltip-on-overflow', modules)\n .directive('showTooltipOnOverflow', ShowTooltipOnOverflow);\n\nfunction ShowTooltipOnOverflow() {\n return {\n link: function(scope, element) {\n function updateTooltip() {\n const innerTextElement = element[0].querySelector('.editable-text-element');\n if (!innerTextElement) return;\n\n if (innerTextElement.scrollWidth > innerTextElement.clientWidth) {\n element.attr('title', scope.chat.name);\n } else {\n element.removeAttr('title');\n }\n }\n\n // Needed in order to have values for scrollWidth and clientWidth\n setTimeout(updateTooltip, 0);\n }\n };\n}\n","/* FileSaver.js\n * A saveAs() FileSaver implementation.\n * 2015-05-07.2\n *\n * By Eli Grey, http://eligrey.com\n * License: X11/MIT\n * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md\n */\n\n/*global self */\n/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */\n\n/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */\n\nvar saveAs = saveAs || (function(view) {\n\t\"use strict\";\n\t// IE <10 is explicitly unsupported\n\tif (typeof navigator !== \"undefined\" && /MSIE [1-9]\\./.test(navigator.userAgent)) {\n\t\treturn;\n\t}\n\tvar\n\t\t doc = view.document\n\t\t // only get URL when necessary in case Blob.js hasn't overridden it yet\n\t\t, get_URL = function() {\n\t\t\treturn view.URL || view.webkitURL || view;\n\t\t}\n\t\t, save_link = doc.createElementNS(\"http://www.w3.org/1999/xhtml\", \"a\")\n\t\t, can_use_save_link = \"download\" in save_link\n\t\t, click = function(node) {\n\t\t\tvar event = new MouseEvent(\"click\");\n\t\t\tnode.dispatchEvent(event);\n\t\t}\n\t\t, webkit_req_fs = view.webkitRequestFileSystem\n\t\t, req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem\n\t\t, throw_outside = function(ex) {\n\t\t\t(view.setImmediate || view.setTimeout)(function() {\n\t\t\t\tthrow ex;\n\t\t\t}, 0);\n\t\t}\n\t\t, force_saveable_type = \"application/octet-stream\"\n\t\t, fs_min_size = 0\n\t\t// See https://code.google.com/p/chromium/issues/detail?id=375297#c7 and\n\t\t// https://github.com/eligrey/FileSaver.js/commit/485930a#commitcomment-8768047\n\t\t// for the reasoning behind the timeout and revocation flow\n\t\t, arbitrary_revoke_timeout = 500 // in ms\n\t\t, revoke = function(file) {\n\t\t\tvar revoker = function() {\n\t\t\t\tif (typeof file === \"string\") { // file is an object URL\n\t\t\t\t\tget_URL().revokeObjectURL(file);\n\t\t\t\t} else { // file is a File\n\t\t\t\t\tfile.remove();\n\t\t\t\t}\n\t\t\t};\n\t\t\tif (view.chrome) {\n\t\t\t\trevoker();\n\t\t\t} else {\n\t\t\t\tsetTimeout(revoker, arbitrary_revoke_timeout);\n\t\t\t}\n\t\t}\n\t\t, dispatch = function(filesaver, event_types, event) {\n\t\t\tevent_types = [].concat(event_types);\n\t\t\tvar i = event_types.length;\n\t\t\twhile (i--) {\n\t\t\t\tvar listener = filesaver[\"on\" + event_types[i]];\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlistener.call(filesaver, event || filesaver);\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tthrow_outside(ex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t, auto_bom = function(blob) {\n\t\t\t// prepend BOM for UTF-8 XML and text/* types (including HTML)\n\t\t\tif (/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n\t\t\t\treturn new Blob([\"\\ufeff\", blob], {type: blob.type});\n\t\t\t}\n\t\t\treturn blob;\n\t\t}\n\t\t, FileSaver = function(blob, name) {\n\t\t\tblob = auto_bom(blob);\n\t\t\t// First try a.download, then web filesystem, then object URLs\n\t\t\tvar\n\t\t\t\t filesaver = this\n\t\t\t\t, type = blob.type\n\t\t\t\t, blob_changed = false\n\t\t\t\t, object_url\n\t\t\t\t, target_view\n\t\t\t\t, dispatch_all = function() {\n\t\t\t\t\tdispatch(filesaver, \"writestart progress write writeend\".split(\" \"));\n\t\t\t\t}\n\t\t\t\t// on any filesys errors revert to saving with object URLs\n\t\t\t\t, fs_error = function() {\n\t\t\t\t\t// don't create more object URLs than needed\n\t\t\t\t\tif (blob_changed || !object_url) {\n\t\t\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\t\t}\n\t\t\t\t\tif (target_view) {\n\t\t\t\t\t\ttarget_view.location.href = object_url;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar new_tab = view.open(object_url, \"_blank\");\n\t\t\t\t\t\tif (new_tab == undefined && typeof safari !== \"undefined\") {\n\t\t\t\t\t\t\t//Apple do not allow window.open, see http://bit.ly/1kZffRI\n\t\t\t\t\t\t\tview.location.href = object_url\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t}\n\t\t\t\t, abortable = function(func) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif (filesaver.readyState !== filesaver.DONE) {\n\t\t\t\t\t\t\treturn func.apply(this, arguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t, create_if_not_found = {create: true, exclusive: false}\n\t\t\t\t, slice\n\t\t\t;\n\t\t\tfilesaver.readyState = filesaver.INIT;\n\t\t\tif (!name) {\n\t\t\t\tname = \"download\";\n\t\t\t}\n\t\t\tif (save_link) {\n\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\t//window.open('data:attachment/csv;charset=utf-8,' + object_url);\n\t\t\t\tsave_link.href = object_url;\n\t\t\t\tsave_link.download = name;\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tclick(save_link);\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Object and web filesystem URLs have a problem saving in Google Chrome when\n\t\t\t// viewed in a tab, so I force save with application/octet-stream\n\t\t\t// http://code.google.com/p/chromium/issues/detail?id=91158\n\t\t\t// Update: Google errantly closed 91158, I submitted it again:\n\t\t\t// https://code.google.com/p/chromium/issues/detail?id=389642\n\t\t\tif (view.chrome && type && type !== force_saveable_type) {\n\t\t\t\tslice = blob.slice || blob.webkitSlice;\n\t\t\t\tblob = slice.call(blob, 0, blob.size, force_saveable_type);\n\t\t\t\tblob_changed = true;\n\t\t\t}\n\t\t\t// Since I can't be sure that the guessed media type will trigger a download\n\t\t\t// in WebKit, I append .download to the filename.\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=65440\n\t\t\tif (webkit_req_fs && name !== \"download\") {\n\t\t\t\tname += \".download\";\n\t\t\t}\n\t\t\tif (type === force_saveable_type || webkit_req_fs) {\n\t\t\t\ttarget_view = view;\n\t\t\t}\n\t\t\tif (!req_fs) {\n\t\t\t\tfs_error();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfs_min_size += blob.size;\n\t\t\treq_fs(view.TEMPORARY, fs_min_size, abortable(function(fs) {\n\t\t\t\tfs.root.getDirectory(\"saved\", create_if_not_found, abortable(function(dir) {\n\t\t\t\t\tvar save = function() {\n\t\t\t\t\t\tdir.getFile(name, create_if_not_found, abortable(function(file) {\n\t\t\t\t\t\t\tfile.createWriter(abortable(function(writer) {\n\t\t\t\t\t\t\t\twriter.onwriteend = function(event) {\n\t\t\t\t\t\t\t\t\ttarget_view.location.href = file.toURL();\n\t\t\t\t\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\t\t\t\t\tdispatch(filesaver, \"writeend\", event);\n\t\t\t\t\t\t\t\t\trevoke(file);\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\twriter.onerror = function() {\n\t\t\t\t\t\t\t\t\tvar error = writer.error;\n\t\t\t\t\t\t\t\t\tif (error.code !== error.ABORT_ERR) {\n\t\t\t\t\t\t\t\t\t\tfs_error();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\"writestart progress write abort\".split(\" \").forEach(function(event) {\n\t\t\t\t\t\t\t\t\twriter[\"on\" + event] = filesaver[\"on\" + event];\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\twriter.write(blob);\n\t\t\t\t\t\t\t\tfilesaver.abort = function() {\n\t\t\t\t\t\t\t\t\twriter.abort();\n\t\t\t\t\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tfilesaver.readyState = filesaver.WRITING;\n\t\t\t\t\t\t\t}), fs_error);\n\t\t\t\t\t\t}), fs_error);\n\t\t\t\t\t};\n\t\t\t\t\tdir.getFile(name, {create: false}, abortable(function(file) {\n\t\t\t\t\t\t// delete file if it already exists\n\t\t\t\t\t\tfile.remove();\n\t\t\t\t\t\tsave();\n\t\t\t\t\t}), abortable(function(ex) {\n\t\t\t\t\t\tif (ex.code === ex.NOT_FOUND_ERR) {\n\t\t\t\t\t\t\tsave();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfs_error();\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}), fs_error);\n\t\t\t}), fs_error);\n\t\t}\n\t\t, FS_proto = FileSaver.prototype\n\t\t, saveAs = function(blob, name) {\n\t\t\treturn new FileSaver(blob, name);\n\t\t}\n\t;\n\t// IE 10+ (native saveAs)\n\tif (typeof navigator !== \"undefined\" && navigator.msSaveOrOpenBlob) {\n\t\treturn function(blob, name) {\n\t\t\treturn navigator.msSaveOrOpenBlob(auto_bom(blob), name);\n\t\t};\n\t}\n\n\tFS_proto.abort = function() {\n\t\tvar filesaver = this;\n\t\tfilesaver.readyState = filesaver.DONE;\n\t\tdispatch(filesaver, \"abort\");\n\t};\n\tFS_proto.readyState = FS_proto.INIT = 0;\n\tFS_proto.WRITING = 1;\n\tFS_proto.DONE = 2;\n\n\tFS_proto.error =\n\tFS_proto.onwritestart =\n\tFS_proto.onprogress =\n\tFS_proto.onwrite =\n\tFS_proto.onabort =\n\tFS_proto.onerror =\n\tFS_proto.onwriteend =\n\t\tnull;\n\n\treturn saveAs;\n}(\n\t typeof self !== \"undefined\" && self\n\t|| typeof window !== \"undefined\" && window\n\t|| this.content\n));\n// `self` is undefined in Firefox for Android content script context\n// while `this` is nsIContentFrameMessageManager\n// with an attribute `content` that corresponds to the window\n\nif (typeof module !== \"undefined\" && module.exports) {\n module.exports.saveAs = saveAs;\n} else if ((typeof define !== \"undefined\" && define !== null) && (define.amd != null)) {\n define([], function() {\n return saveAs;\n });\n}","/**\n * @name helpInfoPopover\n * @restrict E\n * @scope\n *\n * @description\n * Custom element directive for showing a help info popover on hover. The content is\n * passed in through the `helpInfo` attribute and rendered using an external template.\n *\n * @param {Object} helpInfo - The help information to be displayed in the popover.\n *\n * @example\n * <help-info-popover help-info=\"myHelpData\"></help-info-popover>\n *\n * @returns {Object} Directive definition object\n */\nangular.module('graphdb.framework.core.directives.help-info-popover', [])\n .directive('helpInfoPopover', function() {\n return {\n restrict: 'E',\n scope: {\n helpInfo: '=',\n },\n templateUrl: 'js/angular/ttyg/templates/modal/helpInfoPopoverTemplate.html',\n link: function($scope, element) {\n // Track whether the popover is open\n $scope.isPopoverOpen = false;\n\n const mouseEnterHandler = () => {\n $scope.$apply(() => {\n $scope.isPopoverOpen = true;\n });\n };\n\n const mouseLeaveHandler = () => {\n $scope.$apply(() => {\n $scope.isPopoverOpen = false;\n });\n };\n\n // =========================\n // Events\n // =========================\n element.on('mouseenter', mouseEnterHandler);\n element.on('mouseleave', mouseLeaveHandler);\n\n // Clean up the event listeners on scope destroy\n $scope.$on('$destroy', function() {\n element.off('mouseenter', mouseEnterHandler);\n element.off('mouseleave', mouseLeaveHandler);\n });\n }\n };\n });\n","export const status = {\n BAD_REQUEST: 400,\n UNAUTHORIZED: 401,\n FORBIDDEN: 403,\n NOT_FOUND: 404,\n CONFLICT: 409,\n INTERNAL_SERVER_ERROR: 500,\n SERVICE_UNAVAILABLE: 503\n};\n","angular\n .module('graphdb.framework.ttyg.services.ttygstorage', [])\n .factory('TTYGStorageService', TTYGStorageService);\n\nTTYGStorageService.$inject = ['LocalStorageAdapter', 'LSKeys'];\n\nfunction TTYGStorageService(localStorageAdapter, LSKeys) {\n\n const defaultSettings = {\n agent: {\n id: undefined\n },\n chat: {\n id: undefined\n }\n };\n\n /**\n * Gets the TTYG settings from the local storage or returns the default settings if there are none.\n * @return {{agent: {id: undefined}, chat: {id: undefined}}}\n */\n const getTtygSettings = () => {\n let settings = localStorageAdapter.get(LSKeys.TTYG);\n if (!settings) {\n settings = defaultSettings;\n }\n if (!settings.agent) {\n settings.agent = {};\n }\n if (!settings.chat) {\n settings.chat = {};\n }\n return settings;\n };\n\n /**\n * Saves the agent in the local storage.\n * @param {AgentModel} agent\n */\n function saveAgent(agent) {\n const settings = getTtygSettings();\n // If the agent is not provided, we will persist undefined to clear any previously saved ID, if one exists.\n settings.agent.id = agent ? agent.id : undefined;\n localStorageAdapter.set(LSKeys.TTYG, settings);\n }\n\n /**\n * Gets the agent id from the local storage.\n * @return {string|undefined}\n */\n function getAgentId() {\n const settings = getTtygSettings();\n if (settings.agent) {\n return settings.agent.id;\n }\n }\n\n /**\n * Saves the chat in the local storage.\n * @param {ChatModel} chat\n */\n function saveChat(chat) {\n const settings = getTtygSettings();\n // If the chat is not provided, we will persist undefined to clear any previously saved ID, if one exists.\n settings.chat.id = chat ? chat.id : undefined;\n localStorageAdapter.set(LSKeys.TTYG, settings);\n }\n\n /**\n * Gets the chat id from the local storage.\n * @return {string|undefined}\n */\n function getChatId() {\n const settings = getTtygSettings();\n if (settings.chat) {\n return settings.chat.id;\n }\n }\n\n return {\n saveAgent,\n getAgentId,\n saveChat,\n getChatId\n };\n}\n"],"names":["editableContent","restrict","require","scope","ngModel","ngDisabled","placeholder","templateUrl","link","element","attrs","ngModelCtrl","editableDiv","find","updateModelValue","$apply","html","length","text","trim","empty","$setViewValue","innerText","$render","$viewValue","pasteHandler","event","preventDefault","originalEvent","clipboardData","getData","selection","window","getSelection","rangeCount","deleteFromDocument","range","getRangeAt","fragment","document","createDocumentFragment","lines","split","forEach","line","index","appendChild","createTextNode","createElement","insertNode","collapseToEnd","$on","removeAllSubscribers","off","on","angular","module","directive","$inject","NoAgentsView","TTYGContextService","productInfo","$scope","canModifyAgent","talkToGraphDocumentationLink","DocumentationUrlResolver","getDocumentationUrl","productShortVersion","onCreateAgent","emit","TTYGEventName","OPEN_AGENT_SETTINGS","subscriptions","push","onCanUpdateAgentUpdated","onDestroy","subscription","TTYGViewCtrl","$jwtAuth","$window","$rootScope","$http","$timeout","$translate","$uibModal","$repositories","toastr","ModalService","LocalStorageAdapter","TTYGService","TTYGStorageService","labels","filter_all","instant","pendingQuestionCancelingPromise","helpTemplateUrl","isHelpVisible","showChats","showAgents","chats","undefined","loadingChats","loadingChat","initialized","agents","selectedAgent","loadingAgents","reloadingAgents","connectorID","agentListFilterModel","activeRepositoryList","onopen","onclose","noop","startNewChat","getChats","containsNewChats","deselectChat","toggleChatsListSidebar","toggleAgentsListSidebar","onToggleHelp","onExportSelectedChat","onExportChat","getSelectedChat","getDefaultAgent","defaultAgent","Promise","resolve","then","response","setDefaultAgent","onOpenNewAgentSettings","agentDefaultValues","activeRepositoryInfo","repositoryInfoMapper","getActiveRepositoryObject","repositoryId","id","agentFormModel","agentFormModelMapper","AgentModel","AGENT_OPERATION","CREATE","controller","windowClass","backdrop","dialogModel","AgentSettingsModal","size","options","open","result","reloadAgents","catch","error","getError","TTYG_ERROR_MSG_LENGTH","onOpenAgentSettings","agent","agentToEdit","getSelectedAgent","EDIT","updatedAgent","hasSelectedAgent","selectAgent","onOpenCloneAgentSettings","agentToClone","CLONE","name","loadChats","getConversations","updateChats","setupChatListPanel","ChatsListModel","finally","getAgents","updateAgents","updateCanModifyAgent","setCanModifyAgent","isRepoManager","updateChatAnswers","selectedChat","chatItem","chatAnswer","timestamp","answers","messages","updateSelectedChat","continueRunId","CONTINUE_CHAT_RUN","ContinueChatRun","updateChatTimestamp","updateChatName","chatName","LAST_MESSAGE_RECEIVED","isEmpty","getChatId","selectChat","getFirstChat","chat","exportConversation","data","filename","saveAs","CHAT_EXPORT_SUCCESSFUL","CHAT_EXPORT_FAILURE","buildAgentsFilterModel","currentRepository","getActiveRepository","repositoryObjects","getLocalReadableGraphdbRepositories","map","repo","AgentListFilterModel","AGENTS_FILTER_ALL_KEY","goToView","confirmMessageLabelKey","viewURL","repository","getRepository","openConfirmationModal","title","message","decodeHTML","confirmButtonKey","setRepository","openView","openInSparqlEditorInNewTab","query","encodeURIComponent","setCurrentChat","chatId","getChat","$watch","activeRepo","authService","service","AuthenticationService","hasGqlRights","SelectMenuOptionsModel","value","label","loadAgents","showLoader","onSelectedChatChanged","isNew","getConversation","saveChat","status","httpStatus","NOT_FOUND","openModalAlert","deleteChat","notifyForMissingChat","LOAD_CHAT_FAILURE","onChatsListChanged","subscribe","onAgentsListChanged","CREATE_CHAT","createChat","conversationId","newChat","ChatModel","getNewChat","ASK_QUESTION","CREATE_CHAT_FAILURE","RENAME_CHAT","renameConversation","RENAME_CHAT_SUCCESSFUL","LOAD_CHATS","RENAME_CHAT_FAILURE","DELETE_CHAT","DELETING_CHAT","inProgress","deleteConversation","DELETE_CHAT_SUCCESSFUL","DELETE_CHAT_FAILURE","CANCEL_PENDING_QUESTION","selectedChatId","cancelPendingQuestion","answer","PENDING_QUESTION_CANCELED_SUCCESSFUL","CANCEL_PENDING_QUESTION_FAILURE","CHAT_EXPORT","ASK_QUESTION_STARTING","askQuestion","new","setChatAsOld","updateChatAnswersFirstResponse","cancelingResponse","currentSelectedChat","ChatMessageModel","runStatus","isTerminalState","tokenUsageInfo","addToChatAnswer","chatHistory","appendItem","ASK_QUESTION_FAILURE","continueData","continueChatRun","items","lastItem","EDIT_AGENT","CLONE_AGENT","DELETE_AGENT","DELETING_AGENT","agentId","deleteAgent","AGENT_DELETED","AGENT_SELECTED","GO_TO_CREATE_SIMILARITY_VIEW","payload","GO_TO_AUTOCOMPLETE_INDEX_VIEW","GO_TO_CONNECTORS_VIEW","GO_TO_SPARQL_EDITOR","openConfirmation","updateLabels","resetContext","ChatPanelComponent","askingChatItem","waitingForLastMessage","showCancelButton","ask","question","Date","now","cloneDeep","createNewChat","getEmptyChatItem","scrollToBottom","focusQuestionInput","regenerateQuestion","regenerateChatItem","setQuestionMessage","getQuestionMessage","onKeypressOnInput","$event","key","shiftKey","ctrlKey","onAskHowDeliveredAnswer","askHowDerivedAnswerChatItem","getAgentName","getAgent","setAskingState","isAsking","onQuestionFailure","ChatItemModel","role","CHAT_MESSAGE_ROLE","USER","setTimeout","inputElement","querySelector","focus","chatDetailsElement","scrollTop","scrollHeight","reset","$watchCollection","onSelectedChatUpdated","lastChatItem","getLast","onLastMessageReceived","onSelectedAgentChanged","onLoadChatFailure","deletedChat","onAskQuestionStarted","AgentListComponent","ExternalIntegrationModalService","agentList","selectedAgentsFilter","deletingAgent","onEditAgent","onExternalIntegration","onCloneAgent","onDeleteAgent","confirmDeleteMessage","agentName","onAgentsFilterChange","selectedFilter","filterByRepository","updateSelectedAgentsFilter","filter","selected","InlineEditableText","fieldName","source","onSave","onCancel","onClick","onDblclick","isEditing","editableModel","clickTimeout","onKeydown","cancelClickTimeout","newText","cancelEditing","onCancelEditing","onSelect","cancel","newVal","select","constructor","operation","this","AgentSelectMenuComponent","$sce","agentOptionsList","onAgentSelected","isCompatible","stopPropagation","markAsSelected","saveAgent","isRepositoryDeleted","confirmMessage","agentOption","agentsListModel","selectLastUsedOrDefaultAgent","storedAgentId","getAgentId","deletedAgent","isDeleted","ChatListComponent","$filter","renamedChat","deletingChat","onSelectChatForRenaming","onSelectChat","nonPersistedChat","getNonPersistedChat","onDeleteChat","onRenameChat","newName","onCancelChatRenaming","getHumanReadableChatGroupTimestamp","getHumanReadableTimestamp","chatList","innerTextElement","scrollWidth","clientWidth","attr","removeAttr","view","navigator","test","userAgent","doc","get_URL","URL","webkitURL","save_link","createElementNS","webkit_req_fs","webkitRequestFileSystem","req_fs","requestFileSystem","mozRequestFileSystem","throw_outside","ex","setImmediate","force_saveable_type","fs_min_size","revoke","file","revoker","revokeObjectURL","remove","chrome","dispatch","filesaver","event_types","i","concat","listener","call","auto_bom","blob","type","Blob","FileSaver","object_url","target_view","slice","blob_changed","dispatch_all","fs_error","createObjectURL","location","href","safari","readyState","DONE","abortable","func","apply","arguments","create_if_not_found","create","exclusive","INIT","download","node","MouseEvent","dispatchEvent","webkitSlice","TEMPORARY","fs","root","getDirectory","dir","save","getFile","createWriter","writer","onwriteend","toURL","onerror","code","ABORT_ERR","write","abort","WRITING","NOT_FOUND_ERR","FS_proto","prototype","msSaveOrOpenBlob","onwritestart","onprogress","onwrite","onabort","self","content","exports","define","helpInfo","isPopoverOpen","mouseEnterHandler","mouseLeaveHandler","BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","CONFLICT","INTERNAL_SERVER_ERROR","SERVICE_UNAVAILABLE","localStorageAdapter","LSKeys","defaultSettings","getTtygSettings","settings","get","TTYG","set","factory"],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export const __webpack_id__=19402;export const __webpack_ids__=[19402,36633,63415];export const __webpack_modules__={19402:(t,s,e)=>{e.r(s),e.d(s,{ChatByDayModel:()=>n,ChatModel:()=>h,ChatsListModel:()=>r});var a=e(63415),i=e(93135);class h{static getNewChat(){const t={name:"· · ·",timestamp:Math.floor(Date.now()/1e3),new:!0};return new h(t,(0,i.md5HashGenerator)())}constructor(t,s){this.hashGenerator=s,this._id=t.id,this._name=t.name,this._timestamp=t.timestamp,this._chatHistory=t.chatHistory||new a.ChatItemsListModel,this._new=void 0!==t.new&&t.new,this.hash=this.generateHash()}isNew(){return this._new}set new(t){this._new=t}generateHash(){return this.hashGenerator(JSON.stringify(this))}get id(){return this._id}set id(t){this._id=t}get name(){return this._name}set name(t){this.generateHash(),this._name=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}get chatHistory(){return this._chatHistory}set chatHistory(t){this._chatHistory=t||new a.ChatItemsListModel}toRenameRequestPayload(){return{name:this._name}}}class n{constructor(t){this._day=t.day,this._timestamp=t.timestamp,this._chats=t.chats}get day(){return this._day}set day(t){this._day=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}get chats(){return this._chats}set chats(t){this._chats=t}}class r{constructor(t){this._chats=t||[],this._chatsByDay=[],this.sortByTime(),this.updateChatsByDay()}containsNewChats(){return this._chats.some(t=>t.isNew())}sortByTime(){this._chats.sort((t,s)=>s.timestamp-t.timestamp)}updateChatTimestamp(t,s){const e=this._chats.find(s=>s.id===t);e&&(e.timestamp=s,this.sortByTime(),this.updateChatsByDay())}setChatAsOld(t){const s=this._chats.find(s=>s.id===t);s&&(s.new=!1)}updateChatName(t,s){const e=this._chats.find(s=>s.id===t);e&&(e.name=s)}deleteChat(t){this._chats=this._chats.filter(s=>s.id!==t.id),this.sortByTime(),this.updateChatsByDay()}updateChatsByDay(){this._chatsByDay=[],this._chats.forEach(t=>{const s=new Date(1e3*t.timestamp).toDateString(),e=this._chatsByDay.find(t=>t.day===s);e?e.chats.push(t):this._chatsByDay.push(new n({day:s,timestamp:1e3*t.timestamp,chats:[t]}))})}appendChat(t){this._chats.push(t),this.sortByTime(),this.updateChatsByDay()}replaceChat(t,s){this._chats=this._chats.map(e=>e.id===s.id?t:e),this.sortByTime(),this.updateChatsByDay()}isEmpty(){return 0===this._chats.length}getFirstChat(){return this._chats[0]}deselectAll(){this._chats.forEach(t=>{t.selected=!1})}selectChat(t){this.deselectAll(),this._chats.forEach(s=>{s.selected=s.id===t.id})}getChat(t){return this._chats.find(s=>s.id===t)}getNonPersistedChat(){return this._chats.find(t=>!t.id)}renameChat(t){const s=this._chats.find(s=>s.id===t.id);s&&(s.name=t.name)}get chats(){return this._chats}set chats(t){this._chats=t}get chatsByDay(){return this._chatsByDay}set chatsByDay(t){this._chatsByDay=t}}},36633:(t,s,e)=>{e.r(s),e.d(s,{CHAT_MESSAGE_ROLE:()=>i,ChatMessageModel:()=>a});class a{constructor(t){this._id=t.id,this._role=t.role,this._message=t.message,this._timestamp=1e3*t.timestamp,this.tokenUsageInfo=t.tokenUsageInfo,this._isTerminalState=t.isTerminalState,this._status=t.status}addToChatAnswer(t){t.messages=[this]}get id(){return this._id}set id(t){this._id=t}get role(){return this._role}set role(t){this._role=t}get message(){return this._message}set message(t){this._message=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}get isTerminalState(){return this._isTerminalState}set isTerminalState(t){this._isTerminalState=t}get status(){return this._status}set status(t){this._status=t}}const i={USER:"user",ASSISTANT:"assistant"}},63415:(t,s,e)=>{e.r(s),e.d(s,{ChatItemModel:()=>i,ChatItemsListModel:()=>h});var a=e(36633);class i{constructor(t,s){this._chatId=t,this._agentId=void 0,this._question=s,this._answers=[]}get chatId(){return this._chatId}set chatId(t){this._chatId=t}get agentId(){return this._agentId}set agentId(t){this._agentId=t}get question(){return this._question}set question(t){this._question=t}get answers(){return this._answers}set answers(t){this._answers=t}setQuestionMessage(t){this._question||(this._question=new a.ChatMessageModel({role:a.CHAT_MESSAGE_ROLE.USER})),this._question.message=t}getQuestionMessage(){return this._question.message}toCreateChatRequestPayload(){return{agentId:this._agentId,question:this._question.message}}toAskRequestPayload(){return{conversationId:this._chatId,agentId:this._agentId,question:this._question.message,tzOffset:-(new Date).getTimezoneOffset()}}toExplainResponsePayload(t){return{conversationId:this._chatId,answerId:t}}}class h{constructor(t=[]){this._items=t}isEmpty(){return 0===this._items.length}appendItem(t){this._items.push(t)}get items(){return this._items}set items(t){this._items=t||[]}getLast(){if(!this.isEmpty())return this._items[this._items.length-1]}}}};
|
|
2
|
-
//# sourceMappingURL=19402.7f6ea977348338acc824.bundle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"19402.7f6ea977348338acc824.bundle.js","mappings":"yOAGO,MAAMA,EACT,iBAAOC,GACH,MAAMC,EAAO,CACTC,KAAM,QACNC,UAAWC,KAAKC,MAAMC,KAAKC,MAAQ,KACnCC,KAAK,GAET,OAAO,IAAIT,EAAUE,GAAMQ,EAAAA,EAAAA,oBAC/B,CAEAC,WAAAA,CAAYT,EAAMU,GACdC,KAAKD,cAAgBA,EAKrBC,KAAKC,IAAMZ,EAAKa,GAKhBF,KAAKG,MAAQd,EAAKC,KAKlBU,KAAKI,WAAaf,EAAKE,UAKvBS,KAAKK,aAAehB,EAAKiB,aAAe,IAAIC,EAAAA,mBAC5CP,KAAKQ,UAAoBC,IAAbpB,EAAKO,KAAoBP,EAAKO,IAC1CI,KAAKU,KAAOV,KAAKW,cACrB,CAEAC,KAAAA,GACI,OAAOZ,KAAKQ,IAChB,CAEA,OAAIZ,CAAIiB,GACJb,KAAKQ,KAAOK,CAChB,CAEAF,YAAAA,GACI,OAAOX,KAAKD,cAAce,KAAKC,UAAUf,MAC7C,CAEA,MAAIE,GACA,OAAOF,KAAKC,GAChB,CAEA,MAAIC,CAAGW,GACHb,KAAKC,IAAMY,CACf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ByB,WAAW,IAAIjG,MAAOkG,oBAE9B,CAEAC,wBAAAA,CAAyBC,GACrB,MAAO,CACHJ,eAAgB1F,KAAKgF,QACrBc,WAER,EAGG,MAAMvF,EAKTT,WAAAA,CAAYiG,EAAQ,IAChB/F,KAAKgG,OAASD,CAClB,CAEA5C,OAAAA,GACI,OAA8B,IAAvBnD,KAAKgG,OAAO5C,MACvB,CAKA6C,UAAAA,CAAWC,GACPlG,KAAKgG,OAAOnD,KAAKqD,EACrB,CAEA,SAAIH,GACA,OAAO/F,KAAKgG,MAChB,CAEA,SAAID,CAAMlF,GACNb,KAAKgG,OAASnF,GAAS,EAC3B,CAEAsF,OAAAA,GACI,IAAKnG,KAAKmD,UACN,OAAOnD,KAAKgG,OAAOhG,KAAKgG,OAAO5C,OAAS,EAEhD,E","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/chats.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/chat-message.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ttyg/chat-item.js"],"sourcesContent":["import {ChatItemsListModel} from \"./chat-item\";\nimport {md5HashGenerator} from \"../../utils/hash-utils\";\n\nexport class ChatModel {\n static getNewChat() {\n const data = {\n name: \"\\u00B7 \\u00B7 \\u00B7\",\n timestamp: Math.floor(Date.now() / 1000),\n new: true\n };\n return new ChatModel(data, md5HashGenerator());\n }\n\n constructor(data, hashGenerator) {\n this.hashGenerator = hashGenerator;\n\n /**\n * @type {string}\n */\n this._id = data.id;\n\n /**\n * @type {string}\n */\n this._name = data.name;\n\n /**\n * @type {number}\n */\n this._timestamp = data.timestamp;\n\n /**\n * @type {ChatItemsListModel}\n */\n this._chatHistory = data.chatHistory || new ChatItemsListModel();\n this._new = data.new !== undefined ? data.new : false;\n this.hash = this.generateHash();\n }\n\n isNew() {\n return this._new;\n }\n\n set new(value) {\n this._new = value;\n }\n\n generateHash() {\n return this.hashGenerator(JSON.stringify(this));\n }\n\n get id() {\n return this._id;\n }\n\n set id(value) {\n this._id = value;\n }\n\n get name() {\n return this._name;\n }\n\n set name(value) {\n this.generateHash();\n this._name = value;\n }\n\n get timestamp() {\n return this._timestamp;\n }\n\n set timestamp(value) {\n this._timestamp = value;\n }\n\n get chatHistory() {\n return this._chatHistory;\n }\n\n set chatHistory(value) {\n this._chatHistory = value || new ChatItemsListModel();\n }\n\n /**\n * Converts the instance to a rename chat request payload.\n * This request object contains the new name for renaming the chat.\n *\n * @return {{name: string}} An object representing the rename request payload.\n */\n toRenameRequestPayload() {\n return {name: this._name};\n }\n}\n\nexport class ChatByDayModel {\n constructor(data) {\n this._day = data.day;\n /**\n * @type {number}\n * @private\n */\n this._timestamp = data.timestamp;\n /**\n * @type {ChatModel[]|*}\n * @private\n */\n this._chats = data.chats;\n }\n\n get day() {\n return this._day;\n }\n\n set day(value) {\n this._day = value;\n }\n\n get timestamp() {\n return this._timestamp;\n }\n\n set timestamp(value) {\n this._timestamp = value;\n }\n\n get chats() {\n return this._chats;\n }\n\n set chats(value) {\n this._chats = value;\n }\n}\n\nexport class ChatsListModel {\n constructor(chats) {\n /**\n * @type {ChatModel[]}\n * @private\n */\n this._chats = chats || [];\n /**\n * @type {ChatByDayModel[]}\n * @private\n */\n this._chatsByDay = [];\n this.sortByTime();\n this.updateChatsByDay();\n }\n\n /**\n * Checks if there is at least one new chat.\n *\n * @returns {boolean} True if any chat is marked as new, otherwise false.\n */\n containsNewChats() {\n return this._chats.some((chat) => chat.isNew());\n }\n\n /**\n * Sorts the list of chats by timestamp in descending order, with the newest items on top.\n */\n sortByTime() {\n this._chats.sort((a, b) => {\n return b.timestamp - a.timestamp;\n });\n }\n\n /**\n * Updates the timestamp of a chat in the list.\n * @param {string} chatId\n * @param {number} timestamp\n */\n updateChatTimestamp(chatId, timestamp) {\n const chat = this._chats.find((c) => c.id === chatId);\n if (chat) {\n chat.timestamp = timestamp;\n this.sortByTime();\n this.updateChatsByDay();\n }\n }\n\n /**\n * Marks the specified chat as no longer new.\n *\n * @param {string} chatId - The ID of the chat to update.\n */\n setChatAsOld(chatId) {\n const chat = this._chats.find((chat) => chat.id === chatId);\n if (chat) {\n chat.new = false;\n }\n }\n\n /**\n * Updates the name of a chat in the list.\n * @param {string} chatId\n * @param {string} name\n */\n updateChatName(chatId, name) {\n const chat = this._chats.find((c) => c.id === chatId);\n if (chat) {\n chat.name = name;\n }\n }\n\n /**\n * Deletes a chat from the chat list.\n * @param {ChatModel} chatToBeDeleted\n */\n deleteChat(chatToBeDeleted) {\n this._chats = this._chats.filter((chat) => chat.id !== chatToBeDeleted.id);\n this.sortByTime();\n this.updateChatsByDay();\n }\n\n updateChatsByDay() {\n this._chatsByDay = [];\n // group chats by day\n this._chats.forEach((chat) => {\n const day = new Date(chat.timestamp * 1000).toDateString();\n const dayModel = this._chatsByDay.find((d) => d.day === day);\n if (dayModel) {\n dayModel.chats.push(chat);\n } else {\n this._chatsByDay.push(new ChatByDayModel({day: day, timestamp: chat.timestamp * 1000, chats: [chat]}));\n }\n });\n }\n\n appendChat(chat) {\n this._chats.push(chat);\n this.sortByTime();\n this.updateChatsByDay();\n }\n\n replaceChat(newChat, oldChat) {\n this._chats = this._chats.map((chat) => {\n if (chat.id === oldChat.id) {\n return newChat;\n }\n return chat;\n });\n this.sortByTime();\n this.updateChatsByDay();\n }\n\n /**\n * Checks if the chat list is empty.\n * @return {boolean}\n */\n isEmpty() {\n return this._chats.length === 0;\n }\n\n /**\n * Returns the first chat from the list.\n * @return {ChatModel|undefined}\n */\n getFirstChat() {\n return this._chats[0];\n }\n\n /**\n * Deselects all chats.\n */\n deselectAll() {\n this._chats.forEach((c) => {\n c.selected = false;\n });\n }\n\n /**\n * Selects a chat.\n * @param {ChatModel} chat\n */\n selectChat(chat) {\n this.deselectAll();\n this._chats.forEach((c) => {\n c.selected = c.id === chat.id;\n });\n }\n\n getChat(id) {\n return this._chats.find((c) => c.id === id);\n }\n\n getNonPersistedChat() {\n return this._chats.find((chat) => !chat.id);\n }\n\n renameChat(renamedChat) {\n const chat = this._chats.find((c) => c.id === renamedChat.id);\n if (chat) {\n chat.name = renamedChat.name;\n }\n }\n\n /**\n * @return {ChatModel[]}\n */\n get chats() {\n return this._chats;\n }\n\n /**\n * @param {ChatModel[]} value\n */\n set chats(value) {\n this._chats = value;\n }\n\n get chatsByDay() {\n return this._chatsByDay;\n }\n\n set chatsByDay(value) {\n this._chatsByDay = value;\n }\n}\n","export class ChatMessageModel {\n constructor(data) {\n\n /**\n * @type {string}\n */\n this._id = data.id;\n\n /**\n * @type @type {string} - A value from {@link CHAT_MESSAGE_ROLE}, determining the owner of the message (e.g., user, assistant).\n */\n this._role = data.role;\n\n /**\n * @type {string}\n */\n this._message = data.message;\n\n /**\n * @type {number}\n */\n this._timestamp = data.timestamp * 1000;\n\n /**\n * Holds information about the number of tokens used for this answer, including prompt and completion tokens.\n * It is applicable only to the assistant role ({@link CHAT_MESSAGE_ROLE#ASSISTANT}).\n *\n * @type {TokenUsageInfo}\n */\n this.tokenUsageInfo = data.tokenUsageInfo;\n\n /**\n * If the message was terminated via the Abort button\n * @type {boolean}\n */\n this._isTerminalState = data.isTerminalState;\n\n /**\n * Reason for cancellation.\n * @private {string}\n */\n this._status = data.status\n }\n\n /**\n * Updates the chatAnswer.messages array with this message instance.\n * @param {ChatAnswerModel} chatAnswer - The answer object containing the messages.\n */\n addToChatAnswer(chatAnswer) {\n chatAnswer.messages = [this];\n }\n\n get id() {\n return this._id;\n }\n\n set id(value) {\n this._id = value;\n }\n\n get role() {\n return this._role;\n }\n\n set role(value) {\n this._role = value;\n }\n\n get message() {\n return this._message;\n }\n\n set message(value) {\n this._message = value;\n }\n\n get timestamp() {\n return this._timestamp;\n }\n\n set timestamp(value) {\n this._timestamp = value;\n }\n\n get isTerminalState() {\n return this._isTerminalState;\n }\n\n set isTerminalState(value) {\n this._isTerminalState = value;\n }\n\n get status() {\n return this._status;\n }\n\n set status(value) {\n this._status = value;\n }\n}\n\nexport const CHAT_MESSAGE_ROLE = {\n USER: 'user',\n ASSISTANT: 'assistant'\n};\n","import {CHAT_MESSAGE_ROLE, ChatMessageModel} from \"./chat-message\";\n\n/**\n *\n * Represents a model that holds a question and the answer of it in a chat.\n *\n */\nexport class ChatItemModel {\n\n /**\n * Creates an instance of ChatItemModel.\n *\n * @param {string} chatId - The unique identifier for the chat associated with this instance.\n * @param {ChatMessageModel} question - The message object representing the question.\n */\n constructor(chatId, question) {\n\n /**\n * @type {string | undefined}\n * @private\n */\n this._chatId = chatId;\n\n /**\n * @type {string | undefined}\n * @private\n */\n this._agentId = undefined;\n\n /**\n * @type {ChatMessageModel}\n * @private\n */\n this._question = question;\n\n /**\n *\n * @type {ChatMessageModel[] | undefined}\n * @private\n */\n this._answers = [];\n }\n\n get chatId() {\n return this._chatId;\n }\n\n set chatId(value) {\n this._chatId = value;\n }\n\n get agentId() {\n return this._agentId;\n }\n\n set agentId(value) {\n this._agentId = value;\n }\n\n get question() {\n return this._question;\n }\n\n set question(value) {\n this._question = value;\n }\n\n get answers() {\n return this._answers;\n }\n\n /**\n *\n * @param {ChatMessageModel[]} value\n */\n set answers(value) {\n this._answers = value;\n }\n\n /**\n * Sets the message for the user's question.\n *\n * @param {string} message - The message content for the user's question.\n */\n setQuestionMessage(message) {\n if (!this._question) {\n this._question = new ChatMessageModel({role: CHAT_MESSAGE_ROLE.USER});\n }\n this._question.message = message;\n }\n\n /**\n * Retrieves the message of the user's question.\n *\n * @return {string} - The message content of the user's question.\n */\n getQuestionMessage() {\n return this._question.message;\n }\n\n /**\n * Converts the instance to a create chat request payload.\n *\n * @return {{agentId: string, question: string}} An object representing the create request payload.\n */\n toCreateChatRequestPayload() {\n return {\n agentId: this._agentId,\n question: this._question.message\n };\n }\n\n /**\n * Converts the instance to an ask request payload.\n *\n * @return {{conversationId: string, agentId: string, question: string}} An object representing the ask request payload.\n */\n toAskRequestPayload() {\n return {\n conversationId: this._chatId,\n agentId: this._agentId,\n question: this._question.message,\n tzOffset: -new Date().getTimezoneOffset() // offsets are reversed here hence the minus\n };\n }\n\n toExplainResponsePayload(answerId) {\n return {\n conversationId: this._chatId,\n answerId\n };\n }\n}\n\nexport class ChatItemsListModel {\n\n /**\n * @param {ChatItemModel[]} items\n */\n constructor(items = []) {\n this._items = items;\n }\n\n isEmpty() {\n return this._items.length === 0;\n }\n\n /**\n * @param {ChatItemModel} chatItem\n */\n appendItem(chatItem) {\n this._items.push(chatItem);\n }\n\n get items() {\n return this._items;\n }\n\n set items(value) {\n this._items = value || [];\n }\n\n getLast() {\n if (!this.isEmpty()) {\n return this._items[this._items.length - 1];\n }\n }\n}\n"],"names":["ChatModel","getNewChat","data","name","timestamp","Math","floor","Date","now","new","md5HashGenerator","constructor","hashGenerator","this","_id","id","_name","_timestamp","_chatHistory","chatHistory","ChatItemsListModel","_new","undefined","hash","generateHash","isNew","value","JSON","stringify","toRenameRequestPayload","ChatByDayModel","_day","day","_chats","chats","ChatsListModel","_chatsByDay","sortByTime","updateChatsByDay","containsNewChats","some","chat","sort","a","b","updateChatTimestamp","chatId","find","c","setChatAsOld","updateChatName","deleteChat","chatToBeDeleted","filter","forEach","toDateString","dayModel","d","push","appendChat","replaceChat","newChat","oldChat","map","isEmpty","length","getFirstChat","deselectAll","selected","selectChat","getChat","getNonPersistedChat","renameChat","renamedChat","chatsByDay","ChatMessageModel","_role","role","_message","message","tokenUsageInfo","_isTerminalState","isTerminalState","_status","status","addToChatAnswer","chatAnswer","messages","CHAT_MESSAGE_ROLE","USER","ASSISTANT","ChatItemModel","question","_chatId","_agentId","_question","_answers","agentId","answers","setQuestionMessage","getQuestionMessage","toCreateChatRequestPayload","toAskRequestPayload","conversationId","tzOffset","getTimezoneOffset","toExplainResponsePayload","answerId","items","_items","appendItem","chatItem","getLast"],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export const __webpack_id__=36665;export const __webpack_ids__=[14702,36665,45458,51490,64871,87252,89358,92561,96089];export const __webpack_modules__={14702:(t,e,s)=>{s.r(e),s.d(e,{agentInstructionsExplainMapper:()=>n});var a=s(89358);const n=t=>t?t.map(t=>new a.AgentInstructionsExplain(t)):new a.AgentInstructionsExplainList([])},19402:(t,e,s)=>{s.r(e),s.d(e,{ChatByDayModel:()=>r,ChatModel:()=>i,ChatsListModel:()=>o});var a=s(63415),n=s(93135);class i{static getNewChat(){const t={name:"· · ·",timestamp:Math.floor(Date.now()/1e3),new:!0};return new i(t,(0,n.md5HashGenerator)())}constructor(t,e){this.hashGenerator=e,this._id=t.id,this._name=t.name,this._timestamp=t.timestamp,this._chatHistory=t.chatHistory||new a.ChatItemsListModel,this._new=void 0!==t.new&&t.new,this.hash=this.generateHash()}isNew(){return this._new}set new(t){this._new=t}generateHash(){return this.hashGenerator(JSON.stringify(this))}get id(){return this._id}set id(t){this._id=t}get name(){return this._name}set name(t){this.generateHash(),this._name=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}get chatHistory(){return this._chatHistory}set chatHistory(t){this._chatHistory=t||new a.ChatItemsListModel}toRenameRequestPayload(){return{name:this._name}}}class r{constructor(t){this._day=t.day,this._timestamp=t.timestamp,this._chats=t.chats}get day(){return this._day}set day(t){this._day=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}get chats(){return this._chats}set chats(t){this._chats=t}}class o{constructor(t){this._chats=t||[],this._chatsByDay=[],this.sortByTime(),this.updateChatsByDay()}containsNewChats(){return this._chats.some(t=>t.isNew())}sortByTime(){this._chats.sort((t,e)=>e.timestamp-t.timestamp)}updateChatTimestamp(t,e){const s=this._chats.find(e=>e.id===t);s&&(s.timestamp=e,this.sortByTime(),this.updateChatsByDay())}setChatAsOld(t){const e=this._chats.find(e=>e.id===t);e&&(e.new=!1)}updateChatName(t,e){const s=this._chats.find(e=>e.id===t);s&&(s.name=e)}deleteChat(t){this._chats=this._chats.filter(e=>e.id!==t.id),this.sortByTime(),this.updateChatsByDay()}updateChatsByDay(){this._chatsByDay=[],this._chats.forEach(t=>{const e=new Date(1e3*t.timestamp).toDateString(),s=this._chatsByDay.find(t=>t.day===e);s?s.chats.push(t):this._chatsByDay.push(new r({day:e,timestamp:1e3*t.timestamp,chats:[t]}))})}appendChat(t){this._chats.push(t),this.sortByTime(),this.updateChatsByDay()}replaceChat(t,e){this._chats=this._chats.map(s=>s.id===e.id?t:s),this.sortByTime(),this.updateChatsByDay()}isEmpty(){return 0===this._chats.length}getFirstChat(){return this._chats[0]}deselectAll(){this._chats.forEach(t=>{t.selected=!1})}selectChat(t){this.deselectAll(),this._chats.forEach(e=>{e.selected=e.id===t.id})}getChat(t){return this._chats.find(e=>e.id===t)}getNonPersistedChat(){return this._chats.find(t=>!t.id)}renameChat(t){const e=this._chats.find(e=>e.id===t.id);e&&(e.name=t.name)}get chats(){return this._chats}set chats(t){this._chats=t}get chatsByDay(){return this._chatsByDay}set chatsByDay(t){this._chatsByDay=t}}},36665:(t,e,s)=>{s.r(e);var a=s(85609),n=(s(96089),s(85788)),i=s(51490),r=s(92561),o=s(14702);function h(t,e){return{createChat:e=>t.createChat(e.toAskRequestPayload()).then(t=>t.data.conversationId),getConversation:e=>t.getConversation(e).then(t=>(0,a.chatModelMapper)(t.data)),renameConversation:e=>t.renameConversation(e.id,e.toRenameRequestPayload()).then(t=>(0,a.chatModelMapper)(t.data)),exportConversation:e=>t.exportConversation(e).then(function(t){const e=t.data,s=t.headers()["content-disposition"];let a="chat-export";return s&&(a=s.split("filename=")[1],a=a.substring(0,a.length)),{data:e,filename:a}}),askQuestion:e=>t.askQuestion(e.toAskRequestPayload()).then(t=>(0,n.chatAnswerModelMapper)(t.data)),continueChatRun:e=>{const s=e.toContinueRunRequestPayload();return t.continueChatRun(s).then(t=>(0,n.chatAnswerModelMapper)(t.data))},getConversations:(e,s)=>t.getConversations().then(t=>(0,a.chatsListMapper)(t.data)),deleteConversation:e=>t.deleteConversation(e),createConversation:e=>t.createConversation(e.toCreateChatRequestPayload()).then(t=>(0,n.chatAnswerModelMapper)(t.data)),cancelPendingQuestion:e=>t.cancelPendingQuestion(e),getAgents:()=>{const s=e.getLocalReadablGraphdbRepositoryIds();return t.getAgents().then(t=>(0,i.agentListMapper)(t.data,s))},getAgent:s=>{const a=e.getLocalReadablGraphdbRepositoryIds();return t.getAgent(s).then(t=>(0,i.agentModelMapper)(t.data,a))},createAgent:s=>{const a=e.getLocalReadablGraphdbRepositoryIds();return t.createAgent(s).then(t=>(0,i.agentModelMapper)(t.data,a))},editAgent:s=>{const a=e.getLocalReadablGraphdbRepositoryIds();return t.editAgent(s).then(t=>(0,i.agentModelMapper)(t.data,a))},deleteAgent:e=>t.deleteAgent(e),explainResponse:(e,s)=>t.explainResponse(e.toExplainResponsePayload(s)).then(t=>(0,r.explainResponseMapper)(t.data)),getDefaultAgent:()=>{const s=e.getLocalReadablGraphdbRepositoryIds();return t.getAgentDefaultValues().then(t=>(0,i.agentModelMapper)(t.data,s))},explainAgentSettings:e=>t.explainAgentSettings(e).then(t=>(0,o.agentInstructionsExplainMapper)(t.data))}}angular.module("graphdb.framework.core.services.ttyg-service",["graphdb.framework.rest.ttyg.service"]).factory("TTYGService",h),h.$inject=["TTYGRestService","$repositories"]},45458:(t,e,s)=>{s.r(e),s.d(e,{ChatAnswerModel:()=>a,ContinueChatRun:()=>n});class a{constructor(t={}){this._chatId=t.chatId,this._chatName=t.chatName||"",this._timestamp=t.timestamp,this._messages=t.messages||[],this._continueRunId=t.continueRunId,this.tokenUsageInfo=t.tokenUsageInfo}get chatId(){return this._chatId}set chatId(t){this._chatId=t}get chatName(){return this._chatName}set chatName(t){this._chatName=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}get messages(){return this._messages}set messages(t){this._messages=t}get continueRunId(){return this._continueRunId}set continueRunId(t){this._continueRunId=t}}class n{constructor(t,e){this._chatItem=t,this._runId=e}get chatId(){return this._chatItem.chatId}toContinueRunRequestPayload(){return{conversationId:this.chatId,runId:this._runId,agentId:this._chatItem.agentId,tzOffset:-(new Date).getTimezoneOffset()}}}},51490:(t,e,s)=>{s.r(e),s.d(e,{agentFormModelMapper:()=>h,agentListMapper:()=>u,agentModelMapper:()=>l});var a=s(28319),n=s(23283),i=s(38940),r=s(93135),o=s(70826);const h=(t,e,s)=>{if(!t)return;const i=new n.AgentFormModel;return i.id=t.id||e.id,i.name=t.name||e.name,i.repositoryId=t.repositoryId||e.repositoryId,i.model=t.model||e.model,i.contextSize=t.contextSize||e.contextSize,i.contextSizeCopy=e.contextSize,i.temperature.value=void 0!==t.temperature?t.temperature:e.temperature,i.topP.value=void 0!==t.topP?t.topP:e.topP,i.seed=t.seed||e.seed,i.instructions=d(t.instructions,e.instructions),c(i,s,e.assistantExtractionMethods,t.assistantExtractionMethods),function(t,e,s){if(!t)return;const i=t.map(s=>{let i={method:s.method||e.method,expanded:s.expanded||e.expanded};return s.method!==a.AdditionalExtractionMethod.IRI_DISCOVERY_SEARCH&&s.method!==a.AdditionalExtractionMethod.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH||(i.selected=t.some(t=>t.method===s.method)),s.method===a.AdditionalExtractionMethod.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH&&(i.maxNumberOfResultsPerCall=s._maxNumberOfResultsPerCall||e.maxNumberOfResultsPerCall),new n.AdditionalExtractionMethodFormModel(i)});s.additionalExtractionMethods.setAdditionalExtractionMethod(i)}(t.additionalExtractionMethods,e.additionalExtractionMethods,i),i},d=(t,e)=>{if(!t&&!e)return;const s=t&&t.systemInstruction||e.systemInstruction,a=t&&t.userInstruction||e.userInstruction;return new n.AgentInstructionsFormModel({systemInstruction:s,userInstruction:a,defaultSystemInstruction:e.systemInstruction,defaultUserInstruction:e.userInstruction})},c=(t,e,s,a=[])=>{const r=s.filter(t=>!a.some(e=>e.method===t.method)),h=s.find(t=>"sparql_search"===t.method);[...a,...r].forEach(s=>{const r=a.some(t=>t.method===s.method);let d="";r&&"sparql_search"===s.method&&(o.AGENT_OPERATION.CREATE===e?d="":s.sparqlQuery?d="sparqlQuery":s.ontologyGraph&&(d="ontologyGraph"));const c=e===o.AGENT_OPERATION.EDIT||e===o.AGENT_OPERATION.CLONE,u=new n.ExtractionMethodFormModel({selected:c&&r,method:s.method,sparqlOption:d,ontologyGraph:s.ontologyGraph||h.ontologyGraph,addMissingNamespaces:s.addMissingNamespaces,sparqlQuery:new i.TextFieldModel({value:s.sparqlQuery||h.sparqlQuery,minLength:1,maxLength:2380}),similarityIndex:s.similarityIndex,similarityIndexThreshold:s.similarityIndexThreshold&&new i.NumericRangeModel({value:s.similarityIndexThreshold,minValue:0,maxValue:1,step:.1}),maxNumberOfTriplesPerCall:0===s.maxNumberOfTriplesPerCall?null:s.maxNumberOfTriplesPerCall,queryTemplate:s.queryTemplate&&new i.TextFieldModel({value:s.queryTemplate,minLength:1,maxLength:2380}),retrievalConnectorInstance:s.retrievalConnectorInstance});t.assistantExtractionMethods.setExtractionMethod(u)})},u=(t,e)=>{if(!t)return new a.AgentListModel;const s=t.map(t=>l(t,e));return new a.AgentListModel(s)},l=(t,e)=>{if(!t)return;const s=(0,r.md5HashGenerator)();return new a.AgentModel({id:t.id,name:t.name,repositoryId:t.repositoryId,isRepositoryDeleted:!e.includes(t.repositoryId),model:t.model,contextSize:"openai-assistants"===t.api?null:t.contextSize,temperature:t.temperature,topP:t.topP,seed:t.seed,instructions:y(t.instructions),assistantExtractionMethods:m(t.assistantExtractionMethods),additionalExtractionMethods:g(t.additionalExtractionMethods),compatibility:t.compatibility},s)},m=t=>{if(t)return t.map(t=>p(t))},p=t=>{if(t)return new a.ExtractionMethodModel({method:t.method,ontologyGraph:t.ontologyGraph,addMissingNamespaces:t.addMissingNamespaces,sparqlQuery:t.sparqlQuery,similarityIndex:t.similarityIndex,similarityIndexThreshold:t.similarityIndexThreshold,maxNumberOfTriplesPerCall:t.maxNumberOfTriplesPerCall,queryTemplate:t.queryTemplate,retrievalConnectorInstance:t.retrievalConnectorInstance})},g=t=>{if(t)return t.map(t=>_(t))},_=t=>{if(t)return t.method===a.AdditionalExtractionMethod.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH?new a.AdditionalExtractionMethodModel({method:t.method,maxNumberOfResultsPerCall:t.limit||0}):t.method===a.AdditionalExtractionMethod.IRI_DISCOVERY_SEARCH?new a.AdditionalExtractionMethodModel({method:t.method}):void 0},y=t=>{if(t)return new a.AgentInstructionsModel({systemInstruction:t.systemInstruction,userInstruction:t.userInstruction})}},63415:(t,e,s)=>{s.r(e),s.d(e,{ChatItemModel:()=>n,ChatItemsListModel:()=>i});var a=s(36633);class n{constructor(t,e){this._chatId=t,this._agentId=void 0,this._question=e,this._answers=[]}get chatId(){return this._chatId}set chatId(t){this._chatId=t}get agentId(){return this._agentId}set agentId(t){this._agentId=t}get question(){return this._question}set question(t){this._question=t}get answers(){return this._answers}set answers(t){this._answers=t}setQuestionMessage(t){this._question||(this._question=new a.ChatMessageModel({role:a.CHAT_MESSAGE_ROLE.USER})),this._question.message=t}getQuestionMessage(){return this._question.message}toCreateChatRequestPayload(){return{agentId:this._agentId,question:this._question.message}}toAskRequestPayload(){return{conversationId:this._chatId,agentId:this._agentId,question:this._question.message,tzOffset:-(new Date).getTimezoneOffset()}}toExplainResponsePayload(t){return{conversationId:this._chatId,answerId:t}}}class i{constructor(t=[]){this._items=t}isEmpty(){return 0===this._items.length}appendItem(t){this._items.push(t)}get items(){return this._items}set items(t){this._items=t||[]}getLast(){if(!this.isEmpty())return this._items[this._items.length-1]}}},85609:(t,e,s)=>{s.r(e),s.d(e,{chatModelMapper:()=>d,chatsListMapper:()=>h});var a=s(19402),n=s(93135),i=s(85788),r=s(63415);const o=(0,n.md5HashGenerator)(),h=t=>{if(!t)return new a.ChatsListModel;const e=t.map(t=>d(t));return new a.ChatsListModel(e)},d=t=>{if(t)return new a.ChatModel({id:t.id,name:t.name,timestamp:t.timestamp,chatHistory:t.messages&&t.messages.length?(0,i.chatItemsModelMapper)(t.messages):new r.ChatItemsListModel},o)}},85788:(t,e,s)=>{s.r(e),s.d(e,{chatAnswerModelMapper:()=>d,chatItemsModelMapper:()=>o,chatMessageModelListMapper:()=>r,chatMessageModelMapper:()=>h});var a=s(36633),n=s(63415),i=s(45458);const r=t=>t?t.map(t=>h(t)):[],o=(t=[])=>{const e=[];let s;return t.forEach(t=>{const i=t.conversationId;a.CHAT_MESSAGE_ROLE.USER===t.role?(s&&e.push(s),s=new n.ChatItemModel(i,h(t))):(s||(s=new n.ChatItemModel(i,null)),s.answers.push(h(t)),s.agentId=t.agentId)}),s&&e.push(s),new n.ChatItemsListModel(e)},h=t=>{if(t)return new a.ChatMessageModel({id:t.id,role:t.role,message:t.message,timestamp:t.timestamp,tokenUsageInfo:t.usage,data:t,isTerminalState:t.isTerminalState,status:t.terminalStatusCode})},d=t=>{if(t)return new i.ChatAnswerModel({chatId:t.id,chatName:t.name,timestamp:t.timestamp,messages:r(t.messages),continueRunId:t.continueRunId,tokenUsageInfo:t.usage})}},87252:(t,e,s)=>{s.r(e),s.d(e,{ExplainQueryMethodModel:()=>i,ExplainQueryMethodsListModel:()=>n,ExplainQueryType:()=>r,ExplainResponseModel:()=>a});class a{constructor(t={}){this._chatId=t.chatId,this._answerId=t.answerId,this._queryMethods=t.queryMethods,this._expanded=void 0===t.expanded||t.expanded}get chatId(){return this._chatId}set chatId(t){this._chatId=t}get answerId(){return this._answerId}set answerId(t){this._answerId=t}get queryMethods(){return this._queryMethods}set queryMethods(t){this._queryMethods=t}get expanded(){return this._expanded}set expanded(t){this._expanded=t}}class n{constructor(t=[]){this._items=t}get items(){return this._items}set items(t){this._items=t}}class i{constructor(t={}){this._name=t.name,this._rawQuery=t.rawQuery,this._query=t.query,this._queryType=t.queryType,this._errorMessage=t.errorOutput}get name(){return this._name}set name(t){this._name=t}get rawQuery(){return this._rawQuery}set rawQuery(t){this._rawQuery=t}get query(){return this._query}set query(t){this._query=t}get queryType(){return this._queryType}set queryType(t){this._queryType=t}get errorMessage(){return this._errorMessage}set errorMessage(t){this._errorMessage=t}}const r={SPARQL:"sparql",JSON:"json",OTHER:"other"}},89358:(t,e,s)=>{s.r(e),s.d(e,{AgentInstructionsExplain:()=>a,AgentInstructionsExplainList:()=>n});class a{constructor(t){this._type=t.type,this._content=t.content,this._size=t.size}get size(){return this._size}set size(t){this._size=t}get content(){return this._content}set content(t){this._content=t}get type(){return this._type}set type(t){this._type=t}}class n{constructor(t){this._instructions=t.instructions}get instructions(){return this._instructions}set instructions(t){this._instructions=t}}},92561:(t,e,s)=>{s.r(e),s.d(e,{explainQueryMethodMapper:()=>r,explainQueryMethodsListMapper:()=>i,explainResponseMapper:()=>n});var a=s(87252);const n=t=>new a.ExplainResponseModel({chatId:t.conversationId,answerId:t.answerId,queryMethods:i(t.queryMethods)}),i=(t=[])=>new a.ExplainQueryMethodsListModel(t.map(r)),r=t=>new a.ExplainQueryMethodModel(t)},96089:(t,e,s)=>{s.r(e);var a=s(73964);angular.module("graphdb.framework.rest.ttyg.service",[]).factory("TTYGRestService",d),d.$inject=["$http"];const n="rest/chat/conversations",i="rest/chat/agents",r=`${n}/explain`,o="rest/chat/chats",h=!1;function d(t){const e=new a.TtygRestServiceFakeBackend;return{createChat:s=>h?e.createChat():t.post(o,s),getConversation:s=>h?e.getConversation(s):t.get(`${n}/${s}`),renameConversation:(s,a)=>h?e.renameConversation(s,a):t.put(`${n}/${s}`,a),exportConversation:s=>h?e.exportConversation(s):t.get(`${n}/export/${s}`,{responseType:"blob"}),askQuestion:s=>h?e.askQuestion(s):t.post(`${o}/question`,s),continueChatRun:s=>h?e.continueChatRun(s):t.post(`${n}/continue`,s),getConversations:()=>h?e.getConversations():t.get(n),deleteConversation:s=>h?e.deleteConversation(s):t.delete(`${n}/${s}`),createConversation:(s={})=>h?e.createConversation(s):t.post(n,s),cancelPendingQuestion:s=>h?e.cancelPendingQuestion(!1):t.post(`${o}/${s}/cancel`),getAgents:()=>h?e.getAgents():t.get(i),getAgent:s=>h?e.getAgent(s):t.get(`${i}/${s}`),createAgent:s=>h?e.createAgent(s):t.post(i,s),editAgent:s=>h?e.editAgent(s):t.put(`${i}`,s),deleteAgent:s=>h?e.deleteAgent(s):t.delete(`${i}/${s}`),explainResponse:(s={})=>h?e.explainResponse(s):t.post(r,s),getAgentDefaultValues:()=>h?e.getAgentDefaultValues():t.get(`${i}/default`),explainAgentSettings:s=>h?e.explainAgentSettings():t.post(`${i}/explain`,s)}}}};
|
|
2
|
-
//# sourceMappingURL=36665.69d43b057bcfc55df3b5.bundle.js.map
|