graphdb-workbench 3.0.0-RC2 → 3.0.0-RC4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{12.a578517b09e5f38db2c5.bundle.js → 12.3cd5d3607c3fc2914a20.bundle.js} +1 -1
- package/dist/230.3e6d1a0606d967cfcc8d.bundle.js +1 -1
- package/dist/{29.8d946e4806be728552a4.bundle.js → 29.aa48cf88c9ae5cfb6a0a.bundle.js} +1 -1
- package/dist/{30.a5ab6e8e1e924ffde4df.bundle.js → 30.fc97ac2cd50e273f8bac.bundle.js} +1 -1
- package/dist/31.756f6db034a221e6bd94.bundle.js +1 -1
- package/dist/{35.15fca07b326baf2661db.bundle.js → 35.a7fcb233204c12f358c1.bundle.js} +1 -1
- package/dist/{356.c6994de36956399a26ce.bundle.js → 356.e8d0fa12548f8da17013.bundle.js} +1 -1
- package/dist/{38.d61e7b160eb0cf4e52a0.bundle.js → 38.4953e07e10d37b9c97ac.bundle.js} +1 -1
- package/dist/396.7cf27406a1fbb04ee9fc.bundle.js +1 -0
- package/dist/407.8cc73dc5f20d4e41214a.bundle.js +1 -1
- package/dist/413.399c0de9a7eed2876f19.bundle.js +1 -1
- package/dist/414.564363a4c2904c835bf2.bundle.js +1 -1
- package/dist/42.198c823c68d7ab997ed8.bundle.js +1 -1
- package/dist/420.86d39a34e0cfe7c5922d.bundle.js +1 -1
- package/dist/421.496b38108447fe3706fd.bundle.js +1 -1
- package/dist/422.9476615eea039ed0a3ca.bundle.js +1 -1
- package/dist/423.8f8b9beeefb8e456e740.bundle.js +1 -1
- package/dist/424.b1f341c2214d28ae62c2.bundle.js +1 -1
- package/dist/425.efd0aac0d1ce59d5193d.bundle.js +1 -1
- package/dist/440.65f4842c6b26f7a8fb04.bundle.js +1 -1
- package/dist/441.c33323aeb6fe095d0b07.bundle.js +1 -1
- package/dist/442.82dc82ea81a83cca825a.bundle.js +1 -1
- package/dist/443.4abf2d489c2afafef5a7.bundle.js +1 -1
- package/dist/444.d0b80c745f68ce002d1c.bundle.js +1 -1
- package/dist/445.10ba12283f340ef90cfa.bundle.js +1 -1
- package/dist/465.5fea1718e3d223ce572b.bundle.js +1 -1
- package/dist/477.ebfc2f101ba75769e928.bundle.js +1 -1
- package/dist/478.a8046c01285d7a20ab0a.bundle.js +1 -1
- package/dist/{479.d6351d065e4611014cf6.bundle.js → 479.4e2bd673726d62bf0524.bundle.js} +1 -1
- package/dist/480.da864736cf389e4277d1.bundle.js +1 -1
- package/dist/481.9f8d8f6d85ab4e0c4644.bundle.js +1 -1
- package/dist/482.3b98ed70bb5211093378.bundle.js +1 -1
- package/dist/485.0c77d57a5e84b6baae8f.bundle.js +1 -1
- package/dist/486.ea7bdffc43fbaf04908c.bundle.js +1 -1
- package/dist/487.709c4b0e218b914e4f4e.bundle.js +1 -1
- package/dist/488.fc918ea5c55681561ed6.bundle.js +1 -1
- package/dist/49.eb484abfcc9a42c7c423.bundle.js +1 -1
- package/dist/50.5a6b73cf0ec26182e5d0.bundle.js +1 -1
- package/dist/75.96247f0a98d70d96e6c2.bundle.js +1 -1
- package/dist/{bundle.1567114f3942e9494fdb.bundle.js → bundle.2a78ee86f58a4cf6f5d3.bundle.js} +2 -2
- package/dist/i18n/locale-en.json +4 -3
- package/dist/i18n/locale-fr.json +4 -3
- package/dist/index.html +3 -3
- package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
- package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
- package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
- package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
- package/dist/js/angular/graphql/templates/graphql-playground.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
- package/dist/js/angular/security/templates/user.html +2 -2
- package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
- package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
- package/dist/js/angular/ttyg/templates/autocomplete-iri-discovery-search.html +0 -17
- package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +2 -2
- package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
- package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
- package/dist/license-checker.json +6 -6
- package/dist/pages/aclmanagement.html +2 -2
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +1 -1
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +8 -8
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.html +1 -1
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +1 -1
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +1 -1
- package/dist/pages/repository.html +1 -1
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-editor.html +1 -1
- package/dist/pages/sparql-template-create.html +1 -1
- package/dist/pages/ux-test1.html +2 -2
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger5/index.html +12 -12
- package/package.json +2 -2
- package/dist/396.8596825a6b99e49f2e53.bundle.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[12,86,110,345,350,389],{139:function(e,t){angular.module("graphdb.framework.rest.cluster.service",[]).factory("ClusterRestService",o),o.$inject=["$http"];function o(e){return{getClusterConfig:function(){return e.get("".concat("rest/cluster","/config"))},createCluster:function(t){return e.post("".concat("rest/cluster","/httpConfig"),t)},updateClusterConfiguration:function(t){t.nodes&&delete t.nodes;return e.patch("".concat("rest/cluster","/config"),t)},deleteCluster:function(t){var o=$.param({force:t});return e.delete("".concat("rest/cluster","/config?").concat(o))},replaceNodesInCluster:function(t){return e.patch("".concat("rest/cluster","/httpConfig"),t)},getClusterStatus:function(){return e.get("".concat("rest/cluster","/group/status"))},getNodeStatus:function(){return e.get("".concat("rest/cluster","/node/status"))},addCusterTag:function(t){return e.post("".concat("rest/cluster","/config/tag"),t)},deleteClusterTag:function(t){return e({method:"DELETE",url:"".concat("rest/cluster","/config/tag"),data:{tag:t},headers:{"Content-type":"application/json;charset=utf-8"}})},disableSecondaryMode:function(){return e.delete("".concat("rest/cluster","/config/secondary-mode"))},enableSecondaryMode:function(t){return e.post("".concat("rest/cluster","/config/secondary-mode"),t)}}}},143:function(e,t,o){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}o.r(t),o.d(t,"UrlUtils",(function(){return c}));var a=/^(h|ht|htt|http|https|http:|https:|http:\/|https:\/|http:\/\/|https:\/\/|https?:\/\/[\S]*)$/i,s=/^(f|ft|ftp|ftps|ftp:|ftps:|ftp:\/|ftps:\/|ftp:\/\/|ftps:\/\/[\S]*)$/i,c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},o=[{key:"isValidUrl",value:function(e){return a.test(e)||s.test(e)}},{key:"doesNotContain",value:function(e,t){return!new RegExp(t).test(e)}},{key:"doesNotUseProtocol",value:function(e,t){return!new RegExp("^("+t.join("|")+")://","i").test(e)}}],(t=null)&&n(e.prototype,t),o&&n(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,o}()},159:function(e,t,o){"use strict";o.r(t),o.d(t,"STATIC_RULESETS",(function(){return r})),o.d(t,"REPOSITORY_TYPES",(function(){return n})),o.d(t,"FILENAME_PATTERN",(function(){return i})),o.d(t,"NUMBER_PATTERN",(function(){return a}));var r=[{id:"empty",name:"No inference"},{id:"rdfs-optimized",name:"RDFS (Optimized)"},{id:"rdfs",name:"RDFS"},{id:"rdfsplus-optimized",name:"RDFS-Plus (Optimized)"},{id:"owl-horst-optimized",name:"OWL-Horst (Optimized)"},{id:"owl-horst",name:"OWL-Horst"},{id:"owl2-ql-optimized",name:"OWL2-QL (Optimized)"},{id:"owl2-ql",name:"OWL2-QL"},{id:"owl-max-optimized",name:"OWL-Max (Optimized)"},{id:"owl-max",name:"OWL-Max"},{id:"owl2-rl-optimized",name:"OWL2-RL (Optimized)"},{id:"owl2-rl",name:"OWL2-RL"}],n={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},i=new RegExp("^[a-zA-Z0-9-_]+$"),a=new RegExp("^[0-9]+$")},160:function(e,t,o){"use strict";o.r(t);var r=o(143);angular.module("graphdb.framework.core.directives.validate-url",[]).directive("validateUrl",(function(){return{restrict:"A",require:"ngModel",link:function(e,t,o,n){n.$validators.validUrl=function(e,t){if(n.$isEmpty(t))return"false"!==o.allowEmpty;if(!r.UrlUtils.isValidUrl(t))return!1;if(o.exclude&&!r.UrlUtils.doesNotContain(t,o.exclude))return!1;if(o.excludeProtocol){var i=o.excludeProtocol.split(",");if(!r.UrlUtils.doesNotUseProtocol(t,i))return!1}return!0}}}}))},246:function(e,t,o){"use strict";o.r(t),o.d(t,"getFileName",(function(){return a}));var r=o(159),n=o(1),i=(o(250),o(36)),a=(o(139),function(e){var t=e.lastIndexOf("/");-1===t&&(t=e.lastIndexOf("\\"));var o=e;return-1!==t&&(o=o.substring(t+1)),o}),s=function(e){e&&Object.keys(e).forEach((function(t){var o=e[t];if(o&&"string"==typeof o.value){var r=parseFloat(e[t].value);!isNaN(r)&&l[t]&&(e[t].value=Number.isInteger(r)?parseInt(o.value,10):r,o.isNumber=!0)}}))},c=function(){var e=document.getElementById("shaclOptions");if(e){var t=e.getAttribute("aria-expanded");if(t&&"true"===t)return"fa fa-angle-down"}return"fa fa-angle-right"},l={queryLimitResults:"invalid.query.limit",queryTimeout:"invalid.query.timeout",validationResultsLimitTotal:"invalid.validation.results.limit.total",validationResultsLimitPerConstraint:"invalid.validation.results.limit.per.constraint",joinWorkerThreads:"invalid.join.worker.threads",leftJoinWorkerThreads:"invalid.left.join.worker.threads",unionWorkerThreads:"invalid.union.worker.threads",boundJoinBlockSize:"invalid.bound.join.block.size",entityIndexSize:"invalid.entity.index.size"},u=function(e,t){if(!e)return"";var o=Object.keys(e).find((function(t){var o=e[t];return o.isNumber&&!r.NUMBER_PATTERN.test(o.value)}));return o&&l[o]?t.instant(l[o]):""},p=function(e){return"https://graphdb.ontotext.com/documentation/".concat(e.productShortVersion)},d=function(e){return e.getLocations().then((function(e){return e.filter((function(e){return e.isGraphDBLocation()&&!e.errorMsg&&!e.degradedReason}))}))};function f(e,t,o,a,s,c,l,u,p,d,f,m,y,g){e.RemoteLocationType=i.RemoteLocationType,e.loader=!0,e.isInCluster=!1,e.locations=[],e.isLocationInactive=function(t){return!t.active||!e.hasActiveLocation()};var v=m.defer();function h(){return s.getLocations(v).then((function(t){return e.locations=t,t})).finally((function(){return e.loader=!1}))}e.getLocalLocation=function(t,o){return e.locations.filter((function(e){var r=!0;return o&&(r=e.locationType===o),r&&e.local===t}))},e.hasAnyRemoteLocation=function(t,o){return o.some((function(o){return e.getLocalLocation(t,o).length>0}))},e.hasActiveLocation=function(){return s.hasActiveLocation()},e.getActiveLocation=function(){return s.getActiveLocation()},e.getLocationError=function(){return s.getLocationError()},e.getDegradedReason=function(){return s.getDegradedReason()},e.getRepositories=function(){return s.getRepositories()},e.isRepoActive=function(e){return s.isRepoActive(e)},e.deleteLocation=function(t){c.openSimpleModal({title:f.instant("location.confirm.detach"),message:f.instant("location.confirm.detach.warning",{uri:t}),warning:!0}).result.then((function(){e.loader=!0,s.deleteLocation(t).finally((function(){return h()}))}))},e.addLocationHttp=function(t){e.loader=!0,u.addLocation(t).success((function(){s.init()})).error((function(e){var t=getError(e);a.error(t,f.instant("common.error"))})).finally((function(){return h()}))},e.addLocation=function(){e.openRemoteLocationDialog()},e.editLocation=function(t){void 0===t.locationType&&(t.locationType=i.RemoteLocationType.GRAPH_DB),e.openRemoteLocationDialog(t)},e.openRemoteLocationDialog=function(t){o.open({templateUrl:"js/angular/repositories/templates/manage-remote-location-dialog.template.html",windowClass:"addLocationDialog",controller:"ManageRemoteLocationDialogController",resolve:{data:function(){return{remoteLocation:t}}}}).result.then((function(o){t?e.editLocationHttp(o):e.addLocationHttp(o)}))},e.editLocationHttp=function(t){e.loader=!0,u.editLocation(t).success((function(){s.init()})).error((function(e){var t=getError(e);a.error(t,f.instant("common.error"))})).finally((function(){return h()}))},e.setRepository=function(e){s.setRepository(e)},e.deleteRepository=function(t){c.openSimpleModal({title:f.instant("common.confirm.delete"),message:Object(n.decodeHTML)(f.instant("delete.repo.warning.msg",{repositoryId:t.id})),warning:!0}).result.then((function(){var o,r,n;e.loader=!0,s.deleteRepository(t).finally((function(){h(),e.loader=!1})),r="dependencies-selectedGraph-".concat((o=t).id),n="classHierarchy-selectedGraph-".concat(o.id),angular.forEach(p.keys(),(function(e){(e.startsWith(n)||e.startsWith(r))&&p.remove(e)}))}))},e.restartRepository=function(t){c.openSimpleModal({title:f.instant("confirm.restart.repo"),message:Object(n.decodeHTML)(f.instant("confirm.restart.repo.warning.msg",{repositoryId:t.id})),warning:!0}).result.then((function(){e.loader=!0,s.restartRepository(t).finally((function(){return h()}))}))},e.toggleDefaultRepository=function(t){e.getDefaultRepository()===t?s.setDefaultRepository(null):s.setDefaultRepository(t)},e.getDefaultRepository=function(){return s.getDefaultRepository()},e.getRepositoryDownloadLink=function(e){var t="rest/repositories/".concat(e.id).concat(e.type===r.REPOSITORY_TYPES.ontop?"/download-zip":"/download-ttl","?location=").concat(e.location),o=l.getAuthToken();return o&&(t="".concat(t,"&authToken=").concat(encodeURIComponent(o))),t},e.copyToClipboard=function(e){c.openCopyToClipboardModal(e)},e.fromFile=function(){o.open({templateUrl:"js/angular/templates/modal/upload-repository-config.html",controller:"UploadRepositoryConfigCtrl"}).result.then((function(){s.init()}))},e.openActiveLocationSettings=function(){o.open({templateUrl:"js/angular/settings/modal/location-settings.html",controller:"ActiveLocationSettingsCtrl"})},h(),g.getNodeStatus().then((function(){e.isInCluster=!0})).catch((function(t){404===t.status?e.isInCluster=!1:console.error("An unexpected error occurred:",t)}));var R=d((function(){y.isActive()&&!t.guidePaused||(s.initQuick(),h())}),5e3);e.$on("$destroy",(function(){d.cancel(R),v&&v.resolve()})),e.getRepositoriesFromLocation=function(e){return s.getRepositoriesFromLocation(e)}}function m(e,t,o,r,n){e.upload=function(t){t&&t.length&&(e.uploadFile=t[0])},e.ok=function(){e.uploadFile&&(e.uploadFileLoader=!0,o.upload({url:"rest/repositories",method:"POST",data:{config:e.uploadFile}}).success((function(){e.uploadFileLoader=!1,t.close()})).error((function(t){var o=getError(t);r.error(o,n.instant("common.error")),e.uploadFileLoader=!1})))},e.cancel=function(){t.dismiss("cancel")}}function y(e,t,o,r,n){e.newLocation={uri:"",authType:"none",username:"",password:"",active:!1},e.docBase=p(r),e.isValidLocation=function(){return(e.newLocation.uri.length<6||0===e.newLocation.uri.indexOf("http:")||0===e.newLocation.uri.indexOf("https:"))&&e.newLocation.uri.indexOf("/repositories")<=-1},e.ok=function(){e.newLocation?t.close(e.newLocation):o.error(n.instant("location.cannot.be.empty.error"))},e.cancel=function(){t.dismiss("cancel")}}function g(e,t,o,r){e.editedLocation=_.cloneDeep(o),e.docBase=p(r),e.ok=function(){t.close(e.editedLocation)},e.cancel=function(){t.dismiss("cancel")}}function v(e,t){e.repositoryTypes=r.REPOSITORY_TYPES,e.chooseRepositoryType=function(e){t.path("".concat(t.path(),"/").concat(e))}}function h(e,t,o,n,i,a,l,p,f,m){function y(e){switch(e){case r.REPOSITORY_TYPES.graphdbRepo:t.pageTitle=m.instant("view.create.repo.title",{repoType:"GraphDB"});break;case r.REPOSITORY_TYPES.ontop:t.pageTitle=m.instant("view.create.repo.title",{repoType:"Ontop Virtual SPARQL"});break;case r.REPOSITORY_TYPES.fedx:t.pageTitle=m.instant("view.create.repo.title",{repoType:"FedX Virtual SPARQL"})}}var g;t.rulesets=r.STATIC_RULESETS.slice(),t.repositoryTypes=r.REPOSITORY_TYPES,t.params=p,t.repositoryType=p.repositoryType,t.enable=!0,t.entityIndexSizeMin=1e4,t.loader=!0,t.pageTitle=m.instant("view.create.repo.title"),t.repositoryInfo={id:"",params:{},title:"",type:"",location:""},d(n).then((function(e){t.locations=e})),t.changedLocation=function(){t.$broadcast("changedLocation")},t.getConfig=function(e){f.getRepositoryConfiguration(e).then((function(e){var o,r=e.data;t.repositoryInfo.params=r.params,t.repositoryInfo.type=r.type,s(t.repositoryInfo.params),(o=t.repositoryInfo.params)&&o.member&&(o.member.value=[]),t.loader=!1,a((function(){angular.element(document).find("#id").focus()}),50)})).catch((function(e){var r=getError(e);o.error(r,m.instant("common.error")),t.loader=!1}))},t.repositoryType&&(function(e){return t.isEnterprise()&&e===r.REPOSITORY_TYPES.graphdbRepo}(g=t.repositoryType)||function(e){return!t.isFreeEdition()&&!t.isEnterprise()&&e===r.REPOSITORY_TYPES.graphdbRepo}(g)||function(e){return t.isFreeEdition()&&e===r.REPOSITORY_TYPES.graphdbRepo}(g)||function(e){return e===r.REPOSITORY_TYPES.ontop}(g)||function(e){return e===r.REPOSITORY_TYPES.fedx}(g))?(t.repositoryInfo.type=t.repositoryType,t.getConfig(t.repositoryType),y(t.repositoryType)):i.path("/repository/create"),t.hasActiveLocation=function(){return n.hasActiveLocation()},t.activeLocation=function(){return n.getActiveLocation()};var v=!1;t.uploadRuleset=function(e){e&&e.length&&(t.uploadFile=e[0],t.uploadFileLoader=!0,l.upload({url:"rest/repositories/ruleset/upload",data:{ruleset:t.uploadFile,location:t.repositoryInfo.location}}).progress((function(e){})).success((function(e){if(e.success){v=!1;var r=t.uploadFile.name,n={id:e.fileLocation,name:"Custom: "+r};t.rulesetPie?t.rulesets[0]=n:t.rulesets.unshift(n),t.rulesetPie=e.fileLocation,t.rulesetPieFile=r,t.repositoryInfo.params.ruleset.value=t.rulesetPie}else o.error(e.errorMessage),v=!0,t.uploadFile="";t.uploadFileLoader=!1})).error((function(e){var r=getError(e);o.error(r,m.instant("common.error")),t.uploadFile="",t.uploadFileLoader=!1,v=!0})))},t.noMembersError=function(){o.error(m.instant("fedx.create.repo.no.members.warning"))},t.goBackToPreviousLocation=function(){angular.isDefined(p.previous)?(delete i.$$search.previous,i.path("/")):i.path("/repository")},t.createRepoHttp=function(){t.loader=!0,f.createRepository(t.repositoryInfo).then((function(){return o.success(m.instant("created.repo.success.msg",{repoId:t.repositoryInfo.id})),n.init()})).then((function(){return t.goBackToPreviousLocation()})).catch((function(e){var t=getError(e.data);o.error(t,m.instant("common.error"))})).finally((function(){t.loader=!1}))},t.createRepo=function(){var e;if(t.repositoryInfo.id){t.isInvalidRepoName=!r.FILENAME_PATTERN.test(t.repositoryInfo.id),t.isInvalidEntityIndexSizeMin=(null===(e=t.repositoryInfo.params.entityIndexSize)||void 0===e?void 0:e.value)<1e4;var n=u(t.repositoryInfo.params,m);v?o.error(m.instant("invalid.ruleset.file.error")):t.isInvalidRepoName?o.error(m.instant("wrong.repo.name.error")):"fedx"===t.repositoryType&&0===t.repositoryInfo.params.member.value.length?t.noMembersError():n?o.error(n):t.isInvalidEntityIndexSizeMin?o.error(m.instant("repo.error.entityIndex.min")):t.createRepoHttp()}else o.error(m.instant("empty.repoid.warning"))},t.rulesetWarning=function(){var e=t.repositoryInfo.params;return void 0===e||void 0===e.ruleset||void 0===e.disableSameAs?"":0===e.ruleset.value.indexOf("owl")&&"true"===e.disableSameAs.value?m.instant("repoTooltips.rulesetWarnings.needsSameAs"):0===e.ruleset.value.indexOf("rdfs")&&"false"===e.disableSameAs.value?m.instant("repoTooltips.rulesetWarnings.doesntNeedSameAs"):e.ruleset.value===t.rulesetPie?m.instant("repoTooltips.rulesetWarnings.customRuleset"):""},t.getShaclOptionsClass=function(){return c()},t.autofocusId="autofocus";var h=e.$on("$translateChangeSuccess",(function(){y(t.repositoryType)}));t.$on("$destroy",(function(){h()}))}function R(e,t,o,r,n,i,a){e.dialogTitle=a||i.instant("update.file.content.header"),r&&o.getRepositoryFileContent(r).success((function(t){e.fileContent=t})).error((function(e){var t=getError(e);n.error(t,i.instant("common.error"))})),e.ok=function(){t.close({content:e.fileContent,fileLocation:r})},e.cancel=function(){t.dismiss("cancel")}}function L(e,t,o,i,l,p,f,m,y,g){t.rulesets=r.STATIC_RULESETS.slice(),t.repositoryTypes=r.REPOSITORY_TYPES,t.entityIndexSizeMin=1e4,t.editRepoPage=!0,t.canEditRepoId=!1,t.isRepoInCluster=!0,t.params=o,t.loader=!0,t.repositoryInfo={},t.repositoryInfo.id=t.params.repositoryId,t.repositoryInfo.location=t.params.location,t.repositoryInfo.restartRequested=!1,t.repositoryType="",t.saveRepoId=t.params.repositoryId,t.pageTitle=y.instant("view.edit.repo.title",{repositoryId:t.params.repositoryId}),t.hasActiveLocation=function(){return l.hasActiveLocation()};t.$watch(t.hasActiveLocation,(function(){var e;t.hasActiveLocation&&d(l).then((function(e){return t.locations=e,m.getRepository(t.repositoryInfo)})).then((function(o){return e=o,g.monitorActiveOperations(t.repositoryInfo.id)})).then((function(e){t.isRepoInCluster=e.hasClusterOperation()})).catch((function(o){return e?Promise.resolve():(t.repositoryInfo=void 0,Promise.reject(o))})).then((function(){!function(e){var o=e.data;if(angular.isDefined(o.params.ruleset)){var r=!1;if(angular.forEach(t.rulesets,(function(e){e.id===o.params.ruleset.value&&(r=!0)})),o.params.ruleset&&!r){var n=a(o.params.ruleset.value);t.rulesets.unshift({id:o.params.ruleset.value,name:"Custom: "+n})}}t.repositoryInfo=o,t.setRepositoryType(o.type),s(t.repositoryInfo.params),t.repositoryInfo.saveId=t.saveRepoId,t.loader=!1}(e)})).catch((function(e){var r,a=e.data,s=e.status,c=o.repositoryId;r=404===s&&"system"!==c?Object(n.decodeHTML)(y.instant("edit.repo.error.not.exists",{repositoryId:c})):404===s&&"system"===c?Object(n.decodeHTML)(y.instant("edit.system.repo.warning")):getError(a),i.error(r,y.instant("common.error"),{allowHtml:!0}),404===s?setTimeout((function(){t.loader=!1,p.path("repository")}),1e3):t.loader=!1}))})),t.setRepositoryType=function(e){t.repositoryType=e},t.noMembersError=function(){i.error(y.instant("fedx.create.repo.no.members.warning"))},t.editRepoHttp=function(){t.loader=!0,m.editRepository(t.repositoryInfo.saveId,t.repositoryInfo).success((function(){i.success(y.instant("edit.repo.success.msg",{saveId:t.repositoryInfo.saveId})),l.init().finally((function(){return t.goBackToPreviousLocation()})),t.repositoryInfo.saveId===t.repositoryInfo.id&&t.repositoryInfo.restartRequested&&l.restartRepository(t.repositoryInfo)})).error((function(e){var o=getError(e);i.error(o,y.instant("common.error")),t.loader=!1}))},t.editRepository=function(){var e;t.isInvalidRepoName=!r.FILENAME_PATTERN.test(t.repositoryInfo.id),t.isInvalidEntityIndexSizeMin=(null===(e=t.repositoryInfo.params.entityIndexSize)||void 0===e?void 0:e.value)<1e4;var o=u(t.repositoryInfo.params,y),a=Object(n.decodeHTML)(y.instant("edit.repo.save.changes.msg",{repoId:t.repositoryInfo.id}));t.repositoryInfo.saveId!==t.repositoryInfo.id?a+=Object(n.decodeHTML)(y.instant("edit.repo.rename.changes.msg")):t.repositoryInfo.restartRequested?a+=Object(n.decodeHTML)(y.instant("edit.repo.restart.requested.msg")):a+=Object(n.decodeHTML)(y.instant("edit.repo.restart.needed.msg")),t.isInvalidRepoName?i.error(y.instant("wrong.repo.name.error")):"fedx"===t.repositoryType&&0===t.repositoryInfo.params.member.value.length?t.noMembersError():o?i.error(o):t.isInvalidEntityIndexSizeMin?i.error(y.instant("repo.error.entityIndex.min")):f.openSimpleModal({title:y.instant("common.confirm.save"),message:a,warning:!0}).result.then((function(){t.editRepoHttp()}))},t.editRepositoryId=function(){var e=Object(n.decodeHTML)(y.instant("edit.repo.id.warning.msg"));t.isEnterprise()&&(e+=Object(n.decodeHTML)(y.instant("edit.repo.id.cluster.warning.msg"))),f.openSimpleModal({title:y.instant("confirm.enable.edit"),message:e,warning:!0}).result.then((function(){t.canEditRepoId=!0}))},t.goBackToPreviousLocation=function(){angular.isDefined(o.previous)?(delete p.$$search.previous,p.path("/")):p.path("/repository")},t.getShaclOptionsClass=function(){return c()};var v=e.$on("$translateChangeSuccess",(function(){t.pageTitle=y.instant("view.edit.repo.title",{repositoryId:t.params.repositoryId})}));t.$on("$destroy",(function(){v()}))}angular.module("graphdb.framework.repositories.controllers",["ngCookies","ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter","toastr","ngFileUpload","graphdb.framework.repositories.controllers.manage-remote-location-dialog","graphdb.framework.rest.cluster.service"]).controller("LocationsAndRepositoriesCtrl",f).controller("AddLocationCtrl",y).controller("EditLocationCtrl",g).controller("ChooseRepositoryCtrl",v).controller("AddRepositoryCtrl",h).controller("EditRepositoryCtrl",L).controller("EditRepositoryFileCtrl",R).controller("UploadRepositoryConfigCtrl",m),f.$inject=["$scope","$rootScope","$uibModal","toastr","$repositories","ModalService","AuthTokenService","LocationsRestService","LocalStorageAdapter","$interval","$translate","$q","GuidesService","ClusterRestService"],m.$inject=["$scope","$uibModalInstance","Upload","toastr","$translate"],y.$inject=["$scope","$uibModalInstance","toastr","productInfo","$translate"],g.$inject=["$scope","$uibModalInstance","location","productInfo"],v.$inject=["$scope","$location"],h.$inject=["$rootScope","$scope","toastr","$repositories","$location","$timeout","Upload","$routeParams","RepositoriesRestService","$translate"],R.$inject=["$scope","$uibModalInstance","RepositoriesRestService","file","toastr","$translate","dialogTitle"],L.$inject=["$rootScope","$scope","$routeParams","toastr","$repositories","$location","ModalService","RepositoriesRestService","$translate","MonitoringRestService"]},250:function(e,t,o){"use strict";o.r(t);var r=o(36);o(160);function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function a(e,t,o){return(t=function(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,t||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function s(e,t,o,n){e.RemoteLocationType=r.RemoteLocationType,e.RemoteLocationAuthType=r.RemoteLocationAuthType,e.isEdit=!!n.remoteLocation,e.remoteLocation=n.remoteLocation?new r.RemoteLocationModel(function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?i(Object(o),!0).forEach((function(t){a(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({},n.remoteLocation)):new r.RemoteLocationModel,e.docBase="https://graphdb.ontotext.com/documentation/".concat(o.productShortVersion),e.ok=function(){e.remoteLocationForm.$pristine||e.remoteLocationForm.$invalid||t.close(e.remoteLocation)},e.cancel=function(){t.dismiss("cancel")},e.onLocationTypeChanged=function(){[r.RemoteLocationType.ONTOPIC,r.RemoteLocationType.SPARQL].includes(e.remoteLocation.locationType)?e.remoteLocation.authType=r.RemoteLocationAuthType.BASIC:e.remoteLocation.authType=r.RemoteLocationAuthType.NONE}}angular.module("graphdb.framework.repositories.controllers.manage-remote-location-dialog",["graphdb.framework.core.directives.validate-url"]).controller("ManageRemoteLocationDialogController",s),s.$inject=["$scope","$uibModalInstance","productInfo","data"]}}]);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[12,86,110,345,350,389],{139:function(e,t){angular.module("graphdb.framework.rest.cluster.service",[]).factory("ClusterRestService",o),o.$inject=["$http"];function o(e){return{getClusterConfig:function(){return e.get("".concat("rest/cluster","/config"))},createCluster:function(t){return e.post("".concat("rest/cluster","/httpConfig"),t)},updateClusterConfiguration:function(t){t.nodes&&delete t.nodes;return e.patch("".concat("rest/cluster","/config"),t)},deleteCluster:function(t){var o=$.param({force:t});return e.delete("".concat("rest/cluster","/config?").concat(o))},replaceNodesInCluster:function(t){return e.patch("".concat("rest/cluster","/httpConfig"),t)},getClusterStatus:function(){return e.get("".concat("rest/cluster","/group/status"))},getNodeStatus:function(){return e.get("".concat("rest/cluster","/node/status"))},addCusterTag:function(t){return e.post("".concat("rest/cluster","/config/tag"),t)},deleteClusterTag:function(t){return e({method:"DELETE",url:"".concat("rest/cluster","/config/tag"),data:{tag:t},headers:{"Content-type":"application/json;charset=utf-8"}})},disableSecondaryMode:function(){return e.delete("".concat("rest/cluster","/config/secondary-mode"))},enableSecondaryMode:function(t){return e.post("".concat("rest/cluster","/config/secondary-mode"),t)}}}},143:function(e,t,o){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}o.r(t),o.d(t,"UrlUtils",(function(){return c}));var a=/^(h|ht|htt|http|https|http:|https:|http:\/|https:\/|http:\/\/|https:\/\/|https?:\/\/[\S]*)$/i,s=/^(f|ft|ftp|ftps|ftp:|ftps:|ftp:\/|ftps:\/|ftp:\/\/|ftps:\/\/[\S]*)$/i,c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},o=[{key:"isValidUrl",value:function(e){return a.test(e)||s.test(e)}},{key:"doesNotContain",value:function(e,t){return!new RegExp(t).test(e)}},{key:"doesNotUseProtocol",value:function(e,t){return!new RegExp("^("+t.join("|")+")://","i").test(e)}}],(t=null)&&n(e.prototype,t),o&&n(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,o}()},159:function(e,t,o){"use strict";o.r(t),o.d(t,"STATIC_RULESETS",(function(){return r})),o.d(t,"REPOSITORY_TYPES",(function(){return n})),o.d(t,"FILENAME_PATTERN",(function(){return i})),o.d(t,"NUMBER_PATTERN",(function(){return a}));var r=[{id:"empty",name:"No inference"},{id:"rdfs-optimized",name:"RDFS (Optimized)"},{id:"rdfs",name:"RDFS"},{id:"rdfsplus-optimized",name:"RDFS-Plus (Optimized)"},{id:"owl-horst-optimized",name:"OWL-Horst (Optimized)"},{id:"owl-horst",name:"OWL-Horst"},{id:"owl2-ql-optimized",name:"OWL2-QL (Optimized)"},{id:"owl2-ql",name:"OWL2-QL"},{id:"owl-max-optimized",name:"OWL-Max (Optimized)"},{id:"owl-max",name:"OWL-Max"},{id:"owl2-rl-optimized",name:"OWL2-RL (Optimized)"},{id:"owl2-rl",name:"OWL2-RL"}],n={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},i=new RegExp("^[a-zA-Z0-9-_]+$"),a=new RegExp("^[0-9]+$")},160:function(e,t,o){"use strict";o.r(t);var r=o(143);angular.module("graphdb.framework.core.directives.validate-url",[]).directive("validateUrl",(function(){return{restrict:"A",require:"ngModel",link:function(e,t,o,n){n.$validators.validUrl=function(e,t){if(n.$isEmpty(t))return"false"!==o.allowEmpty;if(!r.UrlUtils.isValidUrl(t))return!1;if(o.exclude&&!r.UrlUtils.doesNotContain(t,o.exclude))return!1;if(o.excludeProtocol){var i=o.excludeProtocol.split(",");if(!r.UrlUtils.doesNotUseProtocol(t,i))return!1}return!0}}}}))},246:function(e,t,o){"use strict";o.r(t),o.d(t,"getFileName",(function(){return a}));var r=o(159),n=o(1),i=(o(250),o(36)),a=(o(139),function(e){var t=e.lastIndexOf("/");-1===t&&(t=e.lastIndexOf("\\"));var o=e;return-1!==t&&(o=o.substring(t+1)),o}),s=function(e){e&&Object.keys(e).forEach((function(t){var o=e[t];if(o&&"string"==typeof o.value){var r=parseFloat(e[t].value);!isNaN(r)&&l[t]&&(e[t].value=Number.isInteger(r)?parseInt(o.value,10):r,o.isNumber=!0)}}))},c=function(){var e=document.getElementById("shaclOptions");if(e){var t=e.getAttribute("aria-expanded");if(t&&"true"===t)return"fa fa-angle-down"}return"fa fa-angle-right"},l={queryLimitResults:"invalid.query.limit",queryTimeout:"invalid.query.timeout",validationResultsLimitTotal:"invalid.validation.results.limit.total",validationResultsLimitPerConstraint:"invalid.validation.results.limit.per.constraint",joinWorkerThreads:"invalid.join.worker.threads",leftJoinWorkerThreads:"invalid.left.join.worker.threads",unionWorkerThreads:"invalid.union.worker.threads",boundJoinBlockSize:"invalid.bound.join.block.size",entityIndexSize:"invalid.entity.index.size"},u=function(e,t){if(!e)return"";var o=Object.keys(e).find((function(t){var o=e[t];return o.isNumber&&!r.NUMBER_PATTERN.test(o.value)}));return o&&l[o]?t.instant(l[o]):""},p=function(e){return"https://graphdb.ontotext.com/documentation/".concat(e.productShortVersion)},d=function(e){return e.getLocations().then((function(e){return e.filter((function(e){return e.isGraphDBLocation()&&!e.errorMsg&&!e.degradedReason}))}))};function f(e,t,o,a,s,c,l,u,p,d,f,m,y,g){e.RemoteLocationType=i.RemoteLocationType,e.loader=!0,e.isInCluster=!1,e.locations=[],e.isLocationInactive=function(t){return!t.active||!e.hasActiveLocation()};var v=m.defer();function h(){return s.getLocations(v).then((function(t){return e.locations=t,t})).finally((function(){return e.loader=!1}))}e.getLocalLocation=function(t,o){return e.locations.filter((function(e){var r=!0;return o&&(r=e.locationType===o),r&&e.local===t}))},e.hasAnyRemoteLocation=function(t,o){return o.some((function(o){return e.getLocalLocation(t,o).length>0}))},e.hasActiveLocation=function(){return s.hasActiveLocation()},e.getActiveLocation=function(){return s.getActiveLocation()},e.getLocationError=function(){return s.getLocationError()},e.getDegradedReason=function(){return s.getDegradedReason()},e.getRepositories=function(){return s.getRepositories()},e.isRepoActive=function(e){return s.isRepoActive(e)},e.deleteLocation=function(t){c.openSimpleModal({title:f.instant("location.confirm.detach"),message:f.instant("location.confirm.detach.warning",{uri:t}),warning:!0}).result.then((function(){e.loader=!0,s.deleteLocation(t).finally((function(){return h()}))}))},e.addLocationHttp=function(t){e.loader=!0,u.addLocation(t).success((function(){s.init()})).error((function(e){var t=getError(e);a.error(t,f.instant("common.error"))})).finally((function(){return h()}))},e.addLocation=function(){e.openRemoteLocationDialog()},e.editLocation=function(t){void 0===t.locationType&&(t.locationType=i.RemoteLocationType.GRAPH_DB),e.openRemoteLocationDialog(t)},e.openRemoteLocationDialog=function(t){o.open({templateUrl:"js/angular/repositories/templates/manage-remote-location-dialog.template.html",windowClass:"addLocationDialog",controller:"ManageRemoteLocationDialogController",resolve:{data:function(){return{remoteLocation:t}}}}).result.then((function(o){t?e.editLocationHttp(o):e.addLocationHttp(o)}))},e.editLocationHttp=function(t){e.loader=!0,u.editLocation(t).success((function(){s.init()})).error((function(e){var t=getError(e);a.error(t,f.instant("common.error"))})).finally((function(){return h()}))},e.setRepository=function(e){s.setRepository(e)},e.deleteRepository=function(t){c.openSimpleModal({title:f.instant("common.confirm.delete"),message:Object(n.decodeHTML)(f.instant("delete.repo.warning.msg",{repositoryId:t.id})),warning:!0}).result.then((function(){var o,r,n;e.loader=!0,s.deleteRepository(t).finally((function(){h(),e.loader=!1})),r="dependencies-selectedGraph-".concat((o=t).id),n="classHierarchy-selectedGraph-".concat(o.id),angular.forEach(p.keys(),(function(e){(e.startsWith(n)||e.startsWith(r))&&p.remove(e)}))}))},e.restartRepository=function(t){c.openSimpleModal({title:f.instant("confirm.restart.repo"),message:Object(n.decodeHTML)(f.instant("confirm.restart.repo.warning.msg",{repositoryId:t.id})),warning:!0}).result.then((function(){e.loader=!0,s.restartRepository(t).finally((function(){return h()}))}))},e.toggleDefaultRepository=function(t){e.getDefaultRepository()===t?s.setDefaultRepository(null):s.setDefaultRepository(t)},e.getDefaultRepository=function(){return s.getDefaultRepository()},e.getRepositoryDownloadLink=function(e){var t="rest/repositories/".concat(e.id).concat(e.type===r.REPOSITORY_TYPES.ontop?"/download-zip":"/download-ttl","?location=").concat(e.location),o=l.getAuthToken();return o&&(t="".concat(t,"&authToken=").concat(encodeURIComponent(o))),t},e.copyToClipboard=function(e){c.openCopyToClipboardModal(e)},e.fromFile=function(){o.open({templateUrl:"js/angular/templates/modal/upload-repository-config.html",controller:"UploadRepositoryConfigCtrl"}).result.then((function(){s.init()}))},e.openActiveLocationSettings=function(){o.open({templateUrl:"js/angular/settings/modal/location-settings.html",controller:"ActiveLocationSettingsCtrl"})},h(),g.getNodeStatus().then((function(){e.isInCluster=!0})).catch((function(t){404===t.status?e.isInCluster=!1:console.error("An unexpected error occurred:",t)}));var R=d((function(){y.isActive()&&!t.guidePaused||(s.initQuick(),h())}),5e3);e.$on("$destroy",(function(){d.cancel(R),v&&v.resolve()})),e.getRepositoriesFromLocation=function(e){return s.getRepositoriesFromLocation(e)}}function m(e,t,o,r,n){e.upload=function(t){t&&t.length&&(e.uploadFile=t[0])},e.ok=function(){e.uploadFile&&(e.uploadFileLoader=!0,o.upload({url:"rest/repositories",method:"POST",data:{config:e.uploadFile}}).success((function(){e.uploadFileLoader=!1,t.close()})).error((function(t){var o=getError(t);r.error(o,n.instant("common.error")),e.uploadFileLoader=!1})))},e.cancel=function(){t.dismiss("cancel")}}function y(e,t,o,r,n){e.newLocation={uri:"",authType:"none",username:"",password:"",active:!1},e.docBase=p(r),e.isValidLocation=function(){return(e.newLocation.uri.length<6||0===e.newLocation.uri.indexOf("http:")||0===e.newLocation.uri.indexOf("https:"))&&e.newLocation.uri.indexOf("/repositories")<=-1},e.ok=function(){e.newLocation?t.close(e.newLocation):o.error(n.instant("location.cannot.be.empty.error"))},e.cancel=function(){t.dismiss("cancel")}}function g(e,t,o,r){e.editedLocation=_.cloneDeep(o),e.docBase=p(r),e.ok=function(){t.close(e.editedLocation)},e.cancel=function(){t.dismiss("cancel")}}function v(e,t){e.repositoryTypes=r.REPOSITORY_TYPES,e.chooseRepositoryType=function(e){t.path("".concat(t.path(),"/").concat(e))}}function h(e,t,o,n,i,a,l,p,f,m){function y(e){switch(e){case r.REPOSITORY_TYPES.graphdbRepo:t.pageTitle=m.instant("view.create.repo.title",{repoType:"GraphDB"});break;case r.REPOSITORY_TYPES.ontop:t.pageTitle=m.instant("view.create.repo.title",{repoType:"Ontop Virtual SPARQL"});break;case r.REPOSITORY_TYPES.fedx:t.pageTitle=m.instant("view.create.repo.title",{repoType:"FedX Virtual SPARQL"})}}var g;t.rulesets=r.STATIC_RULESETS.slice(),t.repositoryTypes=r.REPOSITORY_TYPES,t.params=p,t.repositoryType=p.repositoryType,t.enable=!0,t.entityIndexSizeMin=1e4,t.loader=!0,t.pageTitle=m.instant("view.create.repo.title"),t.repositoryInfo={id:"",params:{},title:"",type:"",location:""},d(n).then((function(e){t.locations=e})),t.changedLocation=function(){t.$broadcast("changedLocation")},t.getConfig=function(e){f.getRepositoryConfiguration(e).then((function(e){var o,r=e.data;t.repositoryInfo.params=r.params,t.repositoryInfo.type=r.type,s(t.repositoryInfo.params),(o=t.repositoryInfo.params)&&o.member&&(o.member.value=[]),t.loader=!1,a((function(){angular.element(document).find("#id").focus()}),50)})).catch((function(e){var r=getError(e);o.error(r,m.instant("common.error")),t.loader=!1}))},t.repositoryType&&(function(e){return t.isEnterprise()&&e===r.REPOSITORY_TYPES.graphdbRepo}(g=t.repositoryType)||function(e){return!t.isFreeEdition()&&!t.isEnterprise()&&e===r.REPOSITORY_TYPES.graphdbRepo}(g)||function(e){return t.isFreeEdition()&&e===r.REPOSITORY_TYPES.graphdbRepo}(g)||function(e){return e===r.REPOSITORY_TYPES.ontop}(g)||function(e){return e===r.REPOSITORY_TYPES.fedx}(g))?(t.repositoryInfo.type=t.repositoryType,t.getConfig(t.repositoryType),y(t.repositoryType)):i.path("/repository/create"),t.hasActiveLocation=function(){return n.hasActiveLocation()},t.activeLocation=function(){return n.getActiveLocation()};var v=!1;t.uploadRuleset=function(e){e&&e.length&&(t.uploadFile=e[0],t.uploadFileLoader=!0,l.upload({url:"rest/repositories/ruleset/upload",data:{ruleset:t.uploadFile,location:t.repositoryInfo.location}}).progress((function(e){})).success((function(e){if(e.success){v=!1;var r=t.uploadFile.name,n={id:e.fileLocation,name:"Custom: "+r};t.rulesetPie?t.rulesets[0]=n:t.rulesets.unshift(n),t.rulesetPie=e.fileLocation,t.rulesetPieFile=r,t.repositoryInfo.params.ruleset.value=t.rulesetPie}else o.error(e.errorMessage),v=!0,t.uploadFile="";t.uploadFileLoader=!1})).error((function(e){var r=getError(e);o.error(r,m.instant("common.error")),t.uploadFile="",t.uploadFileLoader=!1,v=!0})))},t.noMembersError=function(){o.error(m.instant("fedx.create.repo.no.members.warning"))},t.goBackToPreviousLocation=function(){angular.isDefined(p.previous)?(delete i.$$search.previous,i.path("/")):i.path("/repository")},t.createRepoHttp=function(){t.loader=!0,f.createRepository(t.repositoryInfo).then((function(){return o.success(m.instant("created.repo.success.msg",{repoId:t.repositoryInfo.id})),n.init()})).then((function(){return t.goBackToPreviousLocation()})).catch((function(e){var t=getError(e.data);o.error(t,m.instant("common.error"))})).finally((function(){t.loader=!1}))},t.createRepo=function(){var e;if(t.repositoryInfo.id){t.isInvalidRepoName=!r.FILENAME_PATTERN.test(t.repositoryInfo.id),t.isInvalidEntityIndexSizeMin=(null===(e=t.repositoryInfo.params.entityIndexSize)||void 0===e?void 0:e.value)<1e4;var n=u(t.repositoryInfo.params,m);v?o.error(m.instant("invalid.ruleset.file.error")):t.isInvalidRepoName?o.error(m.instant("wrong.repo.name.error")):"fedx"===t.repositoryType&&0===t.repositoryInfo.params.member.value.length?t.noMembersError():n?o.error(n):t.isInvalidEntityIndexSizeMin?o.error(m.instant("repo.error.entityIndex.min")):t.createRepoHttp()}else o.error(m.instant("empty.repoid.warning"))},t.rulesetWarning=function(){var e=t.repositoryInfo.params;return void 0===e||void 0===e.ruleset||void 0===e.disableSameAs?"":0===e.ruleset.value.indexOf("owl")&&"true"===e.disableSameAs.value?m.instant("repoTooltips.rulesetWarnings.needsSameAs"):0===e.ruleset.value.indexOf("rdfs")&&"false"===e.disableSameAs.value?m.instant("repoTooltips.rulesetWarnings.doesntNeedSameAs"):e.ruleset.value===t.rulesetPie?m.instant("repoTooltips.rulesetWarnings.customRuleset"):""},t.getShaclOptionsClass=function(){return c()},t.autofocusId="autofocus";var h=e.$on("$translateChangeSuccess",(function(){y(t.repositoryType)}));t.$on("$destroy",(function(){h()}))}function R(e,t,o,r,n,i,a){e.dialogTitle=a||i.instant("update.file.content.header"),r&&o.getRepositoryFileContent(r).success((function(t){e.fileContent=t})).error((function(e){var t=getError(e);n.error(t,i.instant("common.error"))})),e.ok=function(){t.close({content:e.fileContent,fileLocation:r})},e.cancel=function(){t.dismiss("cancel")}}function L(e,t,o,i,l,p,f,m,y,g){t.rulesets=r.STATIC_RULESETS.slice(),t.repositoryTypes=r.REPOSITORY_TYPES,t.entityIndexSizeMin=1e4,t.editRepoPage=!0,t.canEditRepoId=!1,t.isRepoInCluster=!0,t.params=o,t.loader=!0,t.repositoryInfo={},t.repositoryInfo.id=t.params.repositoryId,t.repositoryInfo.location=t.params.location,t.repositoryInfo.restartRequested=!1,t.repositoryType="",t.saveRepoId=t.params.repositoryId,t.pageTitle=y.instant("view.edit.repo.title",{repositoryId:t.params.repositoryId}),t.hasActiveLocation=function(){return l.hasActiveLocation()};t.$watch(t.hasActiveLocation,(function(){var e;t.hasActiveLocation&&d(l).then((function(e){return t.locations=e,m.getRepository(t.repositoryInfo)})).then((function(o){return e=o,g.monitorActiveOperations(t.repositoryInfo.id)})).then((function(e){t.isRepoInCluster=e.hasClusterOperation()})).catch((function(o){return e?Promise.resolve():(t.repositoryInfo=void 0,Promise.reject(o))})).then((function(){!function(e){var o=e.data;if(angular.isDefined(o.params.ruleset)){var r=!1;if(angular.forEach(t.rulesets,(function(e){e.id===o.params.ruleset.value&&(r=!0)})),o.params.ruleset&&!r){var n=a(o.params.ruleset.value);t.rulesets.unshift({id:o.params.ruleset.value,name:"Custom: "+n})}}t.repositoryInfo=o,t.setRepositoryType(o.type),s(t.repositoryInfo.params),t.repositoryInfo.saveId=t.saveRepoId,t.loader=!1}(e)})).catch((function(e){var r,a=e.data,s=e.status,c=o.repositoryId;r=404===s&&"system"!==c?Object(n.decodeHTML)(y.instant("edit.repo.error.not.exists",{repositoryId:c})):404===s&&"system"===c?Object(n.decodeHTML)(y.instant("edit.system.repo.warning")):getError(a),i.error(r,y.instant("common.error"),{allowHtml:!0}),404===s?setTimeout((function(){t.loader=!1,p.path("repository")}),1e3):t.loader=!1}))})),t.setRepositoryType=function(e){t.repositoryType=e},t.noMembersError=function(){i.error(y.instant("fedx.create.repo.no.members.warning"))},t.editRepoHttp=function(){t.loader=!0,m.editRepository(t.repositoryInfo.saveId,t.repositoryInfo).success((function(){i.success(y.instant("edit.repo.success.msg",{saveId:t.repositoryInfo.saveId})),l.init().finally((function(){return t.goBackToPreviousLocation()})),t.repositoryInfo.saveId===t.repositoryInfo.id&&t.repositoryInfo.restartRequested&&l.restartRepository(t.repositoryInfo)})).error((function(e){var o=getError(e);i.error(o,y.instant("common.error")),t.loader=!1}))},t.editRepository=function(){var e;t.isInvalidRepoName=!r.FILENAME_PATTERN.test(t.repositoryInfo.id),t.isInvalidEntityIndexSizeMin=(null===(e=t.repositoryInfo.params.entityIndexSize)||void 0===e?void 0:e.value)<1e4;var o=u(t.repositoryInfo.params,y),a=Object(n.decodeHTML)(y.instant("edit.repo.save.changes.msg",{repoId:t.repositoryInfo.id}));t.repositoryInfo.saveId!==t.repositoryInfo.id?a+=Object(n.decodeHTML)(y.instant("edit.repo.rename.changes.msg")):t.repositoryInfo.restartRequested?a+=Object(n.decodeHTML)(y.instant("edit.repo.restart.requested.msg")):a+=Object(n.decodeHTML)(y.instant("edit.repo.restart.needed.msg")),t.isInvalidRepoName?i.error(y.instant("wrong.repo.name.error")):"fedx"===t.repositoryType&&0===t.repositoryInfo.params.member.value.length?t.noMembersError():o?i.error(o):t.isInvalidEntityIndexSizeMin?i.error(y.instant("repo.error.entityIndex.min")):f.openSimpleModal({title:y.instant("common.confirm.save"),message:a,warning:!0}).result.then((function(){t.editRepoHttp()}))},t.editRepositoryId=function(){var e=Object(n.decodeHTML)(y.instant("edit.repo.id.warning.msg"));f.openSimpleModal({title:y.instant("confirm.enable.edit"),message:e,warning:!0}).result.then((function(){t.canEditRepoId=!0}))},t.goBackToPreviousLocation=function(){angular.isDefined(o.previous)?(delete p.$$search.previous,p.path("/")):p.path("/repository")},t.getShaclOptionsClass=function(){return c()};var v=e.$on("$translateChangeSuccess",(function(){t.pageTitle=y.instant("view.edit.repo.title",{repositoryId:t.params.repositoryId})}));t.$on("$destroy",(function(){v()}))}angular.module("graphdb.framework.repositories.controllers",["ngCookies","ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter","toastr","ngFileUpload","graphdb.framework.repositories.controllers.manage-remote-location-dialog","graphdb.framework.rest.cluster.service"]).controller("LocationsAndRepositoriesCtrl",f).controller("AddLocationCtrl",y).controller("EditLocationCtrl",g).controller("ChooseRepositoryCtrl",v).controller("AddRepositoryCtrl",h).controller("EditRepositoryCtrl",L).controller("EditRepositoryFileCtrl",R).controller("UploadRepositoryConfigCtrl",m),f.$inject=["$scope","$rootScope","$uibModal","toastr","$repositories","ModalService","AuthTokenService","LocationsRestService","LocalStorageAdapter","$interval","$translate","$q","GuidesService","ClusterRestService"],m.$inject=["$scope","$uibModalInstance","Upload","toastr","$translate"],y.$inject=["$scope","$uibModalInstance","toastr","productInfo","$translate"],g.$inject=["$scope","$uibModalInstance","location","productInfo"],v.$inject=["$scope","$location"],h.$inject=["$rootScope","$scope","toastr","$repositories","$location","$timeout","Upload","$routeParams","RepositoriesRestService","$translate"],R.$inject=["$scope","$uibModalInstance","RepositoriesRestService","file","toastr","$translate","dialogTitle"],L.$inject=["$rootScope","$scope","$routeParams","toastr","$repositories","$location","ModalService","RepositoriesRestService","$translate","MonitoringRestService"]},250:function(e,t,o){"use strict";o.r(t);var r=o(36);o(160);function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function a(e,t,o){return(t=function(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,t||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function s(e,t,o,n){e.RemoteLocationType=r.RemoteLocationType,e.RemoteLocationAuthType=r.RemoteLocationAuthType,e.isEdit=!!n.remoteLocation,e.remoteLocation=n.remoteLocation?new r.RemoteLocationModel(function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?i(Object(o),!0).forEach((function(t){a(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({},n.remoteLocation)):new r.RemoteLocationModel,e.docBase="https://graphdb.ontotext.com/documentation/".concat(o.productShortVersion),e.ok=function(){e.remoteLocationForm.$pristine||e.remoteLocationForm.$invalid||t.close(e.remoteLocation)},e.cancel=function(){t.dismiss("cancel")},e.onLocationTypeChanged=function(){[r.RemoteLocationType.ONTOPIC,r.RemoteLocationType.SPARQL].includes(e.remoteLocation.locationType)?e.remoteLocation.authType=r.RemoteLocationAuthType.BASIC:e.remoteLocation.authType=r.RemoteLocationAuthType.NONE}}angular.module("graphdb.framework.repositories.controllers.manage-remote-location-dialog",["graphdb.framework.core.directives.validate-url"]).controller("ManageRemoteLocationDialogController",s),s.$inject=["$scope","$uibModalInstance","productInfo","data"]}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[230],{329:function(t,e){function o(){return{link:function(t,e,o){t.$watch("file.status",(function(){"IMPORTING"!==t.file.status&&"UPLOADING"!==t.file.status||!$(e).has("object").length>0&&$(e).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.0.0-
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[230],{329:function(t,e){function o(){return{link:function(t,e,o){t.$watch("file.status",(function(){"IMPORTING"!==t.file.status&&"UPLOADING"!==t.file.status||!$(e).has("object").length>0&&$(e).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.0.0-RC4">{{\'common.loading\' | translate}}</object>')}))}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",o),o.$inject=[]}}]);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[29,20,30,35,36,47,67,68,72,80,87,93,118,147,148,149,170,173,178,179,241,258,314,315,351,360,375,376,380,381,382],{102:function(t,e,n){"use strict";n.r(e),n.d(e,"TTYGEventName",(function(){return r}));var o=n(24);function i(t){var e=void 0,n=void 0,i=void 0,a=void 0,s={},c=void 0,u=!1,l=function(){return Object(o.cloneDeep)(e)},d=function(){return Object(o.cloneDeep)(n)},g=function(t){n=Object(o.cloneDeep)(t),T(r.CHAT_LIST_UPDATED,d())},f=function(){return Object(o.cloneDeep)(i)},p=function(){return Object(o.cloneDeep)(a)},m=function(){return Object(o.cloneDeep)(s)},h=function(t){return!!s[t]},y=function(){return u},T=function(e,n){t.emitSync(e,Object(o.cloneDeep)(n))},v=function(e,n){return t.subscribeSync(e,(function(t){return n(t)}))};return{resetContext:function(){e=void 0,n=void 0,i=void 0,a=void 0,s={},c=void 0,u=!1},emit:T,subscribe:v,getChats:d,updateChats:g,addChat:function(t){n.appendChat(t),g(n)},replaceChat:function(t,e){n.replaceChat(t,e),g(n)},onChatsListChanged:function(t){return n&&angular.isFunction(t)&&t(d()),v(r.CHAT_LIST_UPDATED,(function(e){return t(e)}))},getSelectedChat:f,selectChat:function(t){i&&i.id===t.id||(i=Object(o.cloneDeep)(t),T(r.SELECT_CHAT,f()))},deselectChat:function(){i=void 0,T(r.SELECT_CHAT,f())},deleteChat:function(t){n.deleteChat(t),g(n)},onSelectedChatChanged:function(t){return angular.isFunction(t)&&t(f()),v(r.SELECT_CHAT,(function(e){return t(e)}))},updateSelectedChat:function(t){i&&i.id&&t&&i.id!==t.id||(i=Object(o.cloneDeep)(t),T(r.SELECTED_CHAT_UPDATED,f()))},onSelectedChatUpdated:function(t){return i&&angular.isFunction(t)&&t(f()),v(r.SELECTED_CHAT_UPDATED,(function(e){return t(e)}))},onLastMessageReceived:function(t){return i&&angular.isFunction(t)&&t(f()),v(r.LAST_MESSAGE_RECEIVED,(function(e){return t(e)}))},updateAgents:function(t){e=Object(o.cloneDeep)(t),T(r.AGENT_LIST_UPDATED,l())},onAgentsListChanged:function(t){return e&&angular.isFunction(t)&&t(l()),v(r.AGENT_LIST_UPDATED,(function(e){return t(e)}))},getAgents:l,getAgent:function(t){if(e)return Object(o.cloneDeep)(e.getAgent(t))},selectAgent:function(t){a=Object(o.cloneDeep)(t),T(r.AGENT_SELECTED,p())},getSelectedAgent:p,onSelectedAgentChanged:function(t){return a&&angular.isFunction(t)&&t(p()),v(r.AGENT_SELECTED,(function(e){return t(e)}))},getDefaultAgent:function(){return Object(o.cloneDeep)(c)},setDefaultAgent:function(t){c=t},setCanModifyAgent:function(t){u=Object(o.cloneDeep)(t),T(r.CAN_MODIFY_AGENT_UPDATED,y())},getCanModifyAgent:y,onCanUpdateAgentUpdated:function(t){return angular.isFunction(t)&&t(y()),v(r.CAN_MODIFY_AGENT_UPDATED,(function(e){return t(e)}))},hasExplainResponse:h,toggleExplainResponse:function(t){h(t)&&(s[t].expanded=!s[t].expanded,T(r.EXPLAIN_RESPONSE_CACHE_UPDATED,m()))},getExplainResponse:function(t){return Object(o.cloneDeep)(s[t])},addExplainResponseCache:function(t){s[t.answerId]=Object(o.cloneDeep)(t),T(r.EXPLAIN_RESPONSE_CACHE_UPDATED,m())},onExplainResponseCacheUpdated:function(t){return angular.isFunction(t)&&t(m()),v(r.EXPLAIN_RESPONSE_CACHE_UPDATED,(function(e){return t(e)}))}}}angular.module("graphdb.framework.ttyg.services.ttygcontext",[]).factory("TTYGContextService",i),i.$inject=["EventEmitterService","TTYGService"];var r={CREATE_CHAT:"createChat",CREATE_CHAT_SUCCESSFUL:"chatCreated",CREATE_CHAT_FAILURE:"chatCreationFailed",RENAME_CHAT:"renameChat",RENAME_CHAT_SUCCESSFUL:"chatRenamed",RENAME_CHAT_FAILURE:"chatRenamedFailure",SELECT_CHAT:"selectChat",SELECTED_CHAT_UPDATED:"selectChatUpdated",LAST_MESSAGE_RECEIVED:"lastMessageReceived",DELETING_CHAT:"deletingChat",DELETE_CHAT:"deleteChat",DELETE_CHAT_SUCCESSFUL:"chatDeleted",DELETE_CHAT_FAILURE:"chatDeletedFailure",CHAT_EXPORT:"chatExport",CHAT_EXPORT_SUCCESSFUL:"chatExportSuccess",CHAT_EXPORT_FAILURE:"chatExportFailure",CHAT_LIST_UPDATED:"chatListUpdated",ASK_QUESTION:"askQuestion",ASK_QUESTION_FAILURE:"askQuestionFailure",CONTINUE_CHAT_RUN:"continueChatRun",LOAD_CHATS:"loadChats",LOAD_CHAT_SUCCESSFUL:"loadChatSuccess",LOAD_CHAT_FAILURE:"loadChatFailure",AGENT_LIST_UPDATED:"agentListUpdated",OPEN_AGENT_SETTINGS:"openAgentSettings",EDIT_AGENT:"editAgent",CLONE_AGENT:"cloneAgent",DELETE_AGENT:"deleteAgent",AGENT_DELETED:"agentDeleted",DELETING_AGENT:"deletingAgent",AGENT_SELECTED:"agentSelected",GO_TO_CREATE_SIMILARITY_VIEW:"goToCreateSimilarityView",GO_TO_CONNECTORS_VIEW:"goToConnectorsView",EXPLAIN_RESPONSE:"explainResponse",EXPLAIN_RESPONSE_CACHE_UPDATED:"explainResponseCacheUpdated",GO_TO_SPARQL_EDITOR:"openQueryInSparqlEditor",CAN_MODIFY_AGENT_UPDATED:"canModifyAgentUpdated"}},106:function(t,e,n){"use strict";n.r(e),n.d(e,"SimilarityIndexType",(function(){return o}));var o={TEXT:"text",TEXT_LITERAL:"textLiteral",PREDICATION:"predication",isTextType:function(t){return o.TEXT===t},isTextLiteralType:function(t){return o.TEXT_LITERAL===t},isPredicationType:function(t){return o.PREDICATION===t}}},107:function(t,e,n){"use strict";n.r(e),n.d(e,"SimilarityIndexStatus",(function(){return o}));var o={CREATING:"CREATING",BUILDING:"BUILDING",BUILT:"BUILT",REBUILDING:"REBUILDING",OUTDATED:"OUTDATED",INTERRUPTED:"INTERRUPTED",OBSOLETE:"OBSOLETE",FAILED:"FAILED",isCreatingStatus:function(t){return o.CREATING===t},isBuildingStatus:function(t){return o.BUILDING===t},isBuiltStatus:function(t){return o.BUILT===t},isRebuildingStatus:function(t){return o.REBUILDING===t},isOutdatedStatus:function(t){return o.OUTDATED===t},isInterruptedStatus:function(t){return o.INTERRUPTED===t},isObsoleteStatus:function(t){return o.OBSOLETE===t},isFailedStatus:function(t){return o.FAILED===t}}},110:function(t,e,n){"use strict";n.r(e),n.d(e,"SimilarityIndex",(function(){return c}));var o=n(106),i=n(107);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,s(o.key),o)}}function s(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}var c=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.analyzer="",this.infer=!0,this.options="",this.sameAs=!0,this.searchQuery="",this.selectQuery="",this.stopList=void 0,this.name="",this.type=o.SimilarityIndexType.TEXT,this.status=void 0,this.analogicalQuery=void 0,this.inputIndex=void 0,this.isLiteralIndex=""},(e=[{key:"isTextType",value:function(){return o.SimilarityIndexType.isTextType(this.type)}},{key:"isTextLiteralType",value:function(){return o.SimilarityIndexType.isTextLiteralType(this.type)}},{key:"isPredicationType",value:function(){return o.SimilarityIndexType.isPredicationType(this.type)}},{key:"isCreatingStatus",value:function(){return i.SimilarityIndexStatus.isCreatingStatus(this.status)}},{key:"isBuildingStatus",value:function(){return i.SimilarityIndexStatus.isBuildingStatus(this.status)}},{key:"isBuiltStatus",value:function(){return i.SimilarityIndexStatus.isBuiltStatus(this.status)}},{key:"isRebuildingStatus",value:function(){return i.SimilarityIndexStatus.isRebuildingStatus(this.status)}},{key:"isOutdatedStatus",value:function(){return i.SimilarityIndexStatus.isOutdatedStatus(this.status)}},{key:"isInterruptedStatus",value:function(){return i.SimilarityIndexStatus.isInterruptedStatus(this.status)}},{key:"isObsoleteStatus",value:function(){return i.SimilarityIndexStatus.isObsoleteStatus(this.status)}},{key:"isFailedStatus",value:function(){return i.SimilarityIndexStatus.isFailedStatus(this.status)}}])&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}()},111:function(t,e){angular.module("graphdb.framework.rest.connectors.service",[]).factory("ConnectorsRestService",n),n.$inject=["$http"];function n(t){return{getConnectors:function(e,n){if(e)return t.get("rest/connectors",{headers:{"X-GraphDB-Repository":e,"X-GraphDB-Repository-Location":n}});return t.get("rest/connectors")},initConnector:function(e){return t.get("".concat("rest/connectors","/options?prefix=").concat(e))},hasConnector:function(e,n,o){if(n)return t.get("".concat("rest/connectors","/existing?prefix=").concat(e),{headers:{"X-GraphDB-Repository":n,"X-GraphDB-Repository-Location":o}});return t.get("".concat("rest/connectors","/existing?prefix=").concat(e))},checkConnector:function(e){return t.post("".concat("rest/connectors","/check"),e,{headers:{"Content-Type":"text/plain"}})}}}},117:function(t,e,n){"use strict";n.r(e),n.d(e,"mapIndexesResponseToSimilarityIndex",(function(){return i}));var o=n(110),i=function(t){return t.map((function(t){var e=new o.SimilarityIndex;return e.type=t.type,e.stopList=t.stopList,e.status=t.status,e.selectQuery=t.selectQuery,e.searchQuery=t.searchQuery,e.sameAs=t.sameAs,e.options=t.options,e.name=t.name,e.infer=t.infer,e.analyzer=t.analyzer,e.analogicalQuery=t.analogicalQuery,e}))}},122:function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,s(o.key),o)}}function a(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}n.r(e),n.d(e,"ConnectorTypesListModel",(function(){return c})),n.d(e,"ConnectorTypeModel",(function(){return u})),n.d(e,"ConnectorListModel",(function(){return l})),n.d(e,"ConnectorModel",(function(){return d})),n.d(e,"ConnectorSettingsModel",(function(){return g}));var c=function(){return a((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t),this._connectors=e.connectors||[]}),[{key:"getConnectorByName",value:function(t){return this._connectors.find((function(e){return e.name===t}))}},{key:"connectors",get:function(){return this._connectors},set:function(t){this._connectors=t}}])}(),u=function(){return a((function t(e){i(this,t),this._name=e.name,this._prefix=e.prefix}),[{key:"name",get:function(){return this._name},set:function(t){this._name=t}},{key:"prefix",get:function(){return this._prefix},set:function(t){this._prefix=t}}])}(),l=function(){return a((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];i(this,t),this._connectors=e.connectors}),[{key:"connectors",get:function(){return this._connectors},set:function(t){this._connectors=t}}])}(),d=function(){return a((function t(e){i(this,t),this._name=e.name,this._settings=new g(e)}),[{key:"settings",get:function(){return this._settings},set:function(t){this._settings=t}},{key:"name",get:function(){return this._name},set:function(t){this._name=t}}])}(),g=function(){return a((function t(e){i(this,t),this._settings=e.values||{}}),[{key:"settings",get:function(){return this._settings},set:function(t){this._settings=t}}])}()},123:function(t,e){angular.module("graphdb.framework.rest.similarity.service",[]).factory("SimilarityRestService",n),n.$inject=["$http","$repositories"];function n(t){return{getIndexes:function(e,n){if(e)return t.get("rest/similarity",{headers:{"X-GraphDB-Repository":e,"X-GraphDB-Repository-Location":n}});return t.get("rest/similarity")},getSearchQueries:function(){return t.get("".concat("rest/similarity","/config"))},rebuildIndex:function(t){return e("PUT",t.name,t.options,t.selectQuery,t.searchQuery,t.analogicalQuery,t.stopList,t.infer,t.sameAs,t.type)},deleteIndex:function(e){return t.delete("".concat("rest/similarity","?name=").concat(e.name))},createIndex:e,getSamples:function(){return t.get("".concat("rest/similarity","/samples"))},getQuery:function(e){return t.get("rest/similarity/query",{params:{name:e.indexName,options:e.indexOptions,stopList:e.indexStopList,selectQuery:e.query,infer:e.queryInference,sameAs:e.querySameAs,type:e.viewType,analyzer:e.indexAnalyzer}})},saveSearchQuery:function(e){return t({method:"put",url:"rest/similarity/search-query",data:e})}};function e(e,n,o,i,r,a,s,c,u,l,d){return t({method:e,url:"".concat("rest/similarity"),noCancelOnRouteChange:!0,data:{name:n,options:o,selectQuery:i,stopList:s,infer:c,sameAs:u,type:l,analyzer:d,searchQuery:r,analogicalQuery:a}})}}},125:function(t,e,n){"use strict";n.r(e);n(111);var o=n(134),i=n(25);function r(t){var e=function(e,n){return t.getConnectors(e,n).then((function(t){return Object(o.connectorTypesListMapper)(t.data)}))},n=function(e,n,i){return t.hasConnector(encodeURIComponent(e),n,i).then((function(t){return Object(o.connectorsMapper)(t.data)}))};return{getConnectorTypes:e,getConnectorsByType:n,getConnectorPrefixByName:function(t,n,o){return e(n,o).then((function(e){var n=e.getConnectorByName(t);return n?n.prefix:null}))},getConnectorsByTypeAsSelectMenuOptions:function(t,e,o){return n(t,e,o).then((function(t){return t.connectors.map((function(t){return new i.SelectMenuOptionsModel({value:t.name,label:t.name})}))}))}}}angular.module("graphdb.framework.core.services.connectors",["graphdb.framework.rest.connectors.service"]).factory("ConnectorsService",r),r.$inject=["ConnectorsRestService"]},127:function(t,e,n){"use strict";n.r(e);n(123);var o=n(117),i=n(25);function r(t){var e=function(e,n){return t.getIndexes(e,n).then((function(t){return Object(o.mapIndexesResponseToSimilarityIndex)(t.data)}))};return{getIndexes:e,getIndexesAsMenuModel:function(t,n){return e(t,n).then((function(t){return t.map((function(t){return new i.SelectMenuOptionsModel({label:t.name,value:t.name})}))}))}}}angular.module("graphdb.framework.core.services.similarity",["graphdb.framework.rest.similarity.service"]).factory("SimilarityService",r),r.$inject=["SimilarityRestService"]},131:function(t,e,n){"use strict";n.r(e),n.d(e,"markdownCodeCopyPlugin",(function(){return r}));var o={buttonStyle:"position: absolute; top: 0; right: 0;",buttonClass:""};function i(t,e){return e=_.merge({},o,e),function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var r=o[0],a=o[1],s=r[a],c=r[a].content.replaceAll('"',""").replaceAll("'","'"),u=t.apply(void 0,o);return"fence"===s.type&&u.trim()?'<div style="position: relative">\n '.concat(u,'\n <copy-to-clipboard\n style="').concat(e.buttonStyle,'"\n class="').concat(e.buttonClass,'"\n tooltip-text="ttyg.chat_panel.btn.copy_sparql.tooltip"\n text-to-copy="').concat(c,'">\n </copy-to-clipboard>\n </div>'):u}}var r=function(t,e){t.renderer.rules.code_block=i(t.renderer.rules.code_block,e),t.renderer.rules.fence=i(t.renderer.rules.fence,e)}},132:function(t,e,n){"use strict";n.r(e),n.d(e,"markdownOpenInSparqlEditorPlugin",(function(){return r}));var o={buttonStyle:"position: absolute; top: 0; right: 0;",buttonClass:""};function i(t,e){return e=_.merge({},o,e),function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var r=o[0],a=o[1],s=r[a],c=r[a].content.replaceAll('"',""").replaceAll("'","'"),u=t.apply(void 0,o);return"fence"===s.type&&"sparql"===s.info&&u.trim()?'<div style="position: relative">\n '.concat(u,'\n <open-in-sparql-editor\n style="').concat(e.buttonStyle,'"\n class="').concat(e.buttonClass,'"\n execute-query="').concat(e.executeQuery,'"\n repository-id="').concat(e.repositoryId,'"\n query="').concat(c,'">\n </open-in-sparql-editor>\n </div>'):u}}var r=function(t,e){t.renderer.rules.code_block=i(t.renderer.rules.code_block,e),t.renderer.rules.fence=i(t.renderer.rules.fence,e)}},134:function(t,e,n){"use strict";n.r(e),n.d(e,"connectorTypesListMapper",(function(){return i})),n.d(e,"connectorsMapper",(function(){return r}));var o=n(122),i=function(t){var e=new o.ConnectorTypesListModel;return t?(e.connectors=Object.keys(t).map((function(e){return new o.ConnectorTypeModel({name:e,prefix:t[e]})})),e):e},r=function(t){var e=new o.ConnectorListModel;return t?(e.connectors=t.map((function(t){return new o.ConnectorModel(t)})),e):e}},138:function(t,e,n){"use strict";n.r(e),n.d(e,"getHumanReadableTimestamp",(function(){return o}));var o=function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)return"";var i=new Date(n),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(a);s.setDate(a.getDate()-1);var c=new Date(i.getFullYear(),i.getMonth(),i.getDate()),u=o.timeFormat?e("date")(i,o.timeFormat):"";if(c.getTime()===a.getTime())return t.instant("common.dates.today")+u;if(c.getTime()===s.getTime())return t.instant("common.dates.yesterday")+u;var l=o.dateFormat||"yyyy-MM-dd";return e("date")(i,l)+u}},145:function(t,e,n){"use strict";n.r(e);var o=n(666),i=n(131),r=n(132),a={buttonStyle:"position: absolute; top: 0; right: 0; margin-right: 24px"};function s(t){var e=Object(o.a)().use(i.markdownCodeCopyPlugin).use(r.markdownOpenInSparqlEditorPlugin,a);return{renderMarkdown:function(n,s){try{return t.trustAsHtml(function(t){return t?Object(o.a)().use(i.markdownCodeCopyPlugin,t).use(r.markdownOpenInSparqlEditorPlugin,_.merge({},a,t)):e}(s).render(n))}catch(e){return console.error("Error rendering markdown:",e),t.trustAsHtml(n)}}}}angular.module("graphdb.framework.core.services.markdown-service",[]).service("MarkdownService",s),s.$inject=["$sce"]},164:function(t,e){function n(t){return{restrict:"E",scope:{fieldName:"@",source:"=",onSave:"&",onCancel:"&",onClick:"&",onDblclick:"&",isEditing:"="},templateUrl:"js/angular/core/directives/inline-editable-text/templates/inline-editable-text.template.html",link:function(e,n){e.editableModel={};var o,i=[];e.onKeydown=function(t){"Enter"===t.key?(a(),e.editableModel.text!==e.text&&e.onSave({newText:e.editableModel.text,source:e.source})):"Escape"===t.key&&r()},e.onCancelEditing=function(){r()},e.onSelect=function(){o?(a(),e.onDblclick({source:e.source})):o=t((function(){e.onClick({source:e.source}),a()}),250)};var r=function(){a(),e.onCancel()},a=function(){t.cancel(o),o=void 0};i.push(e.$watch("isEditing",(function(o){o&&(e.editableModel.text=e.source[e.fieldName],t((function(){var t=n.find("input")[0];t.focus(),t.select()}),0))})));e.$on("$destroy",(function(){i.forEach((function(t){return t()})),a()}))}}}angular.module("graphdb.framework.core.directives.inline-editable-text",[]).directive("inlineEditableText",n),n.$inject=["$timeout"]},165:function(t,e,n){"use strict";n.r(e);n(145);function o(t,e){return{template:'<div class="markdown-content" ng-bind-html="markdownContent"></div>',restrict:"E",scope:{content:"@",options:"="},link:function(n,o){n.markdownContent=void 0;var i=function(){n.$evalAsync((function(){var e=o.find(".markdown-content");t(angular.element(e).contents())(n)}))};n.markdownContent=e.renderMarkdown(n.content,n.options),i()}}}angular.module("graphdb.framework.core.directives.markdown-content",["graphdb.framework.core.services.markdown-service"]).directive("markdownContent",o),o.$inject=["$compile","MarkdownService"]},166:function(t,e,n){"use strict";n.r(e);var o=n(1);function i(t,e,n,i){return{template:'\n <style>\n .open-in-sparql-editor-btn {\n line-height: 0.75;\n }\n .open-in-sparql-editor-btn .fa:nth-child(2) {\n margin-left: -0.2em;\n margin-right: -0.2em;\n font-size: 0.9em;\n }\n </style>\n <button class="btn btn-link btn-sm open-in-sparql-editor-btn" gdb-tooltip="{{\'ttyg.chat_panel.btn.open_in_sparql_editor.tooltip\' | translate}}" ng-click="onGoToSparqlEditorView()" guide-selector="open-in-sparql-editor-btn">\n <i class="fa fa-bracket-curly"></i><i class="fa fa-ellipsis"></i><i class="fa fa-bracket-curly-right"></i>\n </button>\n ',restrict:"E",scope:{query:"@",repositoryId:"@",executeQuery:"@"},link:function(r,a){r.tooltipText="ttyg.chat_panel.btn.open_in_sparql_editor.tooltip";var s="true"===r.executeQuery;r.onGoToSparqlEditorView=function(){var i=t.getActiveRepository();i&&i===r.repositoryId?c(r.query):n.openConfirmationModal({title:e.instant("common.confirm"),message:Object(o.decodeHTML)(e.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:r.repositoryId})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},(function(){t.setRepository(t.getRepository(r.repositoryId)),c(r.query)}))};var c=function(t){i.open("/sparql?query=".concat(encodeURIComponent(t),"&execute=").concat(s),"_blank")}}}}angular.module("graphdb.framework.core.directives.open-in-sparql-editor",[]).directive("openInSparqlEditor",i),i.$inject=["$repositories","$translate","ModalService","$window"]},179:function(t,e,n){"use strict";n.r(e);n(127),n(125),n(140),n(26);function o(t,e,n,o,i){t.agentInstructionsExplain=i.agentInstructionsExplain,t.close=function(){e.dismiss({})},t.onCloseAgentInstructionsExplainModal=function(){e.dismiss({})};var r=[];t.$on("$destroy",(function(){r.forEach((function(t){return t()}))}))}angular.module("graphdb.framework.ttyg.controllers.agent-instructions-explain-modal",[]).controller("AgentInstructionsExplainModalController",o),o.$inject=["$scope","$uibModalInstance","ModalService","$translate","dialogModel"]},190:function(t,e,n){"use strict";n.r(e);n(165),n(166);var o=n(102),i=n(142),r=n(138);function a(t,e,n,a,s){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-item-detail.html",scope:{chatItemDetail:"=",showActions:"=",asking:"=",disabled:"=",onRegenerateQuestion:"&",onAskHowDeliveredAnswer:"&"},link:function(c,u,l){c.ExplainQueryType=i.ExplainQueryType,c.repositoryId=void 0,c.markdownContentOptions=void 0,c.agentNameByIdMap={},c.explainResponseModel={},c.loadingExplainResponse={},c.regenerateQuestion=function(){c.onRegenerateQuestion({chatItem:c.chatItemDetail})},c.explainResponse=function(o){n.hasExplainResponse(o)?n.toggleExplainResponse(o):(c.loadingExplainResponse[o]=!0,a.explainResponse(c.chatItemDetail,o).then((function(t){n.addExplainResponseCache(t)})).catch((function(){t.error(e.instant("ttyg.chat_panel.messages.explain_response_failure"))})).finally((function(){return c.loadingExplainResponse[o]=!1})))},c.onAskHowAnswerWasDerived=function(){c.onAskHowDeliveredAnswer()},c.onOpenInSparqlEditor=function(t){c.chatItemDetail.agentId&&n.emit(o.TTYGEventName.GO_TO_SPARQL_EDITOR,{query:t,repositoryId:c.repositoryId})},c.showRawQuery=function(t){var e=t.rawQuery.replace(/\s+/g,""),n=t.query.replace(/\s+/g,"");return e&&e!==n},c.getRepositoryId=function(t){var e=n.getAgent(c.chatItemDetail.agentId);return e?e.repositoryId:""},c.getHumanReadableQuestionTimestamp=function(t){return Object(r.getHumanReadableTimestamp)(e,s,t)};var d=function(){c.chatItemDetail.answers.forEach((function(t){c.explainResponseModel[t.id]=n.getExplainResponse(t.id)}))},g=[];g.push(n.onExplainResponseCacheUpdated((function(){d()}))),g.push(n.onAgentsListChanged((function(){c.agentNameByIdMap=n.getAgents().agentNameByIdMap}))),c.$on("$destroy",(function(){g.forEach((function(t){return t()}))})),c.repositoryId=c.getRepositoryId(),c.markdownContentOptions={repositoryId:c.repositoryId},d()}}}angular.module("graphdb.framework.ttyg.directives.chat-item-detail",["graphdb.framework.core.directives.open-in-sparql-editor","graphdb.framework.core.directives.markdown-content"]).directive("chatItemDetail",a),a.$inject=["toastr","$translate","TTYGContextService","TTYGService","$filter"]},231:function(t,e,n){"use strict";n.r(e),n.d(e,"status",(function(){return o}));var o={BAD_REQUEST:400,UNAUTHORIZED:401,FORBIDDEN:403,NOT_FOUND:404,CONFLICT:409,INTERNAL_SERVER_ERROR:500,SERVICE_UNAVAILABLE:503}},237:function(t,e,n){"use strict";n.r(e);n(164);var o=n(102),i=n(138),r=n(1);function a(t,e,n,a){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-list.html",link:function(s){s.selectedChat=void 0,s.renamedChat=void 0,s.deletingChat=void 0,s.onSelectChatForRenaming=function(t){s.renamedChat=t},s.onSelectChat=function(e){if(!s.selectedChat||s.selectedChat.id!==e.id){var n=t.getChats().getNonPersistedChat();n&&t.deleteChat(n),t.selectChat(e),s.renamedChat=void 0}},s.onDeleteChat=function(i){var a=n.instant("ttyg.dialog.delete.title"),s=Object(r.decodeHTML)(n.instant("ttyg.dialog.delete.body",{chatName:i.name}));e.openConfirmation(a,s,(function(){return t.emit(o.TTYGEventName.DELETE_CHAT,i)}))},s.onRenameChat=function(e,n){n.name=e,s.renamedChat=void 0,t.emit(o.TTYGEventName.RENAME_CHAT,n)},s.onExportChat=function(e){t.emit(o.TTYGEventName.CHAT_EXPORT,e)},s.onCancelChatRenaming=function(){s.renamedChat=void 0},s.getHumanReadableChatGroupTimestamp=function(t){return Object(i.getHumanReadableTimestamp)(n,a,t)};var c=function(t){s.selectedChat=t},u=[];u.push(t.onSelectedChatChanged(c)),u.push(t.onSelectedChatUpdated(c)),u.push(t.onChatsListChanged((function(t){s.chatList=t}))),u.push(t.subscribe(o.TTYGEventName.DELETING_CHAT,(function(t){s.deletingChat=t}))),s.$on("$destroy",(function(){u.forEach((function(t){return t()}))}))}}}angular.module("graphdb.framework.ttyg.directives.chat-list",["graphdb.framework.core.directives.inline-editable-text"]).directive("chatList",a),a.$inject=["TTYGContextService","ModalService","$translate","$filter"]},238:function(t,e,n){"use strict";n.r(e);n(190);var o=n(102),i=n(108),r=n(112),a=n(24),s=n(1),c=n(135);function u(t,e,n,u){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-panel.html",link:function(t,u,l){t.chat=void 0,t.selectedAgent=void 0,t.chatItem=void 0,t.askingChatItem=void 0,t.waitingForLastMessage=!1,t.loadingChat=!0,t.ask=function(){t.chatItem.question.timestamp=Date.now(),t.askingChatItem=Object(a.cloneDeep)(t.chatItem),t.chatItem.chatId?g(t.chatItem):d(),t.chatItem=p(),h(),m()},t.regenerateQuestion=function(e){var n=p();n.setQuestionMessage(e.getQuestionMessage()),n.question.timestamp=Date.now(),t.askingChatItem=n,g(n),h()},t.onKeypressOnInput=function(e){t.askingChatItem||"Enter"!==e.key||e.shiftKey||e.ctrlKey||t.ask()},t.onAskHowDeliveredAnswer=function(){var n=p();n.setQuestionMessage(e.instant("ttyg.chat_panel.btn.derive_answer.label")),n.question.timestamp=Date.now(),t.askingChatItem=Object(a.cloneDeep)(n),g(n),h()},t.getAgentName=function(t){var o=n.getAgent(t);return o?o.name:Object(s.decodeHTML)(e.instant("ttyg.chat_panel.deleted_agent"))};var d=function(){t.waitingForLastMessage=!0,n.emit(o.TTYGEventName.CREATE_CHAT,t.chatItem)},g=function(e){t.waitingForLastMessage=!0,n.emit(o.TTYGEventName.ASK_QUESTION,e)},f=function(){t.chatItem=Object(a.cloneDeep)(t.askingChatItem),t.askingChatItem=void 0,t.waitingForLastMessage=!1},p=function(){var e=new r.ChatItemModel;return e.question=new i.ChatMessageModel({role:i.CHAT_MESSAGE_ROLE.USER}),t.chat&&(e.chatId=t.chat.id),t.selectedAgent&&(e.agentId=t.selectedAgent.id),e},m=function(){setTimeout((function(){var t=document.querySelector(".question-input");t&&t.focus()}))},h=function(){setTimeout((function(){var t=u.find(".chat-details")[0];t&&(t.scrollTop=t.scrollHeight)}))},y=function(){t.chat=c.ChatModel.getEmptyChat(),t.loadingChat=!1,t.chatItem=p(),t.askingChatItem=void 0,t.waitingForLastMessage=!1,m()},T=[];T.push(t.$watchCollection("chat.chatHistory.items",h)),T.push(n.onSelectedChatUpdated((function(e){if(t.chat=e,e&&(e.id||!t.askingChatItem)){t.loadingChat=!1;var o=t.chatItem.question.message;if(t.chatItem=p(),t.chatItem.question.message=o,t.askingChatItem=void 0,t.chat){var i=t.chat.chatHistory.getLast();i&&i.agentId&&n.selectAgent(n.getAgent(i.agentId))}m()}}))),T.push(n.onLastMessageReceived((function(){t.waitingForLastMessage=!1}))),T.push(n.onSelectedAgentChanged((function(e){t.selectedAgent=e,t.selectedAgent&&t.chatItem&&(t.chatItem.agentId=t.selectedAgent.id),m()}))),T.push(n.onSelectedChatChanged((function(e){e?(t.loadingChat=e&&e.id,t.chatItem=p(),m()):y()}))),T.push(n.subscribe(o.TTYGEventName.LOAD_CHAT_FAILURE,(function(){t.loadingChat=!1,t.chatItem=p(),m()}))),T.push(n.subscribe(o.TTYGEventName.ASK_QUESTION_FAILURE,f)),T.push(n.subscribe(o.TTYGEventName.CREATE_CHAT_FAILURE,f)),T.push(n.subscribe(o.TTYGEventName.DELETE_CHAT_SUCCESSFUL,(function(e){t.chat&&e.id===t.chat.id&&y()}))),t.$on("$destroy",(function(){T.forEach((function(t){return t()}))})),t.chat=c.ChatModel.getEmptyChat(),t.chatItem=p(),m()}}}angular.module("graphdb.framework.ttyg.directives.chat-panel",["graphdb.framework.ttyg.directives.chat-item-detail"]).directive("chatPanel",u),u.$inject=["toastr","$translate","TTYGContextService","$timeout"]},239:function(t,e,n){"use strict";n.r(e);var o=n(1),i=n(102);function r(t,e,n){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-list.html",scope:{agentList:"=",agentListFilterModel:"="},link:function(r,a,s){r.selectedAgent=void 0,r.selectedAgentsFilter=void 0,r.deletingAgent=void 0,r.onEditAgent=function(e){t.emit(i.TTYGEventName.EDIT_AGENT,e)},r.onCloneAgent=function(e){t.emit(i.TTYGEventName.CLONE_AGENT,e)},r.onDeleteAgent=function(r){var a=n.instant("ttyg.agent.delete_agent_modal.title"),s=Object(o.decodeHTML)(n.instant("ttyg.agent.delete_agent_modal.body",{agentName:r.name}));e.openConfirmation(a,s,(function(){return t.emit(i.TTYGEventName.DELETE_AGENT,r)}))},r.onAgentsFilterChange=function(t){r.selectedAgentsFilter=t,r.selectedAgentsFilter&&r.agentList.filterByRepository(r.selectedAgentsFilter.key)};var c=function(){var t=r.agentListFilterModel.find((function(t){return t.selected}));r.selectedAgentsFilter=t||r.agentListFilterModel[0],r.onAgentsFilterChange(r.selectedAgentsFilter)},u=[];u.push(r.$watch("agentListFilterModel",c)),u.push(t.subscribe(i.TTYGEventName.DELETING_AGENT,(function(t){r.deletingAgent=t}))),u.push(t.onSelectedAgentChanged((function(t){r.selectedAgent=t}))),r.$on("$destroy",(function(){u.forEach((function(t){return t()}))})),c()}}}angular.module("graphdb.framework.ttyg.directives.agent-list",[]).directive("agentList",r),r.$inject=["TTYGContextService","ModalService","$translate"]},240:function(t,e,n){"use strict";n.r(e);var o=n(25),i=n(102);function r(t,e,n,r){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-select-menu.html",scope:{},link:function(n){n.agentOptionsList=[],n.selectedAgent=void 0,n.onAgentSelected=function(o){if(a(o),n.selectedAgent=o,t.selectAgent(o),o.isRepositoryDeleted){var s=e.instant("ttyg.agent.agent_select_menu.configure_agent_modal.title"),c=e.instant("ttyg.agent.agent_select_menu.configure_agent_modal.body");r.openConfirmation(s,c,(function(){return t.emit(i.TTYGEventName.EDIT_AGENT,o)}))}};var a=function(t){n.agentOptionsList.forEach((function(e){e.selected=e.data.agent===t}))},s=function(t){n.agentOptionsList=t.agents.map((function(t){return new o.SelectMenuOptionsModel({value:t.id,label:t.name,data:{agent:t}})}))},c=[];c.push(t.onAgentsListChanged((function(t){s(t)}))),c.push(t.subscribe(i.TTYGEventName.AGENT_DELETED,(function(e){n.selectedAgent&&n.selectedAgent.id===e.id&&(n.selectedAgent.isDeleted=!0,t.selectAgent(n.selectedAgent))}))),c.push(t.onSelectedAgentChanged((function(t){a(t),n.selectedAgent=t}))),n.$on("$destroy",(function(){c.forEach((function(t){return t()}))}))}}}angular.module("graphdb.framework.ttyg.directives.agent-select-menu",[]).directive("agentSelectMenu",r),r.$inject=["TTYGContextService","$translate","$sce","ModalService"]},241:function(t,e,n){"use strict";n.r(e);var o=n(102),i=n(17);function r(t,e){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/no-agents-view.html",scope:{},link:function(n){n.canModifyAgent=!1,n.talkToGraphDocumentationLink=i.DocumentationUrlResolver.getDocumentationUrl(e.productShortVersion,"talk-to-graph.html"),n.onCreateAgent=function(){t.emit(o.TTYGEventName.OPEN_AGENT_SETTINGS)};var r=[];r.push(t.onCanUpdateAgentUpdated((function(t){n.canModifyAgent=t}))),n.$on("$destroy",(function(){r.forEach((function(t){return t()}))}))}}}angular.module("graphdb.framework.ttyg.directives.no-agents-view",[]).directive("noAgentsView",r),r.$inject=["TTYGContextService","productInfo"]},242:function(t,e){angular.module("graphdb.framework.ttyg.directives.show-tooltip-on-overflow",[]).directive("showTooltipOnOverflow",(function(){return{link:function(t,e){setTimeout((function(){var n=e[0].querySelector(".editable-text-element");n&&(n.scrollWidth>n.clientWidth?e.attr("title",t.chat.name):e.removeAttr("title"))}),0)}}}))},243:function(t,e,n){"use strict";n.r(e);var o=n(1),i=n(141),r=(n(127),n(125),n(140),n(26),n(179),n(12)),a=n(102),s=n(128),c=n(37);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=u(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d(t,e,n,u,d,g,f,p,m,h,y,T,v,E,S,A,C){t.AGENT_OPERATION=s.AGENT_OPERATION,t.operation=T.operation,t.savingAgent=!1,t.agentFormModel=T.agentFormModel,t.activeRepositoryInfo=T.activeRepositoryInfo,t.extractionMethodLoaderFlags=l({},i.ExtractionMethod.SIMILARITY,!1),t.activeRepositoryList=T.activeRepositoryList,t.extractionMethods=i.ExtractionMethod,t.additionalExtractionMethods=i.AdditionalExtractionMethod,t.ExtractionMethodTemplates=S,t.showAdvancedSettings=!1,t.showHighTemperatureWarning=!1,t.showSystemInstructionWarning=!1,t.similarityIndexes=[],t.retrievalConnectors=[],t.ftsEnabled=!1,t.autocompleteSuggestions=[],t.toggleExtractionMethod=function(e){e.expanded=e.selected,t.agentSettingsForm.extractionMethods.$setTouched(),x(),G[e.method](e)},t.onExtractionMethodPanelToggle=function(t){t.toggleCollapse(),G[t.method](t)},t.toggleAdditionalExtractionMethod=function(e){e.expanded=e.selected,t.checkAutocompleteIndexEnabled(),k[e.method](e)},t.onAdditionalExtractionMethodPanelToggle=function(t){t.toggleCollapse(),k[t.method](t)},t.getModelHelpMessage=function(){var t=Object(o.decodeHTML)(y.instant("ttyg.agent.create_agent_modal.form.model.hint"));return p.trustAsHtml(t)},t.getFTSDisabledHelpMessage=function(){var e=Object(o.decodeHTML)(y.instant("ttyg.agent.create_agent_modal.form.fts_search.fts_disabled_message",{repositoryEditPage:"#/repository/edit/"+t.agentFormModel.repositoryId}));return p.trustAsHtml(e)},t.getAutocompleteDisabledHelpMessage=function(){var t=Object(o.decodeHTML)(y.instant("ttyg.agent.create_agent_modal.form.additional_query_methods.autocomplete_disabled_message",{autocompleteIndexPage:"#/autocomplete"}));return p.trustAsHtml(t)},t.goToCreateSimilarityView=function(){v.emit(a.TTYGEventName.GO_TO_CREATE_SIMILARITY_VIEW,{repositoryId:t.agentFormModel.repositoryId})},t.goToConnectorsView=function(){v.emit(a.TTYGEventName.GO_TO_CONNECTORS_VIEW,{repositoryId:t.agentFormModel.repositoryId})},t.ok=function(){var e=t.agentFormModel.toPayload();return b[t.operation](e)},t.cancel=function(){e.dismiss({})},t.close=function(){e.dismiss({})},t.updateSimilaritySearchPanel=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t.agentFormModel.assistantExtractionMethods.getSimilarityExtractionMethod();n.selected&&(e&&(n.similarityIndex=null),L(n))},t.updateRetrievalConnectorPanel=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t.agentFormModel.assistantExtractionMethods.getRetrievalExtractionMethod();n.selected&&(e&&(n.retrievalConnectorInstance=null),M(n))},t.checkIfFTSEnabled=function(){t.agentFormModel.repositoryId?t.agentFormModel.assistantExtractionMethods.getFTSSearchExtractionMethod().selected?(t.extractionMethodLoaderFlags[i.ExtractionMethod.FTS_SEARCH]=!0,f.getRepositoryModel({id:t.agentFormModel.repositoryId}).then((function(e){t.ftsEnabled=e.getParamValue(r.REPOSITORY_PARAMS.enableFtsIndex)})).catch((function(t){w(t,"ttyg.agent.messages.error_repository_config_loading")})).finally((function(){t.extractionMethodLoaderFlags[i.ExtractionMethod.FTS_SEARCH]=!1,t.agentSettingsForm.$setValidity("FTSDisabled",t.ftsEnabled)}))):t.agentSettingsForm.$setValidity("FTSDisabled",!0):t.agentSettingsForm.$setValidity("FTSDisabled",!1)},t.onRepositoryChange=function(){F(!0,!0)},t.checkAutocompleteIndexEnabled=function(){A.checkAutocompleteStatus().then((function(e){t.autocompleteEnabled=e})).catch((function(t){m.error(getError(t))}))},t.onRestoreDefaultSystemInstructions=function(){t.agentFormModel.instructions.systemInstruction=t.agentFormModel.instructions.systemInstructionCopy},t.onRestoreDefaultUserInstructions=function(){t.agentFormModel.instructions.userInstruction=t.agentFormModel.instructions.userInstructionCopy},t.onTemperatureChange=function(){t.showHighTemperatureWarning=t.agentFormModel.temperature.value>1},t.onSystemInstructionChange=function(){""===t.agentFormModel.instructions.systemInstruction||t.showSystemInstructionWarning||(t.showSystemInstructionWarning=!0,n.openModalAlert({title:y.instant("ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.title"),message:y.instant("ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.body")}).result.then((function(){}))),""===t.agentFormModel.instructions.systemInstruction&&(t.showSystemInstructionWarning=!1)},t.onExplainAgentSettings=function(){var e=t.agentFormModel.toPayload();E.explainAgentSettings(e).then((function(t){var e={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:t}}},size:"lg"};u.open(e).result.then((function(){}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))}))},t.getSuggestions=function(e){var n=e.target.value;C.getAutocompleteSuggestions(n).then(c.mapUriAsNtripleAutocompleteResponse).then((function(e){t.autocompleteSuggestions=e.map((function(t){return{text:t.value}}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))}))};var b=l(l(l({},s.AGENT_OPERATION.CREATE,(function(t){return _(t)})),s.AGENT_OPERATION.EDIT,(function(t){return I(t)})),s.AGENT_OPERATION.CLONE,(function(t){return R(t)})),_=function(n){return t.savingAgent=!0,E.createAgent(n).then((function(t){e.close(t),m.success(y.instant("ttyg.agent.messages.agent_save_successfully",{agentName:t.name}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))})).finally((function(){t.savingAgent=!1}))},I=function(n){return t.savingAgent=!0,E.editAgent(n).then((function(t){e.close(t),m.success(y.instant("ttyg.agent.messages.agent_save_successfully",{agentName:t.name}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))})).finally((function(){t.savingAgent=!1}))},R=function(n){return t.savingAgent=!0,E.createAgent(n).then((function(t){e.close(t),m.success(y.instant("ttyg.agent.messages.agent_save_successfully",{agentName:t.name}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))})).finally((function(){t.savingAgent=!1}))},w=function(t,e){console.error(t),m.error(y.instant(e))},x=function(){t.agentSettingsForm.extractionMethods.$setValidity("required",t.agentFormModel.hasExtractionMethodSelected())},O=function(){var e=t.activeRepositoryList.find((function(e){return e.value===t.agentFormModel.repositoryId}));return{repositoryId:e?e.data.repository.id:void 0,repositoryLocation:e?e.data.repository.location:void 0}},L=function(e){if(e.selected||t.agentSettingsForm.$setValidity("missingIndex",!0),e.expanded){t.extractionMethodLoaderFlags[e.method]=!0;var n=O();d.getIndexesAsMenuModel(n.repositoryId,n.repositoryLocation).then((function(n){t.similarityIndexes=n,t.agentSettingsForm.$setValidity("missingIndex",!e.selected||!(!n||!n.length)),N(t.similarityIndexes,e)})).catch((function(e){t.agentSettingsForm.$setValidity("missingIndex",!1),w(e,"ttyg.agent.messages.error_similarity_indexes_loading")})).finally((function(){t.extractionMethodLoaderFlags[e.method]=!1}))}},N=function(t,e){if(0!==t.length){var n=t.find((function(t){return t.value===e.similarityIndex}));e.similarityIndex=n?n.value:t[0].value}else e.similarityIndex=null},M=function(e){if(e.selected||t.agentSettingsForm.$setValidity("missingConnector",!0),e.expanded){t.extractionMethodLoaderFlags[e.method]=!0;var n=O();g.getConnectorPrefixByName("ChatGPT Retrieval",n.repositoryId,n.repositoryLocation).then((function(t){return g.getConnectorsByTypeAsSelectMenuOptions(t,n.repositoryId,n.repositoryLocation)})).then((function(n){t.retrievalConnectors=n,t.agentSettingsForm.$setValidity("missingConnector",!e.selected||!(!n||!n.length)),D(t.retrievalConnectors,e)})).catch((function(e){t.agentSettingsForm.$setValidity("missingConnector",!1),w(e,"ttyg.agent.messages.error_retrieval_connectors_loading")})).finally((function(){t.extractionMethodLoaderFlags[e.method]=!1}))}},D=function(t,e){if(0!==t.length){var n=t.find((function(t){return t.value===e.retrievalConnectorInstance}));e.retrievalConnectorInstance=n?n.value:t[0].value}else e.retrievalConnectorInstance=null},G=l(l(l(l({},i.ExtractionMethod.FTS_SEARCH,(function(e){t.checkIfFTSEnabled()})),i.ExtractionMethod.SPARQL,(function(t){})),i.ExtractionMethod.SIMILARITY,(function(t){return L(t)})),i.ExtractionMethod.RETRIEVAL,(function(t){return M(t)})),k=l(l({},i.AdditionalExtractionMethod.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH,(function(t){return $(t)})),i.AdditionalExtractionMethod.IRI_DISCOVERY_SEARCH,(function(){})),$=function(){t.checkAutocompleteIndexEnabled()},F=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.checkIfFTSEnabled(),t.updateSimilaritySearchPanel(e),t.updateRetrievalConnectorPanel(n),t.checkAutocompleteIndexEnabled()},U=function(){document.hidden||F()};document.addEventListener("visibilitychange",U),t.$on("$destroy",(function(){document.removeEventListener("visibilitychange",U)}));setTimeout(x,0)}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","ngTagsInput"]).constant("ExtractionMethodTemplates",{iri_discovery_search:"iri-discovery-search",autocomplete_iri_discovery_search:"autocomplete-iri-discovery-search"}).controller("AgentSettingsModalController",d),d.$inject=["$scope","$uibModalInstance","ModalService","$uibModal","SimilarityService","ConnectorsService","RepositoriesRestService","$sce","toastr","UriUtils","$translate","dialogModel","TTYGContextService","TTYGService","ExtractionMethodTemplates","AutocompleteService","AutocompleteRestService"]},244:function(t,e){function n(t,e){var n={agent:{id:void 0},chat:{id:void 0}},o=function(){var o=t.get(e.TTYG);return o||(o=n),o.agent||(o.agent={}),o.chat||(o.chat={}),o};return{saveAgent:function(n){var i=o();i.agent.id=n?n.id:void 0,t.set(e.TTYG,i)},getAgentId:function(){var t=o();if(t.agent)return t.agent.id},saveChat:function(n){var i=o();i.chat.id=n?n.id:void 0,t.set(e.TTYG,i)},getChatId:function(){var t=o();if(t.chat)return t.chat.id}}}angular.module("graphdb.framework.ttyg.services.ttygstorage",[]).factory("TTYGStorageService",n),n.$inject=["LocalStorageAdapter","LSKeys"]},245:function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,a(o.key),o)}}function r(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}n.r(e),n.d(e,"AgentSettingsModal",(function(){return s}));var s=r((function t(e,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.activeRepositoryInfo=e,this.activeRepositoryList=n,this.agentFormModel=o,this.operation=i}))},369:function(t,e,n){"use strict";n.r(e);n(237),n(238),n(239),n(240),n(241),n(242),n(243),n(140);var o=n(102),i=(n(244),n(128)),r=n(141),a=n(135),s=n(214),c=n(25),u=n(38),l=n(636),d=n(245),g=n(1),f=n(231),p=n(148);function m(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function y(t,e,n,h,y,T,v,E,S,A,C,b,_,I,R){var w=[],x={filter_all:v.instant("ttyg.agent.btn.filter.all")};h.helpTemplateUrl="js/angular/ttyg/templates/chatInfo.html",h.isHelpVisible=!1,h.showChats=!0,h.showAgents=!1,h.chats=void 0,h.loadingChats=!1,h.loadingChat=!1,h.initialized=!1,h.agents=void 0,h.selectedAgent=void 0,h.loadingAgents=!1,h.reloadingAgents=!1,h.connectorID=void 0,h.canModifyAgent=!1,h.agentListFilterModel=[],h.activeRepositoryList=[],h.onopen=h.onclose=function(){return angular.noop()},h.startNewChat=function(){I.deselectChat()},h.toggleChatsListSidebar=function(){h.showChats=!h.showChats},h.toggleAgentsListSidebar=function(){h.showAgents=!h.showAgents},h.onToggleHelp=function(){h.isHelpVisible=!h.isHelpVisible},h.onExportSelectedChat=function(){$(I.getSelectedChat())};var O=function(){var t=I.getDefaultAgent();return t?Promise.resolve(t):_.getDefaultAgent().then((function(t){return I.setDefaultAgent(t),t}))};h.onOpenNewAgentSettings=function(){O().then((function(t){var e=Object(u.repositoryInfoMapper)(S.getActiveRepositoryObject());t.repositoryId=e.id;var n=Object(s.agentFormModelMapper)(new r.AgentModel({}),t,i.AGENT_OPERATION.CREATE);return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new d.AgentSettingsModal(e,h.activeRepositoryList,n,i.AGENT_OPERATION.CREATE)}},size:"lg"}})).then((function(t){E.open(t).result.then(N)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))},h.onOpenAgentSettings=function(t){var e=t;e||(e=I.getSelectedAgent()),O().then((function(t){var n=Object(s.agentFormModelMapper)(e,t,i.AGENT_OPERATION.EDIT),o=Object(u.repositoryInfoMapper)(S.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new d.AgentSettingsModal(o,h.activeRepositoryList,n,i.AGENT_OPERATION.EDIT)}},size:"lg"}})).then((function(t){E.open(t).result.then((function(t){var e=I.getSelectedAgent();e&&t.id===e.id&&I.selectAgent(t),N()}))})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))},h.onOpenCloneAgentSettings=function(t){O().then((function(e){var n=Object(s.agentFormModelMapper)(t,e,i.AGENT_OPERATION.CLONE);n.name="clone-".concat(n.name);var o=Object(u.repositoryInfoMapper)(S.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new d.AgentSettingsModal(o,h.activeRepositoryList,n,i.AGENT_OPERATION.CLONE)}},size:"lg"}})).then((function(t){E.open(t).result.then((function(t){var e=I.getSelectedAgent();e&&t.id===e.id&&I.selectAgent(t),N()}))})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))};var L=function(){return h.loadingChats=!0,_.getConversations().then((function(t){return I.updateChats(t)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH)),k(new a.ChatsListModel)})).finally((function(){h.loadingChats=!1}))},N=function(){return h.reloadingAgents=!0,_.getAgents().then((function(t){return I.updateAgents(t)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))})).finally((function(){h.reloadingAgents=!1}))},M=function(){I.setCanModifyAgent(t.isRepoManager())},D=function(t,e,n){var i;if(t.timestamp=n.timestamp,e.answers=e.answers||[],(i=e.answers).push.apply(i,m(n.messages)),I.updateSelectedChat(t),n.continueRunId)I.emit(o.TTYGEventName.CONTINUE_CHAT_RUN,new p.ContinueChatRun(e,n.continueRunId));else{var r=I.getChats();r.updateChatTimestamp(t.id,n.timestamp),r.updateChatName(t.id,n.chatName),t.name=n.name,I.updateChats(r),I.emit(o.TTYGEventName.LAST_MESSAGE_RECEIVED,t)}},G=function(t,e,n){t.chatHistory.appendItem(e),D(t,e,n)},k=function(t){t.isEmpty()?h.showChats=!1:(h.showChats=!0,I.getSelectedChat()||R.getChatId()||I.selectChat(h.chats.getFirstChat()))},$=function(t){_.exportConversation(t.id).then((function(e){var n=e.data,i=e.filename;Object(l.saveAs)(n,i),I.emit(o.TTYGEventName.CHAT_EXPORT_SUCCESSFUL,t)})).catch((function(){I.emit(o.TTYGEventName.CHAT_EXPORT_FAILURE),A.error(v.instant("ttyg.chat.messages.export_failure"))}))},F=function(){var t=S.getActiveRepository(),e=S.getLocalReadableGraphdbRepositories().map((function(e){return new r.AgentListFilterModel(e.id,e.id,e.id===t)}));h.agentListFilterModel=[new r.AgentListFilterModel(i.AGENTS_FILTER_ALL_KEY,x.filter_all)].concat(m(e))},U=function(t){C.openModalAlert({title:v.instant("ttyg.chat.dialog.chat_is_missing.title"),message:v.instant("ttyg.chat.dialog.chat_is_missing.body")}).result.then((function(){I.deleteChat(t)}))},P=function(){e.open("/similarity/index/create","_blank")},H=function(){e.open("/connectors","_blank")},j=function(t){e.open("/sparql?query=".concat(encodeURIComponent(t),"&execute=true"),"_blank")},Y=function(){var t=R.getChatId(),e=I.getChats();t&&e.getChat(t)&&I.selectChat(I.getChats().getChat(t))};w.push(h.$watch(h.getActiveRepositoryObject,(function(t){t&&(h.activeRepositoryList=S.getLocalReadableGraphdbRepositories().map((function(t){return new c.SelectMenuOptionsModel({value:t.id,label:t.id,data:{repository:t}})})),function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return h.loadingAgents=t,_.getAgents().then((function(t){return I.updateAgents(t)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))})).finally((function(){h.loadingAgents=!1}))}().then((function(){return h.initialized=!0,F(),L()})).then(Y),M())}))),w.push(I.onSelectedChatChanged((function(t){t&&t.id?_.getConversation(t.id).then((function(e){I.updateSelectedChat(e),R.saveChat(t)})).catch((function(e){e.status===f.status.NOT_FOUND&&(U(t),I.emit(o.TTYGEventName.LOAD_CHAT_FAILURE,t))})):t&&I.updateSelectedChat(t)}))),w.push(I.onChatsListChanged((function(t){h.chats=t,k(t)}))),w.push(I.onCanUpdateAgentUpdated((function(t){h.canModifyAgent=t}))),w.push(I.subscribe(I.onAgentsListChanged((function(t){h.agents=t})))),w.push(I.subscribe(o.TTYGEventName.CREATE_CHAT,(function(t){var e=I.getChats().getNonPersistedChat();e||(e=a.ChatModel.getEmptyChat(),I.addChat(e)),I.selectChat(e),_.createConversation(t).then((function(e){I.emit(o.TTYGEventName.CREATE_CHAT_SUCCESSFUL);var n=I.getSelectedChat();if(n&&!n.id){n.id=e.chatId,t.chatId=e.chatId;var i=I.getChats().getNonPersistedChat();I.replaceChat(n,i),R.saveChat(n),G(n,t,e)}})).catch((function(t){I.emit(o.TTYGEventName.CREATE_CHAT_FAILURE),A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))}))),w.push(I.subscribe(o.TTYGEventName.RENAME_CHAT,(function(t){_.renameConversation(t).then((function(){I.emit(o.TTYGEventName.RENAME_CHAT_SUCCESSFUL),I.emit(o.TTYGEventName.LOAD_CHATS)})).catch((function(){I.emit(o.TTYGEventName.RENAME_CHAT_FAILURE),A.error(v.instant("ttyg.chat.messages.rename_failure"))}))}))),w.push(I.subscribe(o.TTYGEventName.DELETE_CHAT,(function(t){I.emit(o.TTYGEventName.DELETING_CHAT,{chatId:t.id,inProgress:!0}),_.deleteConversation(t.id).then((function(){I.emit(o.TTYGEventName.DELETE_CHAT_SUCCESSFUL,t);var e=I.getChats();e.deleteChat(t),I.updateChats(e)})).catch((function(){I.emit(o.TTYGEventName.DELETE_CHAT_FAILURE),A.error(v.instant("ttyg.chat.messages.delete_failure"))})).finally((function(){return I.emit(o.TTYGEventName.DELETING_CHAT,{chatId:t.id,inProgress:!1})}))}))),w.push(I.subscribe(o.TTYGEventName.CHAT_EXPORT,$)),w.push(I.subscribe(o.TTYGEventName.ASK_QUESTION,(function(t){_.askQuestion(t).then((function(e){var n=I.getSelectedChat();n&&n.id===t.chatId&&G(n,t,e)})).catch((function(t){I.emit(o.TTYGEventName.ASK_QUESTION_FAILURE),A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))}))),w.push(I.subscribe(o.TTYGEventName.CONTINUE_CHAT_RUN,(function(t){_.continueChatRun(t).then((function(e){var n=t.chatId,o=I.getSelectedChat();if(o&&o.id===n){var i=o.chatHistory.items,r=i[i.length-1];D(o,r,e)}})).catch((function(t){I.emit(o.TTYGEventName.ASK_QUESTION_FAILURE),A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))}))),w.push(I.subscribe(o.TTYGEventName.LOAD_CHATS,L)),w.push(I.subscribe(o.TTYGEventName.OPEN_AGENT_SETTINGS,h.onOpenNewAgentSettings)),w.push(I.subscribe(o.TTYGEventName.EDIT_AGENT,h.onOpenAgentSettings)),w.push(I.subscribe(o.TTYGEventName.CLONE_AGENT,h.onOpenCloneAgentSettings)),w.push(I.subscribe(o.TTYGEventName.DELETE_AGENT,(function(t){I.emit(o.TTYGEventName.DELETING_AGENT,{agentId:t.id,inProgress:!0}),_.deleteAgent(t.id).then((function(){return N()})).then((function(){I.emit(o.TTYGEventName.AGENT_DELETED,t),h.selectedAgent&&h.selectedAgent.id===t.id&&(h.selectedAgent=void 0)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))})).finally((function(){I.emit(o.TTYGEventName.DELETING_AGENT,{agentId:t.id,inProgress:!1})}))}))),w.push(I.subscribe(o.TTYGEventName.AGENT_SELECTED,(function(t){h.selectedAgent=t}))),w.push(I.subscribe(o.TTYGEventName.GO_TO_CREATE_SIMILARITY_VIEW,(function(t){if(t.repositoryId!==S.getActiveRepository()){var e=S.getRepository(t.repositoryId);e&&C.openConfirmationModal({title:v.instant("common.confirm"),message:Object(g.decodeHTML)(v.instant("ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_similarity.body",{repositoryId:e.id})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},(function(){S.setRepository(e),P()}))}else P()}))),w.push(I.subscribe(o.TTYGEventName.GO_TO_CONNECTORS_VIEW,(function(t){if(t.repositoryId!==S.getActiveRepository()){var e=S.getRepository(t.repositoryId);e&&C.openConfirmationModal({title:v.instant("common.confirm"),message:Object(g.decodeHTML)(v.instant("ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_connectors.body",{repositoryId:e.id})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},(function(){S.setRepository(e),H()}))}else H()}))),w.push(I.subscribe(o.TTYGEventName.GO_TO_SPARQL_EDITOR,(function(t){if(t.repositoryId!==S.getActiveRepository()){var e=S.getRepository(t.repositoryId);e&&C.openConfirmation(v.instant("common.confirm"),Object(g.decodeHTML)(v.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:t.repositoryId})),(function(){S.setRepository(e),j(t.query)}))}else j(t.query)}))),w.push(n.$on("$translateChangeSuccess",(function(){x.filter_all=v.instant("ttyg.agent.btn.filter.all"),F()}))),w.push(n.$on("securityInit",M)),h.$on("$destroy",(function(){w.forEach((function(t){return t()})),I.resetContext()}))}angular.module("graphdb.framework.ttyg.controllers.ttyg-view",["toastr","graphdb.framework.utils.localstorageadapter","graphdb.framework.core.services.ttyg-service","graphdb.framework.ttyg.services.ttygcontext","graphdb.framework.ttyg.services.ttygstorage","graphdb.framework.ttyg.directives.chat-list","graphdb.framework.ttyg.directives.chat-panel","graphdb.framework.ttyg.directives.agent-list","graphdb.framework.ttyg.directives.agent-select-menu","graphdb.framework.ttyg.directives.no-agents-view","graphdb.framework.ttyg.directives.show-tooltip-on-overflow","graphdb.framework.ttyg.controllers.agent-settings-modal"]).controller("TTYGViewCtrl",y),y.$inject=["$jwtAuth","$window","$rootScope","$scope","$http","$timeout","$translate","$uibModal","$repositories","toastr","ModalService","LocalStorageAdapter","TTYGService","TTYGContextService","TTYGStorageService"]},480:function(t,e,n){"use strict";n.r(e);n(369),n(656);angular.module("graphdb.framework.ttyg",["ngRoute","graphdb.framework.ttyg.controllers.ttyg-view"])},635:function(t,e){(function(e){t.exports=e}).call(this,{})},636:function(t,e,n){var o,i=i||function(t){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var e=t.document,n=function(){return t.URL||t.webkitURL||t},o=e.createElementNS("http://www.w3.org/1999/xhtml","a"),i=t.webkitRequestFileSystem,r=t.requestFileSystem||i||t.mozRequestFileSystem,a=function(e){(t.setImmediate||t.setTimeout)((function(){throw e}),0)},s=0,c=function(e){var o=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};t.chrome?o():setTimeout(o,500)},u=function(t,e,n){for(var o=(e=[].concat(e)).length;o--;){var i=t["on"+e[o]];if("function"==typeof i)try{i.call(t,n||t)}catch(t){a(t)}}},l=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t},d=function(e,a){e=l(e);var d,g,f,p=this,m=e.type,h=!1,y=function(){u(p,"writestart progress write writeend".split(" "))},T=function(){(!h&&d||(d=n().createObjectURL(e)),g)?g.location.href=d:null==t.open(d,"_blank")&&"undefined"!=typeof safari&&(t.location.href=d);p.readyState=p.DONE,y(),c(d)},v=function(t){return function(){if(p.readyState!==p.DONE)return t.apply(this,arguments)}},E={create:!0,exclusive:!1};if(p.readyState=p.INIT,a||(a="download"),o)return d=n().createObjectURL(e),o.href=d,o.download=a,void setTimeout((function(){var t,e;t=o,e=new MouseEvent("click"),t.dispatchEvent(e),y(),c(d),p.readyState=p.DONE}));t.chrome&&m&&"application/octet-stream"!==m&&(f=e.slice||e.webkitSlice,e=f.call(e,0,e.size,"application/octet-stream"),h=!0),i&&"download"!==a&&(a+=".download"),("application/octet-stream"===m||i)&&(g=t),r?(s+=e.size,r(t.TEMPORARY,s,v((function(t){t.root.getDirectory("saved",E,v((function(t){var n=function(){t.getFile(a,E,v((function(t){t.createWriter(v((function(n){n.onwriteend=function(e){g.location.href=t.toURL(),p.readyState=p.DONE,u(p,"writeend",e),c(t)},n.onerror=function(){var t=n.error;t.code!==t.ABORT_ERR&&T()},"writestart progress write abort".split(" ").forEach((function(t){n["on"+t]=p["on"+t]})),n.write(e),p.abort=function(){n.abort(),p.readyState=p.DONE},p.readyState=p.WRITING})),T)})),T)};t.getFile(a,{create:!1},v((function(t){t.remove(),n()})),v((function(t){t.code===t.NOT_FOUND_ERR?n():T()})))})),T)})),T)):T()},g=d.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e){return navigator.msSaveOrOpenBlob(l(t),e)}:(g.abort=function(){this.readyState=this.DONE,u(this,"abort")},g.readyState=g.INIT=0,g.WRITING=1,g.DONE=2,g.error=g.onwritestart=g.onprogress=g.onwrite=g.onabort=g.onerror=g.onwriteend=null,function(t,e){return new d(t,e)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[29,20,30,35,36,47,67,68,72,80,87,93,118,147,148,149,170,173,178,179,241,258,314,315,351,360,375,376,380,381,382],{102:function(t,e,n){"use strict";n.r(e),n.d(e,"TTYGEventName",(function(){return r}));var o=n(24);function i(t){var e=void 0,n=void 0,i=void 0,a=void 0,s={},c=void 0,u=!1,l=function(){return Object(o.cloneDeep)(e)},d=function(){return Object(o.cloneDeep)(n)},g=function(t){n=Object(o.cloneDeep)(t),T(r.CHAT_LIST_UPDATED,d())},f=function(){return Object(o.cloneDeep)(i)},p=function(){return Object(o.cloneDeep)(a)},m=function(){return Object(o.cloneDeep)(s)},h=function(t){return!!s[t]},y=function(){return u},T=function(e,n){t.emitSync(e,Object(o.cloneDeep)(n))},v=function(e,n){return t.subscribeSync(e,(function(t){return n(t)}))};return{resetContext:function(){e=void 0,n=void 0,i=void 0,a=void 0,s={},c=void 0,u=!1},emit:T,subscribe:v,getChats:d,updateChats:g,addChat:function(t){n.appendChat(t),g(n)},replaceChat:function(t,e){n.replaceChat(t,e),g(n)},onChatsListChanged:function(t){return n&&angular.isFunction(t)&&t(d()),v(r.CHAT_LIST_UPDATED,(function(e){return t(e)}))},getSelectedChat:f,selectChat:function(t){i&&i.id===t.id||(i=Object(o.cloneDeep)(t),T(r.SELECT_CHAT,f()))},deselectChat:function(){i=void 0,T(r.SELECT_CHAT,f())},deleteChat:function(t){n.deleteChat(t),g(n)},onSelectedChatChanged:function(t){return angular.isFunction(t)&&t(f()),v(r.SELECT_CHAT,(function(e){return t(e)}))},updateSelectedChat:function(t){i&&i.id&&t&&i.id!==t.id||(i=Object(o.cloneDeep)(t),T(r.SELECTED_CHAT_UPDATED,f()))},onSelectedChatUpdated:function(t){return i&&angular.isFunction(t)&&t(f()),v(r.SELECTED_CHAT_UPDATED,(function(e){return t(e)}))},onLastMessageReceived:function(t){return i&&angular.isFunction(t)&&t(f()),v(r.LAST_MESSAGE_RECEIVED,(function(e){return t(e)}))},updateAgents:function(t){e=Object(o.cloneDeep)(t),T(r.AGENT_LIST_UPDATED,l())},onAgentsListChanged:function(t){return e&&angular.isFunction(t)&&t(l()),v(r.AGENT_LIST_UPDATED,(function(e){return t(e)}))},getAgents:l,getAgent:function(t){if(e)return Object(o.cloneDeep)(e.getAgent(t))},selectAgent:function(t){a=Object(o.cloneDeep)(t),T(r.AGENT_SELECTED,p())},getSelectedAgent:p,onSelectedAgentChanged:function(t){return a&&angular.isFunction(t)&&t(p()),v(r.AGENT_SELECTED,(function(e){return t(e)}))},getDefaultAgent:function(){return Object(o.cloneDeep)(c)},setDefaultAgent:function(t){c=t},setCanModifyAgent:function(t){u=Object(o.cloneDeep)(t),T(r.CAN_MODIFY_AGENT_UPDATED,y())},getCanModifyAgent:y,onCanUpdateAgentUpdated:function(t){return angular.isFunction(t)&&t(y()),v(r.CAN_MODIFY_AGENT_UPDATED,(function(e){return t(e)}))},hasExplainResponse:h,toggleExplainResponse:function(t){h(t)&&(s[t].expanded=!s[t].expanded,T(r.EXPLAIN_RESPONSE_CACHE_UPDATED,m()))},getExplainResponse:function(t){return Object(o.cloneDeep)(s[t])},addExplainResponseCache:function(t){s[t.answerId]=Object(o.cloneDeep)(t),T(r.EXPLAIN_RESPONSE_CACHE_UPDATED,m())},onExplainResponseCacheUpdated:function(t){return angular.isFunction(t)&&t(m()),v(r.EXPLAIN_RESPONSE_CACHE_UPDATED,(function(e){return t(e)}))}}}angular.module("graphdb.framework.ttyg.services.ttygcontext",[]).factory("TTYGContextService",i),i.$inject=["EventEmitterService","TTYGService"];var r={CREATE_CHAT:"createChat",CREATE_CHAT_SUCCESSFUL:"chatCreated",CREATE_CHAT_FAILURE:"chatCreationFailed",RENAME_CHAT:"renameChat",RENAME_CHAT_SUCCESSFUL:"chatRenamed",RENAME_CHAT_FAILURE:"chatRenamedFailure",SELECT_CHAT:"selectChat",SELECTED_CHAT_UPDATED:"selectChatUpdated",LAST_MESSAGE_RECEIVED:"lastMessageReceived",DELETING_CHAT:"deletingChat",DELETE_CHAT:"deleteChat",DELETE_CHAT_SUCCESSFUL:"chatDeleted",DELETE_CHAT_FAILURE:"chatDeletedFailure",CHAT_EXPORT:"chatExport",CHAT_EXPORT_SUCCESSFUL:"chatExportSuccess",CHAT_EXPORT_FAILURE:"chatExportFailure",CHAT_LIST_UPDATED:"chatListUpdated",ASK_QUESTION:"askQuestion",ASK_QUESTION_FAILURE:"askQuestionFailure",CONTINUE_CHAT_RUN:"continueChatRun",LOAD_CHATS:"loadChats",LOAD_CHAT_SUCCESSFUL:"loadChatSuccess",LOAD_CHAT_FAILURE:"loadChatFailure",AGENT_LIST_UPDATED:"agentListUpdated",OPEN_AGENT_SETTINGS:"openAgentSettings",EDIT_AGENT:"editAgent",CLONE_AGENT:"cloneAgent",DELETE_AGENT:"deleteAgent",AGENT_DELETED:"agentDeleted",DELETING_AGENT:"deletingAgent",AGENT_SELECTED:"agentSelected",GO_TO_CREATE_SIMILARITY_VIEW:"goToCreateSimilarityView",GO_TO_CONNECTORS_VIEW:"goToConnectorsView",EXPLAIN_RESPONSE:"explainResponse",EXPLAIN_RESPONSE_CACHE_UPDATED:"explainResponseCacheUpdated",GO_TO_SPARQL_EDITOR:"openQueryInSparqlEditor",CAN_MODIFY_AGENT_UPDATED:"canModifyAgentUpdated"}},106:function(t,e,n){"use strict";n.r(e),n.d(e,"SimilarityIndexType",(function(){return o}));var o={TEXT:"text",TEXT_LITERAL:"textLiteral",PREDICATION:"predication",isTextType:function(t){return o.TEXT===t},isTextLiteralType:function(t){return o.TEXT_LITERAL===t},isPredicationType:function(t){return o.PREDICATION===t}}},107:function(t,e,n){"use strict";n.r(e),n.d(e,"SimilarityIndexStatus",(function(){return o}));var o={CREATING:"CREATING",BUILDING:"BUILDING",BUILT:"BUILT",REBUILDING:"REBUILDING",OUTDATED:"OUTDATED",INTERRUPTED:"INTERRUPTED",OBSOLETE:"OBSOLETE",FAILED:"FAILED",isCreatingStatus:function(t){return o.CREATING===t},isBuildingStatus:function(t){return o.BUILDING===t},isBuiltStatus:function(t){return o.BUILT===t},isRebuildingStatus:function(t){return o.REBUILDING===t},isOutdatedStatus:function(t){return o.OUTDATED===t},isInterruptedStatus:function(t){return o.INTERRUPTED===t},isObsoleteStatus:function(t){return o.OBSOLETE===t},isFailedStatus:function(t){return o.FAILED===t}}},110:function(t,e,n){"use strict";n.r(e),n.d(e,"SimilarityIndex",(function(){return c}));var o=n(106),i=n(107);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,s(o.key),o)}}function s(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}var c=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.analyzer="",this.infer=!0,this.options="",this.sameAs=!0,this.searchQuery="",this.selectQuery="",this.stopList=void 0,this.name="",this.type=o.SimilarityIndexType.TEXT,this.status=void 0,this.analogicalQuery=void 0,this.inputIndex=void 0,this.isLiteralIndex=""},(e=[{key:"isTextType",value:function(){return o.SimilarityIndexType.isTextType(this.type)}},{key:"isTextLiteralType",value:function(){return o.SimilarityIndexType.isTextLiteralType(this.type)}},{key:"isPredicationType",value:function(){return o.SimilarityIndexType.isPredicationType(this.type)}},{key:"isCreatingStatus",value:function(){return i.SimilarityIndexStatus.isCreatingStatus(this.status)}},{key:"isBuildingStatus",value:function(){return i.SimilarityIndexStatus.isBuildingStatus(this.status)}},{key:"isBuiltStatus",value:function(){return i.SimilarityIndexStatus.isBuiltStatus(this.status)}},{key:"isRebuildingStatus",value:function(){return i.SimilarityIndexStatus.isRebuildingStatus(this.status)}},{key:"isOutdatedStatus",value:function(){return i.SimilarityIndexStatus.isOutdatedStatus(this.status)}},{key:"isInterruptedStatus",value:function(){return i.SimilarityIndexStatus.isInterruptedStatus(this.status)}},{key:"isObsoleteStatus",value:function(){return i.SimilarityIndexStatus.isObsoleteStatus(this.status)}},{key:"isFailedStatus",value:function(){return i.SimilarityIndexStatus.isFailedStatus(this.status)}}])&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}()},111:function(t,e){angular.module("graphdb.framework.rest.connectors.service",[]).factory("ConnectorsRestService",n),n.$inject=["$http"];function n(t){return{getConnectors:function(e,n){if(e)return t.get("rest/connectors",{headers:{"X-GraphDB-Repository":e,"X-GraphDB-Repository-Location":n}});return t.get("rest/connectors")},initConnector:function(e){return t.get("".concat("rest/connectors","/options?prefix=").concat(e))},hasConnector:function(e,n,o){if(n)return t.get("".concat("rest/connectors","/existing?prefix=").concat(e),{headers:{"X-GraphDB-Repository":n,"X-GraphDB-Repository-Location":o}});return t.get("".concat("rest/connectors","/existing?prefix=").concat(e))},checkConnector:function(e){return t.post("".concat("rest/connectors","/check"),e,{headers:{"Content-Type":"text/plain"}})}}}},117:function(t,e,n){"use strict";n.r(e),n.d(e,"mapIndexesResponseToSimilarityIndex",(function(){return i}));var o=n(110),i=function(t){return t.map((function(t){var e=new o.SimilarityIndex;return e.type=t.type,e.stopList=t.stopList,e.status=t.status,e.selectQuery=t.selectQuery,e.searchQuery=t.searchQuery,e.sameAs=t.sameAs,e.options=t.options,e.name=t.name,e.infer=t.infer,e.analyzer=t.analyzer,e.analogicalQuery=t.analogicalQuery,e}))}},122:function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,s(o.key),o)}}function a(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}n.r(e),n.d(e,"ConnectorTypesListModel",(function(){return c})),n.d(e,"ConnectorTypeModel",(function(){return u})),n.d(e,"ConnectorListModel",(function(){return l})),n.d(e,"ConnectorModel",(function(){return d})),n.d(e,"ConnectorSettingsModel",(function(){return g}));var c=function(){return a((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t),this._connectors=e.connectors||[]}),[{key:"getConnectorByName",value:function(t){return this._connectors.find((function(e){return e.name===t}))}},{key:"connectors",get:function(){return this._connectors},set:function(t){this._connectors=t}}])}(),u=function(){return a((function t(e){i(this,t),this._name=e.name,this._prefix=e.prefix}),[{key:"name",get:function(){return this._name},set:function(t){this._name=t}},{key:"prefix",get:function(){return this._prefix},set:function(t){this._prefix=t}}])}(),l=function(){return a((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];i(this,t),this._connectors=e.connectors}),[{key:"connectors",get:function(){return this._connectors},set:function(t){this._connectors=t}}])}(),d=function(){return a((function t(e){i(this,t),this._name=e.name,this._settings=new g(e)}),[{key:"settings",get:function(){return this._settings},set:function(t){this._settings=t}},{key:"name",get:function(){return this._name},set:function(t){this._name=t}}])}(),g=function(){return a((function t(e){i(this,t),this._settings=e.values||{}}),[{key:"settings",get:function(){return this._settings},set:function(t){this._settings=t}}])}()},123:function(t,e){angular.module("graphdb.framework.rest.similarity.service",[]).factory("SimilarityRestService",n),n.$inject=["$http","$repositories"];function n(t){return{getIndexes:function(e,n){if(e)return t.get("rest/similarity",{headers:{"X-GraphDB-Repository":e,"X-GraphDB-Repository-Location":n}});return t.get("rest/similarity")},getSearchQueries:function(){return t.get("".concat("rest/similarity","/config"))},rebuildIndex:function(t){return e("PUT",t.name,t.options,t.selectQuery,t.searchQuery,t.analogicalQuery,t.stopList,t.infer,t.sameAs,t.type)},deleteIndex:function(e){return t.delete("".concat("rest/similarity","?name=").concat(e.name))},createIndex:e,getSamples:function(){return t.get("".concat("rest/similarity","/samples"))},getQuery:function(e){return t.get("rest/similarity/query",{params:{name:e.indexName,options:e.indexOptions,stopList:e.indexStopList,selectQuery:e.query,infer:e.queryInference,sameAs:e.querySameAs,type:e.viewType,analyzer:e.indexAnalyzer}})},saveSearchQuery:function(e){return t({method:"put",url:"rest/similarity/search-query",data:e})}};function e(e,n,o,i,r,a,s,c,u,l,d){return t({method:e,url:"".concat("rest/similarity"),noCancelOnRouteChange:!0,data:{name:n,options:o,selectQuery:i,stopList:s,infer:c,sameAs:u,type:l,analyzer:d,searchQuery:r,analogicalQuery:a}})}}},125:function(t,e,n){"use strict";n.r(e);n(111);var o=n(134),i=n(25);function r(t){var e=function(e,n){return t.getConnectors(e,n).then((function(t){return Object(o.connectorTypesListMapper)(t.data)}))},n=function(e,n,i){return t.hasConnector(encodeURIComponent(e),n,i).then((function(t){return Object(o.connectorsMapper)(t.data)}))};return{getConnectorTypes:e,getConnectorsByType:n,getConnectorPrefixByName:function(t,n,o){return e(n,o).then((function(e){var n=e.getConnectorByName(t);return n?n.prefix:null}))},getConnectorsByTypeAsSelectMenuOptions:function(t,e,o){return n(t,e,o).then((function(t){return t.connectors.map((function(t){return new i.SelectMenuOptionsModel({value:t.name,label:t.name})}))}))}}}angular.module("graphdb.framework.core.services.connectors",["graphdb.framework.rest.connectors.service"]).factory("ConnectorsService",r),r.$inject=["ConnectorsRestService"]},127:function(t,e,n){"use strict";n.r(e);n(123);var o=n(117),i=n(25);function r(t){var e=function(e,n){return t.getIndexes(e,n).then((function(t){return Object(o.mapIndexesResponseToSimilarityIndex)(t.data)}))};return{getIndexes:e,getIndexesAsMenuModel:function(t,n){return e(t,n).then((function(t){return t.map((function(t){return new i.SelectMenuOptionsModel({label:t.name,value:t.name})}))}))}}}angular.module("graphdb.framework.core.services.similarity",["graphdb.framework.rest.similarity.service"]).factory("SimilarityService",r),r.$inject=["SimilarityRestService"]},131:function(t,e,n){"use strict";n.r(e),n.d(e,"markdownCodeCopyPlugin",(function(){return r}));var o={buttonStyle:"position: absolute; top: 0; right: 0;",buttonClass:""};function i(t,e){return e=_.merge({},o,e),function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var r=o[0],a=o[1],s=r[a],c=r[a].content.replaceAll('"',""").replaceAll("'","'"),u=t.apply(void 0,o);return"fence"===s.type&&u.trim()?'<div style="position: relative">\n '.concat(u,'\n <copy-to-clipboard\n style="').concat(e.buttonStyle,'"\n class="').concat(e.buttonClass,'"\n tooltip-text="ttyg.chat_panel.btn.copy_sparql.tooltip"\n text-to-copy="').concat(c,'">\n </copy-to-clipboard>\n </div>'):u}}var r=function(t,e){t.renderer.rules.code_block=i(t.renderer.rules.code_block,e),t.renderer.rules.fence=i(t.renderer.rules.fence,e)}},132:function(t,e,n){"use strict";n.r(e),n.d(e,"markdownOpenInSparqlEditorPlugin",(function(){return r}));var o={buttonStyle:"position: absolute; top: 0; right: 0;",buttonClass:""};function i(t,e){return e=_.merge({},o,e),function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var r=o[0],a=o[1],s=r[a],c=r[a].content.replaceAll('"',""").replaceAll("'","'"),u=t.apply(void 0,o);return"fence"===s.type&&"sparql"===s.info&&u.trim()?'<div style="position: relative">\n '.concat(u,'\n <open-in-sparql-editor\n style="').concat(e.buttonStyle,'"\n class="').concat(e.buttonClass,'"\n execute-query="').concat(e.executeQuery,'"\n repository-id="').concat(e.repositoryId,'"\n query="').concat(c,'">\n </open-in-sparql-editor>\n </div>'):u}}var r=function(t,e){t.renderer.rules.code_block=i(t.renderer.rules.code_block,e),t.renderer.rules.fence=i(t.renderer.rules.fence,e)}},134:function(t,e,n){"use strict";n.r(e),n.d(e,"connectorTypesListMapper",(function(){return i})),n.d(e,"connectorsMapper",(function(){return r}));var o=n(122),i=function(t){var e=new o.ConnectorTypesListModel;return t?(e.connectors=Object.keys(t).map((function(e){return new o.ConnectorTypeModel({name:e,prefix:t[e]})})),e):e},r=function(t){var e=new o.ConnectorListModel;return t?(e.connectors=t.map((function(t){return new o.ConnectorModel(t)})),e):e}},138:function(t,e,n){"use strict";n.r(e),n.d(e,"getHumanReadableTimestamp",(function(){return o}));var o=function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)return"";var i=new Date(n),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(a);s.setDate(a.getDate()-1);var c=new Date(i.getFullYear(),i.getMonth(),i.getDate()),u=o.timeFormat?e("date")(i,o.timeFormat):"";if(c.getTime()===a.getTime())return t.instant("common.dates.today")+u;if(c.getTime()===s.getTime())return t.instant("common.dates.yesterday")+u;var l=o.dateFormat||"yyyy-MM-dd";return e("date")(i,l)+u}},145:function(t,e,n){"use strict";n.r(e);var o=n(666),i=n(131),r=n(132),a={buttonStyle:"position: absolute; top: 0; right: 0; margin-right: 24px"};function s(t){var e=Object(o.a)().use(i.markdownCodeCopyPlugin).use(r.markdownOpenInSparqlEditorPlugin,a);return{renderMarkdown:function(n,s){try{return t.trustAsHtml(function(t){return t?Object(o.a)().use(i.markdownCodeCopyPlugin,t).use(r.markdownOpenInSparqlEditorPlugin,_.merge({},a,t)):e}(s).render(n))}catch(e){return console.error("Error rendering markdown:",e),t.trustAsHtml(n)}}}}angular.module("graphdb.framework.core.services.markdown-service",[]).service("MarkdownService",s),s.$inject=["$sce"]},164:function(t,e){function n(t){return{restrict:"E",scope:{fieldName:"@",source:"=",onSave:"&",onCancel:"&",onClick:"&",onDblclick:"&",isEditing:"="},templateUrl:"js/angular/core/directives/inline-editable-text/templates/inline-editable-text.template.html",link:function(e,n){e.editableModel={};var o,i=[];e.onKeydown=function(t){"Enter"===t.key?(a(),e.editableModel.text!==e.text&&e.onSave({newText:e.editableModel.text,source:e.source})):"Escape"===t.key&&r()},e.onCancelEditing=function(){r()},e.onSelect=function(){o?(a(),e.onDblclick({source:e.source})):o=t((function(){e.onClick({source:e.source}),a()}),250)};var r=function(){a(),e.onCancel()},a=function(){t.cancel(o),o=void 0};i.push(e.$watch("isEditing",(function(o){o&&(e.editableModel.text=e.source[e.fieldName],t((function(){var t=n.find("input")[0];t.focus(),t.select()}),0))})));e.$on("$destroy",(function(){i.forEach((function(t){return t()})),a()}))}}}angular.module("graphdb.framework.core.directives.inline-editable-text",[]).directive("inlineEditableText",n),n.$inject=["$timeout"]},165:function(t,e,n){"use strict";n.r(e);n(145);function o(t,e){return{template:'<div class="markdown-content" ng-bind-html="markdownContent"></div>',restrict:"E",scope:{content:"@",options:"="},link:function(n,o){n.markdownContent=void 0;var i=function(){n.$evalAsync((function(){var e=o.find(".markdown-content");t(angular.element(e).contents())(n)}))};n.markdownContent=e.renderMarkdown(n.content,n.options),i()}}}angular.module("graphdb.framework.core.directives.markdown-content",["graphdb.framework.core.services.markdown-service"]).directive("markdownContent",o),o.$inject=["$compile","MarkdownService"]},166:function(t,e,n){"use strict";n.r(e);var o=n(1);function i(t,e,n,i){return{template:'\n <style>\n .open-in-sparql-editor-btn {\n line-height: 0.75;\n }\n .open-in-sparql-editor-btn .fa:nth-child(2) {\n margin-left: -0.2em;\n margin-right: -0.2em;\n font-size: 0.9em;\n }\n </style>\n <button class="btn btn-link btn-sm open-in-sparql-editor-btn" gdb-tooltip="{{\'ttyg.chat_panel.btn.open_in_sparql_editor.tooltip\' | translate}}" ng-click="onGoToSparqlEditorView()" guide-selector="open-in-sparql-editor-btn">\n <i class="fa fa-bracket-curly"></i><i class="fa fa-ellipsis"></i><i class="fa fa-bracket-curly-right"></i>\n </button>\n ',restrict:"E",scope:{query:"@",repositoryId:"@",executeQuery:"@"},link:function(r,a){r.tooltipText="ttyg.chat_panel.btn.open_in_sparql_editor.tooltip";var s="true"===r.executeQuery;r.onGoToSparqlEditorView=function(){var i=t.getActiveRepository();i&&i===r.repositoryId?c(r.query):n.openConfirmationModal({title:e.instant("common.confirm"),message:Object(o.decodeHTML)(e.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:r.repositoryId})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},(function(){t.setRepository(t.getRepository(r.repositoryId)),c(r.query)}))};var c=function(t){i.open("/sparql?query=".concat(encodeURIComponent(t),"&execute=").concat(s),"_blank")}}}}angular.module("graphdb.framework.core.directives.open-in-sparql-editor",[]).directive("openInSparqlEditor",i),i.$inject=["$repositories","$translate","ModalService","$window"]},179:function(t,e,n){"use strict";n.r(e);n(127),n(125),n(140),n(26);function o(t,e,n,o,i){t.agentInstructionsExplain=i.agentInstructionsExplain,t.close=function(){e.dismiss({})},t.onCloseAgentInstructionsExplainModal=function(){e.dismiss({})};var r=[];t.$on("$destroy",(function(){r.forEach((function(t){return t()}))}))}angular.module("graphdb.framework.ttyg.controllers.agent-instructions-explain-modal",[]).controller("AgentInstructionsExplainModalController",o),o.$inject=["$scope","$uibModalInstance","ModalService","$translate","dialogModel"]},190:function(t,e,n){"use strict";n.r(e);n(165),n(166);var o=n(102),i=n(142),r=n(138);function a(t,e,n,a,s){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-item-detail.html",scope:{chatItemDetail:"=",showActions:"=",asking:"=",disabled:"=",onRegenerateQuestion:"&",onAskHowDeliveredAnswer:"&"},link:function(c,u,l){c.ExplainQueryType=i.ExplainQueryType,c.repositoryId=void 0,c.markdownContentOptions=void 0,c.agentNameByIdMap={},c.explainResponseModel={},c.loadingExplainResponse={},c.regenerateQuestion=function(){c.onRegenerateQuestion({chatItem:c.chatItemDetail})},c.explainResponse=function(o){n.hasExplainResponse(o)?n.toggleExplainResponse(o):(c.loadingExplainResponse[o]=!0,a.explainResponse(c.chatItemDetail,o).then((function(t){n.addExplainResponseCache(t)})).catch((function(){t.error(e.instant("ttyg.chat_panel.messages.explain_response_failure"))})).finally((function(){return c.loadingExplainResponse[o]=!1})))},c.onAskHowAnswerWasDerived=function(){c.onAskHowDeliveredAnswer()},c.onOpenInSparqlEditor=function(t){c.chatItemDetail.agentId&&n.emit(o.TTYGEventName.GO_TO_SPARQL_EDITOR,{query:t,repositoryId:c.repositoryId})},c.showRawQuery=function(t){var e=t.rawQuery.replace(/\s+/g,""),n=t.query.replace(/\s+/g,"");return e&&e!==n},c.getRepositoryId=function(t){var e=n.getAgent(c.chatItemDetail.agentId);return e?e.repositoryId:""},c.getHumanReadableQuestionTimestamp=function(t){return Object(r.getHumanReadableTimestamp)(e,s,t)};var d=function(){c.chatItemDetail.answers.forEach((function(t){c.explainResponseModel[t.id]=n.getExplainResponse(t.id)}))},g=[];g.push(n.onExplainResponseCacheUpdated((function(){d()}))),g.push(n.onAgentsListChanged((function(){c.agentNameByIdMap=n.getAgents().agentNameByIdMap}))),c.$on("$destroy",(function(){g.forEach((function(t){return t()}))})),c.repositoryId=c.getRepositoryId(),c.markdownContentOptions={repositoryId:c.repositoryId},d()}}}angular.module("graphdb.framework.ttyg.directives.chat-item-detail",["graphdb.framework.core.directives.open-in-sparql-editor","graphdb.framework.core.directives.markdown-content"]).directive("chatItemDetail",a),a.$inject=["toastr","$translate","TTYGContextService","TTYGService","$filter"]},231:function(t,e,n){"use strict";n.r(e),n.d(e,"status",(function(){return o}));var o={BAD_REQUEST:400,UNAUTHORIZED:401,FORBIDDEN:403,NOT_FOUND:404,CONFLICT:409,INTERNAL_SERVER_ERROR:500,SERVICE_UNAVAILABLE:503}},237:function(t,e,n){"use strict";n.r(e);n(164);var o=n(102),i=n(138),r=n(1);function a(t,e,n,a){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-list.html",link:function(s){s.selectedChat=void 0,s.renamedChat=void 0,s.deletingChat=void 0,s.onSelectChatForRenaming=function(t){s.renamedChat=t},s.onSelectChat=function(e){if(!s.selectedChat||s.selectedChat.id!==e.id){var n=t.getChats().getNonPersistedChat();n&&t.deleteChat(n),t.selectChat(e),s.renamedChat=void 0}},s.onDeleteChat=function(i){var a=n.instant("ttyg.dialog.delete.title"),s=Object(r.decodeHTML)(n.instant("ttyg.dialog.delete.body",{chatName:i.name}));e.openConfirmation(a,s,(function(){return t.emit(o.TTYGEventName.DELETE_CHAT,i)}))},s.onRenameChat=function(e,n){n.name=e,s.renamedChat=void 0,t.emit(o.TTYGEventName.RENAME_CHAT,n)},s.onExportChat=function(e){t.emit(o.TTYGEventName.CHAT_EXPORT,e)},s.onCancelChatRenaming=function(){s.renamedChat=void 0},s.getHumanReadableChatGroupTimestamp=function(t){return Object(i.getHumanReadableTimestamp)(n,a,t)};var c=function(t){s.selectedChat=t},u=[];u.push(t.onSelectedChatChanged(c)),u.push(t.onSelectedChatUpdated(c)),u.push(t.onChatsListChanged((function(t){s.chatList=t}))),u.push(t.subscribe(o.TTYGEventName.DELETING_CHAT,(function(t){s.deletingChat=t}))),s.$on("$destroy",(function(){u.forEach((function(t){return t()}))}))}}}angular.module("graphdb.framework.ttyg.directives.chat-list",["graphdb.framework.core.directives.inline-editable-text"]).directive("chatList",a),a.$inject=["TTYGContextService","ModalService","$translate","$filter"]},238:function(t,e,n){"use strict";n.r(e);n(190);var o=n(102),i=n(108),r=n(112),a=n(24),s=n(1),c=n(135);function u(t,e,n,u){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-panel.html",link:function(t,u,l){t.chat=void 0,t.selectedAgent=void 0,t.chatItem=void 0,t.askingChatItem=void 0,t.waitingForLastMessage=!1,t.loadingChat=!0,t.ask=function(){t.chatItem.question.timestamp=Date.now(),t.askingChatItem=Object(a.cloneDeep)(t.chatItem),t.chatItem.chatId?g(t.chatItem):d(),t.chatItem=p(),h(),m()},t.regenerateQuestion=function(e){var n=p();n.setQuestionMessage(e.getQuestionMessage()),n.question.timestamp=Date.now(),t.askingChatItem=n,g(n),h()},t.onKeypressOnInput=function(e){t.askingChatItem||"Enter"!==e.key||e.shiftKey||e.ctrlKey||t.ask()},t.onAskHowDeliveredAnswer=function(){var n=p();n.setQuestionMessage(e.instant("ttyg.chat_panel.btn.derive_answer.label")),n.question.timestamp=Date.now(),t.askingChatItem=Object(a.cloneDeep)(n),g(n),h()},t.getAgentName=function(t){var o=n.getAgent(t);return o?o.name:Object(s.decodeHTML)(e.instant("ttyg.chat_panel.deleted_agent"))};var d=function(){t.waitingForLastMessage=!0,n.emit(o.TTYGEventName.CREATE_CHAT,t.chatItem)},g=function(e){t.waitingForLastMessage=!0,n.emit(o.TTYGEventName.ASK_QUESTION,e)},f=function(){t.chatItem=Object(a.cloneDeep)(t.askingChatItem),t.askingChatItem=void 0,t.waitingForLastMessage=!1},p=function(){var e=new r.ChatItemModel;return e.question=new i.ChatMessageModel({role:i.CHAT_MESSAGE_ROLE.USER}),t.chat&&(e.chatId=t.chat.id),t.selectedAgent&&(e.agentId=t.selectedAgent.id),e},m=function(){setTimeout((function(){var t=document.querySelector(".question-input");t&&t.focus()}))},h=function(){setTimeout((function(){var t=u.find(".chat-details")[0];t&&(t.scrollTop=t.scrollHeight)}))},y=function(){t.chat=c.ChatModel.getEmptyChat(),t.loadingChat=!1,t.chatItem=p(),t.askingChatItem=void 0,t.waitingForLastMessage=!1,m()},T=[];T.push(t.$watchCollection("chat.chatHistory.items",h)),T.push(n.onSelectedChatUpdated((function(e){if(t.chat=e,e&&(e.id||!t.askingChatItem)){t.loadingChat=!1;var o=t.chatItem.question.message;if(t.chatItem=p(),t.chatItem.question.message=o,t.askingChatItem=void 0,t.chat){var i=t.chat.chatHistory.getLast();i&&i.agentId&&n.selectAgent(n.getAgent(i.agentId))}m()}}))),T.push(n.onLastMessageReceived((function(){t.waitingForLastMessage=!1}))),T.push(n.onSelectedAgentChanged((function(e){t.selectedAgent=e,t.selectedAgent&&t.chatItem&&(t.chatItem.agentId=t.selectedAgent.id),m()}))),T.push(n.onSelectedChatChanged((function(e){e?(t.loadingChat=e&&e.id,t.chatItem=p(),m()):y()}))),T.push(n.subscribe(o.TTYGEventName.LOAD_CHAT_FAILURE,(function(){t.loadingChat=!1,t.chatItem=p(),m()}))),T.push(n.subscribe(o.TTYGEventName.ASK_QUESTION_FAILURE,f)),T.push(n.subscribe(o.TTYGEventName.CREATE_CHAT_FAILURE,f)),T.push(n.subscribe(o.TTYGEventName.DELETE_CHAT_SUCCESSFUL,(function(e){t.chat&&e.id===t.chat.id&&y()}))),t.$on("$destroy",(function(){T.forEach((function(t){return t()}))})),t.chat=c.ChatModel.getEmptyChat(),t.chatItem=p(),m()}}}angular.module("graphdb.framework.ttyg.directives.chat-panel",["graphdb.framework.ttyg.directives.chat-item-detail"]).directive("chatPanel",u),u.$inject=["toastr","$translate","TTYGContextService","$timeout"]},239:function(t,e,n){"use strict";n.r(e);var o=n(1),i=n(102);function r(t,e,n){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-list.html",scope:{agentList:"=",agentListFilterModel:"="},link:function(r,a,s){r.selectedAgent=void 0,r.selectedAgentsFilter=void 0,r.deletingAgent=void 0,r.onEditAgent=function(e){t.emit(i.TTYGEventName.EDIT_AGENT,e)},r.onCloneAgent=function(e){t.emit(i.TTYGEventName.CLONE_AGENT,e)},r.onDeleteAgent=function(r){var a=n.instant("ttyg.agent.delete_agent_modal.title"),s=Object(o.decodeHTML)(n.instant("ttyg.agent.delete_agent_modal.body",{agentName:r.name}));e.openConfirmation(a,s,(function(){return t.emit(i.TTYGEventName.DELETE_AGENT,r)}))},r.onAgentsFilterChange=function(t){r.selectedAgentsFilter=t,r.selectedAgentsFilter&&r.agentList.filterByRepository(r.selectedAgentsFilter.key)};var c=function(){var t=r.agentListFilterModel.find((function(t){return t.selected}));r.selectedAgentsFilter=t||r.agentListFilterModel[0],r.onAgentsFilterChange(r.selectedAgentsFilter)},u=[];u.push(r.$watch("agentListFilterModel",c)),u.push(t.subscribe(i.TTYGEventName.DELETING_AGENT,(function(t){r.deletingAgent=t}))),u.push(t.onSelectedAgentChanged((function(t){r.selectedAgent=t}))),r.$on("$destroy",(function(){u.forEach((function(t){return t()}))})),c()}}}angular.module("graphdb.framework.ttyg.directives.agent-list",[]).directive("agentList",r),r.$inject=["TTYGContextService","ModalService","$translate"]},240:function(t,e,n){"use strict";n.r(e);var o=n(25),i=n(102);function r(t,e,n,r){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-select-menu.html",scope:{},link:function(n){n.agentOptionsList=[],n.selectedAgent=void 0,n.onAgentSelected=function(o){if(a(o),n.selectedAgent=o,t.selectAgent(o),o.isRepositoryDeleted){var s=e.instant("ttyg.agent.agent_select_menu.configure_agent_modal.title"),c=e.instant("ttyg.agent.agent_select_menu.configure_agent_modal.body");r.openConfirmation(s,c,(function(){return t.emit(i.TTYGEventName.EDIT_AGENT,o)}))}};var a=function(t){n.agentOptionsList.forEach((function(e){e.selected=e.data.agent===t}))},s=function(t){n.agentOptionsList=t.agents.map((function(t){return new o.SelectMenuOptionsModel({value:t.id,label:t.name,data:{agent:t}})}))},c=[];c.push(t.onAgentsListChanged((function(t){s(t)}))),c.push(t.subscribe(i.TTYGEventName.AGENT_DELETED,(function(e){n.selectedAgent&&n.selectedAgent.id===e.id&&(n.selectedAgent.isDeleted=!0,t.selectAgent(n.selectedAgent))}))),c.push(t.onSelectedAgentChanged((function(t){a(t),n.selectedAgent=t}))),n.$on("$destroy",(function(){c.forEach((function(t){return t()}))}))}}}angular.module("graphdb.framework.ttyg.directives.agent-select-menu",[]).directive("agentSelectMenu",r),r.$inject=["TTYGContextService","$translate","$sce","ModalService"]},241:function(t,e,n){"use strict";n.r(e);var o=n(102),i=n(17);function r(t,e){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/no-agents-view.html",scope:{},link:function(n){n.canModifyAgent=!1,n.talkToGraphDocumentationLink=i.DocumentationUrlResolver.getDocumentationUrl(e.productShortVersion,"talk-to-graph.html"),n.onCreateAgent=function(){t.emit(o.TTYGEventName.OPEN_AGENT_SETTINGS)};var r=[];r.push(t.onCanUpdateAgentUpdated((function(t){n.canModifyAgent=t}))),n.$on("$destroy",(function(){r.forEach((function(t){return t()}))}))}}}angular.module("graphdb.framework.ttyg.directives.no-agents-view",[]).directive("noAgentsView",r),r.$inject=["TTYGContextService","productInfo"]},242:function(t,e){angular.module("graphdb.framework.ttyg.directives.show-tooltip-on-overflow",[]).directive("showTooltipOnOverflow",(function(){return{link:function(t,e){setTimeout((function(){var n=e[0].querySelector(".editable-text-element");n&&(n.scrollWidth>n.clientWidth?e.attr("title",t.chat.name):e.removeAttr("title"))}),0)}}}))},243:function(t,e,n){"use strict";n.r(e);var o=n(1),i=n(141),r=(n(127),n(125),n(140),n(26),n(179),n(12)),a=n(102),s=n(128),c=n(37);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=u(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d(t,e,n,u,d,g,f,p,m,h,y,T,v,E,S,A,C){t.AGENT_OPERATION=s.AGENT_OPERATION,t.operation=T.operation,t.savingAgent=!1,t.agentFormModel=T.agentFormModel,t.activeRepositoryInfo=T.activeRepositoryInfo,t.extractionMethodLoaderFlags=l({},i.ExtractionMethod.SIMILARITY,!1),t.activeRepositoryList=T.activeRepositoryList,t.extractionMethods=i.ExtractionMethod,t.additionalExtractionMethods=i.AdditionalExtractionMethod,t.ExtractionMethodTemplates=S,t.showAdvancedSettings=!1,t.showHighTemperatureWarning=!1,t.showSystemInstructionWarning=!1,t.similarityIndexes=[],t.retrievalConnectors=[],t.ftsEnabled=!1,t.autocompleteSuggestions=[],t.toggleExtractionMethod=function(e){e.expanded=e.selected,t.agentSettingsForm.extractionMethods.$setTouched(),x(),G[e.method](e)},t.onExtractionMethodPanelToggle=function(t){t.toggleCollapse(),G[t.method](t)},t.toggleAdditionalExtractionMethod=function(e){e.expanded=e.selected,t.checkAutocompleteIndexEnabled(),k[e.method](e)},t.onAdditionalExtractionMethodPanelToggle=function(t){t.toggleCollapse(),k[t.method](t)},t.getModelHelpMessage=function(){var t=Object(o.decodeHTML)(y.instant("ttyg.agent.create_agent_modal.form.model.hint"));return p.trustAsHtml(t)},t.getFTSDisabledHelpMessage=function(){var e=Object(o.decodeHTML)(y.instant("ttyg.agent.create_agent_modal.form.fts_search.fts_disabled_message",{repositoryEditPage:"#/repository/edit/"+t.agentFormModel.repositoryId}));return p.trustAsHtml(e)},t.getAutocompleteDisabledHelpMessage=function(){var t=Object(o.decodeHTML)(y.instant("ttyg.agent.create_agent_modal.form.additional_query_methods.autocomplete_disabled_message",{autocompleteIndexPage:"#/autocomplete"}));return p.trustAsHtml(t)},t.goToCreateSimilarityView=function(){v.emit(a.TTYGEventName.GO_TO_CREATE_SIMILARITY_VIEW,{repositoryId:t.agentFormModel.repositoryId})},t.goToConnectorsView=function(){v.emit(a.TTYGEventName.GO_TO_CONNECTORS_VIEW,{repositoryId:t.agentFormModel.repositoryId})},t.ok=function(){var e=t.agentFormModel.toPayload();return b[t.operation](e)},t.cancel=function(){e.dismiss({})},t.close=function(){e.dismiss({})},t.updateSimilaritySearchPanel=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t.agentFormModel.assistantExtractionMethods.getSimilarityExtractionMethod();n.selected&&(e&&(n.similarityIndex=null),L(n))},t.updateRetrievalConnectorPanel=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t.agentFormModel.assistantExtractionMethods.getRetrievalExtractionMethod();n.selected&&(e&&(n.retrievalConnectorInstance=null),M(n))},t.checkIfFTSEnabled=function(){t.agentFormModel.repositoryId?t.agentFormModel.assistantExtractionMethods.getFTSSearchExtractionMethod().selected?(t.extractionMethodLoaderFlags[i.ExtractionMethod.FTS_SEARCH]=!0,f.getRepositoryModel({id:t.agentFormModel.repositoryId}).then((function(e){t.ftsEnabled=e.getParamValue(r.REPOSITORY_PARAMS.enableFtsIndex)})).catch((function(t){w(t,"ttyg.agent.messages.error_repository_config_loading")})).finally((function(){t.extractionMethodLoaderFlags[i.ExtractionMethod.FTS_SEARCH]=!1,t.agentSettingsForm.$setValidity("FTSDisabled",t.ftsEnabled)}))):t.agentSettingsForm.$setValidity("FTSDisabled",!0):t.agentSettingsForm.$setValidity("FTSDisabled",!1)},t.onRepositoryChange=function(){F(!0,!0)},t.checkAutocompleteIndexEnabled=function(){A.checkAutocompleteStatus().then((function(e){t.autocompleteEnabled=e})).catch((function(t){m.error(getError(t))}))},t.onRestoreDefaultSystemInstructions=function(){t.agentFormModel.instructions.systemInstruction=t.agentFormModel.instructions.systemInstructionCopy},t.onRestoreDefaultUserInstructions=function(){t.agentFormModel.instructions.userInstruction=t.agentFormModel.instructions.userInstructionCopy},t.onTemperatureChange=function(){t.showHighTemperatureWarning=t.agentFormModel.temperature.value>1},t.onSystemInstructionChange=function(){""===t.agentFormModel.instructions.systemInstruction||t.showSystemInstructionWarning||(t.showSystemInstructionWarning=!0,n.openModalAlert({title:y.instant("ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.title"),message:y.instant("ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.body")}).result.then((function(){}))),""===t.agentFormModel.instructions.systemInstruction&&(t.showSystemInstructionWarning=!1)},t.onExplainAgentSettings=function(){var e=t.agentFormModel.toPayload();E.explainAgentSettings(e).then((function(t){var e={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:t}}},size:"lg"};u.open(e).result.then((function(){}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))}))},t.getSuggestions=function(e){var n=e.target.value;C.getAutocompleteSuggestions(n).then(c.mapUriAsNtripleAutocompleteResponse).then((function(e){t.autocompleteSuggestions=e.map((function(t){return{text:t.value}}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))}))};var b=l(l(l({},s.AGENT_OPERATION.CREATE,(function(t){return _(t)})),s.AGENT_OPERATION.EDIT,(function(t){return I(t)})),s.AGENT_OPERATION.CLONE,(function(t){return R(t)})),_=function(n){return t.savingAgent=!0,E.createAgent(n).then((function(t){e.close(t),m.success(y.instant("ttyg.agent.messages.agent_save_successfully",{agentName:t.name}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))})).finally((function(){t.savingAgent=!1}))},I=function(n){return t.savingAgent=!0,E.editAgent(n).then((function(t){e.close(t),m.success(y.instant("ttyg.agent.messages.agent_save_successfully",{agentName:t.name}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))})).finally((function(){t.savingAgent=!1}))},R=function(n){return t.savingAgent=!0,E.createAgent(n).then((function(t){e.close(t),m.success(y.instant("ttyg.agent.messages.agent_save_successfully",{agentName:t.name}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))})).finally((function(){t.savingAgent=!1}))},w=function(t,e){console.error(t),m.error(y.instant(e))},x=function(){t.agentSettingsForm.extractionMethods.$setValidity("required",t.agentFormModel.hasExtractionMethodSelected())},O=function(){var e=t.activeRepositoryList.find((function(e){return e.value===t.agentFormModel.repositoryId}));return{repositoryId:e?e.data.repository.id:void 0,repositoryLocation:e?e.data.repository.location:void 0}},L=function(e){if(e.selected||t.agentSettingsForm.$setValidity("missingIndex",!0),e.expanded){t.extractionMethodLoaderFlags[e.method]=!0;var n=O();d.getIndexesAsMenuModel(n.repositoryId,n.repositoryLocation).then((function(n){t.similarityIndexes=n,t.agentSettingsForm.$setValidity("missingIndex",!e.selected||!(!n||!n.length)),N(t.similarityIndexes,e)})).catch((function(e){t.agentSettingsForm.$setValidity("missingIndex",!1),w(e,"ttyg.agent.messages.error_similarity_indexes_loading")})).finally((function(){t.extractionMethodLoaderFlags[e.method]=!1}))}},N=function(t,e){if(0!==t.length){var n=t.find((function(t){return t.value===e.similarityIndex}));e.similarityIndex=n?n.value:t[0].value}else e.similarityIndex=null},M=function(e){if(e.selected||t.agentSettingsForm.$setValidity("missingConnector",!0),e.expanded){t.extractionMethodLoaderFlags[e.method]=!0;var n=O();g.getConnectorPrefixByName("ChatGPT Retrieval",n.repositoryId,n.repositoryLocation).then((function(t){return g.getConnectorsByTypeAsSelectMenuOptions(t,n.repositoryId,n.repositoryLocation)})).then((function(n){t.retrievalConnectors=n,t.agentSettingsForm.$setValidity("missingConnector",!e.selected||!(!n||!n.length)),D(t.retrievalConnectors,e)})).catch((function(e){t.agentSettingsForm.$setValidity("missingConnector",!1),w(e,"ttyg.agent.messages.error_retrieval_connectors_loading")})).finally((function(){t.extractionMethodLoaderFlags[e.method]=!1}))}},D=function(t,e){if(0!==t.length){var n=t.find((function(t){return t.value===e.retrievalConnectorInstance}));e.retrievalConnectorInstance=n?n.value:t[0].value}else e.retrievalConnectorInstance=null},G=l(l(l(l({},i.ExtractionMethod.FTS_SEARCH,(function(e){t.checkIfFTSEnabled()})),i.ExtractionMethod.SPARQL,(function(t){})),i.ExtractionMethod.SIMILARITY,(function(t){return L(t)})),i.ExtractionMethod.RETRIEVAL,(function(t){return M(t)})),k=l(l({},i.AdditionalExtractionMethod.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH,(function(t){return $(t)})),i.AdditionalExtractionMethod.IRI_DISCOVERY_SEARCH,(function(){})),$=function(){t.checkAutocompleteIndexEnabled()},F=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.checkIfFTSEnabled(),t.updateSimilaritySearchPanel(e),t.updateRetrievalConnectorPanel(n),t.checkAutocompleteIndexEnabled()},U=function(){document.hidden||F()};document.addEventListener("visibilitychange",U),t.$on("$destroy",(function(){document.removeEventListener("visibilitychange",U)}));setTimeout(x,0)}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","ngTagsInput"]).constant("ExtractionMethodTemplates",{iri_discovery_search:"iri-discovery-search"}).controller("AgentSettingsModalController",d),d.$inject=["$scope","$uibModalInstance","ModalService","$uibModal","SimilarityService","ConnectorsService","RepositoriesRestService","$sce","toastr","UriUtils","$translate","dialogModel","TTYGContextService","TTYGService","ExtractionMethodTemplates","AutocompleteService","AutocompleteRestService"]},244:function(t,e){function n(t,e){var n={agent:{id:void 0},chat:{id:void 0}},o=function(){var o=t.get(e.TTYG);return o||(o=n),o.agent||(o.agent={}),o.chat||(o.chat={}),o};return{saveAgent:function(n){var i=o();i.agent.id=n?n.id:void 0,t.set(e.TTYG,i)},getAgentId:function(){var t=o();if(t.agent)return t.agent.id},saveChat:function(n){var i=o();i.chat.id=n?n.id:void 0,t.set(e.TTYG,i)},getChatId:function(){var t=o();if(t.chat)return t.chat.id}}}angular.module("graphdb.framework.ttyg.services.ttygstorage",[]).factory("TTYGStorageService",n),n.$inject=["LocalStorageAdapter","LSKeys"]},245:function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,a(o.key),o)}}function r(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}n.r(e),n.d(e,"AgentSettingsModal",(function(){return s}));var s=r((function t(e,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.activeRepositoryInfo=e,this.activeRepositoryList=n,this.agentFormModel=o,this.operation=i}))},369:function(t,e,n){"use strict";n.r(e);n(237),n(238),n(239),n(240),n(241),n(242),n(243),n(140);var o=n(102),i=(n(244),n(128)),r=n(141),a=n(135),s=n(214),c=n(25),u=n(38),l=n(636),d=n(245),g=n(1),f=n(231),p=n(148);function m(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function y(t,e,n,h,y,T,v,E,S,A,C,b,_,I,R){var w=[],x={filter_all:v.instant("ttyg.agent.btn.filter.all")};h.helpTemplateUrl="js/angular/ttyg/templates/chatInfo.html",h.isHelpVisible=!1,h.showChats=!0,h.showAgents=!1,h.chats=void 0,h.loadingChats=!1,h.loadingChat=!1,h.initialized=!1,h.agents=void 0,h.selectedAgent=void 0,h.loadingAgents=!1,h.reloadingAgents=!1,h.connectorID=void 0,h.canModifyAgent=!1,h.agentListFilterModel=[],h.activeRepositoryList=[],h.onopen=h.onclose=function(){return angular.noop()},h.startNewChat=function(){I.deselectChat()},h.toggleChatsListSidebar=function(){h.showChats=!h.showChats},h.toggleAgentsListSidebar=function(){h.showAgents=!h.showAgents},h.onToggleHelp=function(){h.isHelpVisible=!h.isHelpVisible},h.onExportSelectedChat=function(){$(I.getSelectedChat())};var O=function(){var t=I.getDefaultAgent();return t?Promise.resolve(t):_.getDefaultAgent().then((function(t){return I.setDefaultAgent(t),t}))};h.onOpenNewAgentSettings=function(){O().then((function(t){var e=Object(u.repositoryInfoMapper)(S.getActiveRepositoryObject());t.repositoryId=e.id;var n=Object(s.agentFormModelMapper)(new r.AgentModel({}),t,i.AGENT_OPERATION.CREATE);return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new d.AgentSettingsModal(e,h.activeRepositoryList,n,i.AGENT_OPERATION.CREATE)}},size:"lg"}})).then((function(t){E.open(t).result.then(N)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))},h.onOpenAgentSettings=function(t){var e=t;e||(e=I.getSelectedAgent()),O().then((function(t){var n=Object(s.agentFormModelMapper)(e,t,i.AGENT_OPERATION.EDIT),o=Object(u.repositoryInfoMapper)(S.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new d.AgentSettingsModal(o,h.activeRepositoryList,n,i.AGENT_OPERATION.EDIT)}},size:"lg"}})).then((function(t){E.open(t).result.then((function(t){var e=I.getSelectedAgent();e&&t.id===e.id&&I.selectAgent(t),N()}))})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))},h.onOpenCloneAgentSettings=function(t){O().then((function(e){var n=Object(s.agentFormModelMapper)(t,e,i.AGENT_OPERATION.CLONE);n.name="clone-".concat(n.name);var o=Object(u.repositoryInfoMapper)(S.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new d.AgentSettingsModal(o,h.activeRepositoryList,n,i.AGENT_OPERATION.CLONE)}},size:"lg"}})).then((function(t){E.open(t).result.then((function(t){var e=I.getSelectedAgent();e&&t.id===e.id&&I.selectAgent(t),N()}))})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))};var L=function(){return h.loadingChats=!0,_.getConversations().then((function(t){return I.updateChats(t)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH)),k(new a.ChatsListModel)})).finally((function(){h.loadingChats=!1}))},N=function(){return h.reloadingAgents=!0,_.getAgents().then((function(t){return I.updateAgents(t)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))})).finally((function(){h.reloadingAgents=!1}))},M=function(){I.setCanModifyAgent(t.isRepoManager())},D=function(t,e,n){var i;if(t.timestamp=n.timestamp,e.answers=e.answers||[],(i=e.answers).push.apply(i,m(n.messages)),I.updateSelectedChat(t),n.continueRunId)I.emit(o.TTYGEventName.CONTINUE_CHAT_RUN,new p.ContinueChatRun(e,n.continueRunId));else{var r=I.getChats();r.updateChatTimestamp(t.id,n.timestamp),r.updateChatName(t.id,n.chatName),t.name=n.name,I.updateChats(r),I.emit(o.TTYGEventName.LAST_MESSAGE_RECEIVED,t)}},G=function(t,e,n){t.chatHistory.appendItem(e),D(t,e,n)},k=function(t){t.isEmpty()?h.showChats=!1:(h.showChats=!0,I.getSelectedChat()||R.getChatId()||I.selectChat(h.chats.getFirstChat()))},$=function(t){_.exportConversation(t.id).then((function(e){var n=e.data,i=e.filename;Object(l.saveAs)(n,i),I.emit(o.TTYGEventName.CHAT_EXPORT_SUCCESSFUL,t)})).catch((function(){I.emit(o.TTYGEventName.CHAT_EXPORT_FAILURE),A.error(v.instant("ttyg.chat.messages.export_failure"))}))},F=function(){var t=S.getActiveRepository(),e=S.getLocalReadableGraphdbRepositories().map((function(e){return new r.AgentListFilterModel(e.id,e.id,e.id===t)}));h.agentListFilterModel=[new r.AgentListFilterModel(i.AGENTS_FILTER_ALL_KEY,x.filter_all)].concat(m(e))},U=function(t){C.openModalAlert({title:v.instant("ttyg.chat.dialog.chat_is_missing.title"),message:v.instant("ttyg.chat.dialog.chat_is_missing.body")}).result.then((function(){I.deleteChat(t)}))},P=function(){e.open("/similarity/index/create","_blank")},H=function(){e.open("/connectors","_blank")},j=function(t){e.open("/sparql?query=".concat(encodeURIComponent(t),"&execute=true"),"_blank")},Y=function(){var t=R.getChatId(),e=I.getChats();t&&e.getChat(t)&&I.selectChat(I.getChats().getChat(t))};w.push(h.$watch(h.getActiveRepositoryObject,(function(t){t&&(h.activeRepositoryList=S.getLocalReadableGraphdbRepositories().map((function(t){return new c.SelectMenuOptionsModel({value:t.id,label:t.id,data:{repository:t}})})),function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return h.loadingAgents=t,_.getAgents().then((function(t){return I.updateAgents(t)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))})).finally((function(){h.loadingAgents=!1}))}().then((function(){return h.initialized=!0,F(),L()})).then(Y),M())}))),w.push(I.onSelectedChatChanged((function(t){t&&t.id?_.getConversation(t.id).then((function(e){I.updateSelectedChat(e),R.saveChat(t)})).catch((function(e){e.status===f.status.NOT_FOUND&&(U(t),I.emit(o.TTYGEventName.LOAD_CHAT_FAILURE,t))})):t&&I.updateSelectedChat(t)}))),w.push(I.onChatsListChanged((function(t){h.chats=t,k(t)}))),w.push(I.onCanUpdateAgentUpdated((function(t){h.canModifyAgent=t}))),w.push(I.subscribe(I.onAgentsListChanged((function(t){h.agents=t})))),w.push(I.subscribe(o.TTYGEventName.CREATE_CHAT,(function(t){var e=I.getChats().getNonPersistedChat();e||(e=a.ChatModel.getEmptyChat(),I.addChat(e)),I.selectChat(e),_.createConversation(t).then((function(e){I.emit(o.TTYGEventName.CREATE_CHAT_SUCCESSFUL);var n=I.getSelectedChat();if(n&&!n.id){n.id=e.chatId,t.chatId=e.chatId;var i=I.getChats().getNonPersistedChat();I.replaceChat(n,i),R.saveChat(n),G(n,t,e)}})).catch((function(t){I.emit(o.TTYGEventName.CREATE_CHAT_FAILURE),A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))}))),w.push(I.subscribe(o.TTYGEventName.RENAME_CHAT,(function(t){_.renameConversation(t).then((function(){I.emit(o.TTYGEventName.RENAME_CHAT_SUCCESSFUL),I.emit(o.TTYGEventName.LOAD_CHATS)})).catch((function(){I.emit(o.TTYGEventName.RENAME_CHAT_FAILURE),A.error(v.instant("ttyg.chat.messages.rename_failure"))}))}))),w.push(I.subscribe(o.TTYGEventName.DELETE_CHAT,(function(t){I.emit(o.TTYGEventName.DELETING_CHAT,{chatId:t.id,inProgress:!0}),_.deleteConversation(t.id).then((function(){I.emit(o.TTYGEventName.DELETE_CHAT_SUCCESSFUL,t);var e=I.getChats();e.deleteChat(t),I.updateChats(e)})).catch((function(){I.emit(o.TTYGEventName.DELETE_CHAT_FAILURE),A.error(v.instant("ttyg.chat.messages.delete_failure"))})).finally((function(){return I.emit(o.TTYGEventName.DELETING_CHAT,{chatId:t.id,inProgress:!1})}))}))),w.push(I.subscribe(o.TTYGEventName.CHAT_EXPORT,$)),w.push(I.subscribe(o.TTYGEventName.ASK_QUESTION,(function(t){_.askQuestion(t).then((function(e){var n=I.getSelectedChat();n&&n.id===t.chatId&&G(n,t,e)})).catch((function(t){I.emit(o.TTYGEventName.ASK_QUESTION_FAILURE),A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))}))),w.push(I.subscribe(o.TTYGEventName.CONTINUE_CHAT_RUN,(function(t){_.continueChatRun(t).then((function(e){var n=t.chatId,o=I.getSelectedChat();if(o&&o.id===n){var i=o.chatHistory.items,r=i[i.length-1];D(o,r,e)}})).catch((function(t){I.emit(o.TTYGEventName.ASK_QUESTION_FAILURE),A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))}))),w.push(I.subscribe(o.TTYGEventName.LOAD_CHATS,L)),w.push(I.subscribe(o.TTYGEventName.OPEN_AGENT_SETTINGS,h.onOpenNewAgentSettings)),w.push(I.subscribe(o.TTYGEventName.EDIT_AGENT,h.onOpenAgentSettings)),w.push(I.subscribe(o.TTYGEventName.CLONE_AGENT,h.onOpenCloneAgentSettings)),w.push(I.subscribe(o.TTYGEventName.DELETE_AGENT,(function(t){I.emit(o.TTYGEventName.DELETING_AGENT,{agentId:t.id,inProgress:!0}),_.deleteAgent(t.id).then((function(){return N()})).then((function(){I.emit(o.TTYGEventName.AGENT_DELETED,t),h.selectedAgent&&h.selectedAgent.id===t.id&&(h.selectedAgent=void 0)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))})).finally((function(){I.emit(o.TTYGEventName.DELETING_AGENT,{agentId:t.id,inProgress:!1})}))}))),w.push(I.subscribe(o.TTYGEventName.AGENT_SELECTED,(function(t){h.selectedAgent=t}))),w.push(I.subscribe(o.TTYGEventName.GO_TO_CREATE_SIMILARITY_VIEW,(function(t){if(t.repositoryId!==S.getActiveRepository()){var e=S.getRepository(t.repositoryId);e&&C.openConfirmationModal({title:v.instant("common.confirm"),message:Object(g.decodeHTML)(v.instant("ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_similarity.body",{repositoryId:e.id})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},(function(){S.setRepository(e),P()}))}else P()}))),w.push(I.subscribe(o.TTYGEventName.GO_TO_CONNECTORS_VIEW,(function(t){if(t.repositoryId!==S.getActiveRepository()){var e=S.getRepository(t.repositoryId);e&&C.openConfirmationModal({title:v.instant("common.confirm"),message:Object(g.decodeHTML)(v.instant("ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_connectors.body",{repositoryId:e.id})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},(function(){S.setRepository(e),H()}))}else H()}))),w.push(I.subscribe(o.TTYGEventName.GO_TO_SPARQL_EDITOR,(function(t){if(t.repositoryId!==S.getActiveRepository()){var e=S.getRepository(t.repositoryId);e&&C.openConfirmation(v.instant("common.confirm"),Object(g.decodeHTML)(v.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:t.repositoryId})),(function(){S.setRepository(e),j(t.query)}))}else j(t.query)}))),w.push(n.$on("$translateChangeSuccess",(function(){x.filter_all=v.instant("ttyg.agent.btn.filter.all"),F()}))),w.push(n.$on("securityInit",M)),h.$on("$destroy",(function(){w.forEach((function(t){return t()})),I.resetContext()}))}angular.module("graphdb.framework.ttyg.controllers.ttyg-view",["toastr","graphdb.framework.utils.localstorageadapter","graphdb.framework.core.services.ttyg-service","graphdb.framework.ttyg.services.ttygcontext","graphdb.framework.ttyg.services.ttygstorage","graphdb.framework.ttyg.directives.chat-list","graphdb.framework.ttyg.directives.chat-panel","graphdb.framework.ttyg.directives.agent-list","graphdb.framework.ttyg.directives.agent-select-menu","graphdb.framework.ttyg.directives.no-agents-view","graphdb.framework.ttyg.directives.show-tooltip-on-overflow","graphdb.framework.ttyg.controllers.agent-settings-modal"]).controller("TTYGViewCtrl",y),y.$inject=["$jwtAuth","$window","$rootScope","$scope","$http","$timeout","$translate","$uibModal","$repositories","toastr","ModalService","LocalStorageAdapter","TTYGService","TTYGContextService","TTYGStorageService"]},480:function(t,e,n){"use strict";n.r(e);n(369),n(656);angular.module("graphdb.framework.ttyg",["ngRoute","graphdb.framework.ttyg.controllers.ttyg-view"])},635:function(t,e){(function(e){t.exports=e}).call(this,{})},636:function(t,e,n){var o,i=i||function(t){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var e=t.document,n=function(){return t.URL||t.webkitURL||t},o=e.createElementNS("http://www.w3.org/1999/xhtml","a"),i=t.webkitRequestFileSystem,r=t.requestFileSystem||i||t.mozRequestFileSystem,a=function(e){(t.setImmediate||t.setTimeout)((function(){throw e}),0)},s=0,c=function(e){var o=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};t.chrome?o():setTimeout(o,500)},u=function(t,e,n){for(var o=(e=[].concat(e)).length;o--;){var i=t["on"+e[o]];if("function"==typeof i)try{i.call(t,n||t)}catch(t){a(t)}}},l=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t},d=function(e,a){e=l(e);var d,g,f,p=this,m=e.type,h=!1,y=function(){u(p,"writestart progress write writeend".split(" "))},T=function(){(!h&&d||(d=n().createObjectURL(e)),g)?g.location.href=d:null==t.open(d,"_blank")&&"undefined"!=typeof safari&&(t.location.href=d);p.readyState=p.DONE,y(),c(d)},v=function(t){return function(){if(p.readyState!==p.DONE)return t.apply(this,arguments)}},E={create:!0,exclusive:!1};if(p.readyState=p.INIT,a||(a="download"),o)return d=n().createObjectURL(e),o.href=d,o.download=a,void setTimeout((function(){var t,e;t=o,e=new MouseEvent("click"),t.dispatchEvent(e),y(),c(d),p.readyState=p.DONE}));t.chrome&&m&&"application/octet-stream"!==m&&(f=e.slice||e.webkitSlice,e=f.call(e,0,e.size,"application/octet-stream"),h=!0),i&&"download"!==a&&(a+=".download"),("application/octet-stream"===m||i)&&(g=t),r?(s+=e.size,r(t.TEMPORARY,s,v((function(t){t.root.getDirectory("saved",E,v((function(t){var n=function(){t.getFile(a,E,v((function(t){t.createWriter(v((function(n){n.onwriteend=function(e){g.location.href=t.toURL(),p.readyState=p.DONE,u(p,"writeend",e),c(t)},n.onerror=function(){var t=n.error;t.code!==t.ABORT_ERR&&T()},"writestart progress write abort".split(" ").forEach((function(t){n["on"+t]=p["on"+t]})),n.write(e),p.abort=function(){n.abort(),p.readyState=p.DONE},p.readyState=p.WRITING})),T)})),T)};t.getFile(a,{create:!1},v((function(t){t.remove(),n()})),v((function(t){t.code===t.NOT_FOUND_ERR?n():T()})))})),T)})),T)):T()},g=d.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e){return navigator.msSaveOrOpenBlob(l(t),e)}:(g.abort=function(){this.readyState=this.DONE,u(this,"abort")},g.readyState=g.INIT=0,g.WRITING=1,g.DONE=2,g.error=g.onwritestart=g.onprogress=g.onwrite=g.onabort=g.onerror=g.onwriteend=null,function(t,e){return new d(t,e)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
|
|
2
2
|
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */t.exports?t.exports.saveAs=i:null!==n(642)&&null!=n(635)&&(void 0===(o=function(){return i}.apply(e,[]))||(t.exports=o))},642:function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},656:function(t,e){
|
|
3
3
|
/*! ngTagsInput v3.2.0 License: MIT */!function(){"use strict";var t=8,e=9,n=13,o=27,i=32,r=38,a=40,s=37,c=39,u=46,l=188,d=9007199254740991,g=["text","email","url"],f=angular.module("ngTagsInput",[]);f.directive("tagsInput",["$timeout","$document","$window","$q","tagsInputConfig","tiUtil",function(e,o,r,a,f,p){function m(t,e,n,o){var i,r,s,c,u={};return i=function(e){return p.safeToString(e[t.displayProperty])},r=function(e,n){e[t.displayProperty]=n},s=function(e){var o=i(e),r=o&&o.length>=t.minLength&&o.length<=t.maxLength&&t.allowedTagsPattern.test(o)&&!p.findInObjectArray(u.items,e,t.keyProperty||t.displayProperty);return a.when(r&&n({$tag:e})).then(p.promisifyValue)},c=function(t){return a.when(o({$tag:t})).then(p.promisifyValue)},u.items=[],u.addText=function(t){var e={};return r(e,t),u.add(e)},u.add=function(n){var o=i(n);return t.replaceSpacesWithDashes&&(o=p.replaceSpacesWithDashes(o)),r(n,o),s(n).then((function(){u.items.push(n),e.trigger("tag-added",{$tag:n})})).catch((function(){o&&e.trigger("invalid-tag",{$tag:n})}))},u.remove=function(t){var n=u.items[t];return c(n).then((function(){return u.items.splice(t,1),u.clearSelection(),e.trigger("tag-removed",{$tag:n}),n}))},u.select=function(t){0>t?t=u.items.length-1:t>=u.items.length&&(t=0),u.index=t,u.selected=u.items[t]},u.selectPrior=function(){u.select(--u.index)},u.selectNext=function(){u.select(++u.index)},u.removeSelected=function(){return u.remove(u.index)},u.clearSelection=function(){u.selected=null,u.index=-1},u.getItems=function(){return t.useStrings?u.items.map(i):u.items},u.clearSelection(),u}function h(t){return-1!==g.indexOf(t)}return{restrict:"E",require:"ngModel",scope:{tags:"=ngModel",text:"=?",templateScope:"=?",tagClass:"&",onTagAdding:"&",onTagAdded:"&",onInvalidTag:"&",onTagRemoving:"&",onTagRemoved:"&",onTagClicked:"&"},replace:!1,transclude:!0,templateUrl:"ngTagsInput/tags-input.html",controller:["$scope","$attrs","$element",function(t,e,n){t.events=p.simplePubSub(),f.load("tagsInput",t,e,{template:[String,"ngTagsInput/tag-item.html"],type:[String,"text",h],placeholder:[String,"Add a tag"],tabindex:[Number,null],removeTagSymbol:[String,String.fromCharCode(215)],replaceSpacesWithDashes:[Boolean,!0],minLength:[Number,3],maxLength:[Number,d],addOnEnter:[Boolean,!0],addOnSpace:[Boolean,!1],addOnComma:[Boolean,!0],addOnBlur:[Boolean,!0],addOnPaste:[Boolean,!1],pasteSplitPattern:[RegExp,/,/],allowedTagsPattern:[RegExp,/.+/],enableEditingLastTag:[Boolean,!1],minTags:[Number,0],maxTags:[Number,d],displayProperty:[String,"text"],keyProperty:[String,""],allowLeftoverText:[Boolean,!1],addFromAutocompleteOnly:[Boolean,!1],spellcheck:[Boolean,!0],useStrings:[Boolean,!1]}),t.tagList=new m(t.options,t.events,p.handleUndefinedResult(t.onTagAdding,!0),p.handleUndefinedResult(t.onTagRemoving,!0)),this.registerAutocomplete=function(){return n.find("input"),{addTag:function(e){return t.tagList.add(e)},getTags:function(){return t.tagList.items},getCurrentTagText:function(){return t.newTag.text()},getOptions:function(){return t.options},getTemplateScope:function(){return t.templateScope},on:function(e,n){return t.events.on(e,n,!0),this}}},this.registerTagItem=function(){return{getOptions:function(){return t.options},removeTag:function(e){t.disabled||t.tagList.remove(e)}}}}],link:function(a,d,g,f){var m,h,y=[n,l,i,t,u,s,c],T=a.tagList,v=a.events,E=a.options,S=d.find("input"),A=["minTags","maxTags","allowLeftoverText"];m=function(){f.$setValidity("maxTags",T.items.length<=E.maxTags),f.$setValidity("minTags",T.items.length>=E.minTags),f.$setValidity("leftoverText",!(!a.hasFocus&&!E.allowLeftoverText)||!a.newTag.text())},h=function(){e((function(){S[0].focus()}))},f.$isEmpty=function(t){return!t||!t.length},a.newTag={text:function(t){return angular.isDefined(t)?(a.text=t,void v.trigger("input-change",t)):a.text||""},invalid:null},a.track=function(t){return t[E.keyProperty||E.displayProperty]},a.getTagClass=function(t,e){var n=t===T.selected;return[a.tagClass({$tag:t,$index:e,$selected:n}),{selected:n}]},a.$watch("tags",(function(t){if(t){if(T.items=p.makeObjectArray(t,E.displayProperty),E.useStrings)return;a.tags=T.items}else T.items=[]})),a.$watch("tags.length",(function(){m(),f.$validate()})),g.$observe("disabled",(function(t){a.disabled=t})),a.eventHandlers={input:{keydown:function(t){v.trigger("input-keydown",t)},focus:function(){a.hasFocus||(a.hasFocus=!0,v.trigger("input-focus"))},blur:function(){e((function(){var t=o.prop("activeElement"),e=t===S[0],n=d[0].contains(t);(e||!n)&&(a.hasFocus=!1,v.trigger("input-blur"))}))},paste:function(t){t.getTextData=function(){var e=t.clipboardData||t.originalEvent&&t.originalEvent.clipboardData;return e?e.getData("text/plain"):r.clipboardData.getData("Text")},v.trigger("input-paste",t)}},host:{click:function(){a.disabled||h()}},tag:{click:function(t){v.trigger("tag-clicked",{$tag:t})}}},v.on("tag-added",a.onTagAdded).on("invalid-tag",a.onInvalidTag).on("tag-removed",a.onTagRemoved).on("tag-clicked",a.onTagClicked).on("tag-added",(function(){a.newTag.text("")})).on("tag-added tag-removed",(function(){a.tags=T.getItems(),f.$setDirty(),h()})).on("invalid-tag",(function(){a.newTag.invalid=!0})).on("option-change",(function(t){-1!==A.indexOf(t.name)&&m()})).on("input-change",(function(){T.clearSelection(),a.newTag.invalid=null})).on("input-focus",(function(){d.triggerHandler("focus"),f.$setValidity("leftoverText",!0)})).on("input-blur",(function(){E.addOnBlur&&!E.addFromAutocompleteOnly&&T.addText(a.newTag.text()),d.triggerHandler("blur"),m()})).on("input-keydown",(function(e){var o,r,d,g,f=e.keyCode,m={};p.isModifierOn(e)||-1===y.indexOf(f)||(m[n]=E.addOnEnter,m[l]=E.addOnComma,m[i]=E.addOnSpace,o=!E.addFromAutocompleteOnly&&m[f],r=(f===t||f===u)&&T.selected,g=f===t&&0===a.newTag.text().length&&E.enableEditingLastTag,d=(f===t||f===s||f===c)&&0===a.newTag.text().length&&!E.enableEditingLastTag,o?T.addText(a.newTag.text()):g?(T.selectPrior(),T.removeSelected().then((function(t){t&&a.newTag.text(t[E.displayProperty])}))):r?T.removeSelected():d&&(f===s||f===t?T.selectPrior():f===c&&T.selectNext()),(o||d||r||g)&&e.preventDefault())})).on("input-paste",(function(t){if(E.addOnPaste){var e=t.getTextData().split(E.pasteSplitPattern);e.length>1&&(e.forEach((function(t){T.addText(t)})),t.preventDefault())}}))}}}]),f.directive("tiTagItem",["tiUtil",function(t){return{restrict:"E",require:"^tagsInput",template:'<ng-include src="$$template"></ng-include>',scope:{$scope:"=scope",data:"="},link:function(e,n,o,i){var r=i.registerTagItem(),a=r.getOptions();e.$$template=a.template,e.$$removeTagSymbol=a.removeTagSymbol,e.$getDisplayText=function(){return t.safeToString(e.data[a.displayProperty])},e.$removeTag=function(){r.removeTag(e.$index)},e.$watch("$parent.$index",(function(t){e.$index=t}))}}}]),f.directive("autoComplete",["$document","$timeout","$sce","$q","tagsInputConfig","tiUtil",function(t,i,s,c,u,l){function d(t,e,n){var o,i,r,a={};return r=function(){return e.tagsInput.keyProperty||e.tagsInput.displayProperty},o=function(t,n){return t.filter((function(t){return!l.findInObjectArray(n,t,r(),(function(t,n){return e.tagsInput.replaceSpacesWithDashes&&(t=l.replaceSpacesWithDashes(t),n=l.replaceSpacesWithDashes(n)),l.defaultComparer(t,n)}))}))},a.reset=function(){i=null,a.items=[],a.visible=!1,a.index=-1,a.selected=null,a.query=null},a.show=function(){e.selectFirstMatch?a.select(0):a.selected=null,a.visible=!0},a.load=l.debounce((function(n,s){a.query=n;var u=c.when(t({$query:n}));i=u,u.then((function(t){u===i&&(t=l.makeObjectArray(t.data||t,r()),t=o(t,s),a.items=t.slice(0,e.maxResultsToShow),a.items.length>0?a.show():a.reset())}))}),e.debounceDelay),a.selectNext=function(){a.select(++a.index)},a.selectPrior=function(){a.select(--a.index)},a.select=function(t){0>t?t=a.items.length-1:t>=a.items.length&&(t=0),a.index=t,a.selected=a.items[t],n.trigger("suggestion-selected",t)},a.reset(),a}return{restrict:"E",require:"^tagsInput",scope:{source:"&",matchClass:"&"},templateUrl:"ngTagsInput/auto-complete.html",controller:["$scope","$element","$attrs",function(t,e,n){t.events=l.simplePubSub(),u.load("autoComplete",t,n,{template:[String,"ngTagsInput/auto-complete-match.html"],debounceDelay:[Number,100],minLength:[Number,3],highlightMatchedText:[Boolean,!0],maxResultsToShow:[Number,10],loadOnDownArrow:[Boolean,!1],loadOnEmpty:[Boolean,!1],loadOnFocus:[Boolean,!1],selectFirstMatch:[Boolean,!0],displayProperty:[String,""]}),t.suggestionList=new d(t.source,t.options,t.events),this.registerAutocompleteMatch=function(){return{getOptions:function(){return t.options},getQuery:function(){return t.suggestionList.query}}}}],link:function(t,i,s,c){var u,d=[n,e,o,r,a],g=t.suggestionList,f=c.registerAutocomplete(),p=t.options,m=t.events;p.tagsInput=f.getOptions(),u=function(t){return t&&t.length>=p.minLength||!t&&p.loadOnEmpty},t.templateScope=f.getTemplateScope(),t.addSuggestionByIndex=function(e){g.select(e),t.addSuggestion()},t.addSuggestion=function(){var t=!1;return g.selected&&(f.addTag(angular.copy(g.selected)),g.reset(),t=!0),t},t.track=function(t){return t[p.tagsInput.keyProperty||p.tagsInput.displayProperty]},t.getSuggestionClass=function(e,n){var o=e===g.selected;return[t.matchClass({$match:e,$index:n,$selected:o}),{selected:o}]},f.on("tag-added tag-removed invalid-tag input-blur",(function(){g.reset()})).on("input-change",(function(t){u(t)?g.load(t,f.getTags()):g.reset()})).on("input-focus",(function(){var t=f.getCurrentTagText();p.loadOnFocus&&u(t)&&g.load(t,f.getTags())})).on("input-keydown",(function(i){var s=i.keyCode,c=!1;if(!l.isModifierOn(i)&&-1!==d.indexOf(s))return g.visible?s===a?(g.selectNext(),c=!0):s===r?(g.selectPrior(),c=!0):s===o?(g.reset(),c=!0):(s===n||s===e)&&(c=t.addSuggestion()):s===a&&t.options.loadOnDownArrow&&(g.load(f.getCurrentTagText(),f.getTags()),c=!0),c?(i.preventDefault(),i.stopImmediatePropagation(),!1):void 0})),m.on("suggestion-selected",(function(t){!function(t,e){var n=t.find("li").eq(e),o=n.parent(),i=n.prop("offsetTop"),r=n.prop("offsetHeight"),a=o.prop("clientHeight"),s=o.prop("scrollTop");s>i?o.prop("scrollTop",i):i+r>a+s&&o.prop("scrollTop",i+r-a)}(i,t)}))}}}]),f.directive("tiAutocompleteMatch",["$sce","tiUtil",function(t,e){return{restrict:"E",require:"^autoComplete",template:'<ng-include src="$$template"></ng-include>',scope:{$scope:"=scope",data:"="},link:function(n,o,i,r){var a=r.registerAutocompleteMatch(),s=a.getOptions();n.$$template=s.template,n.$index=n.$parent.$index,n.$highlight=function(n){return s.highlightMatchedText&&(n=e.safeHighlight(n,a.getQuery())),t.trustAsHtml(n)},n.$getDisplayText=function(){return e.safeToString(n.data[s.displayProperty||s.tagsInput.displayProperty])}}}}]),f.directive("tiTranscludeAppend",(function(){return function(t,e,n,o,i){i((function(t){e.append(t)}))}})),f.directive("tiAutosize",["tagsInputConfig",function(t){return{restrict:"A",require:"ngModel",link:function(e,n,o,i){var r,a,s=t.getTextAutosizeThreshold();(r=angular.element('<span class="input"></span>')).css("display","none").css("visibility","hidden").css("width","auto").css("white-space","pre"),n.parent().append(r),a=function(t){var e,i=t;return angular.isString(i)&&0===i.length&&(i=o.placeholder),i&&(r.text(i),r.css("display",""),e=r.prop("offsetWidth"),r.css("display","none")),n.css("width",e?e+s+"px":""),t},i.$parsers.unshift(a),i.$formatters.unshift(a),o.$observe("placeholder",(function(t){i.$modelValue||a(t)}))}}}]),f.directive("tiBindAttrs",(function(){return function(t,e,n){t.$watch(n.tiBindAttrs,(function(t){angular.forEach(t,(function(t,e){n.$set(e,t)}))}),!0)}})),f.provider("tagsInputConfig",(function(){var t={},e={},n=3;this.setDefaults=function(e,n){return t[e]=n,this},this.setActiveInterpolation=function(t,n){return e[t]=n,this},this.setTextAutosizeThreshold=function(t){return n=t,this},this.$get=["$interpolate",function(o){var i={};return i[String]=function(t){return t},i[Number]=function(t){return parseInt(t,10)},i[Boolean]=function(t){return"true"===t.toLowerCase()},i[RegExp]=function(t){return new RegExp(t)},{load:function(n,r,a,s){var c=function(){return!0};r.options={},angular.forEach(s,(function(s,u){var l,d,g,f,p,m;l=s[0],d=s[1],g=s[2]||c,f=i[l],p=function(){var e=t[n]&&t[n][u];return angular.isDefined(e)?e:d},m=function(t){r.options[u]=t&&g(t)?f(t):p()},e[n]&&e[n][u]?a.$observe(u,(function(t){m(t),r.events.trigger("option-change",{name:u,newValue:t})})):m(a[u]&&o(a[u])(r.$parent))}))},getTextAutosizeThreshold:function(){return n}}}]})),f.factory("tiUtil",["$timeout","$q",function(t,e){var n={debounce:function(e,n){var o;return function(){var i=arguments;t.cancel(o),o=t((function(){e.apply(null,i)}),n)}},makeObjectArray:function(t,e){if(!angular.isArray(t)||0===t.length||angular.isObject(t[0]))return t;var n=[];return t.forEach((function(t){var o={};o[e]=t,n.push(o)})),n},findInObjectArray:function(t,e,o,i){var r=null;return i=i||n.defaultComparer,t.some((function(t){return i(t[o],e[o])?(r=t,!0):void 0})),r},defaultComparer:function(t,e){return n.safeToString(t).toLowerCase()===n.safeToString(e).toLowerCase()},safeHighlight:function(t,e){if(t=n.encodeHTML(t),!(e=n.encodeHTML(e)))return t;var o=new RegExp("&[^;]+;|"+function(t){return t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}(e),"gi");return t.replace(o,(function(t){return t.toLowerCase()===e.toLowerCase()?"<em>"+t+"</em>":t}))},safeToString:function(t){return angular.isUndefined(t)||null==t?"":t.toString().trim()},encodeHTML:function(t){return n.safeToString(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},handleUndefinedResult:function(t,e){return function(){var n=t.apply(null,arguments);return angular.isUndefined(n)?e:n}},replaceSpacesWithDashes:function(t){return n.safeToString(t).replace(/\s/g,"-")},isModifierOn:function(t){return t.shiftKey||t.ctrlKey||t.altKey||t.metaKey},promisifyValue:function(t){return t=!!angular.isUndefined(t)||t,e[t?"when":"reject"]()},simplePubSub:function(){var t={};return{on:function(e,n,o){return e.split(" ").forEach((function(e){t[e]||(t[e]=[]),(o?[].unshift:[].push).call(t[e],n)})),this},trigger:function(e,o){return(t[e]||[]).every((function(t){return n.handleUndefinedResult(t,!0)(o)})),this}}}};return n}]),f.run(["$templateCache",function(t){t.put("ngTagsInput/tags-input.html",'<div class="host" tabindex="-1" ng-click="eventHandlers.host.click()" ti-transclude-append><div class="tags" ng-class="{focused: hasFocus}"><ul class="tag-list"><li class="tag-item" ng-repeat="tag in tagList.items track by track(tag)" ng-class="getTagClass(tag, $index)" ng-click="eventHandlers.tag.click(tag)"><ti-tag-item scope="templateScope" data="::tag"></ti-tag-item></li></ul><input class="input" autocomplete="off" ng-model="newTag.text" ng-model-options="{getterSetter: true}" ng-keydown="eventHandlers.input.keydown($event)" ng-focus="eventHandlers.input.focus($event)" ng-blur="eventHandlers.input.blur($event)" ng-paste="eventHandlers.input.paste($event)" ng-trim="false" ng-class="{\'invalid-tag\': newTag.invalid}" ng-disabled="disabled" ti-bind-attrs="{type: options.type, placeholder: options.placeholder, tabindex: options.tabindex, spellcheck: options.spellcheck}" ti-autosize></div></div>'),t.put("ngTagsInput/tag-item.html",'<span ng-bind="$getDisplayText()"></span> <a class="remove-button" ng-click="$removeTag()" ng-bind="::$$removeTagSymbol"></a>'),t.put("ngTagsInput/auto-complete.html",'<div class="autocomplete" ng-if="suggestionList.visible"><ul class="suggestion-list"><li class="suggestion-item" ng-repeat="item in suggestionList.items track by track(item)" ng-class="getSuggestionClass(item, $index)" ng-click="addSuggestionByIndex($index)" ng-mouseenter="suggestionList.select($index)"><ti-autocomplete-match scope="templateScope" data="::item"></ti-autocomplete-match></li></ul></div>'),t.put("ngTagsInput/auto-complete-match.html",'<span ng-bind-html="$highlight($getDisplayText())"></span>')}])}()}}]);
|