graphdb-workbench 4.0.0-TR2 → 4.0.0-TR3

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.
Files changed (121) hide show
  1. package/dist/{30575.19fdf3b549db571bb535.bundle.js → 30575.184c5f6f13b5bff89fec.bundle.js} +2 -2
  2. package/dist/30575.184c5f6f13b5bff89fec.bundle.js.map +1 -0
  3. package/dist/32401.e87fc66be912718fffc3.bundle.js +2 -0
  4. package/dist/32401.e87fc66be912718fffc3.bundle.js.map +1 -0
  5. package/dist/44906.42387d9a889a05ef93ae.bundle.js +2 -0
  6. package/dist/44906.42387d9a889a05ef93ae.bundle.js.map +1 -0
  7. package/dist/{64700.a10c20a33a6c92f01733.bundle.js → 64700.847995c53301ff65bccd.bundle.js} +2 -2
  8. package/dist/64700.847995c53301ff65bccd.bundle.js.map +1 -0
  9. package/dist/{64709.dfde8159d07e957a12b0.bundle.js → 64709.d0144177c2b8d83b494f.bundle.js} +2 -2
  10. package/dist/{64709.dfde8159d07e957a12b0.bundle.js.map → 64709.d0144177c2b8d83b494f.bundle.js.map} +1 -1
  11. package/dist/{65677.4ed21f2097d86718611c.bundle.js → 65677.9e40e2d5fe66932a18ab.bundle.js} +2 -2
  12. package/dist/{65677.4ed21f2097d86718611c.bundle.js.map → 65677.9e40e2d5fe66932a18ab.bundle.js.map} +1 -1
  13. package/dist/{75384.cc7de25be91251aa6aa4.bundle.js → 75384.94d3d9790b82fe24ba69.bundle.js} +2 -2
  14. package/dist/75384.94d3d9790b82fe24ba69.bundle.js.map +1 -0
  15. package/dist/79796.9e99cce3ecaefe7b75fc.bundle.js +2 -0
  16. package/dist/79796.9e99cce3ecaefe7b75fc.bundle.js.map +1 -0
  17. package/dist/{80933.19f69bc85c52a8b19311.bundle.js → 80933.d5c0bca925e9cb27ac57.bundle.js} +2 -2
  18. package/dist/{80933.19f69bc85c52a8b19311.bundle.js.map → 80933.d5c0bca925e9cb27ac57.bundle.js.map} +1 -1
  19. package/dist/{82917.c68c153aaca95c11341f.bundle.js → 82917.9da9f14ffe9dc7768d10.bundle.js} +2 -2
  20. package/dist/{82917.c68c153aaca95c11341f.bundle.js.map → 82917.9da9f14ffe9dc7768d10.bundle.js.map} +1 -1
  21. package/dist/{86099.ab0bf43b346e9cfb20d8.bundle.js → 86099.33c740b4d5684dde18c7.bundle.js} +2 -2
  22. package/dist/{86099.ab0bf43b346e9cfb20d8.bundle.js.map → 86099.33c740b4d5684dde18c7.bundle.js.map} +1 -1
  23. package/dist/api/models/broadcast/broadcast-message.d.ts +11 -0
  24. package/dist/api/models/broadcast/index.d.ts +3 -0
  25. package/dist/api/models/broadcast/message-handler.d.ts +5 -0
  26. package/dist/api/models/broadcast/message-type.d.ts +3 -0
  27. package/dist/api/ontotext-workbench-api.d.ts +2 -0
  28. package/dist/api/ontotext-workbench-api.js +1 -1
  29. package/dist/api/ontotext-workbench-api.js.map +1 -1
  30. package/dist/api/services/broadcast/broadcast.service.d.ts +24 -0
  31. package/dist/api/services/broadcast/index.d.ts +1 -0
  32. package/dist/api/services/broadcast/test/broadcast.service.spec.d.ts +1 -0
  33. package/dist/assets/i18n/language-config.json +1 -1
  34. package/dist/css/user.css +1 -1
  35. package/dist/i18n/locale-en.json +1 -0
  36. package/dist/i18n/locale-fr.json +1 -0
  37. package/dist/index.html +8 -8
  38. package/dist/js/angular/clustermanagement/templates/cluster-configuration/cluster-configuration.html +1 -1
  39. package/dist/js/angular/clustermanagement/templates/cluster-configuration/multi-region.html +1 -1
  40. package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
  41. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  42. package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
  43. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  44. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  45. package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
  46. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +2 -2
  47. package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
  48. package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
  49. package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
  50. package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
  51. package/dist/js/angular/core/templates/search-resource-input.html +1 -1
  52. package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
  53. package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
  54. package/dist/js/angular/graphql/templates/graphql-playground.html +2 -2
  55. package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
  56. package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
  57. package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
  58. package/dist/js/angular/security/templates/user.html +8 -5
  59. package/dist/js/angular/security/templates/users.html +1 -1
  60. package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
  61. package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
  62. package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
  63. package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
  64. package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
  65. package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
  66. package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +3 -3
  67. package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
  68. package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
  69. package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
  70. package/dist/legacyWorkbench.5ba16dfe45d478531c81.js +3 -0
  71. package/dist/{legacyWorkbench.d546b7e4a3f1505b1746.js.map → legacyWorkbench.5ba16dfe45d478531c81.js.map} +1 -1
  72. package/dist/pages/aclmanagement.html +1 -1
  73. package/dist/pages/autocomplete.html +1 -1
  74. package/dist/pages/choose-repository-type.html +1 -1
  75. package/dist/pages/cluster-management/clusterInfo.html +2 -2
  76. package/dist/pages/create-index.html +1 -1
  77. package/dist/pages/dependencies.html +1 -1
  78. package/dist/pages/domainRangeInfo.html +2 -2
  79. package/dist/pages/edit.html +1 -1
  80. package/dist/pages/explore.html +1 -1
  81. package/dist/pages/export.html +1 -1
  82. package/dist/pages/find.html +1 -1
  83. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  84. package/dist/pages/graphs-visualizations.html +7 -7
  85. package/dist/pages/guides.html +1 -1
  86. package/dist/pages/home.html +1 -1
  87. package/dist/pages/import.html +2 -2
  88. package/dist/pages/jdbc-create.html +1 -1
  89. package/dist/pages/jdbc.html +1 -1
  90. package/dist/pages/monitor/backup-and-restore.html +1 -1
  91. package/dist/pages/monitor/queries.html +1 -1
  92. package/dist/pages/monitor/resources.html +1 -1
  93. package/dist/pages/namespaces.html +2 -2
  94. package/dist/pages/plugins.html +1 -1
  95. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  96. package/dist/pages/rdfrank.html +2 -2
  97. package/dist/pages/repositories.html +1 -1
  98. package/dist/pages/repository.html +1 -1
  99. package/dist/pages/similarity-indexes.html +1 -1
  100. package/dist/pages/sparql-editor.html +1 -1
  101. package/dist/pages/sparql-template-create.html +1 -1
  102. package/dist/pages/sparql-templates.html +1 -1
  103. package/dist/pages/ux-test1.html +2 -2
  104. package/dist/pages/webapi.html +2 -2
  105. package/dist/plugins/plugins-bundle.js +1 -1
  106. package/dist/plugins/plugins-bundle.js.map +1 -1
  107. package/dist/plugins.js +1 -1
  108. package/dist/res/swagger5/index.html +11 -11
  109. package/dist/shared-components/collection/pages/js/main.js +1 -1
  110. package/package.json +2 -2
  111. package/dist/30575.19fdf3b549db571bb535.bundle.js.map +0 -1
  112. package/dist/32401.023d0082b98ee532b4d3.bundle.js +0 -2
  113. package/dist/32401.023d0082b98ee532b4d3.bundle.js.map +0 -1
  114. package/dist/44906.6d83b4aafb42ccc2f46c.bundle.js +0 -2
  115. package/dist/44906.6d83b4aafb42ccc2f46c.bundle.js.map +0 -1
  116. package/dist/64700.a10c20a33a6c92f01733.bundle.js.map +0 -1
  117. package/dist/75384.cc7de25be91251aa6aa4.bundle.js.map +0 -1
  118. package/dist/79796.c484b55f1aa1581ac64c.bundle.js +0 -2
  119. package/dist/79796.c484b55f1aa1581ac64c.bundle.js.map +0 -1
  120. package/dist/legacyWorkbench.d546b7e4a3f1505b1746.js +0 -3
  121. /package/dist/{legacyWorkbench.d546b7e4a3f1505b1746.js.LICENSE.txt → legacyWorkbench.5ba16dfe45d478531c81.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ export const __webpack_esm_id__=79796;export const __webpack_esm_ids__=[3801,48605,79796,93966];export const __webpack_esm_modules__={48605(){angular.module("graphdb.framework.core.directives.multiselect",[]).directive("multiSelectDropdown",function(){return{restrict:"E",scope:{items:"=",placeholder:"@?",onChange:"&?",labelKeys:"=?"},templateUrl:"js/angular/core/directives/multiselect-search/templates/multiselect-search.html",controller:["$scope","$document","$element","$filter","$timeout",function(e,t,o,n,r){e.open=!1,e.search={query:""},e.visibleItems=[];const i=[],a=e=>null===e?"":(""+e).toLowerCase(),s=()=>{const t=Array.isArray(e.items)?e.items:[],o=a(e.search.query);e.visibleItems=o?t.filter(e=>a(e.label).includes(o)):t},l=t=>{e.open&&(o[0].contains(t.target)||e.$applyAsync(function(){e.open=!1}))};e.toggleOpen=function(t){t&&t.stopPropagation(),e.open=!e.open,e.open&&r(function(){const e=o[0].querySelector(".multiselect-search");e&&e.focus()})},e.onKeydownMenu=function(t){"Escape"===t.key&&(e.open=!1,t.stopPropagation(),t.preventDefault(),r(function(){const e=o[0].querySelector(".multiselect-button");e&&e.focus()}))},e.selectedCount=function(){return Array.isArray(e.items)?e.items.filter(e=>e.selected).length:0},e.allFilteredSelected=function(){const t=e.visibleItems||[];return 0!==t.length&&t.every(e=>e.selected)},e.someFilteredSelected=function(){const t=e.visibleItems||[],o=t.some(e=>e.selected),n=t.every(e=>e.selected);return o&&!n},e.toggleSelectAll=function(t){t&&t.stopPropagation();const o=e.visibleItems||[],n=!e.allFilteredSelected();for(const e of o)e.selected=n;e.emitChange()},e.emitChange=function(){if("function"==typeof e.onChange){const t=(e.items||[]).filter(e=>e.selected);e.onChange({selected:t})}},t.on("click",l),i.push(e.$watch("search.query",s),e.$watchCollection("items",s)),e.$on("$destroy",()=>{t.off("click",l);for(const e of i)e()}),s()}]}})},3801(e,t,o){o.d(t,{X:()=>n});const n={SIMILARITY:"similarity",ELASTICSEARCH:"elasticsearch",OPENSEARCH:"opensearch"}},79796(e,t,o){var n=o(41767),r=o(12454),i=(o(48175),o(6336),o(75384),o(48605),o(51504),o(94154),o(83427),o(75504)),a=o(35197),s=o(9297),l=o(19274),c=o(82385),d=o(71315),g=o(79069),m=o(3801);const u=d.I.logger;function p(e,t,o,d,p,y,h,I,f,v,M,E,S,F,x,_,C,A,T){let b=r.Hn.value,R=r.Zb.value;e.similarityInput={hovered:!1},e.AGENT_OPERATION=s.A1,e.operation=E.operation,e.savingAgent=!1,e.agentFormModel=E.agentFormModel,e.activeRepositoryInfo=E.activeRepositoryInfo,e.extractionMethodLoaderFlags={[r.Ht.SIMILARITY]:!1},e.activeRepositoryList=E.activeRepositoryList,e.extractionMethods=r.Ht,e.additionalExtractionMethods=r.eA,e.ExtractionMethodTemplates=x,e.showAdvancedSettings=!1,e.showHighTemperatureWarning=!1,e.showSystemInstructionWarning=!1,e.retrievalConnectors=[],e.ftsEnabled=!1,e.autocompleteSuggestions=[],e.showContextSize=null!==e.agentFormModel.contextSize,e.vectorFields=[],e.documentationUrlForSimilarity=c.m.getDocumentationUrl(T.shortVersion,"talk-to-graph.html#prerequisites-and-configuration"),e.similarityOptionsGrouped=[],e.toggleExtractionMethod=t=>{t.expanded=t.selected,e.agentSettingsForm.extractionMethods.$setTouched(),P(),W[t.method](t)},e.toggleTemperature=()=>{const t=new g.U0({...r.Hn});e.agentFormModel.temperatureEnabled?t.value=b:(b=e.agentFormModel.temperature.value,t.value=void 0),e.agentFormModel.temperature=t,Z()},e.toggleTopP=()=>{const t=new g.U0({...r.Zb});e.agentFormModel.topPEnabled?t.value=R:(R=e.agentFormModel.topP.value,t.value=void 0),e.agentFormModel.topP=t},e.onExtractionMethodPanelToggle=e=>{e.toggleCollapse(),W[e.method](e)},e.toggleAdditionalExtractionMethod=t=>{t.expanded=t.selected,e.checkAutocompleteIndexEnabled(),Y[t.method](t)},e.onAdditionalExtractionMethodPanelToggle=e=>{e.toggleCollapse(),Y[e.method](e)},e.helpInfoForModel={ttygHelpInfo:function(){const e=(0,n.Gz)(M.instant("ttyg.agent.create_agent_modal.form.model.hint"));return I.trustAsHtml(e)}(),linkText:M.instant("ttyg.agent.create_agent_modal.form.model.link_text"),documentationUrl:c.m.getDocumentationUrl(T.shortVersion,"talk-to-graph.html#prerequisites-and-configuration")},e.getFTSDisabledHelpMessage=()=>{const t=(0,n.Gz)(M.instant("ttyg.agent.create_agent_modal.form.fts_search.fts_disabled_message",{repositoryEditPage:"repository/edit/"+e.agentFormModel.repositoryId}));return I.trustAsHtml(t)},e.goToAutocompleteView=t=>{t.preventDefault(),S.emit(a.I.GO_TO_AUTOCOMPLETE_INDEX_VIEW,{repositoryId:e.agentFormModel.repositoryId})},e.goToCreateSimilarityView=t=>{t.preventDefault(),S.emit(a.I.GO_TO_CREATE_SIMILARITY_VIEW,{repositoryId:e.agentFormModel.repositoryId})},e.goToConnectorsView=t=>{t.preventDefault(),S.emit(a.I.GO_TO_CONNECTORS_VIEW,{repositoryId:e.agentFormModel.repositoryId})},e.ok=()=>{const t=e.agentFormModel.toPayload();return w[e.operation](t)},e.cancel=()=>{t.dismiss({})},e.close=()=>{t.dismiss({})},e.updateSimilaritySearchPanel=(t=!1)=>{const o=e.agentFormModel.assistantExtractionMethods.getSimilarityExtractionMethod();o.selected?(t&&(o.similarityIndex=null),U(o,!0)):e.agentSettingsForm.$setValidity("FTSDisabled",!0)},e.updateRetrievalConnectorPanel=(t=!1)=>{const o=e.agentFormModel.assistantExtractionMethods.getRetrievalExtractionMethod();o.selected&&(t&&(o.retrievalConnectorInstance=null),j(o))},e.checkIfFTSEnabled=()=>{e.agentFormModel.repositoryId?e.agentFormModel.assistantExtractionMethods.getFTSSearchExtractionMethod().selected?(e.extractionMethodLoaderFlags[r.Ht.FTS_SEARCH]=!0,h.getRepositoryModel({id:e.agentFormModel.repositoryId}).then(t=>{e.ftsEnabled=t.getParamValue(i.YF.enableFtsIndex)}).catch(e=>{V(e,"ttyg.agent.messages.error_repository_config_loading")}).finally(()=>{e.extractionMethodLoaderFlags[r.Ht.FTS_SEARCH]=!1,e.agentSettingsForm.$setValidity("FTSDisabled",e.ftsEnabled)})):e.agentSettingsForm.$setValidity("FTSDisabled",!0):e.agentSettingsForm.$setValidity("FTSDisabled",!1)},e.openExternalIntegrationConfig=()=>{const t=e.agentFormModel;A.open(t)},e.onRepositoryChange=()=>{X(!0,!0)},e.checkAutocompleteIndexEnabled=t=>{if(t||(t=e.agentFormModel.additionalExtractionMethods.additionalExtractionMethods.find(e=>e.method===r.eA.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH)),t&&!t.selected||!e.agentFormModel.repositoryId)return;const o=H();_.checkAutocompleteStatus(o.repositoryId,o.repositoryLocation).then(t=>{e.autocompleteEnabled=t,e.agentSettingsForm.$setValidity("autocompleteDisabled",t)}).catch(t=>{e.agentSettingsForm.$setValidity("autocompleteDisabled",!1),f.error(getError(t))})},e.onRestoreDefaultContextSize=()=>{e.agentFormModel.contextSize=e.agentFormModel.contextSizeCopy},e.onRestoreDefaultSystemInstructions=()=>{e.agentFormModel.instructions.systemInstruction=e.agentFormModel.instructions.systemInstructionCopy},e.onRestoreDefaultUserInstructions=()=>{e.agentFormModel.instructions.userInstruction=e.agentFormModel.instructions.userInstructionCopy},e.onTemperatureChange=()=>{Z()},e.onSystemInstructionChange=()=>{""===e.agentFormModel.instructions.systemInstruction||e.showSystemInstructionWarning||(e.showSystemInstructionWarning=!0,o.openModalAlert({title:M.instant("ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.title"),message:M.instant("ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.body")}).result.then(function(){})),""===e.agentFormModel.instructions.systemInstruction&&(e.showSystemInstructionWarning=!1)},e.onExplainAgentSettings=()=>{const t=e.agentFormModel.toPayload();F.explainAgentSettings(t).then(e=>{const t={templateUrl:"js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html",controller:"AgentInstructionsExplainModalController",windowClass:"agent-instructions-explain-modal",backdrop:"static",resolve:{dialogModel:function(){return{agentInstructionsExplain:e}}},size:"lg"};d.open(t).result.then(()=>{})}).catch(e=>{f.error(getError(e,0,s.LE))})},e.getSuggestions=t=>{const o=t.target.value;C.getAutocompleteSuggestions(o).then(l.C).then(t=>{e.autocompleteSuggestions=t.map(e=>({text:e.value}))}).catch(e=>{f.error(getError(e,0,s.LE))})},e.onVectorFieldsChange=function(e){e.connectorFields=e.selectedConnectorField?[e.selectedConnectorField]:[]},e.hasConnectorData=()=>!(!e.connectorMap||!Object.keys(e.connectorMap).length),e.shouldShowVectorFields=t=>{if(!t)return!1;const o=t.connectorType,n=t.similarityIndex;if(!D(o))return!1;if(Array.isArray(e.vectorFields))return e.vectorFields.length>0;const r=$(o,n);return Array.isArray(r)&&r.length>0},e.onSimilarityIndexChange=t=>{const o=t&&t.similarityIndexOption;if(t.selectedConnectorField=void 0,t.connectorFields=[],!o)return t.connectorType=null,t.similarityIndex="",void(e.vectorFields=[]);t.connectorType=o.provider,t.similarityIndex=o.value,e.vectorFields=$(o.provider,o.value)};const $=(t,o)=>{const n=e.connectorMap||{};return n[t]&&n[t][o]?n[t][o]:[]},w={[s.A1.CREATE]:e=>L(e),[s.A1.EDIT]:e=>O(e),[s.A1.CLONE]:e=>k(e)},L=o=>(e.savingAgent=!0,F.createAgent(o).then(e=>{t.close(e),f.success(M.instant("ttyg.agent.messages.agent_save_successfully",{agentName:e.name}))}).catch(e=>{f.error(getError(e,0,s.LE))}).finally(()=>{e.savingAgent=!1})),O=o=>(e.savingAgent=!0,F.editAgent(o).then(e=>{t.close(e),f.success(M.instant("ttyg.agent.messages.agent_save_successfully",{agentName:e.name}))}).catch(e=>{f.error(getError(e,0,s.LE))}).finally(()=>{e.savingAgent=!1})),k=o=>(e.savingAgent=!0,F.createAgent(o).then(e=>{t.close(e),f.success(M.instant("ttyg.agent.messages.agent_save_successfully",{agentName:e.name}))}).catch(e=>{f.error(getError(e,0,s.LE))}).finally(()=>{e.savingAgent=!1})),V=(e,t)=>{u.error(e),f.error(M.instant(t))},P=()=>{e.agentSettingsForm.extractionMethods.$setValidity("required",e.agentFormModel.hasExtractionMethodSelected())},H=()=>{const t=e.activeRepositoryList.find(t=>t.value===e.agentFormModel.repositoryId);return{repositoryId:t?t.data.repository.id:void 0,repositoryLocation:t?t.data.repository.location:void 0}},D=e=>e===m.X.OPENSEARCH||e===m.X.ELASTICSEARCH,U=(t,o=!1)=>{if(!t.selected)return void e.agentSettingsForm.$setValidity("missingIndex",!0);const n=e.agentSettingsForm&&e.agentSettingsForm.connectorInstances,r=!n||n.$pristine;if(e.connectorMap&&!r)return;if(!e.agentFormModel.repositoryId)return;e.extractionMethodLoaderFlags[t.method]=!0;const i=H();p.getSimilarityIndexesWithVectorFields(i.repositoryId).then(n=>{e.connectorMap=n;const r=G(n);(t=>{e.similarityOptionsGrouped=[],Object.entries(t).forEach(([t,o])=>{const n=M.instant(`ttyg.agent.create_agent_modal.form.similarity_instance_type_label.${t}`);Object.keys(o||{}).forEach(o=>{e.similarityOptionsGrouped.push({provider:t,label:o,value:o,group:n})})})})(n),N(r,t),(t=>{const o=t.connectorType,n=t.similarityIndex;D(o)?e.vectorFields=$(o,n):e.vectorFields=[]})(t),e.agentSettingsForm.$setValidity("missingIndex",!t.selected||e.hasConnectorData()),(o||t.connectorFields&&0===t.connectorFields.length)&&e.onSimilarityIndexChange(t)}).catch(t=>{e.connectorMap=null,e.agentSettingsForm.$setValidity("missingIndex",!1),V(t,"ttyg.agent.messages.error_similarity_indexes_loading")}).finally(()=>{e.extractionMethodLoaderFlags[t.method]=!1})},N=(t,o)=>{if(!t.length)return o.connectorType="",o.similarityIndex="",void(o.similarityIndexOption=void 0);const n=o.connectorType,r=o.similarityIndex,i=t.find(e=>e.data.connectorType===n&&e.value===r)||t[0];o.connectorType=i.data.connectorType,o.similarityIndex=i.value;const a=(e.similarityOptionsGrouped||[]).find(e=>e.provider===o.connectorType&&e.value===o.similarityIndex);o.similarityIndexOption=a||void 0},G=e=>{const t=[];return Object.entries(e).forEach(([e,o])=>{Object.entries(o).forEach(([o,n])=>{t.push(new g.rx({label:o,value:o,data:{connectorType:e,connectorFields:n}}))})}),t},j=t=>{if(!e.agentFormModel.repositoryId)return;if(!t.selected)return void e.agentSettingsForm.$setValidity("missingConnector",!0);e.extractionMethodLoaderFlags[t.method]=!0;const o=H();y.getConnectorPrefixByName("ChatGPT Retrieval",o.repositoryId,o.repositoryLocation).then(e=>y.getConnectorsByTypeAsSelectMenuOptions(e,o.repositoryId,o.repositoryLocation)).then(o=>{e.retrievalConnectors=o,e.agentSettingsForm.$setValidity("missingConnector",!t.selected||!(!o||!o.length)),q(e.retrievalConnectors,t)}).catch(t=>{e.agentSettingsForm.$setValidity("missingConnector",!1),V(t,"ttyg.agent.messages.error_retrieval_connectors_loading")}).finally(()=>{e.extractionMethodLoaderFlags[t.method]=!1})},q=(e,t)=>{if(0===e.length)return void(t.retrievalConnectorInstance=null);const o=e.find(e=>e.value===t.retrievalConnectorInstance);t.retrievalConnectorInstance=o?o.value:e[0].value},W={[r.Ht.FTS_SEARCH]:t=>{e.checkIfFTSEnabled()},[r.Ht.SPARQL]:e=>{},[r.Ht.SIMILARITY]:e=>U(e),[r.Ht.RETRIEVAL]:e=>j(e)},Y={[r.eA.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH]:e=>z(e),[r.eA.IRI_DISCOVERY_SEARCH]:()=>{}},z=t=>{t.selected||e.agentSettingsForm.$setValidity("autocompleteDisabled",!0),e.checkAutocompleteIndexEnabled(t)},X=(t=!1,o=!1)=>{e.checkIfFTSEnabled(),e.updateSimilaritySearchPanel(t),e.updateRetrievalConnectorPanel(o),e.checkAutocompleteIndexEnabled(),Z()},B=()=>{document.hidden||X()},K=(e,t)=>{const o=document.getElementById(e);o&&(o.value=t)},Z=()=>{e.showHighTemperatureWarning=e.agentFormModel.temperature.value>1};document.addEventListener("visibilitychange",B),e.$on("$destroy",()=>{document.removeEventListener("visibilitychange",B)}),H().repositoryId||(e.agentFormModel.repositoryId=null),setTimeout(P,0),t.rendered.then(()=>{K("temperatureSlider",e.agentFormModel.temperature.value),K("topPSlider",e.agentFormModel.topP.value),e.operation!==s.A1.CREATE&&X()})}angular.module("graphdb.framework.ttyg.controllers.agent-settings-modal",["graphdb.framework.core.services.similarity","graphdb.framework.core.services.connectors","graphdb.framework.rest.repositories.service","graphdb.framework.ttyg.controllers.agent-instructions-explain-modal","graphdb.framework.ttyg.services.externalIntegrationModal","ngTagsInput","graphdb.framework.core.directives.multiselect"]).constant("ExtractionMethodTemplates",{iri_discovery_search:"iri-discovery-search",autocomplete_iri_discovery_search:"autocomplete-iri-discovery-search"}).filter("map",function(){return function(e,t){return Array.isArray(e)?e.map(function(e){return e[t]}):e}}).controller("AgentSettingsModalController",p),p.$inject=["$scope","$uibModalInstance","ModalService","$uibModal","SimilarityService","ConnectorsService","RepositoriesRestService","$sce","toastr","UriUtils","$translate","dialogModel","TTYGContextService","TTYGService","ExtractionMethodTemplates","AutocompleteService","AutocompleteRestService","ExternalIntegrationModalService","productInfo"]},93966(){function e(e,t,o,n,r){e.externalIntegrationConfiguration=r.externalIntegrationConfiguration,e.difyExtension=r.difyExtensionUrl,e.queryMethods=r.queryMethodsUrl,e.agentId=r.agentId,e.agentName=r.agentName,e.close=()=>{t.dismiss({})},e.onCloseExternalIntegrationConfigurationModal=()=>{t.dismiss({})}}angular.module("graphdb.framework.ttyg.controllers.external-integration-configuration-modal",[]).controller("ExternalIntegrationConfigurationModalController",e),e.$inject=["$scope","$uibModalInstance","ModalService","$translate","dialogModel"]},83427(e,t,o){o(93966);var n=o(9297);function r(e,t,o){return{open:function(r){return t.getExternalUrl().then(t=>{const o=function(e,t){return{agentName:e.name,agentId:e.id,queryMethodsUrl:`${t}/rest/llm/tool/ttyg/${e.id}`,difyExtensionUrl:`${t}/rest/llm/ttyg/${e.id}/dify`}}(r,t.data);return e.open({templateUrl:"js/angular/ttyg/templates/modal/external-integration-configuration-modal.html",controller:"ExternalIntegrationConfigurationModalController",windowClass:"external-integration-configuration-modal",backdrop:"static",resolve:{dialogModel:()=>o}}).result.then(()=>{}).catch(()=>{})}).catch(e=>{o.error(getError(e,0,n.LE))})}}}angular.module("graphdb.framework.ttyg.services.externalIntegrationModal",["graphdb.framework.ttyg.controllers.external-integration-configuration-modal"]).factory("ExternalIntegrationModalService",r),r.$inject=["$uibModal","LocationsRestService","toastr"]}};
2
+ //# sourceMappingURL=79796.9e99cce3ecaefe7b75fc.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"79796.9e99cce3ecaefe7b75fc.bundle.js","mappings":"8IACIA,QAAQC,OAAO,gDAAiD,IAC3DC,UAAU,sBAAuB,WAC9B,MAAO,CACHC,SAAU,IACVC,MAAO,CACHC,MAAO,IACPC,YAAa,KACbC,SAAU,KAYVC,UAAW,MAEfC,YAAa,kFACbC,WAAY,CAAC,SAAU,YAAa,WAAY,UAAW,WAAY,SAASC,EAAQC,EAAWC,EAAUC,EAASC,GAKlHJ,EAAOK,MAAO,EACdL,EAAOM,OAAS,CAACC,MAAO,IACxBP,EAAOQ,aAAe,GAMtB,MAAMC,EAAgB,GAWhBC,EAAaC,GACF,OAANA,EAAa,IAAM,GAAKA,GAAGC,cAMhCC,EAAkBA,KACpB,MAAMC,E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,MAAQ,KACXrG,EAAkBoG,QAAQ,CAAC,IAG/BjK,EAAO0U,6CAA+C,KAClD7Q,EAAkBoG,QAAQ,CAAC,GAEnC,CArCA5K,QACKC,OAAO,8EAA+E,IACtFS,WAAW,kDAAmDoU,GAEnEA,EAAgDD,QAAU,CACtD,SACA,oBACA,eACA,aACA,c,sCCCJ,SAASrP,EAAgCd,EAAW4Q,EAAsBvQ,GAqCtE,MAAO,CAAC/D,KA3BR,SAAc2L,GACV,OAAO2I,EAAqBC,iBACvBtJ,KAAMuJ,IACH,MAAMtQ,EAZlB,SAA0ByH,EAAO8I,GAC7B,MAAO,CACH1E,UAAWpE,EAAMqE,KACjBoE,QAASzI,EAAMX,GACfmJ,gBAAiB,GAAGM,wBAA8B9I,EAAMX,KACxDiJ,iBAAkB,GAAGQ,mBAAyB9I,EAAMX,UAE5D,CAKgC0J,CAAiB/I,EAAO6I,EAASlE,MAErD,OAAO5M,EAAU1D,KAAK,CAClBP,YAAa,gFACbC,WAAY,kDACZ8N,YAAa,2CACbC,SAAU,SACVC,QAAS,CACLxJ,YAAaA,IAAMA,KAExBiJ,OACElC,KAAK,QAGLK,MAAM,UAIdA,MAAOC,IAEJxH,EAAOwH,MAAMc,SAASd,EAAO,EAAGqC,EAAAA,MAE5C,EAGJ,CA7CA5O,QACKC,OAAO,2DACJ,CAAC,gFACJ0V,QAAQ,kCAAmCnQ,GAEhDA,EAAgCqP,QAAU,CAAC,YAAa,uBAAwB,S","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/core/directives/multiselect-search/multiselect-search.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/similarity/similarity-instance-type.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/controllers/agent-settings-modal.controller.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/controllers/external-integration-configuration-modal.controller.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/externalIntegrationModal.service.js"],"sourcesContent":["(function() {\n angular.module('graphdb.framework.core.directives.multiselect', [])\n .directive('multiSelectDropdown', function() {\n return {\n restrict: 'E',\n scope: {\n items: '=',\n placeholder: '@?',\n onChange: '&?',\n /**\n * Keys for labels used in the multiselect dropdown.\n * <code>\n * {\n * \"select_all\": \"All\",\n * \"search_placeholder\": \"Select options\",\n * \"selected_count\": \"{{count}} selected\",\n * \"no_matches\": \"No matches\"\n * }\n * </code>\n */\n labelKeys: '=?',\n },\n templateUrl: 'js/angular/core/directives/multiselect-search/templates/multiselect-search.html',\n controller: ['$scope', '$document', '$element', '$filter', '$timeout', function($scope, $document, $element, $filter, $timeout) {\n // =========================\n // Public variables\n // =========================\n\n $scope.open = false;\n $scope.search = {query: ''};\n $scope.visibleItems = [];\n\n // =========================\n // Private variables\n // =========================\n\n const subscriptions = [];\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Normalize string for searching.\n * @param v {string|null}\n * @returns {string|string}\n */\n const normalize = (v) => {\n return v === null ? '' : ('' + v).toLowerCase();\n };\n\n /**\n * Build filtered list when query or items change.\n */\n const rebuildFiltered = () => {\n const list = Array.isArray($scope.items) ? $scope.items : [];\n const normalizedQuery = normalize($scope.search.query);\n if (normalizedQuery) {\n $scope.visibleItems = list.filter((i) => normalize(i.label).includes(normalizedQuery));\n } else {\n $scope.visibleItems = list;\n }\n };\n\n const dropTheOpenFlag = () => {\n $scope.$applyAsync(function() {\n $scope.open = false;\n });\n };\n\n /**\n * Closes the menu when clicking outside.\n * @param e {MouseEvent} The click event.\n */\n const onDocClick = (e) => {\n if (!$scope.open) {\n return;\n }\n if (!$element[0].contains(e.target)) {\n dropTheOpenFlag();\n }\n };\n\n const focusSearchInput = () => {\n // wait for the menu to open before focusing the input\n $timeout(function() {\n const input = $element[0].querySelector('.multiselect-search');\n if (input) {\n input.focus();\n }\n });\n };\n\n const focusMultiselectButton = () => {\n // wait for the menu to be removed before focusing the button\n $timeout(function() {\n const btn = $element[0].querySelector('.multiselect-button');\n if (btn) {\n btn.focus();\n }\n });\n };\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Toggles the menu open/closed.\n * @param e {MouseEvent} The click event.\n */\n $scope.toggleOpen = function(e) {\n e && e.stopPropagation();\n $scope.open = !$scope.open;\n if ($scope.open) {\n focusSearchInput();\n }\n };\n\n /**\n * Handles keydown events in the menu (for Escape key) and closes the menu.\n * @param e {KeyboardEvent} The keydown event.\n */\n $scope.onKeydownMenu = function(e) {\n if (e.key === 'Escape') {\n $scope.open = false;\n e.stopPropagation();\n e.preventDefault();\n focusMultiselectButton();\n }\n };\n\n /**\n * Gets count of selected items.\n * @returns {*|number}\n */\n $scope.selectedCount = function() {\n if (!Array.isArray($scope.items)) {\n return 0;\n }\n return $scope.items.filter((i) => i.selected).length;\n };\n\n /**\n * Checks if all filtered items are selected.\n * @returns {this is T[]|boolean}\n */\n $scope.allFilteredSelected = function() {\n const list = $scope.visibleItems || [];\n if (list.length === 0) {\n return false;\n }\n return list.every((i) => i.selected);\n };\n\n /**\n * Checks if some (but not all) filtered items are selected.\n * @returns {boolean}\n */\n $scope.someFilteredSelected = function() {\n const list = $scope.visibleItems || [];\n const any = list.some((i) => i.selected);\n const all = list.every((i) => i.selected);\n return any && !all;\n };\n\n /**\n * Toggles select all filtered items.\n * @param e {MouseEvent} The click event.\n */\n $scope.toggleSelectAll = function(e) {\n e && e.stopPropagation();\n const list = $scope.visibleItems || [];\n const makeSelected = !$scope.allFilteredSelected();\n for (const item of list) {\n item.selected = makeSelected;\n }\n $scope.emitChange();\n };\n\n /**\n * Emits change event.\n */\n $scope.emitChange = function() {\n if (typeof $scope.onChange === 'function') {\n const selected = ($scope.items || []).filter((i) => i.selected);\n $scope.onChange({selected: selected});\n }\n };\n\n // =========================\n // Watches & Listeners\n // =========================\n\n $document.on('click', onDocClick);\n subscriptions.push(\n $scope.$watch('search.query', rebuildFiltered),\n $scope.$watchCollection('items', rebuildFiltered),\n );\n\n const onDestroyCallback = () => {\n $document.off('click', onDocClick);\n for (const unsubscribe of subscriptions) {\n unsubscribe();\n }\n };\n $scope.$on('$destroy', onDestroyCallback);\n\n rebuildFiltered();\n }],\n };\n });\n})();\n","export const SimilarityInstanceType = {\n 'SIMILARITY': 'similarity',\n 'ELASTICSEARCH': 'elasticsearch',\n 'OPENSEARCH': 'opensearch',\n};\n","import {decodeHTML} from \"../../../../app\";\nimport {\n AdditionalExtractionMethod,\n DEFAULT_TEMPERATURE_RANGE,\n DEFAULT_TOP_P_RANGE,\n ExtractionMethod,\n} from \"../../models/ttyg/agents\";\nimport 'angular/core/services/similarity.service';\nimport 'angular/core/services/connectors.service';\nimport 'angular/core/services/ttyg.service';\nimport 'angular/core/directives/multiselect-search/multiselect-search.directive';\nimport 'angular/rest/repositories.rest.service';\nimport 'angular/ttyg/controllers/agent-instructions-explain-modal.controller';\nimport 'angular/ttyg/services/externalIntegrationModal.service';\nimport {REPOSITORY_PARAMS} from \"../../models/repository/repository\";\nimport {TTYGEventName} from \"../services/ttyg-context.service\";\nimport {AGENT_OPERATION, TTYG_ERROR_MSG_LENGTH} from \"../services/constants\";\nimport {mapUriAsNtripleAutocompleteResponse} from \"../../rest/mappers/autocomplete-mapper\";\nimport {DocumentationUrlResolver} from \"../../utils/documentation-url-resolver\";\nimport {LoggerProvider} from \"../../core/services/logger-provider\";\nimport {NumericRangeModel, SelectMenuOptionsModel} from \"../../models/form-fields\";\nimport {SimilarityInstanceType} from '../../models/similarity/similarity-instance-type';\n\nconst logger = LoggerProvider.logger;\n/**\n * @typedef {Object} SimilarityIndexOption\n * @property {string} provider\n * @property {string} label\n * @property {string} value\n * @property {string} group\n */\n\n\nangular\n .module('graphdb.framework.ttyg.controllers.agent-settings-modal', [\n 'graphdb.framework.core.services.similarity',\n 'graphdb.framework.core.services.connectors',\n 'graphdb.framework.rest.repositories.service',\n 'graphdb.framework.ttyg.controllers.agent-instructions-explain-modal',\n 'graphdb.framework.ttyg.services.externalIntegrationModal',\n 'ngTagsInput',\n 'graphdb.framework.core.directives.multiselect',\n ])\n .constant('ExtractionMethodTemplates', {\n 'iri_discovery_search': 'iri-discovery-search',\n 'autocomplete_iri_discovery_search': 'autocomplete-iri-discovery-search',\n })\n .filter('map', function() {\n return function(arr, key) {\n if (!Array.isArray(arr)) {\n return arr;\n }\n return arr.map(function(o) {\n return o[key];\n });\n };\n })\n .controller('AgentSettingsModalController', AgentSettingsModalController);\n\nAgentSettingsModalController.$inject = [\n '$scope',\n '$uibModalInstance',\n 'ModalService',\n '$uibModal',\n 'SimilarityService',\n 'ConnectorsService',\n 'RepositoriesRestService',\n '$sce',\n 'toastr',\n 'UriUtils',\n '$translate',\n 'dialogModel',\n 'TTYGContextService',\n 'TTYGService',\n 'ExtractionMethodTemplates',\n 'AutocompleteService',\n 'AutocompleteRestService',\n 'ExternalIntegrationModalService',\n 'productInfo'];\n\nfunction AgentSettingsModalController(\n $scope,\n $uibModalInstance,\n ModalService,\n $uibModal,\n SimilarityService,\n ConnectorsService,\n RepositoriesRestService,\n $sce,\n toastr,\n UriUtils,\n $translate,\n dialogModel,\n TTYGContextService,\n TTYGService,\n ExtractionMethodTemplates,\n AutocompleteService,\n AutocompleteRestService,\n ExternalIntegrationModalService,\n productInfo) {\n // =========================\n // Private variables\n // =========================\n\n const CHAT_GPT_RETRIEVAL_CONNECTOR_NAME = 'ChatGPT Retrieval';\n let lastTemperatureValue = DEFAULT_TEMPERATURE_RANGE.value;\n let lastTopPValue = DEFAULT_TOP_P_RANGE.value;\n\n // =========================\n // Public variables\n // =========================\n\n /**\n * Flag to control the popover visibility of the similarity input\n * @type {{hovered: boolean}}\n */\n $scope.similarityInput = {hovered: false};\n\n $scope.AGENT_OPERATION = AGENT_OPERATION;\n\n /**\n * The operation type for the modal. This can be one of <code>AGENT_OPERATION</code> constants.\n */\n $scope.operation = dialogModel.operation;\n\n /**\n * Flag to control the visibility of the loader when creating an agent.\n * @type {boolean}\n */\n $scope.savingAgent = false;\n\n /**\n * The model used in the form.\n * @type {AgentFormModel|*}\n */\n $scope.agentFormModel = dialogModel.agentFormModel;\n\n /**\n * The active repository info model.\n * @type {RepositoryInfoModel|*}\n */\n $scope.activeRepositoryInfo = dialogModel.activeRepositoryInfo;\n\n /**\n * Flags used to show/hide the loader for the extraction methods when the user opens a panel and some data needs to\n * be loaded.\n * @type {{[string]: boolean}} - the key is the extraction method types in <code>ExtractionMethod</code>\n */\n $scope.extractionMethodLoaderFlags = {\n [ExtractionMethod.SIMILARITY]: false,\n };\n\n /**\n * The repository select menu options model.\n * @type {SelectMenuOptionsModel[]}\n */\n $scope.activeRepositoryList = dialogModel.activeRepositoryList;\n\n /**\n * The extraction method types constants.\n * @type {{SPARQL: string, FTS_SEARCH: string, SIMILARITY: string, RETRIEVAL: string}}\n */\n $scope.extractionMethods = ExtractionMethod;\n\n /**\n * The additional extraction method types constants.\n * @type {{IRI_DISCOVERY_SEARCH: string, AUTOCOMPLETE_IRI_DISCOVERY_SEARCH: string}}\n */\n $scope.additionalExtractionMethods = AdditionalExtractionMethod;\n\n /**\n * The names of the template files, containing the Extraction Method Templates.\n * @type {Object<string, string>}\n */\n $scope.ExtractionMethodTemplates = ExtractionMethodTemplates;\n\n /**\n * Flag used to show/hide the advanced settings in the modal.\n * @type {boolean}\n */\n $scope.showAdvancedSettings = false;\n\n /**\n * Flag used to show/hide the high temperature warning in the modal.\n * @type {boolean}\n */\n $scope.showHighTemperatureWarning = false;\n\n /**\n * Flag used to control the visibility of the system instruction warning.\n * @type {boolean}\n */\n $scope.showSystemInstructionWarning = false;\n\n /**\n * The retrieval connectors to be used for the retrieval extraction method as select menu options.\n * @type {SelectMenuOptionsModel[]}\n */\n $scope.retrievalConnectors = [];\n\n /**\n * Flag used to show/hide the FTS enabled state in the modal.\n * @type {boolean}\n */\n $scope.ftsEnabled = false;\n\n /**\n * The autocomplete suggestions source for the 'Autocomplete IRI discovery' extraction method.\n * @type {*[]}\n */\n $scope.autocompleteSuggestions = [];\n\n /**\n * Flag to determine if the context size field should be visible in the form.\n * @type {boolean}\n */\n $scope.showContextSize = ($scope.agentFormModel.contextSize !== null);\n\n /**\n * The model for the vector fields select dropdown (Similarity search method).\n * @type {string[]}\n */\n $scope.vectorFields = [];\n\n $scope.documentationUrlForSimilarity = DocumentationUrlResolver.getDocumentationUrl(productInfo.shortVersion, 'talk-to-graph.html#prerequisites-and-configuration');\n\n /**\n * The similarity index select options grouped by provider for the similarity search extraction method.\n * @type {*[]}\n */\n $scope.similarityOptionsGrouped = [];\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Sets the UI touched state and validation state for the extraction methods property so that the UI can show if\n * the user has selected at least one extraction method and warn him if he hasn't.\n *\n * @param {ExtractionMethodFormModel} extractionMethod\n */\n $scope.toggleExtractionMethod = (extractionMethod) => {\n extractionMethod.expanded = extractionMethod.selected;\n $scope.agentSettingsForm.extractionMethods.$setTouched();\n setExtractionMethodValidityStatus();\n extractionPanelToggleHandlers[extractionMethod.method](extractionMethod);\n };\n\n /**\n * Toggles whether the temperature value is included in the agent configuration.\n *\n * When disabled, the temperature value is cleared so that it is not passed in the agent configuration.\n */\n $scope.toggleTemperature = () => {\n const temperature = new NumericRangeModel({...DEFAULT_TEMPERATURE_RANGE});\n if (!$scope.agentFormModel.temperatureEnabled) {\n lastTemperatureValue = $scope.agentFormModel.temperature.value;\n temperature.value = undefined;\n } else {\n temperature.value = lastTemperatureValue;\n }\n $scope.agentFormModel.temperature = temperature;\n updateShowHighTemperatureWarning();\n };\n\n /**\n * Toggles whether the top P value is included in the agent configuration.\n *\n * When disabled, the top P value is cleared so that it is not passed in the agent configuration.\n */\n $scope.toggleTopP = () => {\n const topP = new NumericRangeModel({...DEFAULT_TOP_P_RANGE});\n if (!$scope.agentFormModel.topPEnabled) {\n lastTopPValue = $scope.agentFormModel.topP.value;\n topP.value = undefined;\n } else {\n topP.value = lastTopPValue;\n }\n $scope.agentFormModel.topP = topP;\n };\n\n /**\n * Handles the panel toggle event for the extraction method. This is used to do some initialization when the user\n * opens the panel for a specific extraction method.\n * @param {ExtractionMethodFormModel} extractionMethod\n */\n $scope.onExtractionMethodPanelToggle = (extractionMethod) => {\n extractionMethod.toggleCollapse();\n extractionPanelToggleHandlers[extractionMethod.method](extractionMethod);\n };\n\n /**\n * Sets the UI touched state and validation state for the additional extraction methods property so that the UI can show if\n * the user has selected at least one extraction method.\n *\n * @param {AdditionalExtractionMethodFormModel} extractionMethod\n */\n $scope.toggleAdditionalExtractionMethod = (extractionMethod) => {\n extractionMethod.expanded = extractionMethod.selected;\n $scope.checkAutocompleteIndexEnabled();\n additionalExtractionPanelToggleHandlers[extractionMethod.method](extractionMethod);\n };\n\n /**\n * Handles the panel toggle event for the additional extraction method. This is used to do some initialization when the user\n * opens the panel for a specific extraction method.\n * @param {AdditionalExtractionMethodFormModel} extractionMethod\n */\n $scope.onAdditionalExtractionMethodPanelToggle = (extractionMethod) => {\n extractionMethod.toggleCollapse();\n additionalExtractionPanelToggleHandlers[extractionMethod.method](extractionMethod);\n };\n\n $scope.helpInfoForModel = {\n ttygHelpInfo: getModelHelpMessage(),\n linkText: $translate.instant('ttyg.agent.create_agent_modal.form.model.link_text'),\n documentationUrl: DocumentationUrlResolver.getDocumentationUrl(productInfo.shortVersion, 'talk-to-graph.html#prerequisites-and-configuration'),\n };\n\n /**\n * Resolves the hint for the FTS search missing message. This is needed because the hint contains a html link that\n * should be properly rendered.\n * @return {*}\n */\n $scope.getFTSDisabledHelpMessage = () => {\n // The hint contains a html link which should be properly rendered.\n const message = decodeHTML(\n $translate.instant(\n 'ttyg.agent.create_agent_modal.form.fts_search.fts_disabled_message',\n {repositoryEditPage: 'repository/edit/' + $scope.agentFormModel.repositoryId},\n ),\n );\n return $sce.trustAsHtml(message);\n };\n\n /**\n * Opens the 'Autocomplete index' view in a new tab.\n */\n $scope.goToAutocompleteView = (event) => {\n event.preventDefault();\n TTYGContextService.emit(TTYGEventName.GO_TO_AUTOCOMPLETE_INDEX_VIEW, {repositoryId: $scope.agentFormModel.repositoryId});\n };\n\n /**\n * Opens the 'Create Similarity' view in a new tab.\n */\n $scope.goToCreateSimilarityView = (event) => {\n event.preventDefault();\n TTYGContextService.emit(TTYGEventName.GO_TO_CREATE_SIMILARITY_VIEW, {repositoryId: $scope.agentFormModel.repositoryId});\n };\n\n /**\n * Opens the 'Connectors' view in a new tab.\n */\n $scope.goToConnectorsView = (event) => {\n event.preventDefault();\n TTYGContextService.emit(TTYGEventName.GO_TO_CONNECTORS_VIEW, {repositoryId: $scope.agentFormModel.repositoryId});\n };\n\n /**\n * Handles the selected agent operation which can be one of <code>AGENT_OPERATION</code> types. Respective handler\n * is called based on the operation type with the agent payload build based on the form model.\n * @return {Promise<void>}\n */\n $scope.ok = () => {\n const agentPayload = $scope.agentFormModel.toPayload();\n return agentOperationHandlers[$scope.operation](agentPayload);\n };\n\n /**\n * Closes the modal when the user cancels the agent creation.\n */\n $scope.cancel = () => {\n $uibModalInstance.dismiss({});\n };\n\n /**\n * Closes the modal when the user clicks the close button.\n */\n $scope.close = () => {\n $uibModalInstance.dismiss({});\n };\n\n /**\n * Updates the similarity search panel.\n *\n * @param {boolean} clearIndexSelection - If true, the selected index will be cleared.\n */\n $scope.updateSimilaritySearchPanel = (clearIndexSelection = false) => {\n const similaritySearchExtractionMethod = $scope.agentFormModel.assistantExtractionMethods.getSimilarityExtractionMethod();\n if (!similaritySearchExtractionMethod.selected) {\n // clear the validation status if the method is deselected.\n $scope.agentSettingsForm.$setValidity('FTSDisabled', true);\n return;\n }\n\n if (clearIndexSelection) {\n similaritySearchExtractionMethod.similarityIndex = null;\n }\n handleSimilaritySearchExtractionMethodPanelToggle(similaritySearchExtractionMethod, true);\n };\n\n /**\n * Updates the ChatGPT retrieval connector panel.\n *\n * @param {boolean} clearSelection - If true, the selected connector will be cleared.\n */\n $scope.updateRetrievalConnectorPanel = (clearSelection = false) => {\n const retrievalExtractionExtractionMethod = $scope.agentFormModel.assistantExtractionMethods.getRetrievalExtractionMethod();\n if (!retrievalExtractionExtractionMethod.selected) {\n return;\n }\n if (clearSelection) {\n retrievalExtractionExtractionMethod.retrievalConnectorInstance = null;\n }\n handleRetrievalConnectorExtractionMethodPanelToggle(retrievalExtractionExtractionMethod);\n };\n\n /**\n * Checks if the Full-Text Search (FTS) index is enabled for the selected repository.\n * Sets form validation state based on whether FTS is enabled and required.\n */\n $scope.checkIfFTSEnabled = () => {\n if (!$scope.agentFormModel.repositoryId) {\n $scope.agentSettingsForm.$setValidity('FTSDisabled', false);\n return;\n }\n\n const ftsSearchExtractionMethod = $scope.agentFormModel.assistantExtractionMethods.getFTSSearchExtractionMethod();\n if (!ftsSearchExtractionMethod.selected) {\n // clear the validation status if method is deselected.\n $scope.agentSettingsForm.$setValidity('FTSDisabled', true);\n return;\n }\n\n $scope.extractionMethodLoaderFlags[ExtractionMethod.FTS_SEARCH] = true;\n\n // pass a fake repository info object with only an id because we don't care for the location\n RepositoriesRestService.getRepositoryModel({id: $scope.agentFormModel.repositoryId}).then((repositoryModel) => {\n $scope.ftsEnabled = repositoryModel.getParamValue(REPOSITORY_PARAMS.enableFtsIndex);\n })\n .catch((error) => {\n logAndShowError(error, 'ttyg.agent.messages.error_repository_config_loading');\n })\n .finally(() => {\n $scope.extractionMethodLoaderFlags[ExtractionMethod.FTS_SEARCH] = false;\n $scope.agentSettingsForm.$setValidity('FTSDisabled', $scope.ftsEnabled);\n });\n };\n\n /**\n * Opens a modal to copy the external integration for the currently edited agent.\n *\n * @function\n */\n $scope.openExternalIntegrationConfig = () => {\n const agent = $scope.agentFormModel;\n ExternalIntegrationModalService.open(agent);\n };\n\n /**\n * Handles the change in the repository id field. This is needed because\n * the FTS method configuration depends on the selected repository to be\n * able to validate if the FTS is enabled for that selected repository.\n */\n $scope.onRepositoryChange = () => {\n refreshValidations(true, true);\n };\n\n /**\n * Checks the status of the autocomplete index.\n * @param {AdditionalExtractionMethodFormModel|undefined} method - The extraction method to check the autocomplete\n * index for. This function can be called in the visibilitychange handler, so the method might not be defined.\n * If not provided, it will check the 'Autocomplete IRI discovery search' method from the additional extraction\n * methods.\n */\n $scope.checkAutocompleteIndexEnabled = (method) => {\n if (!method) {\n method = $scope.agentFormModel.additionalExtractionMethods.additionalExtractionMethods\n .find((extractionMethod) => extractionMethod.method === AdditionalExtractionMethod.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH);\n }\n // If the method is not selected, we don't need to check the autocomplete index status.\n // Also, if the repository id is not set, we can't check the autocomplete index status.\n if (method && !method.selected || !$scope.agentFormModel.repositoryId) {\n return;\n }\n const selectedRepositoryInfo = getSelectedRepositoryInfo();\n AutocompleteService.checkAutocompleteStatus(selectedRepositoryInfo.repositoryId, selectedRepositoryInfo.repositoryLocation)\n .then((autocompleteEnabled) => {\n $scope.autocompleteEnabled = autocompleteEnabled;\n $scope.agentSettingsForm.$setValidity('autocompleteDisabled', autocompleteEnabled);\n })\n .catch((error) => {\n $scope.agentSettingsForm.$setValidity('autocompleteDisabled', false);\n toastr.error(getError(error));\n });\n };\n\n /**\n * Restores the default context size.\n */\n $scope.onRestoreDefaultContextSize = () => {\n $scope.agentFormModel.contextSize = $scope.agentFormModel.contextSizeCopy;\n };\n\n /**\n * Restores the default system instructions.\n */\n $scope.onRestoreDefaultSystemInstructions = () => {\n $scope.agentFormModel.instructions.systemInstruction = $scope.agentFormModel.instructions.systemInstructionCopy;\n };\n\n /**\n * Restores the default user instructions.\n */\n $scope.onRestoreDefaultUserInstructions = () => {\n $scope.agentFormModel.instructions.userInstruction = $scope.agentFormModel.instructions.userInstructionCopy;\n };\n\n /**\n * Handles the change in the temperature field. This is needed because the high temperature warning should be shown\n * when the temperature is higher than 1.\n */\n $scope.onTemperatureChange = () => {\n updateShowHighTemperatureWarning();\n };\n\n /**\n * Handles the change in the system instructions field.\n */\n $scope.onSystemInstructionChange = () => {\n if ($scope.agentFormModel.instructions.systemInstruction !== '' && !$scope.showSystemInstructionWarning) {\n $scope.showSystemInstructionWarning = true;\n ModalService.openModalAlert({\n title: $translate.instant('ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.title'),\n message: $translate.instant('ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.body'),\n }).result\n .then(function() {\n // Do nothing, just warning the user\n });\n }\n if ($scope.agentFormModel.instructions.systemInstruction === '') {\n $scope.showSystemInstructionWarning = false;\n }\n };\n\n /**\n * Opens the agent instructions explain modal.\n */\n $scope.onExplainAgentSettings = () => {\n const agentPayload = $scope.agentFormModel.toPayload();\n TTYGService.explainAgentSettings(agentPayload)\n .then((agentInstructionsExplain) => {\n const options = {\n templateUrl: 'js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html',\n controller: 'AgentInstructionsExplainModalController',\n windowClass: 'agent-instructions-explain-modal',\n backdrop: 'static',\n resolve: {\n dialogModel: function() {\n return {\n agentInstructionsExplain,\n };\n },\n },\n size: 'lg',\n };\n $uibModal.open(options).result\n .then(() => {\n // Do nothing\n });\n }).catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n });\n };\n\n /**\n * Populates autocomplete suggestions for the given input text.\n * @param {Event} event - The input event containing the search text.\n */\n $scope.getSuggestions = (event) => {\n const inputText = event.target.value;\n AutocompleteRestService.getAutocompleteSuggestions(inputText)\n .then(mapUriAsNtripleAutocompleteResponse)\n .then((suggestions) => {\n $scope.autocompleteSuggestions = suggestions.map((item) => ({text: item.value}));\n }).catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n });\n };\n\n /**\n * Handles the change event for the vector fields select dropdown.\n * Updates the connector fields based on the selected vector field.\n * @param {ExtractionMethodFormModel} extractionMethod - The extraction method being updated.\n */\n $scope.onVectorFieldsChange = function(extractionMethod) {\n extractionMethod.connectorFields = extractionMethod.selectedConnectorField ? [extractionMethod.selectedConnectorField] : [];\n };\n\n /**\n * Determines whether there is connector data available for the similarity search extraction method.\n * @returns {boolean} True if connector data exists, false otherwise.\n */\n $scope.hasConnectorData = () => {\n return !!($scope.connectorMap && Object.keys($scope.connectorMap).length);\n };\n\n /**\n * Determines whether the vector fields select dropdown should be shown for the similarity search extraction method.\n * @param {ExtractionMethodFormModel} extractionMethod - The extraction method to check.\n * @returns {boolean} True if vector fields dropdown should be shown, false otherwise.\n */\n $scope.shouldShowVectorFields = (extractionMethod) => {\n if (!extractionMethod) {\n return false;\n }\n\n const provider = extractionMethod.connectorType;\n const indexName = extractionMethod.similarityIndex;\n\n if (!isVectorProvider(provider)) {\n return false;\n }\n\n if (Array.isArray($scope.vectorFields)) {\n return $scope.vectorFields.length > 0;\n }\n\n const fields = getVectorFieldsFromMap(provider, indexName);\n\n return Array.isArray(fields) && fields.length > 0;\n };\n\n /**\n * Handles the change event for the similarity index select menu.\n * Updates the connector type, similarity index, and refreshes available vector fields.\n * @param {ExtractionMethodFormModel} extractionMethod - The extraction method being updated.\n */\n $scope.onSimilarityIndexChange = (extractionMethod) => {\n const option = extractionMethod && extractionMethod.similarityIndexOption;\n // The user needs to select a vector field again.\n extractionMethod.selectedConnectorField = undefined;\n extractionMethod.connectorFields = [];\n\n if (!option) {\n extractionMethod.connectorType = null;\n extractionMethod.similarityIndex = '';\n $scope.vectorFields = [];\n return;\n }\n\n extractionMethod.connectorType = option.provider;\n extractionMethod.similarityIndex = option.value;\n\n $scope.vectorFields = getVectorFieldsFromMap(option.provider, option.value);\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Gets vector fields from the connector map for a given provider and index name.\n * @param {string} provider - The provider type.\n * @param {string} indexName - The index name.\n * @returns {Array} The vector fields array, or an empty array if not found.\n */\n const getVectorFieldsFromMap = (provider, indexName) => {\n const map = $scope.connectorMap || {};\n return (map[provider] && map[provider][indexName])\n ? map[provider][indexName]\n : [];\n };\n\n /**\n * Updates the vector fields in the select dropdown based on the selected extraction method.\n * @param extractionMethod\n */\n const updateVectorFields = (extractionMethod) => {\n const provider = extractionMethod.connectorType;\n const indexName = extractionMethod.similarityIndex;\n\n if (!isVectorProvider(provider)) {\n $scope.vectorFields = [];\n return;\n }\n\n $scope.vectorFields = getVectorFieldsFromMap(provider, indexName);\n };\n\n /**\n * Resolves the hint message for the agent model property.\n * This is needed because the hint contains a html link that\n * should be properly rendered.\n * @return {*}\n */\n function getModelHelpMessage() {\n // The hint contains a html link which should be properly rendered.\n const message = decodeHTML($translate.instant('ttyg.agent.create_agent_modal.form.model.hint'));\n return $sce.trustAsHtml(message);\n }\n\n /**\n * Mapping of agent operations to their respective handlers.\n * @type {{[AGENT_OPERATION.EDIT]: (function(*): Promise<void>), [AGENT_OPERATION.CLONE]: (function(*): Promise<void>), [AGENT_OPERATION.CREATE]: (function(*): Promise<void>)}}\n */\n const agentOperationHandlers = {\n [AGENT_OPERATION.CREATE]: (payload) => createAgent(payload),\n [AGENT_OPERATION.EDIT]: (payload) => editAgent(payload),\n [AGENT_OPERATION.CLONE]: (payload) => cloneAgent(payload),\n };\n\n /**\n * Creates a new agent with the given payload and closes the modal if no errors occur.\n * @param {*} newAgentPayload - the payload for the new agent.\n * @return {Promise<void>}\n */\n const createAgent = (newAgentPayload) => {\n $scope.savingAgent = true;\n return TTYGService.createAgent(newAgentPayload)\n .then((agentModel) => {\n $uibModalInstance.close(agentModel);\n toastr.success($translate.instant('ttyg.agent.messages.agent_save_successfully', {agentName: agentModel.name}));\n })\n .catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n })\n .finally(() => {\n $scope.savingAgent = false;\n });\n };\n\n /**\n * Sends the edit agent payload to the server and closes the modal if no errors occur.\n * @param {*} agentPayload - the payload for the agent to be edited.\n * @return {Promise<void>}\n */\n const editAgent = (agentPayload) => {\n $scope.savingAgent = true;\n return TTYGService.editAgent(agentPayload)\n .then((updatedAgent) => {\n $uibModalInstance.close(updatedAgent);\n toastr.success($translate.instant('ttyg.agent.messages.agent_save_successfully', {agentName: updatedAgent.name}));\n })\n .catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n })\n .finally(() => {\n $scope.savingAgent = false;\n });\n };\n\n /**\n * Clones the agent with the given payload and closes the modal if no errors occur.\n * @param {*} agentPayload\n * @return {Promise<void>}\n */\n const cloneAgent = (agentPayload) => {\n $scope.savingAgent = true;\n return TTYGService.createAgent(agentPayload)\n .then((updatedAgent) => {\n $uibModalInstance.close(updatedAgent);\n toastr.success($translate.instant(\"ttyg.agent.messages.agent_save_successfully\", {agentName: updatedAgent.name}));\n })\n .catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n })\n .finally(() => {\n $scope.savingAgent = false;\n });\n };\n\n const logAndShowError = (error, errorMessageKey) => {\n logger.error(error);\n toastr.error($translate.instant(errorMessageKey));\n };\n\n const setExtractionMethodValidityStatus = () => {\n $scope.agentSettingsForm.extractionMethods.$setValidity('required', $scope.agentFormModel.hasExtractionMethodSelected());\n };\n\n const handleFTSExtractionMethodPanelToggle = (extractionMethod) => {\n $scope.checkIfFTSEnabled();\n };\n\n /**\n * Returns the repository info model for the selected repository in the form.\n *\n * @return {{repositoryLocation: (*|undefined), repositoryId: (*|undefined)}}\n */\n const getSelectedRepositoryInfo = () => {\n const selectRepositoryInfo = $scope.activeRepositoryList.find((repository) => repository.value === $scope.agentFormModel.repositoryId);\n return {\n repositoryId: selectRepositoryInfo ? selectRepositoryInfo.data.repository.id : undefined,\n repositoryLocation: selectRepositoryInfo ? selectRepositoryInfo.data.repository.location : undefined,\n };\n };\n\n const isVectorProvider = (p) => p === SimilarityInstanceType.OPENSEARCH || p === SimilarityInstanceType.ELASTICSEARCH;\n\n /**\n * Creates grouped options for ng-options with optgroups.\n * @param connectorMap - The connector map with similarity indexes.\n */\n const buildSimilarityIndexSelectOptions = (connectorMap) => {\n /** @type {SimilarityIndexOption[]} */\n $scope.similarityOptionsGrouped = [];\n Object.entries(connectorMap).forEach(([provider, types]) => {\n const groupLabel = $translate.instant(`ttyg.agent.create_agent_modal.form.similarity_instance_type_label.${provider}`);\n Object.keys(types || {}).forEach((typeName) => {\n $scope.similarityOptionsGrouped.push({\n provider,\n label: typeName,\n value: typeName,\n group: groupLabel,\n });\n });\n });\n };\n\n const handleSimilaritySearchExtractionMethodPanelToggle = (extractionMethod, clearSelectedVectorField = false) => {\n if (!extractionMethod.selected) {\n // clear the validation status if the method is deselected.\n $scope.agentSettingsForm.$setValidity('missingIndex', true);\n return;\n }\n // Check if the connector instances select is pristine (unchanged). Treat the field as pristine until it exists.\n // Because it's loaded with ng-if, on first pass through here, it won't exist yet, so we treat it as pristine.\n const connectorField = $scope.agentSettingsForm && $scope.agentSettingsForm.connectorInstances;\n const isConnectorPristine = connectorField ? connectorField.$pristine : true;\n // Don't reload the indexes and override the user selection if the connector instances field is pristine\n if ($scope.connectorMap && !isConnectorPristine) {\n return;\n }\n if (!$scope.agentFormModel.repositoryId) {\n return;\n }\n $scope.extractionMethodLoaderFlags[extractionMethod.method] = true;\n const selectedRepositoryInfo = getSelectedRepositoryInfo();\n SimilarityService.getSimilarityIndexesWithVectorFields(selectedRepositoryInfo.repositoryId)\n .then((connectorMap) => {\n $scope.connectorMap = connectorMap;\n const indexes = buildSelectMenuOptions(connectorMap);\n // if no indexes are found, selection (connectorsMap) will be cleaned and the info message will be\n // shown to the user again\n buildSimilarityIndexSelectOptions(connectorMap);\n updateSelectedSimilarityIndex(indexes, extractionMethod);\n updateVectorFields(extractionMethod);\n\n $scope.agentSettingsForm.$setValidity('missingIndex', !extractionMethod.selected || $scope.hasConnectorData());\n // Initially, when there is no selection, the first index is selected, and we need to trigger the\n // onSimilarityIndexChange to set the connector fields.\n if (clearSelectedVectorField || (extractionMethod.connectorFields && extractionMethod.connectorFields.length === 0)) {\n $scope.onSimilarityIndexChange(extractionMethod);\n }\n })\n .catch((error) => {\n $scope.connectorMap = null;\n $scope.agentSettingsForm.$setValidity('missingIndex', false);\n logAndShowError(error, 'ttyg.agent.messages.error_similarity_indexes_loading');\n })\n .finally(() => {\n $scope.extractionMethodLoaderFlags[extractionMethod.method] = false;\n });\n };\n\n /**\n * Updates the selected similarity index for the extraction method.\n *\n * @param {SelectMenuOptionsModel[]} indexes - The list of all available similarity indexes.\n * @param {Object} extractionMethod - The extraction method object containing the currently selected similarity index.\n */\n const updateSelectedSimilarityIndex = (indexes, extractionMethod) => {\n if (!indexes.length) {\n extractionMethod.connectorType = '';\n extractionMethod.similarityIndex = '';\n extractionMethod.similarityIndexOption = undefined;\n return;\n }\n\n const currentType = extractionMethod.connectorType;\n const currentName = extractionMethod.similarityIndex;\n\n // Find previously selected index or default to the first one\n const matchedIndex = indexes.find((index) =>\n index.data.connectorType === currentType &&\n index.value === currentName,\n );\n const selectedIndex = matchedIndex || indexes[0];\n\n extractionMethod.connectorType = selectedIndex.data.connectorType;\n extractionMethod.similarityIndex = selectedIndex.value;\n\n const options = $scope.similarityOptionsGrouped || [];\n const opt = options.find((option) =>\n option.provider === extractionMethod.connectorType &&\n option.value === extractionMethod.similarityIndex,\n );\n\n extractionMethod.similarityIndexOption = opt || undefined;\n };\n\n const buildSelectMenuOptions = (data) => {\n const result = [];\n\n Object.entries(data).forEach(([connectorType, indexes]) => {\n Object.entries(indexes).forEach(([indexName, fields]) => {\n result.push(\n new SelectMenuOptionsModel({\n label: indexName,\n value: indexName,\n data: {connectorType, connectorFields: fields},\n }),\n );\n });\n });\n\n return result;\n };\n\n const handleRetrievalConnectorExtractionMethodPanelToggle = (extractionMethod) => {\n if (!$scope.agentFormModel.repositoryId) {\n return;\n }\n if (!extractionMethod.selected) {\n // clear the validation status if method is deselected.\n $scope.agentSettingsForm.$setValidity('missingConnector', true);\n return;\n }\n\n $scope.extractionMethodLoaderFlags[extractionMethod.method] = true;\n const selectedRepositoryInfo = getSelectedRepositoryInfo();\n ConnectorsService.getConnectorPrefixByName(CHAT_GPT_RETRIEVAL_CONNECTOR_NAME, selectedRepositoryInfo.repositoryId, selectedRepositoryInfo.repositoryLocation)\n .then((prefix) => ConnectorsService.getConnectorsByTypeAsSelectMenuOptions(prefix, selectedRepositoryInfo.repositoryId, selectedRepositoryInfo.repositoryLocation))\n .then((connectors) => {\n $scope.retrievalConnectors = connectors;\n $scope.agentSettingsForm.$setValidity('missingConnector', !extractionMethod.selected || !!(connectors && connectors.length));\n updateSelectedRetrievalConnector($scope.retrievalConnectors, extractionMethod);\n })\n .catch((error) => {\n $scope.agentSettingsForm.$setValidity('missingConnector', false);\n logAndShowError(error, 'ttyg.agent.messages.error_retrieval_connectors_loading');\n })\n .finally(() => {\n $scope.extractionMethodLoaderFlags[extractionMethod.method] = false;\n });\n };\n\n /**\n * Updates the selected retrieval connector for the extraction method.\n *\n * @param {SelectMenuOptionsModel[]} retrievalConnectors - The list of all available connectors.\n * @param {Object} extractionMethod - The extraction method object containing the currently selected retrieval connector.\n */\n const updateSelectedRetrievalConnector = (retrievalConnectors, extractionMethod) => {\n if (retrievalConnectors.length === 0) {\n // If no connector are available, clear the similarity index.\n extractionMethod.retrievalConnectorInstance = null;\n return;\n }\n const selectedConnector = retrievalConnectors.find((connector) => connector.value === extractionMethod.retrievalConnectorInstance);\n\n // If the selected connector is not found in the current list, default to the first index.\n extractionMethod.retrievalConnectorInstance = selectedConnector\n ? selectedConnector.value\n : retrievalConnectors[0].value;\n };\n\n const extractionPanelToggleHandlers = {\n [ExtractionMethod.FTS_SEARCH]: (extractionMethod) => handleFTSExtractionMethodPanelToggle(extractionMethod),\n [ExtractionMethod.SPARQL]: (extractionMethod) => {\n },\n [ExtractionMethod.SIMILARITY]: (extractionMethod) => handleSimilaritySearchExtractionMethodPanelToggle(extractionMethod),\n [ExtractionMethod.RETRIEVAL]: (extractionMethod) => handleRetrievalConnectorExtractionMethodPanelToggle(extractionMethod),\n };\n\n const additionalExtractionPanelToggleHandlers = {\n [AdditionalExtractionMethod.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH]: (extractionMethod) => handleAutocompleteExtractionMethodPanelToggle(extractionMethod),\n [AdditionalExtractionMethod.IRI_DISCOVERY_SEARCH]: () => {\n },\n };\n\n const handleAutocompleteExtractionMethodPanelToggle = (extractionMethod) => {\n if (!extractionMethod.selected) {\n // clear the validation status if method is deselected.\n $scope.agentSettingsForm.$setValidity('autocompleteDisabled', true);\n }\n $scope.checkAutocompleteIndexEnabled(extractionMethod);\n };\n\n const refreshValidations = (clearIndexSelection = false, clearRetrievalConnectorSelection = false) => {\n $scope.checkIfFTSEnabled();\n $scope.updateSimilaritySearchPanel(clearIndexSelection);\n $scope.updateRetrievalConnectorPanel(clearRetrievalConnectorSelection);\n $scope.checkAutocompleteIndexEnabled();\n updateShowHighTemperatureWarning();\n };\n\n const onTabVisibilityChanged = () => {\n if (!document.hidden) {\n refreshValidations();\n }\n };\n\n const refreshSliderById = (elementId, value) => {\n const slider = document.getElementById(elementId);\n if (slider) {\n slider.value = value;\n }\n };\n\n const updateShowHighTemperatureWarning = () => {\n $scope.showHighTemperatureWarning = $scope.agentFormModel.temperature.value > 1;\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n const removeAllSubscribers = () => {\n document.removeEventListener(\"visibilitychange\", onTabVisibilityChanged);\n };\n\n document.addEventListener(\"visibilitychange\", onTabVisibilityChanged);\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n\n\n // =========================\n // Initialization\n // =========================\n\n const init = () => {\n // Set repository id to null if it is missing from the list of active repositories\n const selectedRepositoryInfo = getSelectedRepositoryInfo();\n if (!selectedRepositoryInfo.repositoryId) {\n $scope.agentFormModel.repositoryId = null;\n }\n // Delay the validation status setting because angular form ngmodel is not present immediately\n setTimeout(setExtractionMethodValidityStatus, 0);\n $uibModalInstance.rendered.then(() => {\n refreshSliderById('temperatureSlider', $scope.agentFormModel.temperature.value);\n refreshSliderById('topPSlider', $scope.agentFormModel.topP.value);\n if ($scope.operation !== AGENT_OPERATION.CREATE) {\n refreshValidations();\n }\n });\n };\n init();\n}\n","angular\n .module('graphdb.framework.ttyg.controllers.external-integration-configuration-modal', [])\n .controller('ExternalIntegrationConfigurationModalController', ExternalIntegrationConfigurationModalController);\n\nExternalIntegrationConfigurationModalController.$inject = [\n '$scope',\n '$uibModalInstance',\n 'ModalService',\n '$translate',\n 'dialogModel'\n];\n\nfunction ExternalIntegrationConfigurationModalController($scope, $uibModalInstance, ModalService, $translate, dialogModel) {\n // =========================\n // Public variables\n // =========================\n\n $scope.externalIntegrationConfiguration = dialogModel.externalIntegrationConfiguration;\n $scope.difyExtension = dialogModel.difyExtensionUrl;\n $scope.queryMethods = dialogModel.queryMethodsUrl;\n $scope.agentId = dialogModel.agentId;\n $scope.agentName = dialogModel.agentName;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Closes the modal when the user clicks the close button.\n */\n $scope.close = () => {\n $uibModalInstance.dismiss({});\n };\n\n $scope.onCloseExternalIntegrationConfigurationModal = () => {\n $uibModalInstance.dismiss({});\n };\n}\n","import 'angular/ttyg/controllers/external-integration-configuration-modal.controller';\nimport {TTYG_ERROR_MSG_LENGTH} from \"./constants\";\n\nangular\n .module('graphdb.framework.ttyg.services.externalIntegrationModal',\n ['graphdb.framework.ttyg.controllers.external-integration-configuration-modal'])\n .factory('ExternalIntegrationModalService', ExternalIntegrationModalService)\n\nExternalIntegrationModalService.$inject = ['$uibModal', 'LocationsRestService', 'toastr'];\n\nfunction ExternalIntegrationModalService($uibModal, LocationsRestService, toastr) {\n function buildDialogModel(agent, baseUrl) {\n return {\n agentName: agent.name,\n agentId: agent.id,\n queryMethodsUrl: `${baseUrl}/rest/llm/tool/ttyg/${agent.id}`,\n difyExtensionUrl: `${baseUrl}/rest/llm/ttyg/${agent.id}/dify`\n };\n }\n\n function open(agent) {\n return LocationsRestService.getExternalUrl()\n .then((response) => {\n const dialogModel = buildDialogModel(agent, response.data);\n\n return $uibModal.open({\n templateUrl: 'js/angular/ttyg/templates/modal/external-integration-configuration-modal.html',\n controller: 'ExternalIntegrationConfigurationModalController',\n windowClass: 'external-integration-configuration-modal',\n backdrop: 'static',\n resolve: {\n dialogModel: () => dialogModel\n }\n }).result\n .then(() => {\n // Modal was closed with success - do nothing\n })\n .catch(() => {\n // Modal was dismissed — do nothing\n });\n })\n .catch((error) => {\n // Catches API failure\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n });\n }\n\n return {open};\n}\n"],"names":["angular","module","directive","restrict","scope","items","placeholder","onChange","labelKeys","templateUrl","controller","$scope","$document","$element","$filter","$timeout","open","search","query","visibleItems","subscriptions","normalize","v","toLowerCase","rebuildFiltered","list","Array","isArray","normalizedQuery","filter","i","label","includes","onDocClick","e","contains","target","$applyAsync","toggleOpen","stopPropagation","input","querySelector","focus","onKeydownMenu","key","preventDefault","btn","selectedCount","selected","length","allFilteredSelected","every","someFilteredSelected","any","some","all","toggleSelectAll","makeSelected","item","emitChange","on","push","$watch","$watchCollection","$on","onDestroyCallback","off","unsubscribe","SimilarityInstanceType","logger","LoggerProvider","AgentSettingsModalController","$uibModalInstance","ModalService","$uibModal","SimilarityService","ConnectorsService","RepositoriesRestService","$sce","toastr","UriUtils","$translate","dialogModel","TTYGContextService","TTYGService","ExtractionMethodTemplates","AutocompleteService","AutocompleteRestService","ExternalIntegrationModalService","productInfo","lastTemperatureValue","DEFAULT_TEMPERATURE_RANGE","value","lastTopPValue","DEFAULT_TOP_P_RANGE","similarityInput","hovered","AGENT_OPERATION","operation","savingAgent","agentFormModel","activeRepositoryInfo","extractionMethodLoaderFlags","ExtractionMethod","SIMILARITY","activeRepositoryList","extractionMethods","additionalExtractionMethods","AdditionalExtractionMethod","showAdvancedSettings","showHighTemperatureWarning","showSystemInstructionWarning","retrievalConnectors","ftsEnabled","autocompleteSuggestions","showContextSize","contextSize","vectorFields","documentationUrlForSimilarity","DocumentationUrlResolver","getDocumentationUrl","shortVersion","similarityOptionsGrouped","toggleExtractionMethod","extractionMethod","expanded","agentSettingsForm","$setTouched","setExtractionMethodValidityStatus","extractionPanelToggleHandlers","method","toggleTemperature","temperature","NumericRangeModel","temperatureEnabled","undefined","updateShowHighTemperatureWarning","toggleTopP","topP","topPEnabled","onExtractionMethodPanelToggle","toggleCollapse","toggleAdditionalExtractionMethod","checkAutocompleteIndexEnabled","additionalExtractionPanelToggleHandlers","onAdditionalExtractionMethodPanelToggle","helpInfoForModel","ttygHelpInfo","message","decodeHTML","instant","trustAsHtml","getModelHelpMessage","linkText","documentationUrl","getFTSDisabledHelpMessage","repositoryEditPage","repositoryId","goToAutocompleteView","event","emit","TTYGEventName","GO_TO_AUTOCOMPLETE_INDEX_VIEW","goToCreateSimilarityView","GO_TO_CREATE_SIMILARITY_VIEW","goToConnectorsView","GO_TO_CONNECTORS_VIEW","ok","agentPayload","toPayload","agentOperationHandlers","cancel","dismiss","close","updateSimilaritySearchPanel","clearIndexSelection","similaritySearchExtractionMethod","assistantExtractionMethods","getSimilarityExtractionMethod","similarityIndex","handleSimilaritySearchExtractionMethodPanelToggle","$setValidity","updateRetrievalConnectorPanel","clearSelection","retrievalExtractionExtractionMethod","getRetrievalExtractionMethod","retrievalConnectorInstance","handleRetrievalConnectorExtractionMethodPanelToggle","checkIfFTSEnabled","getFTSSearchExtractionMethod","FTS_SEARCH","getRepositoryModel","id","then","repositoryModel","getParamValue","REPOSITORY_PARAMS","enableFtsIndex","catch","error","logAndShowError","finally","openExternalIntegrationConfig","agent","onRepositoryChange","refreshValidations","find","AUTOCOMPLETE_IRI_DISCOVERY_SEARCH","selectedRepositoryInfo","getSelectedRepositoryInfo","checkAutocompleteStatus","repositoryLocation","autocompleteEnabled","getError","onRestoreDefaultContextSize","contextSizeCopy","onRestoreDefaultSystemInstructions","instructions","systemInstruction","systemInstructionCopy","onRestoreDefaultUserInstructions","userInstruction","userInstructionCopy","onTemperatureChange","onSystemInstructionChange","openModalAlert","title","result","onExplainAgentSettings","explainAgentSettings","agentInstructionsExplain","options","windowClass","backdrop","resolve","size","TTYG_ERROR_MSG_LENGTH","getSuggestions","inputText","getAutocompleteSuggestions","mapUriAsNtripleAutocompleteResponse","suggestions","map","text","onVectorFieldsChange","connectorFields","selectedConnectorField","hasConnectorData","connectorMap","Object","keys","shouldShowVectorFields","provider","connectorType","indexName","isVectorProvider","fields","getVectorFieldsFromMap","onSimilarityIndexChange","option","similarityIndexOption","CREATE","payload","createAgent","EDIT","editAgent","CLONE","cloneAgent","newAgentPayload","agentModel","success","agentName","name","updatedAgent","errorMessageKey","hasExtractionMethodSelected","selectRepositoryInfo","repository","data","location","p","OPENSEARCH","ELASTICSEARCH","clearSelectedVectorField","connectorField","connectorInstances","isConnectorPristine","$pristine","getSimilarityIndexesWithVectorFields","indexes","buildSelectMenuOptions","entries","forEach","types","groupLabel","typeName","group","buildSimilarityIndexSelectOptions","updateSelectedSimilarityIndex","updateVectorFields","currentType","currentName","selectedIndex","index","opt","SelectMenuOptionsModel","getConnectorPrefixByName","prefix","getConnectorsByTypeAsSelectMenuOptions","connectors","updateSelectedRetrievalConnector","selectedConnector","connector","SPARQL","RETRIEVAL","handleAutocompleteExtractionMethodPanelToggle","IRI_DISCOVERY_SEARCH","clearRetrievalConnectorSelection","onTabVisibilityChanged","document","hidden","refreshSliderById","elementId","slider","getElementById","addEventListener","removeAllSubscribers","removeEventListener","setTimeout","rendered","constant","arr","o","$inject","ExternalIntegrationConfigurationModalController","externalIntegrationConfiguration","difyExtension","difyExtensionUrl","queryMethods","queryMethodsUrl","agentId","onCloseExternalIntegrationConfigurationModal","LocationsRestService","getExternalUrl","response","baseUrl","buildDialogModel","factory"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- export const __webpack_esm_id__=80933;export const __webpack_esm_ids__=[28662,64709,78469,80933,83847];export const __webpack_esm_modules__={80933(e,r,o){o(22742),o(33136),o(41559),o(83847),o(64709),o(72953),o(75752),o(21146),o(63030),angular.module("graphdb.framework.impex.import",["toastr","ngRoute","ngFileUpload","ui.bootstrap","graphdb.framework.impex.import.controllers","graphdb.framework.core.services.repositories","graphdb.framework.import.directives.validate-uri","graphdb.framework.import.directives.import-progress-indicator","graphdb.framework.import.directives.import-resource-tree"])},78469(e,r,o){var t=o(71315);angular.module("graphdb.framework.impex.import.controllers.import-resource-message-dialog",[]).controller("ImportResourceMessageDialogController",i),i.$inject=["$scope","$uibModalInstance","$translate","toastr","message"];const s=t.I.logger;function i(e,r,o,t,i){e.message=i,e.close=()=>{r.dismiss()},e.copyToClipboard=()=>{navigator.clipboard.writeText(e.message).then(()=>{t.success(o.instant("import.help.messages.copied_to_clipboard")),e.close()},e=>{s.error("Could not copy text: ",e)})}}},64709(){function e(){return{link:function(e,r,o){e.$watch("file.status",function(){"IMPORTING"!==e.file.status&&"UPLOADING"!==e.file.status||!$(r).has("object").length>0&&$(r).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=4.0.0-TR2">{{\'common.loading\' | translate}}</object>')})}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",e),e.$inject=[]},60016(e,r,o){o(78469);var t=o(2998),s=o(35195);function i(e){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-message.html",scope:{resource:"="},link:r=>{r.ImportResourceStatus=t.I,r.toTitleCase=e=>s.Sn(e),r.showMessage=r=>{e.open({templateUrl:"js/angular/import/templates/import-resource-message-dialog.html",controller:"ImportResourceMessageDialogController",size:"lg",windowClass:"import-resource-message-dialog",backdrop:"static",resolve:{message:function(){return r?r.importResource.message:""}}})}}}}angular.module("graphdb.framework.import.directives.import-resource-message",["graphdb.framework.impex.import.controllers.import-resource-message-dialog"]).directive("importResourceMessage",i),i.$inject=["$uibModal"]},28662(){function e(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-status-info.html",scope:{resource:"="},link:o=>{const t=[];o.popoverTemplate="resourceStatusInfoTemplate.html",o.popoverIsOpen=!1,o.context=o.resource.importResource.context,o.replaceGraphs=o.resource.importResource.replaceGraphs,o.baseUrl=decodeURIComponent(o.resource.importResource.baseURI),o.forceSerial=o.resource.importResource.forceSerial,o.importedOn=o.resource.importResource.importedOn,o.parserSettings=o.resource.importResource.parserSettings,o.open=()=>{o.closeAllDialogs(),o.popoverIsOpen=!0},o.closeAllDialogs=()=>{e.$broadcast("closePopovers")},o.close=()=>{o.popoverIsOpen=!1};const s=e=>{"Escape"===e.key&&o.$apply(()=>{o.close()})};t.push(o.$on("closePopovers",o.close)),r.on("keydown",s),o.$on("$destroy",()=>{r.off("keydown",s),t.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-status-info",[]).directive("importResourceStatusInfo",e),e.$inject=["$rootScope","$document"]},72953(e,r,o){var t=o(2998),s=(o(60016),o(28662),o(66256)),i=o(71609),c=o(59601),a=o(33757),l=o(57154);const p={FILE:"FILE",DIRECTORY:"DIRECTORY",ALL:"ALL"},n={ALL:"ALL",NONE:"NONE",IMPORTED:"IMPORTED",NOT_IMPORTED:"NOT_IMPORTED"};function u(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-tree.html",scope:{columnKeys:"=",showTypeFilter:"=",sortBy:"=",asc:"=",onImport:"&",onImportAll:"&",onReset:"&",onRemove:"&",onStopImport:"&",onEditResource:"&"},link:(o,u,m)=>{o.resources=new i.k,o.displayResources=[],o.TYPE_FILTER_OPTIONS=p,o.filterByType=p.ALL,o.filterByFileName="",o.STATUS_OPTIONS=n,o.selectedByStatus=void 0,o.areAllDisplayedImportResourcesSelected=!1,o.areAllDisplayedImportResourcesPartialSelected=!1,o.ImportResourceStatus=t.I,o.canRemoveResource=angular.isDefined(m.onRemove),o.canResetSelectedResources=!1,o.SORTING_TYPES=s.R,o.sortAsc=!angular.isDefined(m.asc)||o.asc,o.sortedBy=o.sortBy,o.showLoader=r.getShowLoader(),o.hasSelection=!1,o.selectionChanged=e=>{e.setSelection(e.selected),I(),d(),g()},o.selectResourceWithStatus=e=>{o.selectedByStatus=e,o.resources.setSelection(!1),n.ALL===o.selectedByStatus?o.resources.setSelection(!0):n.IMPORTED===o.selectedByStatus?o.resources.selectAllWithStatus([t.I.DONE]):n.NOT_IMPORTED===o.selectedByStatus&&o.resources.selectAllWithStatus([t.I.IMPORTING,t.I.NONE,t.I.ERROR,t.I.PENDING,t.I.INTERRUPTING]),R(),d()},o.filterByTypeChanged=e=>{o.filterByType=e,R()},o.filterByFileNameChanged=e=>{o.filterByFileName=e,N(R,100)},o.onResetStatus=()=>{const e=o.resources.getAllSelected().map(e=>e.path);e.length>0&&o.onReset({resources:e})},o.resetStatus=e=>{o.onReset({resources:[e.path]})},o.onRemoveResources=()=>{const e=o.resources.getAllSelected();e&&e.length>0&&o.onRemove({resources:e})},o.removeResource=e=>{o.onRemove({resources:[e]})},o.importAll=e=>{const r=o.resources.getAllSelectedForImport();r.length>0&&o.onImportAll({selectedResources:r,withoutChangingSettings:e})},o.stopImport=e=>{o.onStopImport({resource:e})},o.sort=e=>{o.sortedBy===e?o.sortAsc=!o.sortAsc:o.sortAsc=!0,o.sortedBy=e,R()},o.editResource=e=>{o.onEditResource({resource:e})};const d=()=>{o.canResetSelectedResources=o.resources.getSelectedImportedResources()},R=()=>{o.resources.getRoot().updateSelectionState(),y(),o.displayResources=o.resources.toList().filter(A).filter(E),g(),I()},g=()=>{const e=o.resources.getAllSelectedFilesNames();o.hasSelection=e.length>0,r.updateSelectedFilesNames(e)},I=()=>{const e=o.displayResources.some(e=>!e.selected),r=o.displayResources.some(e=>e.selected);o.areAllDisplayedImportResourcesSelected=r&&!e,o.areAllDisplayedImportResourcesPartialSelected=r&&e},y=()=>{s.R.NAME===o.sortedBy?o.resources.sort(f(o.sortAsc)):s.R.SIZE===o.sortedBy?o.resources.sort(h(o.sortAsc)):s.R.MODIFIED===o.sortedBy?o.resources.sort(S(o.sortAsc)):s.R.IMPORTED===o.sortedBy?o.resources.sort(T(o.sortAsc)):s.R.CONTEXT===o.sortedBy&&o.resources.sort(v(o.sortAsc))},f=e=>(r,o)=>e?r.importResource.name.localeCompare(o.importResource.name):o.importResource.name.localeCompare(r.importResource.name),h=e=>(r,o)=>{const t=l.ByteUtils.convertToBytes(r.importResource.size),s=l.ByteUtils.convertToBytes(o.importResource.size);return e?t-s:s-t},S=e=>(r,o)=>{const t=r.importResource.modifiedOn||Number.MAX_VALUE,s=o.importResource.modifiedOn||Number.MAX_VALUE;return e?t-s:s-t},T=e=>(r,o)=>{const t=r.importResource.importedOn||Number.MAX_VALUE,s=o.importResource.importedOn||Number.MAX_VALUE;return e?t-s:s-t},v=e=>(r,o)=>e?r.importResource.context.localeCompare(o.importResource.context):o.importResource.context.localeCompare(r.importResource.context),A=e=>p.ALL===o.filterByType||(o.filterByType===p.FILE?e.isFile():o.filterByType===p.DIRECTORY&&e.isDirectory()),E=e=>!o.filterByFileName||(o.filterByType===p.DIRECTORY?e.hasTextInDirectoriesName(o.filterByFileName):o.filterByType===p.FILE?e.hasTextInFilesName(o.filterByFileName):e.hasTextInResourcesName(o.filterByFileName));let O;const N=(r,o)=>{O&&e.cancel(O),O=e(r,o)},b=[];b.push(r.onResourcesUpdated((e=[])=>{const t=c.D.USER===r.getActiveTabId();o.resources.isEmpty()?(o.resources=a.Fp.toImportResourceTree(e,t),t&&(o.sortedBy=s.R.MODIFIED)):a.Fp.mergeResourceTree(o.resources,e,t),a.Fp.calculateElementIndent(o.resources),a.Fp.setupAfterTreeInitProperties(o.resources),R(),d()})),b.push(r.onShowLoaderUpdated(e=>o.showLoader=e)),b.push(r.onActiveTabIdUpdated(()=>o.resources=new i.k)),o.$on("$destroy",()=>{b.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-tree",["graphdb.framework.import.directives.import-resource-message","graphdb.framework.import.directives.import-resource-status-info"]).directive("importResourceTree",u),u.$inject=["$timeout","ImportContextService"]},83847(){function e(e){return{restrict:"A",require:"ngModel",link:function(r,o,t,s){s.$parsers.unshift(function(r){if(s.$setValidity("validateUri",!0),!s.$isEmpty(r)){const o=e.isValidIri(r,r.toString());s.$setValidity("validateUri",o)}return r})}}}angular.module("graphdb.framework.import.directives.validate-uri",[]).directive("validateUri",e),e.$inject=["UriUtils"]}};
2
- //# sourceMappingURL=80933.19f69bc85c52a8b19311.bundle.js.map
1
+ export const __webpack_esm_id__=80933;export const __webpack_esm_ids__=[28662,64709,78469,80933,83847];export const __webpack_esm_modules__={80933(e,r,o){o(22742),o(33136),o(41559),o(83847),o(64709),o(72953),o(75752),o(21146),o(63030),angular.module("graphdb.framework.impex.import",["toastr","ngRoute","ngFileUpload","ui.bootstrap","graphdb.framework.impex.import.controllers","graphdb.framework.core.services.repositories","graphdb.framework.import.directives.validate-uri","graphdb.framework.import.directives.import-progress-indicator","graphdb.framework.import.directives.import-resource-tree"])},78469(e,r,o){var t=o(71315);angular.module("graphdb.framework.impex.import.controllers.import-resource-message-dialog",[]).controller("ImportResourceMessageDialogController",i),i.$inject=["$scope","$uibModalInstance","$translate","toastr","message"];const s=t.I.logger;function i(e,r,o,t,i){e.message=i,e.close=()=>{r.dismiss()},e.copyToClipboard=()=>{navigator.clipboard.writeText(e.message).then(()=>{t.success(o.instant("import.help.messages.copied_to_clipboard")),e.close()},e=>{s.error("Could not copy text: ",e)})}}},64709(){function e(){return{link:function(e,r,o){e.$watch("file.status",function(){"IMPORTING"!==e.file.status&&"UPLOADING"!==e.file.status||!$(r).has("object").length>0&&$(r).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=4.0.0-TR3">{{\'common.loading\' | translate}}</object>')})}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",e),e.$inject=[]},60016(e,r,o){o(78469);var t=o(2998),s=o(35195);function i(e){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-message.html",scope:{resource:"="},link:r=>{r.ImportResourceStatus=t.I,r.toTitleCase=e=>s.Sn(e),r.showMessage=r=>{e.open({templateUrl:"js/angular/import/templates/import-resource-message-dialog.html",controller:"ImportResourceMessageDialogController",size:"lg",windowClass:"import-resource-message-dialog",backdrop:"static",resolve:{message:function(){return r?r.importResource.message:""}}})}}}}angular.module("graphdb.framework.import.directives.import-resource-message",["graphdb.framework.impex.import.controllers.import-resource-message-dialog"]).directive("importResourceMessage",i),i.$inject=["$uibModal"]},28662(){function e(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-status-info.html",scope:{resource:"="},link:o=>{const t=[];o.popoverTemplate="resourceStatusInfoTemplate.html",o.popoverIsOpen=!1,o.context=o.resource.importResource.context,o.replaceGraphs=o.resource.importResource.replaceGraphs,o.baseUrl=decodeURIComponent(o.resource.importResource.baseURI),o.forceSerial=o.resource.importResource.forceSerial,o.importedOn=o.resource.importResource.importedOn,o.parserSettings=o.resource.importResource.parserSettings,o.open=()=>{o.closeAllDialogs(),o.popoverIsOpen=!0},o.closeAllDialogs=()=>{e.$broadcast("closePopovers")},o.close=()=>{o.popoverIsOpen=!1};const s=e=>{"Escape"===e.key&&o.$apply(()=>{o.close()})};t.push(o.$on("closePopovers",o.close)),r.on("keydown",s),o.$on("$destroy",()=>{r.off("keydown",s),t.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-status-info",[]).directive("importResourceStatusInfo",e),e.$inject=["$rootScope","$document"]},72953(e,r,o){var t=o(2998),s=(o(60016),o(28662),o(66256)),i=o(71609),c=o(59601),a=o(33757),l=o(57154);const p={FILE:"FILE",DIRECTORY:"DIRECTORY",ALL:"ALL"},n={ALL:"ALL",NONE:"NONE",IMPORTED:"IMPORTED",NOT_IMPORTED:"NOT_IMPORTED"};function u(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-tree.html",scope:{columnKeys:"=",showTypeFilter:"=",sortBy:"=",asc:"=",onImport:"&",onImportAll:"&",onReset:"&",onRemove:"&",onStopImport:"&",onEditResource:"&"},link:(o,u,m)=>{o.resources=new i.k,o.displayResources=[],o.TYPE_FILTER_OPTIONS=p,o.filterByType=p.ALL,o.filterByFileName="",o.STATUS_OPTIONS=n,o.selectedByStatus=void 0,o.areAllDisplayedImportResourcesSelected=!1,o.areAllDisplayedImportResourcesPartialSelected=!1,o.ImportResourceStatus=t.I,o.canRemoveResource=angular.isDefined(m.onRemove),o.canResetSelectedResources=!1,o.SORTING_TYPES=s.R,o.sortAsc=!angular.isDefined(m.asc)||o.asc,o.sortedBy=o.sortBy,o.showLoader=r.getShowLoader(),o.hasSelection=!1,o.selectionChanged=e=>{e.setSelection(e.selected),I(),d(),g()},o.selectResourceWithStatus=e=>{o.selectedByStatus=e,o.resources.setSelection(!1),n.ALL===o.selectedByStatus?o.resources.setSelection(!0):n.IMPORTED===o.selectedByStatus?o.resources.selectAllWithStatus([t.I.DONE]):n.NOT_IMPORTED===o.selectedByStatus&&o.resources.selectAllWithStatus([t.I.IMPORTING,t.I.NONE,t.I.ERROR,t.I.PENDING,t.I.INTERRUPTING]),R(),d()},o.filterByTypeChanged=e=>{o.filterByType=e,R()},o.filterByFileNameChanged=e=>{o.filterByFileName=e,N(R,100)},o.onResetStatus=()=>{const e=o.resources.getAllSelected().map(e=>e.path);e.length>0&&o.onReset({resources:e})},o.resetStatus=e=>{o.onReset({resources:[e.path]})},o.onRemoveResources=()=>{const e=o.resources.getAllSelected();e&&e.length>0&&o.onRemove({resources:e})},o.removeResource=e=>{o.onRemove({resources:[e]})},o.importAll=e=>{const r=o.resources.getAllSelectedForImport();r.length>0&&o.onImportAll({selectedResources:r,withoutChangingSettings:e})},o.stopImport=e=>{o.onStopImport({resource:e})},o.sort=e=>{o.sortedBy===e?o.sortAsc=!o.sortAsc:o.sortAsc=!0,o.sortedBy=e,R()},o.editResource=e=>{o.onEditResource({resource:e})};const d=()=>{o.canResetSelectedResources=o.resources.getSelectedImportedResources()},R=()=>{o.resources.getRoot().updateSelectionState(),y(),o.displayResources=o.resources.toList().filter(A).filter(E),g(),I()},g=()=>{const e=o.resources.getAllSelectedFilesNames();o.hasSelection=e.length>0,r.updateSelectedFilesNames(e)},I=()=>{const e=o.displayResources.some(e=>!e.selected),r=o.displayResources.some(e=>e.selected);o.areAllDisplayedImportResourcesSelected=r&&!e,o.areAllDisplayedImportResourcesPartialSelected=r&&e},y=()=>{s.R.NAME===o.sortedBy?o.resources.sort(f(o.sortAsc)):s.R.SIZE===o.sortedBy?o.resources.sort(h(o.sortAsc)):s.R.MODIFIED===o.sortedBy?o.resources.sort(S(o.sortAsc)):s.R.IMPORTED===o.sortedBy?o.resources.sort(T(o.sortAsc)):s.R.CONTEXT===o.sortedBy&&o.resources.sort(v(o.sortAsc))},f=e=>(r,o)=>e?r.importResource.name.localeCompare(o.importResource.name):o.importResource.name.localeCompare(r.importResource.name),h=e=>(r,o)=>{const t=l.ByteUtils.convertToBytes(r.importResource.size),s=l.ByteUtils.convertToBytes(o.importResource.size);return e?t-s:s-t},S=e=>(r,o)=>{const t=r.importResource.modifiedOn||Number.MAX_VALUE,s=o.importResource.modifiedOn||Number.MAX_VALUE;return e?t-s:s-t},T=e=>(r,o)=>{const t=r.importResource.importedOn||Number.MAX_VALUE,s=o.importResource.importedOn||Number.MAX_VALUE;return e?t-s:s-t},v=e=>(r,o)=>e?r.importResource.context.localeCompare(o.importResource.context):o.importResource.context.localeCompare(r.importResource.context),A=e=>p.ALL===o.filterByType||(o.filterByType===p.FILE?e.isFile():o.filterByType===p.DIRECTORY&&e.isDirectory()),E=e=>!o.filterByFileName||(o.filterByType===p.DIRECTORY?e.hasTextInDirectoriesName(o.filterByFileName):o.filterByType===p.FILE?e.hasTextInFilesName(o.filterByFileName):e.hasTextInResourcesName(o.filterByFileName));let O;const N=(r,o)=>{O&&e.cancel(O),O=e(r,o)},b=[];b.push(r.onResourcesUpdated((e=[])=>{const t=c.D.USER===r.getActiveTabId();o.resources.isEmpty()?(o.resources=a.Fp.toImportResourceTree(e,t),t&&(o.sortedBy=s.R.MODIFIED)):a.Fp.mergeResourceTree(o.resources,e,t),a.Fp.calculateElementIndent(o.resources),a.Fp.setupAfterTreeInitProperties(o.resources),R(),d()})),b.push(r.onShowLoaderUpdated(e=>o.showLoader=e)),b.push(r.onActiveTabIdUpdated(()=>o.resources=new i.k)),o.$on("$destroy",()=>{b.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-tree",["graphdb.framework.import.directives.import-resource-message","graphdb.framework.import.directives.import-resource-status-info"]).directive("importResourceTree",u),u.$inject=["$timeout","ImportContextService"]},83847(){function e(e){return{restrict:"A",require:"ngModel",link:function(r,o,t,s){s.$parsers.unshift(function(r){if(s.$setValidity("validateUri",!0),!s.$isEmpty(r)){const o=e.isValidIri(r,r.toString());s.$setValidity("validateUri",o)}return r})}}}angular.module("graphdb.framework.import.directives.validate-uri",[]).directive("validateUri",e),e.$inject=["UriUtils"]}};
2
+ //# sourceMappingURL=80933.d5c0bca925e9cb27ac57.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"80933.19f69bc85c52a8b19311.bundle.js","mappings":"2OAsBAA,QAAQC,OAAO,iCAZC,CACZ,SACA,UACA,eACA,eACA,6CACA,+CACA,mDACA,gEACA,4D,8BCjBJD,QACKC,OAAO,4EAA6E,IACpFC,WAAW,wCAAyCC,GAEzDA,EAAsCC,QAAU,CAAC,SAAU,oBAAqB,aAAc,SAAU,WAExG,MAAMC,EAASC,EAAAA,EAAeD,OAE9B,SAASF,EAAsCI,EAAQC,EAAmBC,EAAYC,EAAQC,GAC1FJ,EAAOI,QAAUA,EAGjBJ,EAAOK,MAAQ,KACXJ,EAAkBK,WAGtBN,EAAOO,gBAAkB,KACrBC,UAAUC,UAAUC,UAAUV,EAAOI,SAChCO,KAAK,KACFR,EAAOS,QAAQV,EAAWW,QAAQ,6CAClCb,EAAOK,SACPS,IACAhB,EAAOiB,MAAM,wBAAyBD,KAGtD,C,UClBA,SAASE,IACL,MAAO,CACHC,KAAM,SAAUC,EAAOC,EAASC,GAC5BF,EAAMG,OAAO,cAAe,WACE,cAAtBH,EAAMI,KAAKC,QAAgD,cAAtBL,EAAMI,KAAKC,SAC3CC,EAAEL,GAASM,IAAI,UAAUC,OAAS,GACnCF,EAAEL,GAASQ,OAAO,kBAAoBP,EAAKQ,KAAO,aAAeR,EAAKQ,KAAO,6GAGzF,EACJ,EAER,CAnBAnC,QACKC,OAAO,gEAHI,IAIXmC,UAAU,0BAA2Bb,GAE1CA,EAAwBnB,QAAU,E,iDCMl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XmC,UAAU,cAAeuL,GAE9BA,EAAYvN,QAAU,CAAC,W","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/import/app.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/controllers/import-resource-message-dialog.controller.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-progress-indicator.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-message.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-status-info.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-tree.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/validate-uri.directive.js"],"sourcesContent":["import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/import/controllers/import-view.controller';\nimport 'angular/import/directives/validate-uri.directive';\nimport 'angular/import/directives/import-progress-indicator.directive';\nimport 'angular/import/directives/import-resource-tree.directive';\nimport 'angular/core/services/repositories.service';\nimport 'ng-file-upload/dist/ng-file-upload.min';\nimport 'ng-file-upload/dist/ng-file-upload-shim.min';\n\nconst modules = [\n 'toastr',\n 'ngRoute',\n 'ngFileUpload',\n 'ui.bootstrap',\n 'graphdb.framework.impex.import.controllers',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.import.directives.validate-uri',\n 'graphdb.framework.import.directives.import-progress-indicator',\n 'graphdb.framework.import.directives.import-resource-tree'\n];\n\nangular.module('graphdb.framework.impex.import', modules);\n","import {LoggerProvider} from \"../../core/services/logger-provider\";\n\nangular\n .module('graphdb.framework.impex.import.controllers.import-resource-message-dialog', [])\n .controller('ImportResourceMessageDialogController', ImportResourceMessageDialogController);\n\nImportResourceMessageDialogController.$inject = ['$scope', '$uibModalInstance', '$translate', 'toastr', 'message'];\n\nconst logger = LoggerProvider.logger;\n\nfunction ImportResourceMessageDialogController($scope, $uibModalInstance, $translate, toastr, message) {\n $scope.message = message;\n\n\n $scope.close = () => {\n $uibModalInstance.dismiss();\n };\n\n $scope.copyToClipboard = () => {\n navigator.clipboard.writeText($scope.message)\n .then(() => {\n toastr.success($translate.instant('import.help.messages.copied_to_clipboard'));\n $scope.close();\n }, (err) => {\n logger.error('Could not copy text: ', err);\n });\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-progress-indicator', modules)\n .directive('ImportProgressIndicator', ImportProgressIndicator);\n\nImportProgressIndicator.$inject = [];\n\n// importDirectives.directive('filesOntoLoader',\nfunction ImportProgressIndicator() {\n return {\n link: function (scope, element, attr) {\n scope.$watch('file.status', function () {\n if (scope.file.status === 'IMPORTING' || scope.file.status === 'UPLOADING') {\n if (!$(element).has('object').length > 0) {\n $(element).append('<object width=\"' + attr.size + '\" height=\"' + attr.size + '\" data=\"js/angular/templates/loader/ot-loader.svg?v=4.0.0-TR2\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n}\n","import 'angular/import/controllers/import-resource-message-dialog.controller';\nimport {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport * as stringUtils from \"../../utils/string-utils\";\n\nconst modules = ['graphdb.framework.impex.import.controllers.import-resource-message-dialog'];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-message', modules)\n .directive('importResourceMessage', importResourceMessageDirective);\n\nimportResourceMessageDirective.$inject = ['$uibModal'];\n\nfunction importResourceMessageDirective($uibModal) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-message.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.toTitleCase = (str) => stringUtils.toTitleCase(str);\n\n /**\n *\n * @param {ImportResourceTreeElement} resourceTreeElement\n */\n $scope.showMessage = (resourceTreeElement) => {\n $uibModal.open({\n templateUrl: 'js/angular/import/templates/import-resource-message-dialog.html',\n controller: 'ImportResourceMessageDialogController',\n size: 'lg',\n windowClass: 'import-resource-message-dialog',\n backdrop: 'static',\n resolve: {\n message: function () {\n return resourceTreeElement ? resourceTreeElement.importResource.message : '';\n }\n }\n });\n }\n }\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-status-info', modules)\n .directive('importResourceStatusInfo', importResourceStatusInfoDirective);\n\nimportResourceStatusInfoDirective.$inject = ['$rootScope', '$document'];\n\nfunction importResourceStatusInfoDirective($rootScope, $document) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-status-info.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n const subscribers = [];\n\n // =========================\n // Public variables\n // =========================\n $scope.popoverTemplate = 'resourceStatusInfoTemplate.html';\n $scope.popoverIsOpen = false;\n $scope.context = $scope.resource.importResource.context;\n $scope.replaceGraphs = $scope.resource.importResource.replaceGraphs;\n $scope.baseUrl = decodeURIComponent($scope.resource.importResource.baseURI);\n $scope.forceSerial = $scope.resource.importResource.forceSerial;\n $scope.importedOn = $scope.resource.importResource.importedOn;\n $scope.parserSettings = $scope.resource.importResource.parserSettings;\n\n // =========================\n // Public functions\n // =========================\n $scope.open = () => {\n $scope.closeAllDialogs();\n $scope.popoverIsOpen = true;\n };\n\n $scope.closeAllDialogs = () => {\n $rootScope.$broadcast('closePopovers');\n };\n\n $scope.close = () => {\n $scope.popoverIsOpen = false;\n };\n\n const handleEscapeKeyPress = (event) => {\n if (event.key === 'Escape') {\n $scope.$apply(() => {\n $scope.close();\n });\n }\n };\n\n const removeAllSubscribers = () => {\n subscribers.forEach((subscriber) => subscriber());\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n subscribers.push($scope.$on('closePopovers', $scope.close));\n $document.on('keydown', handleEscapeKeyPress);\n\n $scope.$on('$destroy', () => {\n $document.off('keydown', handleEscapeKeyPress);\n removeAllSubscribers();\n });\n }\n };\n}\n","import {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport 'angular/import/directives/import-resource-message.directive';\nimport 'angular/import/directives/import-resource-status-info.directive';\nimport {SortingType} from \"../../models/import/sorting-type\";\nimport {ImportResourceTreeElement} from \"../../models/import/import-resource-tree-element\";\nimport {TABS} from \"../services/import-context.service\";\nimport {ImportResourceTreeService} from \"../services/import-resource-tree.service\";\nimport {\n ByteUtils,\n} from \"@ontotext/workbench-api\";\n\nconst TYPE_FILTER_OPTIONS = {\n 'FILE': 'FILE',\n 'DIRECTORY': 'DIRECTORY',\n 'ALL': 'ALL',\n};\n\nconst STATUS_OPTIONS = {\n 'ALL': 'ALL',\n 'NONE': 'NONE',\n 'IMPORTED': 'IMPORTED',\n 'NOT_IMPORTED': 'NOT_IMPORTED',\n};\n\nconst modules = [\n 'graphdb.framework.import.directives.import-resource-message',\n 'graphdb.framework.import.directives.import-resource-status-info',\n];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-tree', modules)\n .directive('importResourceTree', importResourceTreeDirective);\n\nimportResourceTreeDirective.$inject = ['$timeout', 'ImportContextService'];\n\nfunction importResourceTreeDirective($timeout, ImportContextService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-tree.html',\n scope: {\n /**\n * Contains mapping of the column names to label keys. Should contain\n * keys for: name, size, imported, modified, context column names.\n */\n columnKeys: '=',\n /**\n * If the type filter buttons should be visible.\n */\n showTypeFilter: '=',\n /**\n * The default field to sort the resources by.\n */\n sortBy: '=',\n asc: '=',\n onImport: '&',\n onImportAll: '&',\n onReset: '&',\n onRemove: '&',\n onStopImport: '&',\n onEditResource: '&',\n },\n link: ($scope, element, attrs) => {\n // =========================\n // Public variables\n // =========================\n $scope.resources = new ImportResourceTreeElement();\n $scope.displayResources = [];\n $scope.TYPE_FILTER_OPTIONS = TYPE_FILTER_OPTIONS;\n $scope.filterByType = TYPE_FILTER_OPTIONS.ALL;\n $scope.filterByFileName = '';\n $scope.STATUS_OPTIONS = STATUS_OPTIONS;\n $scope.selectedByStatus = undefined;\n $scope.areAllDisplayedImportResourcesSelected = false;\n $scope.areAllDisplayedImportResourcesPartialSelected = false;\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.canRemoveResource = angular.isDefined(attrs.onRemove);\n $scope.canResetSelectedResources = false;\n $scope.SORTING_TYPES = SortingType;\n $scope.sortAsc = angular.isDefined(attrs.asc) ? $scope.asc : true;\n $scope.sortedBy = $scope.sortBy;\n $scope.showLoader = ImportContextService.getShowLoader();\n $scope.hasSelection = false;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Updates the selection model when a resource is selected or unselected.\n * @param {ImportResourceTreeElement} resource The resource that was selected or unselected.\n */\n $scope.selectionChanged = ((resource) => {\n resource.setSelection(resource.selected);\n updateSelectByStateDropdownModel();\n setCanResetResourcesFlag();\n updateHasSelection();\n });\n\n $scope.selectResourceWithStatus = (resourceStatus) => {\n $scope.selectedByStatus = resourceStatus;\n $scope.resources.setSelection(false);\n\n if (STATUS_OPTIONS.ALL === $scope.selectedByStatus) {\n $scope.resources.setSelection(true);\n } else if (STATUS_OPTIONS.IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.DONE]);\n } else if (STATUS_OPTIONS.NOT_IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.IMPORTING, ImportResourceStatus.NONE, ImportResourceStatus.ERROR, ImportResourceStatus.PENDING, ImportResourceStatus.INTERRUPTING]);\n }\n\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n $scope.filterByTypeChanged = (newType) => {\n $scope.filterByType = newType;\n updateListedImportResources();\n };\n\n $scope.filterByFileNameChanged = (filterByFileName) => {\n $scope.filterByFileName = filterByFileName;\n debounce(updateListedImportResources, 100);\n };\n\n /**\n * Resets the status of the selected resources.\n */\n $scope.onResetStatus = () => {\n const resourcesNames = $scope.resources.getAllSelected()\n .map((resource) => resource.path);\n if (resourcesNames.length > 0) {\n $scope.onReset({resources: resourcesNames});\n }\n };\n\n /**\n * Resets the status of the given resource.\n * @param {ImportResourceTreeElement} importResource\n */\n $scope.resetStatus = (importResource) => {\n $scope.onReset({resources: [importResource.path]});\n };\n\n $scope.onRemoveResources = () => {\n const selectedResources = $scope.resources.getAllSelected();\n if (selectedResources && selectedResources.length > 0) {\n $scope.onRemove({resources: selectedResources});\n }\n };\n\n $scope.removeResource = (resource) => {\n $scope.onRemove({resources: [resource]});\n };\n\n $scope.importAll = (withoutChangingSettings) => {\n const selectedResources = $scope.resources.getAllSelectedForImport();\n if (selectedResources.length > 0) {\n $scope.onImportAll({selectedResources: selectedResources, withoutChangingSettings});\n }\n };\n\n $scope.stopImport = (importResource) => {\n $scope.onStopImport({resource: importResource});\n };\n\n /**\n * Sorts resources by provided sorting type.\n * @param {SortingType} sortedBy The sorting type to use.\n */\n $scope.sort = (sortedBy) => {\n if ($scope.sortedBy === sortedBy) {\n $scope.sortAsc = !$scope.sortAsc;\n } else {\n $scope.sortAsc = true;\n }\n $scope.sortedBy = sortedBy;\n updateListedImportResources();\n };\n\n $scope.editResource = (resource) => {\n $scope.onEditResource({resource});\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Sets the flag showing if any of the selected resources is already imported\n * and can have their states reset.\n */\n const setCanResetResourcesFlag = () => {\n $scope.canResetSelectedResources = $scope.resources.getSelectedImportedResources();\n };\n\n const updateListedImportResources = () => {\n $scope.resources.getRoot().updateSelectionState();\n sortResources();\n $scope.displayResources = $scope.resources.toList()\n .filter(filterByType)\n .filter(filterByName);\n\n updateHasSelection();\n updateSelectByStateDropdownModel();\n };\n\n const updateHasSelection = () => {\n const allSelectedFilesNames = $scope.resources.getAllSelectedFilesNames();\n $scope.hasSelection = allSelectedFilesNames.length > 0;\n ImportContextService.updateSelectedFilesNames(allSelectedFilesNames);\n };\n\n const updateSelectByStateDropdownModel = () => {\n const hasUnselectedDisplayedImportResource = $scope.displayResources.some((resource) => !resource.selected);\n const hasSelectedDisplayedImportResource = $scope.displayResources.some((resource) => resource.selected);\n $scope.areAllDisplayedImportResourcesSelected = hasSelectedDisplayedImportResource && !hasUnselectedDisplayedImportResource;\n $scope.areAllDisplayedImportResourcesPartialSelected = hasSelectedDisplayedImportResource && hasUnselectedDisplayedImportResource;\n };\n\n const sortResources = () => {\n if (SortingType.NAME === $scope.sortedBy) {\n $scope.resources.sort(compareByName($scope.sortAsc));\n } else if (SortingType.SIZE === $scope.sortedBy) {\n $scope.resources.sort(compareBySize($scope.sortAsc));\n } else if (SortingType.MODIFIED === $scope.sortedBy) {\n $scope.resources.sort(compareByModified($scope.sortAsc));\n } else if (SortingType.IMPORTED === $scope.sortedBy) {\n $scope.resources.sort(compareByImportedOn($scope.sortAsc));\n } else if (SortingType.CONTEXT === $scope.sortedBy) {\n $scope.resources.sort(compareByContext($scope.sortAsc));\n }\n };\n\n const compareByName = (acs) => (r1, r2) => {\n return acs ? r1.importResource.name.localeCompare(r2.importResource.name) : r2.importResource.name.localeCompare(r1.importResource.name);\n };\n\n const compareBySize = (acs) => (r1, r2) => {\n // The format of size returned by the backend has changed, but we need to keep the old format for backward compatibility.\n // Therefore, we convert the size to always be in bytes.\n const r1Size = ByteUtils.convertToBytes(r1.importResource.size);\n const r2Size = ByteUtils.convertToBytes(r2.importResource.size);\n return acs ? r1Size - r2Size : r2Size - r1Size;\n };\n\n const compareByModified = (acs) => (r1, r2) => {\n const r1ModifiedOn = r1.importResource.modifiedOn || Number.MAX_VALUE;\n const r2ModifiedOn = r2.importResource.modifiedOn || Number.MAX_VALUE;\n return acs ? r1ModifiedOn - r2ModifiedOn : r2ModifiedOn - r1ModifiedOn;\n };\n\n const compareByImportedOn = (acs) => (r1, r2) => {\n const r1ImportedOn = r1.importResource.importedOn || Number.MAX_VALUE;\n const r2ImportedOn = r2.importResource.importedOn || Number.MAX_VALUE;\n return acs ? r1ImportedOn - r2ImportedOn : r2ImportedOn - r1ImportedOn;\n };\n\n const compareByContext = (acs) => (r1, r2) => {\n return acs ? r1.importResource.context.localeCompare(r2.importResource.context) : r2.importResource.context.localeCompare(r1.importResource.context);\n };\n\n const filterByType = (resource) => {\n if (TYPE_FILTER_OPTIONS.ALL === $scope.filterByType) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.isFile();\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.isDirectory();\n }\n\n return false;\n };\n\n const filterByName = (resource) => {\n if (!$scope.filterByFileName) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.hasTextInDirectoriesName($scope.filterByFileName);\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.hasTextInFilesName($scope.filterByFileName);\n }\n return resource.hasTextInResourcesName($scope.filterByFileName);\n };\n\n let debounceTimeout;\n const debounce = (func, delay) => {\n // Clear previous timeout\n if (debounceTimeout) {\n $timeout.cancel(debounceTimeout);\n }\n\n // Set new timeout\n debounceTimeout = $timeout(func, delay);\n };\n\n // =========================\n // Subscription handlers\n // =========================\n\n const onResourcesUpdatedHandler = (newResources = []) => {\n const isUserImport = TABS.USER === ImportContextService.getActiveTabId();\n if ($scope.resources.isEmpty()) {\n $scope.resources = ImportResourceTreeService.toImportResourceTree(newResources, isUserImport);\n if (isUserImport) {\n $scope.sortedBy = SortingType.MODIFIED;\n }\n } else {\n ImportResourceTreeService.mergeResourceTree($scope.resources, newResources, isUserImport);\n }\n ImportResourceTreeService.calculateElementIndent($scope.resources);\n ImportResourceTreeService.setupAfterTreeInitProperties($scope.resources);\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n subscriptions.push(ImportContextService.onResourcesUpdated(onResourcesUpdatedHandler));\n subscriptions.push(ImportContextService.onShowLoaderUpdated((showLoader) => $scope.showLoader = showLoader));\n subscriptions.push(ImportContextService.onActiveTabIdUpdated(() => $scope.resources = new ImportResourceTreeElement()));\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n },\n };\n}\n","/**\n * This AngularJS directive validates whether an input value is a valid URI (IRI).\n *\n * @directive validateUri\n * @restrict A (Attribute)\n * @requires ngModel\n *\n * @example\n * <input type=\"text\" name=\"url\" ng-model=\"url\" validate-uri>\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.import.directives.validate-uri', modules)\n .directive('validateUri', validateUri);\n\nvalidateUri.$inject = ['UriUtils'];\n\n/**\n * @function validateUri\n * @param {UriUtils} UriUtils - Service for URI validation.\n */\nfunction validateUri(UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n ctrl.$setValidity('validateUri', true);\n if (!ctrl.$isEmpty(value)) {\n const valid = UriUtils.isValidIri(value, value.toString());\n ctrl.$setValidity('validateUri', valid);\n }\n return value;\n });\n }\n };\n}\n"],"names":["angular","module","controller","ImportResourceMessageDialogController","$inject","logger","LoggerProvider","$scope","$uibModalInstance","$translate","toastr","message","close","dismiss","copyToClipboard","navigator","clipboard","writeText","then","success","instant","err","error","ImportProgressIndicator","link","scope","element","attr","$watch","file","status","$","has","length","append","size","directive","importResourceMessageDirective","$uibModal","restrict","templateUrl","resource","ImportResourceStatus","toTitleCase","str","stringUtils","showMessage","resourceTreeElement","open","windowClass","backdrop","resolve","importResource","importResourceStatusInfoDirective","$rootScope","$document","subscribers","popoverTemplate","popoverIsOpen","context","replaceGraphs","baseUrl","decodeURIComponent","baseURI","forceSerial","importedOn","parserSettings","closeAllDialogs","$broadcast","handleEscapeKeyPress","event","key","$apply","push","$on","on","off","forEach","subscriber","TYPE_FILTER_OPTIONS","STATUS_OPTIONS","importResourceTreeDirective","$timeout","ImportContextService","columnKeys","showTypeFilter","sortBy","asc","onImport","onImportAll","onReset","onRemove","onStopImport","onEditResource","attrs","resources","ImportResourceTreeElement","displayResources","filterByType","ALL","filterByFileName","selectedByStatus","undefined","areAllDisplayedImportResourcesSelected","areAllDisplayedImportResourcesPartialSelected","canRemoveResource","isDefined","canResetSelectedResources","SORTING_TYPES","SortingType","sortAsc","sortedBy","showLoader","getShowLoader","hasSelection","selectionChanged","setSelection","selected","updateSelectByStateDropdownModel","setCanResetResourcesFlag","updateHasSelection","selectResourceWithStatus","resourceStatus","IMPORTED","selectAllWithStatus","DONE","NOT_IMPORTED","IMPORTING","NONE","ERROR","PENDING","INTERRUPTING","updateListedImportResources","filterByTypeChanged","newType","filterByFileNameChanged","debounce","onResetStatus","resourcesNames","getAllSelected","map","path","resetStatus","onRemoveResources","selectedResources","removeResource","importAll","withoutChangingSettings","getAllSelectedForImport","stopImport","sort","editResource","getSelectedImportedResources","getRoot","updateSelectionState","sortResources","toList","filter","filterByName","allSelectedFilesNames","getAllSelectedFilesNames","updateSelectedFilesNames","hasUnselectedDisplayedImportResource","some","hasSelectedDisplayedImportResource","NAME","compareByName","SIZE","compareBySize","MODIFIED","compareByModified","compareByImportedOn","CONTEXT","compareByContext","acs","r1","r2","name","localeCompare","r1Size","ByteUtils","convertToBytes","r2Size","r1ModifiedOn","modifiedOn","Number","MAX_VALUE","r2ModifiedOn","r1ImportedOn","r2ImportedOn","FILE","isFile","DIRECTORY","isDirectory","hasTextInDirectoriesName","hasTextInFilesName","hasTextInResourcesName","debounceTimeout","func","delay","cancel","subscriptions","onResourcesUpdated","onResourcesUpdatedHandler","newResources","isUserImport","TABS","USER","getActiveTabId","isEmpty","ImportResourceTreeService","toImportResourceTree","mergeResourceTree","calculateElementIndent","setupAfterTreeInitProperties","onShowLoaderUpdated","onActiveTabIdUpdated","removeAllSubscribers","subscription","validateUri","UriUtils","require","ctrl","$parsers","unshift","value","$setValidity","$isEmpty","valid","isValidIri","toString"],"sourceRoot":""}
1
+ {"version":3,"file":"80933.d5c0bca925e9cb27ac57.bundle.js","mappings":"2OAsBAA,QAAQC,OAAO,iCAZC,CACZ,SACA,UACA,eACA,eACA,6CACA,+CACA,mDACA,gEACA,4D,8BCjBJD,QACKC,OAAO,4EAA6E,IACpFC,WAAW,wCAAyCC,GAEzDA,EA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,WACxDmH,EAAAA,GAA0BI,6BAA6B/M,EAAOwF,WAC9DqC,IACAb,OASJkF,EAAchI,KAAKU,EAAqBoI,oBAAqBvG,GAAezG,EAAOyG,WAAaA,IAChGyF,EAAchI,KAAKU,EAAqBqI,qBAAqB,IAAMjN,EAAOwF,UAAY,IAAIC,EAAAA,IAO1FzF,EAAOmE,IAAI,WALkB+I,KACzBhB,EAAc5H,QAAS6I,GAAiBA,QAOxD,CAvTA1N,QACKC,OAAO,2DANI,CACZ,8DACA,oEAKCmC,UAAU,qBAAsB6C,GAErCA,EAA4B7E,QAAU,CAAC,WAAY,uB,UCXnD,SAASuN,EAAYC,GACjB,MAAO,CACHrL,SAAU,IACVsL,QAAS,UACTrM,KAAM,SAAUC,EAAOC,EAASC,EAAMmM,GAClCA,EAAKC,SAASC,QAAQ,SAAUC,GAE5B,GADAH,EAAKI,aAAa,eAAe,IAC5BJ,EAAKK,SAASF,GAAQ,CACvB,MAAMG,EAAQR,EAASS,WAAWJ,EAAOA,EAAMK,YAC/CR,EAAKI,aAAa,cAAeE,EACrC,CACA,OAAOH,CACX,EACJ,EAER,CAzBAjO,QACKC,OAAO,mDAHI,IAIXmC,UAAU,cAAeuL,GAE9BA,EAAYvN,QAAU,CAAC,W","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/import/app.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/controllers/import-resource-message-dialog.controller.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-progress-indicator.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-message.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-status-info.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-tree.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/validate-uri.directive.js"],"sourcesContent":["import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/import/controllers/import-view.controller';\nimport 'angular/import/directives/validate-uri.directive';\nimport 'angular/import/directives/import-progress-indicator.directive';\nimport 'angular/import/directives/import-resource-tree.directive';\nimport 'angular/core/services/repositories.service';\nimport 'ng-file-upload/dist/ng-file-upload.min';\nimport 'ng-file-upload/dist/ng-file-upload-shim.min';\n\nconst modules = [\n 'toastr',\n 'ngRoute',\n 'ngFileUpload',\n 'ui.bootstrap',\n 'graphdb.framework.impex.import.controllers',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.import.directives.validate-uri',\n 'graphdb.framework.import.directives.import-progress-indicator',\n 'graphdb.framework.import.directives.import-resource-tree'\n];\n\nangular.module('graphdb.framework.impex.import', modules);\n","import {LoggerProvider} from \"../../core/services/logger-provider\";\n\nangular\n .module('graphdb.framework.impex.import.controllers.import-resource-message-dialog', [])\n .controller('ImportResourceMessageDialogController', ImportResourceMessageDialogController);\n\nImportResourceMessageDialogController.$inject = ['$scope', '$uibModalInstance', '$translate', 'toastr', 'message'];\n\nconst logger = LoggerProvider.logger;\n\nfunction ImportResourceMessageDialogController($scope, $uibModalInstance, $translate, toastr, message) {\n $scope.message = message;\n\n\n $scope.close = () => {\n $uibModalInstance.dismiss();\n };\n\n $scope.copyToClipboard = () => {\n navigator.clipboard.writeText($scope.message)\n .then(() => {\n toastr.success($translate.instant('import.help.messages.copied_to_clipboard'));\n $scope.close();\n }, (err) => {\n logger.error('Could not copy text: ', err);\n });\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-progress-indicator', modules)\n .directive('ImportProgressIndicator', ImportProgressIndicator);\n\nImportProgressIndicator.$inject = [];\n\n// importDirectives.directive('filesOntoLoader',\nfunction ImportProgressIndicator() {\n return {\n link: function (scope, element, attr) {\n scope.$watch('file.status', function () {\n if (scope.file.status === 'IMPORTING' || scope.file.status === 'UPLOADING') {\n if (!$(element).has('object').length > 0) {\n $(element).append('<object width=\"' + attr.size + '\" height=\"' + attr.size + '\" data=\"js/angular/templates/loader/ot-loader.svg?v=4.0.0-TR3\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n}\n","import 'angular/import/controllers/import-resource-message-dialog.controller';\nimport {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport * as stringUtils from \"../../utils/string-utils\";\n\nconst modules = ['graphdb.framework.impex.import.controllers.import-resource-message-dialog'];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-message', modules)\n .directive('importResourceMessage', importResourceMessageDirective);\n\nimportResourceMessageDirective.$inject = ['$uibModal'];\n\nfunction importResourceMessageDirective($uibModal) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-message.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.toTitleCase = (str) => stringUtils.toTitleCase(str);\n\n /**\n *\n * @param {ImportResourceTreeElement} resourceTreeElement\n */\n $scope.showMessage = (resourceTreeElement) => {\n $uibModal.open({\n templateUrl: 'js/angular/import/templates/import-resource-message-dialog.html',\n controller: 'ImportResourceMessageDialogController',\n size: 'lg',\n windowClass: 'import-resource-message-dialog',\n backdrop: 'static',\n resolve: {\n message: function () {\n return resourceTreeElement ? resourceTreeElement.importResource.message : '';\n }\n }\n });\n }\n }\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-status-info', modules)\n .directive('importResourceStatusInfo', importResourceStatusInfoDirective);\n\nimportResourceStatusInfoDirective.$inject = ['$rootScope', '$document'];\n\nfunction importResourceStatusInfoDirective($rootScope, $document) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-status-info.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n const subscribers = [];\n\n // =========================\n // Public variables\n // =========================\n $scope.popoverTemplate = 'resourceStatusInfoTemplate.html';\n $scope.popoverIsOpen = false;\n $scope.context = $scope.resource.importResource.context;\n $scope.replaceGraphs = $scope.resource.importResource.replaceGraphs;\n $scope.baseUrl = decodeURIComponent($scope.resource.importResource.baseURI);\n $scope.forceSerial = $scope.resource.importResource.forceSerial;\n $scope.importedOn = $scope.resource.importResource.importedOn;\n $scope.parserSettings = $scope.resource.importResource.parserSettings;\n\n // =========================\n // Public functions\n // =========================\n $scope.open = () => {\n $scope.closeAllDialogs();\n $scope.popoverIsOpen = true;\n };\n\n $scope.closeAllDialogs = () => {\n $rootScope.$broadcast('closePopovers');\n };\n\n $scope.close = () => {\n $scope.popoverIsOpen = false;\n };\n\n const handleEscapeKeyPress = (event) => {\n if (event.key === 'Escape') {\n $scope.$apply(() => {\n $scope.close();\n });\n }\n };\n\n const removeAllSubscribers = () => {\n subscribers.forEach((subscriber) => subscriber());\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n subscribers.push($scope.$on('closePopovers', $scope.close));\n $document.on('keydown', handleEscapeKeyPress);\n\n $scope.$on('$destroy', () => {\n $document.off('keydown', handleEscapeKeyPress);\n removeAllSubscribers();\n });\n }\n };\n}\n","import {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport 'angular/import/directives/import-resource-message.directive';\nimport 'angular/import/directives/import-resource-status-info.directive';\nimport {SortingType} from \"../../models/import/sorting-type\";\nimport {ImportResourceTreeElement} from \"../../models/import/import-resource-tree-element\";\nimport {TABS} from \"../services/import-context.service\";\nimport {ImportResourceTreeService} from \"../services/import-resource-tree.service\";\nimport {\n ByteUtils,\n} from \"@ontotext/workbench-api\";\n\nconst TYPE_FILTER_OPTIONS = {\n 'FILE': 'FILE',\n 'DIRECTORY': 'DIRECTORY',\n 'ALL': 'ALL',\n};\n\nconst STATUS_OPTIONS = {\n 'ALL': 'ALL',\n 'NONE': 'NONE',\n 'IMPORTED': 'IMPORTED',\n 'NOT_IMPORTED': 'NOT_IMPORTED',\n};\n\nconst modules = [\n 'graphdb.framework.import.directives.import-resource-message',\n 'graphdb.framework.import.directives.import-resource-status-info',\n];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-tree', modules)\n .directive('importResourceTree', importResourceTreeDirective);\n\nimportResourceTreeDirective.$inject = ['$timeout', 'ImportContextService'];\n\nfunction importResourceTreeDirective($timeout, ImportContextService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-tree.html',\n scope: {\n /**\n * Contains mapping of the column names to label keys. Should contain\n * keys for: name, size, imported, modified, context column names.\n */\n columnKeys: '=',\n /**\n * If the type filter buttons should be visible.\n */\n showTypeFilter: '=',\n /**\n * The default field to sort the resources by.\n */\n sortBy: '=',\n asc: '=',\n onImport: '&',\n onImportAll: '&',\n onReset: '&',\n onRemove: '&',\n onStopImport: '&',\n onEditResource: '&',\n },\n link: ($scope, element, attrs) => {\n // =========================\n // Public variables\n // =========================\n $scope.resources = new ImportResourceTreeElement();\n $scope.displayResources = [];\n $scope.TYPE_FILTER_OPTIONS = TYPE_FILTER_OPTIONS;\n $scope.filterByType = TYPE_FILTER_OPTIONS.ALL;\n $scope.filterByFileName = '';\n $scope.STATUS_OPTIONS = STATUS_OPTIONS;\n $scope.selectedByStatus = undefined;\n $scope.areAllDisplayedImportResourcesSelected = false;\n $scope.areAllDisplayedImportResourcesPartialSelected = false;\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.canRemoveResource = angular.isDefined(attrs.onRemove);\n $scope.canResetSelectedResources = false;\n $scope.SORTING_TYPES = SortingType;\n $scope.sortAsc = angular.isDefined(attrs.asc) ? $scope.asc : true;\n $scope.sortedBy = $scope.sortBy;\n $scope.showLoader = ImportContextService.getShowLoader();\n $scope.hasSelection = false;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Updates the selection model when a resource is selected or unselected.\n * @param {ImportResourceTreeElement} resource The resource that was selected or unselected.\n */\n $scope.selectionChanged = ((resource) => {\n resource.setSelection(resource.selected);\n updateSelectByStateDropdownModel();\n setCanResetResourcesFlag();\n updateHasSelection();\n });\n\n $scope.selectResourceWithStatus = (resourceStatus) => {\n $scope.selectedByStatus = resourceStatus;\n $scope.resources.setSelection(false);\n\n if (STATUS_OPTIONS.ALL === $scope.selectedByStatus) {\n $scope.resources.setSelection(true);\n } else if (STATUS_OPTIONS.IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.DONE]);\n } else if (STATUS_OPTIONS.NOT_IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.IMPORTING, ImportResourceStatus.NONE, ImportResourceStatus.ERROR, ImportResourceStatus.PENDING, ImportResourceStatus.INTERRUPTING]);\n }\n\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n $scope.filterByTypeChanged = (newType) => {\n $scope.filterByType = newType;\n updateListedImportResources();\n };\n\n $scope.filterByFileNameChanged = (filterByFileName) => {\n $scope.filterByFileName = filterByFileName;\n debounce(updateListedImportResources, 100);\n };\n\n /**\n * Resets the status of the selected resources.\n */\n $scope.onResetStatus = () => {\n const resourcesNames = $scope.resources.getAllSelected()\n .map((resource) => resource.path);\n if (resourcesNames.length > 0) {\n $scope.onReset({resources: resourcesNames});\n }\n };\n\n /**\n * Resets the status of the given resource.\n * @param {ImportResourceTreeElement} importResource\n */\n $scope.resetStatus = (importResource) => {\n $scope.onReset({resources: [importResource.path]});\n };\n\n $scope.onRemoveResources = () => {\n const selectedResources = $scope.resources.getAllSelected();\n if (selectedResources && selectedResources.length > 0) {\n $scope.onRemove({resources: selectedResources});\n }\n };\n\n $scope.removeResource = (resource) => {\n $scope.onRemove({resources: [resource]});\n };\n\n $scope.importAll = (withoutChangingSettings) => {\n const selectedResources = $scope.resources.getAllSelectedForImport();\n if (selectedResources.length > 0) {\n $scope.onImportAll({selectedResources: selectedResources, withoutChangingSettings});\n }\n };\n\n $scope.stopImport = (importResource) => {\n $scope.onStopImport({resource: importResource});\n };\n\n /**\n * Sorts resources by provided sorting type.\n * @param {SortingType} sortedBy The sorting type to use.\n */\n $scope.sort = (sortedBy) => {\n if ($scope.sortedBy === sortedBy) {\n $scope.sortAsc = !$scope.sortAsc;\n } else {\n $scope.sortAsc = true;\n }\n $scope.sortedBy = sortedBy;\n updateListedImportResources();\n };\n\n $scope.editResource = (resource) => {\n $scope.onEditResource({resource});\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Sets the flag showing if any of the selected resources is already imported\n * and can have their states reset.\n */\n const setCanResetResourcesFlag = () => {\n $scope.canResetSelectedResources = $scope.resources.getSelectedImportedResources();\n };\n\n const updateListedImportResources = () => {\n $scope.resources.getRoot().updateSelectionState();\n sortResources();\n $scope.displayResources = $scope.resources.toList()\n .filter(filterByType)\n .filter(filterByName);\n\n updateHasSelection();\n updateSelectByStateDropdownModel();\n };\n\n const updateHasSelection = () => {\n const allSelectedFilesNames = $scope.resources.getAllSelectedFilesNames();\n $scope.hasSelection = allSelectedFilesNames.length > 0;\n ImportContextService.updateSelectedFilesNames(allSelectedFilesNames);\n };\n\n const updateSelectByStateDropdownModel = () => {\n const hasUnselectedDisplayedImportResource = $scope.displayResources.some((resource) => !resource.selected);\n const hasSelectedDisplayedImportResource = $scope.displayResources.some((resource) => resource.selected);\n $scope.areAllDisplayedImportResourcesSelected = hasSelectedDisplayedImportResource && !hasUnselectedDisplayedImportResource;\n $scope.areAllDisplayedImportResourcesPartialSelected = hasSelectedDisplayedImportResource && hasUnselectedDisplayedImportResource;\n };\n\n const sortResources = () => {\n if (SortingType.NAME === $scope.sortedBy) {\n $scope.resources.sort(compareByName($scope.sortAsc));\n } else if (SortingType.SIZE === $scope.sortedBy) {\n $scope.resources.sort(compareBySize($scope.sortAsc));\n } else if (SortingType.MODIFIED === $scope.sortedBy) {\n $scope.resources.sort(compareByModified($scope.sortAsc));\n } else if (SortingType.IMPORTED === $scope.sortedBy) {\n $scope.resources.sort(compareByImportedOn($scope.sortAsc));\n } else if (SortingType.CONTEXT === $scope.sortedBy) {\n $scope.resources.sort(compareByContext($scope.sortAsc));\n }\n };\n\n const compareByName = (acs) => (r1, r2) => {\n return acs ? r1.importResource.name.localeCompare(r2.importResource.name) : r2.importResource.name.localeCompare(r1.importResource.name);\n };\n\n const compareBySize = (acs) => (r1, r2) => {\n // The format of size returned by the backend has changed, but we need to keep the old format for backward compatibility.\n // Therefore, we convert the size to always be in bytes.\n const r1Size = ByteUtils.convertToBytes(r1.importResource.size);\n const r2Size = ByteUtils.convertToBytes(r2.importResource.size);\n return acs ? r1Size - r2Size : r2Size - r1Size;\n };\n\n const compareByModified = (acs) => (r1, r2) => {\n const r1ModifiedOn = r1.importResource.modifiedOn || Number.MAX_VALUE;\n const r2ModifiedOn = r2.importResource.modifiedOn || Number.MAX_VALUE;\n return acs ? r1ModifiedOn - r2ModifiedOn : r2ModifiedOn - r1ModifiedOn;\n };\n\n const compareByImportedOn = (acs) => (r1, r2) => {\n const r1ImportedOn = r1.importResource.importedOn || Number.MAX_VALUE;\n const r2ImportedOn = r2.importResource.importedOn || Number.MAX_VALUE;\n return acs ? r1ImportedOn - r2ImportedOn : r2ImportedOn - r1ImportedOn;\n };\n\n const compareByContext = (acs) => (r1, r2) => {\n return acs ? r1.importResource.context.localeCompare(r2.importResource.context) : r2.importResource.context.localeCompare(r1.importResource.context);\n };\n\n const filterByType = (resource) => {\n if (TYPE_FILTER_OPTIONS.ALL === $scope.filterByType) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.isFile();\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.isDirectory();\n }\n\n return false;\n };\n\n const filterByName = (resource) => {\n if (!$scope.filterByFileName) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.hasTextInDirectoriesName($scope.filterByFileName);\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.hasTextInFilesName($scope.filterByFileName);\n }\n return resource.hasTextInResourcesName($scope.filterByFileName);\n };\n\n let debounceTimeout;\n const debounce = (func, delay) => {\n // Clear previous timeout\n if (debounceTimeout) {\n $timeout.cancel(debounceTimeout);\n }\n\n // Set new timeout\n debounceTimeout = $timeout(func, delay);\n };\n\n // =========================\n // Subscription handlers\n // =========================\n\n const onResourcesUpdatedHandler = (newResources = []) => {\n const isUserImport = TABS.USER === ImportContextService.getActiveTabId();\n if ($scope.resources.isEmpty()) {\n $scope.resources = ImportResourceTreeService.toImportResourceTree(newResources, isUserImport);\n if (isUserImport) {\n $scope.sortedBy = SortingType.MODIFIED;\n }\n } else {\n ImportResourceTreeService.mergeResourceTree($scope.resources, newResources, isUserImport);\n }\n ImportResourceTreeService.calculateElementIndent($scope.resources);\n ImportResourceTreeService.setupAfterTreeInitProperties($scope.resources);\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n subscriptions.push(ImportContextService.onResourcesUpdated(onResourcesUpdatedHandler));\n subscriptions.push(ImportContextService.onShowLoaderUpdated((showLoader) => $scope.showLoader = showLoader));\n subscriptions.push(ImportContextService.onActiveTabIdUpdated(() => $scope.resources = new ImportResourceTreeElement()));\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n },\n };\n}\n","/**\n * This AngularJS directive validates whether an input value is a valid URI (IRI).\n *\n * @directive validateUri\n * @restrict A (Attribute)\n * @requires ngModel\n *\n * @example\n * <input type=\"text\" name=\"url\" ng-model=\"url\" validate-uri>\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.import.directives.validate-uri', modules)\n .directive('validateUri', validateUri);\n\nvalidateUri.$inject = ['UriUtils'];\n\n/**\n * @function validateUri\n * @param {UriUtils} UriUtils - Service for URI validation.\n */\nfunction validateUri(UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n ctrl.$setValidity('validateUri', true);\n if (!ctrl.$isEmpty(value)) {\n const valid = UriUtils.isValidIri(value, value.toString());\n ctrl.$setValidity('validateUri', valid);\n }\n return value;\n });\n }\n };\n}\n"],"names":["angular","module","controller","ImportResourceMessageDialogController","$inject","logger","LoggerProvider","$scope","$uibModalInstance","$translate","toastr","message","close","dismiss","copyToClipboard","navigator","clipboard","writeText","then","success","instant","err","error","ImportProgressIndicator","link","scope","element","attr","$watch","file","status","$","has","length","append","size","directive","importResourceMessageDirective","$uibModal","restrict","templateUrl","resource","ImportResourceStatus","toTitleCase","str","stringUtils","showMessage","resourceTreeElement","open","windowClass","backdrop","resolve","importResource","importResourceStatusInfoDirective","$rootScope","$document","subscribers","popoverTemplate","popoverIsOpen","context","replaceGraphs","baseUrl","decodeURIComponent","baseURI","forceSerial","importedOn","parserSettings","closeAllDialogs","$broadcast","handleEscapeKeyPress","event","key","$apply","push","$on","on","off","forEach","subscriber","TYPE_FILTER_OPTIONS","STATUS_OPTIONS","importResourceTreeDirective","$timeout","ImportContextService","columnKeys","showTypeFilter","sortBy","asc","onImport","onImportAll","onReset","onRemove","onStopImport","onEditResource","attrs","resources","ImportResourceTreeElement","displayResources","filterByType","ALL","filterByFileName","selectedByStatus","undefined","areAllDisplayedImportResourcesSelected","areAllDisplayedImportResourcesPartialSelected","canRemoveResource","isDefined","canResetSelectedResources","SORTING_TYPES","SortingType","sortAsc","sortedBy","showLoader","getShowLoader","hasSelection","selectionChanged","setSelection","selected","updateSelectByStateDropdownModel","setCanResetResourcesFlag","updateHasSelection","selectResourceWithStatus","resourceStatus","IMPORTED","selectAllWithStatus","DONE","NOT_IMPORTED","IMPORTING","NONE","ERROR","PENDING","INTERRUPTING","updateListedImportResources","filterByTypeChanged","newType","filterByFileNameChanged","debounce","onResetStatus","resourcesNames","getAllSelected","map","path","resetStatus","onRemoveResources","selectedResources","removeResource","importAll","withoutChangingSettings","getAllSelectedForImport","stopImport","sort","editResource","getSelectedImportedResources","getRoot","updateSelectionState","sortResources","toList","filter","filterByName","allSelectedFilesNames","getAllSelectedFilesNames","updateSelectedFilesNames","hasUnselectedDisplayedImportResource","some","hasSelectedDisplayedImportResource","NAME","compareByName","SIZE","compareBySize","MODIFIED","compareByModified","compareByImportedOn","CONTEXT","compareByContext","acs","r1","r2","name","localeCompare","r1Size","ByteUtils","convertToBytes","r2Size","r1ModifiedOn","modifiedOn","Number","MAX_VALUE","r2ModifiedOn","r1ImportedOn","r2ImportedOn","FILE","isFile","DIRECTORY","isDirectory","hasTextInDirectoriesName","hasTextInFilesName","hasTextInResourcesName","debounceTimeout","func","delay","cancel","subscriptions","onResourcesUpdated","onResourcesUpdatedHandler","newResources","isUserImport","TABS","USER","getActiveTabId","isEmpty","ImportResourceTreeService","toImportResourceTree","mergeResourceTree","calculateElementIndent","setupAfterTreeInitProperties","onShowLoaderUpdated","onActiveTabIdUpdated","removeAllSubscribers","subscription","validateUri","UriUtils","require","ctrl","$parsers","unshift","value","$setValidity","$isEmpty","valid","isValidIri","toString"],"sourceRoot":""}