graphdb-workbench 2.8.3 → 2.8.4-RC2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/186.2c2a3daf2e31a391bc75.bundle.js +1 -1
  2. package/dist/23.b33b628c8b874334cdb1.bundle.js +1 -1
  3. package/dist/276.96e3a8f50384cb9d94b1.bundle.js +1 -0
  4. package/dist/348.c84b812c3cefa18bcdd0.bundle.js +1 -1
  5. package/dist/354.17ed256eb667904d08df.bundle.js +1 -1
  6. package/dist/357.bfd7aad3bdb3409ea17c.bundle.js +1 -1
  7. package/dist/358.c1194b10992666401cb5.bundle.js +1 -1
  8. package/dist/359.504a602752407371e3a4.bundle.js +1 -1
  9. package/dist/{36.7c3318e965fb19a54c09.bundle.js → 36.f7a5b5c428a450ac58e4.bundle.js} +1 -1
  10. package/dist/360.ec800e7ccf7c65846eac.bundle.js +1 -1
  11. package/dist/361.b515829257fc43342570.bundle.js +1 -1
  12. package/dist/366.ae0ed01c3b1508919e88.bundle.js +1 -0
  13. package/dist/391.0666a2c713a150170ff5.bundle.js +1 -1
  14. package/dist/403.d87d414670015e4f18cd.bundle.js +1 -1
  15. package/dist/404.4efe8914c8cbf7591932.bundle.js +1 -1
  16. package/dist/405.bb51a207dbe9fbfcd773.bundle.js +1 -1
  17. package/dist/406.0fe82124cb33838472c3.bundle.js +1 -1
  18. package/dist/407.d4525d358e6005ee0b02.bundle.js +1 -1
  19. package/dist/409.3c99979a0c06f995a321.bundle.js +1 -1
  20. package/dist/410.8e4e7b4205a7320a7640.bundle.js +1 -1
  21. package/dist/411.f1439685bbeb41c2ab30.bundle.js +1 -1
  22. package/dist/412.28a43e9de915ef681ee5.bundle.js +1 -1
  23. package/dist/42.245988033c04d2389901.bundle.js +1 -1
  24. package/dist/43.d473040175d53a3dc19a.bundle.js +1 -1
  25. package/dist/{48.2daa6db29a43f428bec3.bundle.js → 48.82a1b994b9ea41abfdbd.bundle.js} +1 -1
  26. package/dist/58.23979cb079b55c610619.bundle.js +1 -0
  27. package/dist/61.8a54322d4b106608e0e8.bundle.js +1 -1
  28. package/dist/72.43568229dc07f2bd1d87.bundle.js +1 -1
  29. package/dist/{bundle.01a28f05ec4d6942eb61.bundle.js → bundle.0e20e82b4c2c1a76cfb5.bundle.js} +3 -3
  30. package/dist/index.html +3 -3
  31. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  32. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  33. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  34. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
  35. package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
  36. package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
  37. package/dist/js/angular/core/templates/modal/modal-warning.html +10 -15
  38. package/dist/js/angular/security/templates/user.html +1 -1
  39. package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
  40. package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
  41. package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
  42. package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
  43. package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
  44. package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
  45. package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +1 -1
  46. package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
  47. package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
  48. package/dist/license-checker.json +2 -25
  49. package/dist/pages/aclmanagement.html +2 -2
  50. package/dist/pages/autocomplete.html +1 -1
  51. package/dist/pages/choose-repository-type.html +1 -1
  52. package/dist/pages/cluster-management/clusterInfo.html +5 -3
  53. package/dist/pages/create-index.html +1 -1
  54. package/dist/pages/dependencies.html +1 -1
  55. package/dist/pages/domainRangeInfo.html +2 -2
  56. package/dist/pages/edit.html +1 -1
  57. package/dist/pages/explore.html +1 -1
  58. package/dist/pages/export.html +1 -1
  59. package/dist/pages/find.html +1 -1
  60. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  61. package/dist/pages/graphs-visualizations.html +7 -7
  62. package/dist/pages/guides.html +1 -1
  63. package/dist/pages/import.html +2 -2
  64. package/dist/pages/jdbc-create.html +1 -1
  65. package/dist/pages/monitor/backup-and-restore.html +1 -1
  66. package/dist/pages/monitor/queries.html +1 -1
  67. package/dist/pages/monitor/resources.html +1 -1
  68. package/dist/pages/namespaces.html +2 -2
  69. package/dist/pages/plugins.html +1 -1
  70. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  71. package/dist/pages/rdfrank.html +2 -2
  72. package/dist/pages/repositories.html +1 -1
  73. package/dist/pages/repository.html +1 -1
  74. package/dist/pages/similarity-indexes.html +1 -1
  75. package/dist/pages/sparql-editor.html +1 -1
  76. package/dist/pages/sparql-template-create.html +1 -1
  77. package/dist/pages/ux-test1.html +2 -2
  78. package/dist/pages/webapi.html +2 -2
  79. package/dist/res/swagger5/index.html +12 -12
  80. package/package.json +1 -2
  81. package/dist/276.3e3057cfdd25bc12ab02.bundle.js +0 -1
  82. package/dist/366.e67318394ed1e5bc4816.bundle.js +0 -1
  83. package/dist/58.cfb0de1cb17f24797a22.bundle.js +0 -1
@@ -1,3 +1,3 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[23,41,42,43,60,61,76,98,158,159,160,161,162,163,164,166,167,200,236,244,288,297,301,326,329],{100:function(e,t,r){"use strict";r.r(t),r.d(t,"removeSpecialChars",(function(){return i})),r.d(t,"toBoolean",(function(){return a})),r.d(t,"toTitleCase",(function(){return o}));var n=r(18);const i=e=>e.replace(/[()']/g,""),a=e=>"string"==typeof e?"true"===e:Boolean(e),o=e=>e?Object(n.upperFirst)(e.toLowerCase()):e},101:function(e,t){function r(e,t){return{showToastMessageWithDelay:function(r){return new Promise(n=>{e.success(t.instant(r)),setTimeout(n,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",r),r.$inject=["toastr","$translate"]},111:function(e,t,r){"use strict";r.r(t),r.d(t,"StartMode",(function(){return n})),r.d(t,"GraphsConfig",(function(){return i}));const n={QUERY:"query",NODE:"node",SEARCH:"search"};class i{constructor(e,t,r=n.SEARCH,i,a=!0,o=!0,s,c,l,d,u,p,f,h,g,m,y,v,x,S,w){this._id=e,this._name=t,this._startMode=r,this._owner=i,this._startQueryIncludeInferred=a,this._startQuerySameAs=o,this._startGraphQuery=s,this._startIRI=c,this._startIRILabel=l,this._expandQuery=d,this._resourceQuery=u,this._predicateLabelQuery=p,this._resourcePropertiesQuery=f,this._shared=h,this._description=g,this._hint=m,this._startGraphQueryDescription=y,this._expandQueryDescription=v,this._resourceQueryDescription=x,this._predicateLabelQueryDescription=S,this._resourcePropertiesQueryDescription=w}isStartMode(e){return this.startMode===e}isDefaultGraph(){return"Minimal"===this.name||"Advanced"===this.name}getPropertyDescription(e){return this[e+"Description"]}getQueryType(e){let t;return this.isStartMode(n.QUERY)&&1===e?t=this.startGraphQuery:2===e?t=this.expandQuery:3===e?t=this.resourceQuery:4===e?t=this.predicateLabelQuery:5===e&&(t=this.resourcePropertiesQuery),t||""}updateModel(e,t){return this.isStartMode(n.QUERY)&&1===t?this.startGraphQuery=e:2===t?this.expandQuery=e:3===t?this.resourceQuery=e:4===t?this.predicateLabelQuery=e:5===t&&(this.resourcePropertiesQuery=e),this}toSavePayload(){return{id:this.id,name:this.name,startMode:this.startMode,owner:this.owner,startQueryIncludeInferred:this.startQueryIncludeInferred,startQuerySameAs:this.startQuerySameAs,startGraphQuery:this.startGraphQuery,startIRI:this.startIRI,startIRILabel:this.startIRILabel,expandQuery:this.expandQuery,resourceQuery:this.resourceQuery,predicateLabelQuery:this.predicateLabelQuery,resourcePropertiesQuery:this.resourcePropertiesQuery,shared:this.shared,description:this.description,hint:this.hint}}get id(){return this._id}set id(e){this._id=e}get name(){return this._name}set name(e){this._name=e}get startMode(){return this._startMode}set startMode(e){this._startMode=e}get owner(){return this._owner}set owner(e){this._owner=e}get startQueryIncludeInferred(){return this._startQueryIncludeInferred}set startQueryIncludeInferred(e){this._startQueryIncludeInferred=e}get startQuerySameAs(){return this._startQuerySameAs}set startQuerySameAs(e){this._startQuerySameAs=e}get startGraphQuery(){return this._startGraphQuery}set startGraphQuery(e){this._startGraphQuery=e}get startIRI(){return this._startIRI}set startIRI(e){this._startIRI=e}get startIRILabel(){return this._startIRILabel}set startIRILabel(e){this._startIRILabel=e}get expandQuery(){return this._expandQuery}set expandQuery(e){this._expandQuery=e}get resourceQuery(){return this._resourceQuery}set resourceQuery(e){this._resourceQuery=e}get predicateLabelQuery(){return this._predicateLabelQuery}set predicateLabelQuery(e){this._predicateLabelQuery=e}get resourcePropertiesQuery(){return this._resourcePropertiesQuery}set resourcePropertiesQuery(e){this._resourcePropertiesQuery=e}get shared(){return this._shared}set shared(e){this._shared=e}get description(){return this._description}set description(e){this._description=e}get hint(){return this._hint}set hint(e){this._hint=e}get startGraphQueryDescription(){return this._startGraphQueryDescription}set startGraphQueryDescription(e){this._startGraphQueryDescription=e}get expandQueryDescription(){return this._expandQueryDescription}set expandQueryDescription(e){this._expandQueryDescription=e}get resourceQueryDescription(){return this._resourceQueryDescription}set resourceQueryDescription(e){this._resourceQueryDescription=e}get predicateLabelQueryDescription(){return this._predicateLabelQueryDescription}set predicateLabelQueryDescription(e){this._predicateLabelQueryDescription=e}get resourcePropertiesQueryDescription(){return this._resourcePropertiesQueryDescription}set resourcePropertiesQueryDescription(e){this._resourcePropertiesQueryDescription=e}}},132:function(e,t,r){"use strict";r.r(t),r.d(t,"mapGraphsConfigResponseToModel",(function(){return i})),r.d(t,"mapGraphConfigSampleToGraphConfig",(function(){return a})),r.d(t,"mapGraphConfigSamplesToGraphConfigs",(function(){return o}));var n=r(111);const i=e=>new n.GraphsConfig(e.id,e.name,e.startMode,e.owner,e.startQueryIncludeInferred,e.startQuerySameAs,e.startGraphQuery,e.startIRI,e.startIRILabel,e.expandQuery,e.resourceQuery,e.predicateLabelQuery,e.resourcePropertiesQuery,e.shared,e.description,e.hint),a=e=>new n.GraphsConfig(e.id,e.name,e.startMode,e.owner,e.startQueryIncludeInferred,e.startQuerySameAs,e.startGraphQuery,e.startIRI,e.startIRILabel,e.expandQuery,e.resourceQuery,e.predicateLabelQuery,e.resourcePropertiesQuery,e.shared,e.description,e.hint,e.startGraphQueryDescription,e.expandQueryDescription,e.resourceQueryDescription,e.predicateLabelQueryDescription,e.resourcePropertiesQueryDescription),o=e=>e.map(e=>a(e))},133:function(e,t,r){"use strict";r.r(t),r.d(t,"STATIC_RULESETS",(function(){return n})),r.d(t,"REPOSITORY_TYPES",(function(){return i})),r.d(t,"FILENAME_PATTERN",(function(){return a})),r.d(t,"NUMBER_PATTERN",(function(){return o}));const n=[{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"}],i={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},a=new RegExp("^[a-zA-Z0-9-_]+$"),o=new RegExp("^[0-9]+$")},151:function(e,t){angular.module("graphdb.framework.rest.graphexplore.data.service",[]).factory("GraphDataRestService",r),r.$inject=["$http"];function r(e){return{getClassHierarchyData:function(t){return e.get("rest/class-hierarchy",{params:{graphURI:t}})},reloadClassHierarchy:function(t){return e.get("rest/class-hierarchy",{params:{doReload:!0,graphURI:t}})},getClassInstances:function(t){return e.get("rest/class-hierarchy/class-instances",{params:{targetUri:t}})},getDomainRangeData:function(t,r){return e.get("rest/domain-range",{params:{targetUri:t,collapsed:r}})},checkDomainRangeData:function(t){return e.head("rest/domain-range",{params:{targetUri:t}})},getRelationshipsData:function(t,r,n){return e.get("rest/dependencies/matrix",{params:{mode:r,classes:_.map(t,(function(e){return e.name})),graphURI:n}})},getRelationshipsClasses:function(t,r){return e.get("rest/dependencies/classes",{params:{mode:t,graphURI:r}})},getRelationshipsStatus:function(t){return e.get("rest/dependencies/status",{params:{graphURI:t}})},calculateRelationships:function(t){return e.get("rest/dependencies/update",{params:{graphURI:t}})},getPredicates:function(t,r,n){return e.get("rest/dependencies/predicates",{params:{from:t,to:r,mode:"all",graphURI:n}})},getInstanceNode:function(t){return e.get("rest/explore-graph/node",{params:t})},getInstanceNodeLinks:function(t){return e.get("rest/explore-graph/links",{params:t})},getProperties:function(t){return e.get("rest/explore-graph/properties",{params:t})},updateGraph:function(t){let r={headers:{"Content-Type":"application/json"}};return r=Object.assign(r,t),e.post("rest/explore-graph/graph",r)},getRdfsLabelAndComment:function(t,r,n){const i=n||{};return e({url:"rest/explore/details",method:"GET",params:_.extend(i,{uri:t,languages:r}),headers:{Accept:"application/json"}})}}}},248:function(e,t){function r(e){return{initLazyList:function(t,r,n,i,a){return e((function(){const e=t+i-1,o=Math.max(0-i,e),s=Math.min(e+r-1,a.length);o>s?n([]):$.isArray(a)&&n(a.slice(o,s+1))}),100,!0)}}}angular.module("graphdb.framework.graphexplore.services.uiscroll",[]).factory("UiScrollService",r),r.$inject=["$timeout"]},249:function(e,t){angular.module("graphdb.framework.graphexplore.services.rdfsdetails",[]).factory("RdfsLabelCommentService",(function(){return{processAndFilterLabelAndComment:function(e){function t(e){const t={};for(let r in e)if(e.hasOwnProperty(r)){let n=r;r.indexOf(":")>-1&&(n=r,r=r.split(":")[1].toLowerCase()),t[r]=e[n]}return t}const r=e.results.bindings,n=[],i=[];_.each(r,(function(e){let r;angular.isUndefined(e.label)||(r=t(e.label),n.push(r)),angular.isUndefined(e.comment)||(r=t(e.comment),i.push(r))}));const a=function(e){return"en"===e.lang||"de"===e.lang},o=$.grep(n,a)[0],s=$.grep(i,a)[0],c=angular.isUndefined(o)?n.length>0?n[0].value:void 0:o.value,l=angular.isUndefined(s)?i.length>0?i[0].value:void 0:s.value;return{rdfsLabel:c,rdfsComment:l}}}}))},250:function(e,t){angular.module("graphdb.framework.rest.graphexplore.savedgraphs.service",[]).factory("SavedGraphsRestService",r),r.$inject=["$http"];function r(e){return{getSavedGraphs:function(){return e.get("rest/explore-graph/saved")},getSavedGraph:function(t){return e.get("rest/explore-graph/saved/"+encodeURIComponent(t))},editSavedGraph:function(t){return e.put("rest/explore-graph/saved/"+encodeURIComponent(t.id),t)},deleteSavedGraph:function(t){return e.delete("rest/explore-graph/saved/"+encodeURIComponent(t.id))},addNewSavedGraph:function(t){return e.post("rest/explore-graph/saved",t)}}}},251:function(e,t,r){"use strict";r.r(t);var n=r(132);angular.module("graphdb.framework.rest.graphconfig.service",[]).factory("GraphConfigRestService",i);function i(e){return{getGraphConfigs:function(){return e.get("rest/explore-graph/config")},getGraphConfigSamples:function(){return e.get("rest/explore-graph/samples")},loadGraphForConfig:function(t,r,n,i){return e.get(`rest/explore-graph/config/graph/${encodeURIComponent(t.id)}?includeInferred=${r}&linksLimit=${n}&sameAsState=${i}`)},getConfig:function(t){return e.get("rest/explore-graph/config/"+encodeURIComponent(t)).then(e=>Object(n.mapGraphsConfigResponseToModel)(e.data))},createGraphConfig:function(t){return e.post("rest/explore-graph/config",t)},updateGraphConfig:function(t){return console.log("rest update",t),e.put("rest/explore-graph/config/"+encodeURIComponent(t.id),t)},deleteGraphConfig:function(t){return e.delete("rest/explore-graph/config/"+encodeURIComponent(t.id))},validateQuery:function(t,r,n,i,a){return e({method:"POST",url:"rest/explore-graph/validate",data:{query:t,queryType:r,params:n,all:i,oneOf:a}})}}}i.$inject=["$http"]},252:function(e,t,r){"use strict";r.r(t);r(13);function n(e,t,r,n,i,a,o,s,c,l,d,u,p,f,h,g,m){e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=()=>angular.noop(),e.currentBrowserLimit=2e3,p.firefox?e.currentBrowserLimit=50:(p.safari||p.msie||p.msedge)&&(e.currentBrowserLimit=400);const y={};let v=0,x=0;t.key="",y.get=function(t,r,n){return c.initLazyList(t,r,n,v,e.instancesObj.items)};let S=allGraphs;const w=function(){if(e.getActiveRepository())return g.resolveGraphs(n.getActiveRepository()).success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,C()})).error((function(t){e.repositoryError=getError(t),o.error(getError(t),m.instant("graphexplore.error.getting.graphs"))}))},C=function(){const t=f.get("classHierarchy-selectedGraph-"+n.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?S=t:f.set("classHierarchy-selectedGraph-"+n.getActiveRepository(),S)},b=function(){return e.instancesObj.items.length<1e3?m.instant("graphexplore.search.class.instances"):m.instant("graphexplore.search.first.class.instances")};t.$watch((function(){return t.key}),(function(){v=0,_.each(e.instancesObj.items,(function(e){t.key>e&&v++})),x++})),y.revision=function(){return x},e.adapterContainer={adapter:{remain:!0}};const I=[];I.push(e.$on("goToDomainRangeGraphView",(function(e,t){E(t)}))),I.push(e.$on("classCount",R)),I.push(e.$on("repositoryIsSet",(function(){if(!i.isLicenseValid())return;if(T===n.getActiveRepository())return;T=n.getActiveRepository();if(e.repositoryError=null,!T)return;S=allGraphs,w().then(N)}))),I.push(t.$on("$translateChangeSuccess",()=>{e.instancesSearchPlaceholder=b()}));function R(t,r,n){e.classCountSlider.options&&e.classCountSlider.options.ceil!==r&&(e.classCountSlider={});var i;e.classCountSlider.value||(e.showExternalElements=!0,e.classCountSlider={value:r,options:{floor:1,ceil:r,vertical:!0,showSelectionBar:!0,onChange:function(){d(k,100,!0)}}},null===f.get(h.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&r>e.currentBrowserLimit&&(i=e.currentBrowserLimit,p.chrome?o.warning(m.instant("graphexplore.disabling.animations",{classLimit:i}),m.instant("graphexplore.reducing.visual.effects")):o.warning(m.instant("graphexplore.browser.performance",{browser:p.name,classLimit:i}),m.instant("graphexplore.reducing.visual.effects"))));const a=f.get(h.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=a&&"true"!==a&&(e.showExternalElements=!0),n?e.classCountSlider.value=n:r>=1500&&(e.classCountSlider.value=1500,o.warning(m.instant("graphexplore.class.count.slider",{count:1500}),m.instant("graphexplore.reducing.class.count"))),r>=25&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=25,e.isWarningShowed=!0,o.warning(m.instant("graphexplore.class.count.browser",{count:25}),m.instant("graphexplore.reducing.class.count"))),d((function(){e.$broadcast("reCalcViewDimensions");const t=document.getElementById("rzslider");let r=0;t.addEventListener("wheel",(function(t){t.preventDefault(),t.stopPropagation();const n=(new Date).getTime();if(!(n-r>100))return;r=n;let i=e.classCountSlider.value;const a=e.classCountSlider.options.step||1;t.deltaY<=-1?i+=a:t.deltaY>=1&&(i-=a),i=Math.max(e.classCountSlider.options.floor,Math.min(e.classCountSlider.options.ceil,i)),i!==e.classCountSlider.value&&e.$apply((function(){e.classCountSlider.value=i,d(k,100,!0)}))}))}),200),k()}function k(){e.currentSliderValue=e.classCountSlider.value}function E(e){const t=e.data.fullName,n=e.data.name;s.checkDomainRangeData(t).success((function(e,i){204===i?o.warning(m.instant("graphexplore.no.domain.range",{name:n})):(f.set(h.CLASS_HIERARCHY_LAST_SELECTED_CLASS,r.hash()),r.hash("").path("domain-range-graph").search("uri",t).search("name",n))})).error((function(){o.error(m.instant("graphexplore.error.request.failed",{name:n}))}))}function L(){r.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,f.clearClassHieararchyState(),e.hidePrefixes="true"===f.get(h.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},t.$broadcast("angucomplete-alt:clearInput")}function A(){e.hasClassHierarchy()&&d((function(){$("#toolbar").removeClass("ng-hide")}),0)}I.push(e.$on("$destroy",()=>{I.forEach(e=>e())})),e.datasource=y,e.goToDomainRangeGraphView=E,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,t.$broadcast("sidePanelClosed")},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return n.getActiveRepository()},e.isSystemRepository=function(){return n.isSystemRepository()},e.confirmReloadClassHierarchy=function(){u.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){L(),e.loader=!0,e.hierarchyError=!1,s.reloadClassHierarchy(S.contextID.uri).success((function(t){e.loader=!1,e.classHierarchyData=t,A(),R()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),o.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){u.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){const r={name:e.title};t.$broadcast("searchedClass",r)}},e.instancesQueryObj.query="",e.instancesFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.instancesQueryObj.query.toLowerCase())>=0},w(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&d((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(t){const r=t.data.fullName;let n=t.data.name;if(n===r){const e=n.lastIndexOf("#");n=n.substring(e+1)}e.encodedUri=encodeURIComponent(r);const i=encodeURIComponent("prefix onto:<http://www.ontotext.com/>\nselect ?s {\n ?s a <"+r+"> .\n}");e.viewInstancesUri="sparql?name="+n+"&infer=true&sameAs=false&query="+i+"&execute=true",s.getRdfsLabelAndComment(r).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment,e.expanded=!1})).error((function(){o.error("Error getting rdfs:label and rdfs:comment")})),e.instancesQueryObj.query="",e.instancesLoader=!0,s.getClassInstances(r).success((function(t){e.instancesObj.items=[],_.each(t,(function(t,r){const n={};n.type=t.startsWith("<<")&&t.endsWith(">>")?"triple":"uri",n.absUri=encodeURIComponent(t),n.absUriNonEncoded=t,n.resolvedUri=r,e.instancesObj.items.push(n)})),e.instancesLoader=!1,e.instancesSearchPlaceholder=b(),e.instancesNotFiltered=e.instancesObj.items})).error((function(){o.error(m.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));let T=n.getActiveRepository();function N(){L(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,s.getClassHierarchyData(S.contextID.uri).success((function(t,r){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=t,207===r&&o.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),A()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),o.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.chosenGraph=function(e){S=e,N(),f.set("classHierarchy-selectedGraph-"+n.getActiveRepository(),S)},e.getSelGraphValue=function(){return S.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelGraphValue()}}angular.module("graphdb.framework.graphexplore.controllers.class",["pageslide-directive","ngAnimate","ui.scroll.jqlite","ui.scroll","angucomplete-alt","rzSlider","toastr","graphdb.framework.utils.localstorageadapter"]).controller("RdfClassHierarchyCtlr",n),n.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]},253:function(e,t,r){"use strict";r.r(t);r(13);function n(e,t,r,n,i,a,o,s,c,l,d,u,p){e.predicatesObj={},e.predicatesQueryObj={},e.predicatesObj.items=[],e.predicatesQueryObj.query="",e.predicatesListNotFiltered=[],e.predicatesSearchPlaceholder="Search predicates",e.onopen=e.onclose=()=>angular.noop();const f={};let h=0,g=0;r.key="",f.get=function(t,r,n){return l.initLazyList(t,r,n,h,e.predicatesObj.items)},r.$watch((function(){return r.key}),(function(){h=0,_.each(e.predicatesObj.items,(function(e){r.key>e&&h++})),g++})),f.revision=function(){return g},e.adapterContainer={adapter:{remain:!0}};const m=o.get(s.DOMAIN_RANGE_COLLAPSE_EDGES);function y(){const e=o.get(s.CLASS_HIERARCHY_LAST_SELECTED_CLASS);t.search("").hash(e).path("hierarchy")}e.collapseEdges=null===m||"true"===m,e.datasource=f,e.$on("reloadDomainRangeGraphView",(function(e,r){const n=r.objectPropClassUri,i=r.objectPropClassName;t.path("domain-range-graph").search("uri",n).search("name",i)})),e.$on("switchEdgeMode",(function(e,r){t.path("domain-range-graph").search("uri",r.uri).search("name",r.name).search("collapsed",r.collapsed)})),e.$on("repositoryIsSet",(function(){if(v===i.getActiveRepository())return;v=i.getActiveRepository();y()})),e.$on("changeCollapsedEdgesState",(function(t,r){e.collapseEdges=!r,o.set(s.DOMAIN_RANGE_COLLAPSE_EDGES,e.collapseEdges)})),e.goToClassHierarchyView=y,e.copyToClipboard=function(e){d.openCopyToClipboardModal(e)},e.toggleCollapseEdgesState=function(){e.collapseEdges=!e.collapseEdges,a.history.pushState({collapsed:e.collapseEdges},"domainRangePage",null)},e.predicatesListFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.predicatesQueryObj.query.toLowerCase())>=0},e.$watch("predicatesObj.items",(function(){e.predicatesObj.items>0&&n((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedPredicate",(function(){e.showPredicatesInfoPanel&&function(t){const r=t.target,n=t.source;e.encodedUri=encodeURIComponent(t.uri),e.sourceTargetObjectNodeUri=r.objectPropClassUri?r.objectPropClassUri:n.objectPropClassUri,e.encodedSourceTargetObjectNodeUri=encodeURIComponent(e.sourceTargetObjectNodeUri),e.sourceTargetObjectNodeName=r.objectPropClassName?r.objectPropClassName:n.objectPropClassName?n.objectPropClassName:"<i>Literal</i>",-1===e.sourceTargetObjectNodeName.indexOf("Literal")?c.getRdfsLabelAndComment(e.sourceTargetObjectNodeUri).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment})).error((function(){u.error(p.instant("domain.range.error.get.label.comment"))})):(e.rdfsComment=void 0,e.rdfsLabel=void 0);e.predicatesObj.items=[],e.predicatesQueryObj.query="";const i=r.allEdges?r.allEdges:n.allEdges;_.each(i,(function(t){const r={};r.absUri=encodeURIComponent(t.uri),r.absUriNonEncoded=t.uri,r.resolvedUri=t.name,r.isImplicit=t.implicit,e.predicatesObj.items.push(r)})),e.predicatesListNotFiltered=e.predicatesObj.items}(e.selectedPredicate)})),$(document).ready((function(){$(".compact-mode-toggle").click((function(){$(".tooltip").hide()}))}));let v=i.getActiveRepository()}angular.module("graphdb.framework.graphexplore.controllers.domainrange",["ui.scroll.jqlite","ui.scroll","ngSanitize","graphdb.framework.utils.localstorageadapter"]).controller("DomainRangeGraphCtlr",n),n.$inject=["$scope","$location","$rootScope","$timeout","$repositories","$window","LocalStorageAdapter","LSKeys","GraphDataRestService","UiScrollService","ModalService","toastr","$translate"]},254:function(e,t,r){(function(e){const t="WAIT",r="NO_REPO",n="READY",i="IN_PROGRESS",a="ERROR",o={contextID:{type:"all",value:"all.graphs.label",uri:""}};function s(e){if(e<1e3)return e;const t=Math.floor(Math.log(e)/Math.log(1e3));let r=e/Math.pow(1e3,t);return r=r%1>1/Math.pow(1e3,t-1)?r.toFixed(2):r.toFixed(0),r+["K","M","G","T","P","H"][t-1]}function c(e,s,c,l,d,u,p,f,h,g,m){let y=null;e.status=c.getActiveRepository()?t:r;let v=o;const x=function(){g.resolveGraphs(c.getActiveRepository()).success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,S(),e.isSystemRepository()?"READY"!==e.status&&C():(e.status="WAIT",C(!0))})).error((function(t){e.repositoryError=getError(t),l.error(getError(t),m.instant("graphexplore.error.getting.graph"))}))},S=function(){const t=h.get("dependencies-selectedGraph-"+c.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?v=t:h.set("dependencies-selectedGraph-"+c.getActiveRepository(),v)},w=function(r){d3.select("#dependencies-chord").html(""),e.status=t,u.getRelationshipsData(r,e.direction,v.contextID.uri).success((function(t){e.dependenciesData={matrix:t.right,nodes:t.left,hasLinks:_.sum(_.map(t.right,(function(e){return _.sum(e)})))>0,direction:e.direction},e.status=n})).error((function(t){e.status=n,l.error(getError(t),m.instant("graphexplore.error.dependencies.count"))}))},C=function(r){(e.status!==n||r)&&(e.status=t,u.getRelationshipsStatus(v.contextID.uri).success((function(t){if(e.status=t,e.status===i){if(null!==y)return;y=d(C,2e3)}e.status===n&&(null!==y&&(d.cancel(y),y=null),u.getRelationshipsClasses(e.direction,v.contextID.uri).success((function(t,r){e.allClasses.items=_.filter(t,k),e.allNotFilteredClasses=t,e.selectedClasses=void 0,angular.isUndefined(e.selectedClasses)&&(e.selectedClasses=t.slice(0,10)),w(e.selectedClasses),207===r&&l.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed"))}))),0===e.status.indexOf("ERROR;")&&(e.status=a,l.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})))})).error((function(t){e.status=a,l.error(getError(t),m.instant("graphexplore.error.dependencies.count.status"))})))};e.allClasses={},e.allClasses.items=[],e.allNotFilteredClasses=[],e.direction="all";const b={};let I=0,R=0;function k(t){return-1!==t.name.toLowerCase().indexOf(e.classQuery.query.toLowerCase())}s.key="",b.get=function(t,r,n){p.initLazyList(t,r,n,I,e.allClasses.items)},s.$watch((function(){return s.key}),(function(){I=0,_.each(e.allClasses.items,(function(e){s.key>e&&I++})),R++})),b.revision=function(){return R},e.datasource=b,e.adapterContainer={adapter:{remain:!0}},e.classQuery={},e.classQuery.query="",e.classFilterFunc=k,e.$watch("allClasses.items",(function(){e.allClasses.items.length>0&&d((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("direction",(function(){!c.getActiveRepository()||e.isSystemRepository()||c.isActiveRepoFedXType()||x()})),e.$on("$destroy",(function(){d.cancel(y)})),e.isLoading=function(){return e.status===i||e.status===t},e.confirmCalculateDependencies=function(){f.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.relationships"),warning:!0}).result.then((function(){e.calculateDependencies()}))},e.calculateDependencies=function(){e.status=t,e.selectedClasses=void 0,u.calculateRelationships(v.contextID.uri).success((function(t){0===t.indexOf("ERROR;")?l.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})):C()})).error((function(e){l.error(m.instant("graphexplore.error.could.not.force.count",{error:getError(e)}))}))},e.addClass=function(t){e.selectedClasses.push(t),w(e.selectedClasses)},e.removeClass=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t.name})),w(e.selectedClasses)},e.showClass=function(t){e.classToShow=t},e.isClassByNameShown=function(t){return void 0!==_.find(e.selectedClasses,{name:t})},e.addClassByName=function(t){e.selectedClasses.push(_.find(e.allClasses.items,{name:t})),w(e.selectedClasses)},e.removeClassByName=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t})),w(e.selectedClasses)},e.removeAllClasses=function(){e.selectedClasses=[],w(e.selectedClasses)},e.isSystemRepository=function(){return"SYSTEM"===c.getActiveRepository()};const E=e.$on("repositoryIsSet",(function(){e.classQuery={},e.classQuery.query="",e.repositoryError=null,v=o,c.getActiveRepository()&&!c.isActiveRepoFedXType()?x():e.status=r}));window.addEventListener("beforeunload",(function e(){E(),window.removeEventListener("beforeunload",e)})),e.selectGraph=function(e){v=e,C(!0),h.set("dependencies-selectedGraph-"+c.getActiveRepository(),v)},e.getSelectedGraphValue=function(){return v.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelectedGraphValue()}}Object.defineProperty(e,"allGraphs",{get:()=>o}),angular.module("graphdb.framework.graphexplore.controllers.dependencies",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).controller("DependenciesChordCtrl",c).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]).filter("humanize",(function(){return s})),c.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","GraphDataRestService","UiScrollService","ModalService","LocalStorageAdapter","RDF4JRepositoriesRestService","$translate"]}).call(this,r(15))},255:function(e,t,r){"use strict";r.r(t);r(9),r(23),r(47);var n=r(550),i=r(562),a=(r(13),r(133)),o=r(100),s=r(8);function c(e,t,r,c,l,d,u,p,f,h,g,m,y,v,x,S,w,C,b,I,R,k,E){e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=I.instant("visual.search.instance.placeholder"),e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=f.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=I.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=I.instant("sidepanel.invalid.limit.links.tooltip"),e.datasource=void 0,e.adapterContainer={adapter:{remain:!0}},e.hasInitedRepository=!1,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=_.cloneDeep(e.defaultSettings),e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},t.key="",e.onopen=e.onclose=()=>angular.noop(),e.goToHome=()=>{T(),f.url("graphs-visualizations")},e.shouldShowSettings=()=>e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id,e.shouldDisableSameAs=()=>{const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.propertiesFilterFunc=t=>t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0,e.toggleMoreInfo=e=>{angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=e=>{m.openCopyToClipboardModal(e)},e.resetSettings=()=>{e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),D()},e.changeLimit=t=>{let r=e.settings.linksLimit+t;r<1&&(r=1),r>1e3&&(r=1e3),e.settings.linksLimit=r},e.validateLinksLimit=()=>{e.invalidLimit=!a.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=()=>{e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),D()},e.updateSettings=()=>{e.invalidLimit?l.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,(function(e){return e.text})),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,(function(e){return e.text})),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,(function(e){return e.text})),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,(function(e){return e.text})),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,(function(e){return e.text})),e.rootNodeIri?O(e.rootNodeIri):e.queryResultsMode&&f.search().query?j(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&q(e.configLoaded),P(),e.showInfoPanel=!1,e.showFilter=!1,x.set(S.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=t=>{C.getGraphConfigs().success((function(r){e.graphConfigs=r,t&&t()})).error((function(e){l.error(getError(e),I.instant("graphexplore.error.graph.configs.short.msg"))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=t=>{e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=t=>{m.openSimpleModal({title:I.instant("common.confirm"),message:I.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){C.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){l.error(getError(e),I.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=e=>{A({config:e.id},{config:e}),T(),q(e)},e.replaceIRIWithPrefix=t=>{const r=e.namespaces,n=_.findLast(r,(function(e){return 0===t.indexOf(e.uri)}));return n?n.prefix+":"+t.substring(n.uri.length):t};const L=[];L.push(t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=I.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=I.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=I.instant("visual.search.instance.placeholder")}))),L.push(k.onAutocompleteEnabledUpdated(t=>{e.isAutocompleteEnabled=t})),L.push(k.onSelectedRepositoryIdUpdated(t=>{t?E.getNamespaces(t).then(t=>{e.repositoryNamespaces=t,e.namespaces=t.namespaces}).catch(e=>{const t=getError(e);l.error(t,I.instant("error.getting.namespaces.for.repo"))}):e.repositoryNamespaces=new s.NamespacesListModel})),L.push(e.$on("repositoryIsSet",(function(t,r){r.newRepo&&(e.hasInitedRepository=!1),ce(r.newRepo),r.newRepo&&(T(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),M()))})));L.push(t.$watch(()=>t.key,()=>{W=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&W++})),V++}));L.push(e.$watch("propertiesObj.items",()=>{angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&d((function(){e.adapterContainer.adapter.reload()}),500)}));e.$on("$destroy",()=>{L.forEach(e=>e())});const A=(t,r)=>{e.embedded&&(t.embedded=!0),f.search(t),f.state(r)},T=()=>{e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,Y={},K=0},N=()=>R.isActive()?e.defaultSettings:e.saveSettings,P=()=>{N().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none")},D=()=>{e.settings.languagesMap=_.map(e.settings.languages,(function(e){return{text:e}})),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,(function(e){return{text:e}})),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,(function(e){return{text:e}})),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,(function(e){return{text:e}})),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,(function(e){return{text:e}}))},O=()=>{e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},M=()=>{f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,j(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,r){e.loading=!0;const n=N();angular.isDefined(r)&&(e.rootNodeIri=r,b.getInstanceNode({iri:r,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),se=new oe;const r=se.addNode(t.data,re/2,ne/2);te=ee,Re(r,!0)})).catch((function(t){e.loading=!1,l.error(getError(t),I.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri,!0),f.search().saved&&w.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);l.error(t,I.instant("graphexplore.error.could.not.open"))}))},j=(t,r,n)=>{const i=N(),a=void 0===r?i.sameAsState:!0===r,o=void 0===n?i.includeInferred:!0===n;e.loading=!0,b.updateGraph({query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:o,sameAsState:a}).then((function(e){be(e)}),(function(t){e.loading=!1,l.error(getError(t.data),I.instant("graphexplore.error.cannot.load.graph"))}))},G=(e,t)=>{const r=e.split(" ");return t?[r[0],r[1],r[2]].join(">"):[r[0],r[2]].join(">")},Q=e=>[e.source.iri,e.target.iri].join(">"),U=e=>{if(e.isTriple){const t=document.getElementById(Object(o.removeSpecialChars)(G(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},H=e=>{if(e.isTriple){const t=document.getElementById(Object(o.removeSpecialChars)(G(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},F=e=>{const t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`},z=e=>{const t=e.source.isTriple?G(e.source.iri,!0):e.source.iri,r=e.target.isTriple?G(e.target.iri,!0):e.target.iri;return Object(o.removeSpecialChars)(`${t}>${r}>marker`)},q=t=>{e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?d((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,C.loadGraphForConfig(t,t.startQueryIncludeInferred,N().linksLimit,t.startQuerySameAs).then((function(e){be(e)}),(function(t){e.loading=!1,l.error(getError(t),I.instant("graphexplore.error.graph.load"))})))},B=function(){var t,r;f.search().config?(t=f.search().config,r=M,t===e.defaultGraphConfig.id?q(e.defaultGraphConfig):C.getConfig(t).then(e=>{q(e),r()}).catch(e=>{l.error(getError(e),I.instant("graphexplore.error.could.not.load.config",{configId:t}))})):f.search().query||f.search().uri?(q(e.defaultGraphConfig),M()):M()};v.onpopstate=function(t){T(),t.state&&(t.state.config?(q(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))},e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);let W=0,V=0,Y={},K=0;const X=16,Z=d3.zoom().scaleExtent([.1,10]);let J;const ee=d3.zoomIdentity.translate(0,-70).scale(1);Z.on("zoom",(function(e){R.isActive()||(te=e.transform,J.attr("transform",te))}));let te=ee;const re=1e3,ne=1e3;let ie,ae;function oe(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,r){return e.x=t,e.y=r,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(r){const n=r.source.iri,i=r.target.iri,a=_.min([n,i])+"|"+_.max([n,i]);t[a]||(t[a]=1,e[n]=(e[n]||0)+1,e[i]=(e[i]||0)+1)})),_.each(this.links,(function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0}))},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){let r,n;r=e.isTripleSource?Te(e.source):_.find(t,(function(t){return t.iri===e.source})),n=e.isTripleTarget?Te(e.target):_.find(t,(function(t){return t.iri===e.target}));let i={source:r,target:n,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${i.source.isTriple?G(i.source.iri):i.source.iri}>${i.target.isTriple?G(i.target.iri):i.target.iri}`;if(se.tripleLinksCopy.has(e)){let t=se.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),se.tripleLinksCopy.set(e,t),null}se.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of se.tripleLinksCopy.keys())1===se.tripleLinksCopy.get(e).length&&se.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return r(e,t).length};function r(e,t){return _.filter(t,(function(t){return t.source.iri===e.iri||t.target.iri===e.iri}))}this.countLinks=t,this.linksTypes=function(e,t){const n=r(e,t),i=_.map(n,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const n=r(e,t),i=_.map(n,(function(e){return e.predicates}));return _.uniq(_.flatten(i))},this.removeTriples=function(e){let t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,(function(r){let n=e.split(">"),i=G(r.source.iri),a=G(r.target.iri);if(i===e&&se.tripleNodes.delete(a)){let e=a.split(">");t.push({source:e[0],target:e[1]})}let o=i===e||a===e||r.source.iri===n[0]&&r.target.iri===n[1];return o&&(se.tripleLinksCopy.delete(`${i}>${a}`),se.tripleLinksCopy.delete(`${a}>${i}`)),o})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(r){let n=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===r.iri||e.target.iri===r.iri;return t&&(e.target.isTriple&&n.push(G(e.target.iri)),e.source.isTriple||e.target.isTriple||n.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(n);const i=this.links;this.nodes=_.reject(this.nodes,(function(e){return 0===t(e,i)})),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){let n=[],i=this.links;this.links=_.reject(this.links,(function(a){let o=a.source.iri===e.iri&&1===t(a.target,i)&&!a.target.isTriple||a.target.iri===e.iri&&1===t(a.source,i)&&!a.source.isTriple;if(!o){let n;if(a.source.iri!==e.iri||2!==t(a.target,i)||a.target.isTriple?a.target.iri!==e.iri||2!==t(a.source,i)||a.source.isTriple||(n=r(a.source,i)):n=r(a.target,i),!n)return!1;o=(n[0].source.iri===e.iri||n[0].target.iri)&&(n[1].source.iri===e.iri||n[1].target.iri)}return o&&(a.target.isTriple&&n.push(G(a.target.iri)),a.source.isTriple||a.target.isTriple||n.push([a.source.iri,a.target.iri].join(">"))),o})),this.removeTriples(n),i=this.links,this.nodes=_.reject(this.nodes,(function(r){return 0===t(r,i)&&r.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,r){e.x=t,e.y=r,e.weight=0;let n=G(e.iri);if(this.tripleNodes.has(n)){let t=this.tripleNodes.get(n);t.push(e),this.tripleNodes.set(n,t)}else e.weight=10,this.tripleNodes.set(n,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:_.cloneDeep(e.labels),types:_.cloneDeep(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),r=JSON.stringify(Array.from(this.tripleLinksCopy.entries()));return{nodes:e,links:_.map(this.links,(function(e){return{source:e.source.iri,isTripleSource:e.source.isTriple,target:e.target.iri,isTripleTarget:e.target.isTriple,predicates:e.predicates}})),tripleNodes:t,tripleLinksCopy:r,colorIndex:K,type2color:Y,transform:te}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=_.cloneDeep(t.nodes),this.tripleNodes=t.tripleNodes?new Map(JSON.parse(t.tripleNodes)):new Map,this.links=[],this.addAndMatchLinks(t.links),this.tripleLinksCopy=t.tripleLinksCopy?new Map(JSON.parse(t.tripleLinksCopy)):new Map,_.each(this.nodes,(function(t){t.fixed&&e.numberOfPinnedNodes++})),angular.isDefined(t.colorIndex)&&angular.isDefined(t.type2color)&&(K=t.colorIndex,Y=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(te=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),ve()}}e.datasource={get:function(t,r,n){return g.initLazyList(t,r,n,W,e.propertiesObj.items)},revision:function(){return V}},p.when(h.getPrincipal()).then(t=>(t=>{const r=t.appSettings;e.defaultSettings.includeInferred=r.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=r.DEFAULT_INFERENCE&&r.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=r.DEFAULT_VIS_GRAPH_SCHEMA;const n=x.get(S.GRAPHS_VIZ);if(n&&"object"==typeof n)try{e.saveSettings=n,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch(t){e.saveSettings=_.cloneDeep(e.defaultSettings),x.set(S.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)})(t)),e.showInfoPanel=!1;let se=new oe;function ce(t){!r.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(B))}e.addedTag=function(t){return t.text.indexOf(":")<0?(l.warning(I.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const r=e.split(":"),n=r[0],i=r[1];if(!angular.isUndefined(i)){const e=u.getNamespaceUriForPrefix(t,n);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,r){if(e.text.indexOf(":")<0)return r?l.warning(I.instant("graphexplore.absolute.prefixed.iri.option"),t):l.warning(I.instant("graphexplore.absolute.prefixed.iri"),t),!1;const n=e.text.indexOf("*");if(n>=0){if(!r)return l.warning(I.instant("graphexplore.wildcards.not.allowed"),t),!1;if(n<e.text.length-1)return l.warning(I.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLicenseValid=function(){return c.isLicenseValid()},ce();const le=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),de=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(Y[e])&&(Y[e]=K,K++);const t=Y[e];return t>39?"#c2c2c2":t%2==0?le(t/2):de(t/2)};const ue=d3.forceX(re/2).strength(.005),pe=d3.forceY(ne/2).strength(.005),fe=d3.forceSimulation().force("x",ue).force("y",pe),he=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+re+" "+ne).attr("preserveAspectRatio","xMidYMid meet");he.append("rect").attr("width",10*re).attr("height",10*ne).attr("x",-(10*re-re)/2).attr("y",-(10*ne-ne)/2).style("fill","none").style("pointer-events","all").call(Z).on("click",(function(e){e.stopPropagation(),ke(),fe.stop()}));let ge=0,me=0;const ye=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=2.8.3").attr("x",(function(){return e.x-e.size+5})).attr("y",(function(){return e.y-e.size})).attr("width",(function(){return 2*e.size})).attr("height",(function(){return 2*e.size})).attr("class","node-loader")}};function ve(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),J=he.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(te)&&!t?te:""}));const r=Object(i.a)().attr("class","d3-tip").customPosition((function(){const e=ie.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let r="";return t.fixed&&(r+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?r+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):r+="<i>No types</i>",r})),a=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,r){if(0===r)return Pe(t);if(r<10)return" · "+Pe(t);if(10===r){const t=function(e){return e.predicates.length-10}(e),r=t>1?t+" predicates":t+" predicate";return" · "+I.instant("graphexplore.tip.text",{textToShow:r})}})),""),t};let s;const c=Object(i.a)().attr("class","d3-tip").customPosition((function(e){const t=s.getBoundingClientRect(),r=function(e){const t=a(e),r=document.createElement("canvas").getContext("2d");return r.font="13px Arial",e.predicates.length<10?r.measureText(t).width:r.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:r+"px"}})).html((function(e){return a(e)}));const u=function(){d.cancel(void 0),d.cancel(ge),ie=null,r.hide(),me=d((function(){ke()}),500)};he.call(r);he.call(c);let p=he.selectAll(".link"),f=he.selectAll(".node");const h=d3.forceCollide(e=>e.size+5).strength(.5),g=d3.forceManyBody().strength(-300),m=d3.forceCenter(re/2,ne/2);fe.nodes(se.nodes).force("charge",g).force("collide",h).force("center",m).force("link",d3.forceLink(se.links).distance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),r=e.predicates[0].split("/"),n=r[r.length-1];t.addClass("predicate-text").text(n),$("body").append(t);const i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness}))),J.append("defs").selectAll("marker").data(se.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return z(e)})).attr("viewBox","0 -5 10 10").attr("refX",(function(e){return e.target.isTriple?11:e.target.size+11})).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),p=J.selectAll(".link").data(se.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return Object(o.removeSpecialChars)(Q(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${z(e)})`}));const y=J.selectAll(".link-wrapper").append("text").text((function(e){return Ne(e)})).attr("class",(function(e){return e.predicates.length>1||se.tripleNodes.has(Q(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",N().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){d.cancel(void 0);const r=s=e.target;d((function(){s===r&&t.predicates.length>1&&c.show(t,s)}),300)}(e,t)})).on("mouseout",(function(){d.cancel(void 0),s=null,c.hide()})).on("click",(function(t,r){t.stopPropagation(),function(t,r){Ae();const n=Q(r);if(1===r.predicates.length&&se.tripleNodes.has(n)){ae=null;const e=se.tripleNodes.get(n)[0];if(we(e,this,t.button)){const t={};t.iri=e.iri,t.pred=Pe(e.iri.split(" ")[1]),Le(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,ae===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(ae=null);ae=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){const r=function(e,t){const r=Q(t);return se.tripleNodes.has(r)?se.tripleNodes.get(r).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),n=r>-1;return{value:Pe(e),partOfTriple:n,linkId:n?Q(t):"",nodeIndex:r}})),e.showInfoPanel=!0)}(r)}(t,r)}));let v,x=0,S=null,w=null;const C=function(t,r,n){let i=n||this.parentNode;Array.isArray(n)&&(i=n[r]);se.countLinks(t,se.links)<=N().linksLimit?Re(t,!1,i):l.info(I.instant("graphexplore.increase.limit"),I.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function b(e,t){let r,n,i,a,o=!0;if("down"===t)r=2*e.size,n=e.size/3,i=.8,a=.3;else if("down-fixed"===t)r=2*e.size,n=e.size,i=.8,a=.66;else if("up"===t)r=e.size/3,n=2*e.size,i=.3,a=.8;else{if("fixed"!==t)return;r=e.size,i=.66,o=!1}let s=J.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",r+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",i);"fixed"!==t&&"down-fixed"!==t||(e.pin=s),o&&(s=s.transition().duration(1e3).style("font-size",(function(){return n+"px"})).attr("opacity",a),"down-fixed"!==t&&s.remove())}const k=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(R.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,ke(),d3.select(this).classed("dragging",!0),fe.alphaTarget(.3).restart())})).on("drag",(function(t,r){r.isBeingDragged&&(r.fx=t.x,r.fy=t.y,r.fixed?r.beginDragging&&b(r,"fixed"):(e.numberOfPinnedNodes++,r.fixed=!0,b(r,"down-fixed")),r.pinWasFixed=!0,r.beginDragging=null)})).on("end",(function(e,t){t.isBeingDragged&&(t.pinWasFixed&&(t.pinWasFixed=null,d3.select(".pinned").remove()),t.isBeingDragged=!1,d3.select(this).classed("dragging",!1));fe.alphaTarget(0)}));f=J.selectAll(".node").data(se.nodes).enter().append("g").attr("class","node-wrapper").attr("id",(function(e){return e.iri})).append("circle").attr("class","node").attr("r",(function(e){return e.size})).style("fill",(function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])})).on("mouseover",(function(t,n){n.isBeingDragged||(d.cancel(me),ge=d(()=>{(function(t,r){if(e.showInfoPanel)return!1;(Se.closeIcon||Se.expandIcon||Se.focusIcon||Se.copyURIIcon)&&Se.removeIcons();if(fe.alpha()<.1)return Se.initIcons(t,r.parentNode),fe.stop(),xe(),!0;return!1})(n,this)&&function(e,t){d.cancel(void 0);const n=ie=t.target;d((function(){ie===n&&r.show(e,ie)}),300)}(n,t)},400))})).on("mouseout",u).on("click",(function(t,r){if(t.button&&0!==t.button)return;const n=this;if(S&&w===n)return d.cancel(S),S=null,void C(r,0,n.parentNode);w=n,u(),e.showPredicates=!1,R.isActive()||(d.cancel(S),S=d((function(){we(r,n,t),S=null}),540))})).on("touchstart",(e,t)=>function(e){x=0,v=d((function(){x<5&&Ce(e),v=null}),1e3)}(t)).on("touchmove",(function(){x++})).on("touchend",(function(){d.cancel(v),v=null})).on("contextmenu",(function(t,n){t.shiftKey||(t.preventDefault(),ke(),e.closeInfoPanel(),n.fixed?(e.numberOfPinnedNodes--,n.fixed=!1,n.fx=null,n.fy=null,b(n,"up"),fe.alpha(1).restart()):(e.numberOfPinnedNodes++,n.fixed=!0,b(n,"down")),function(e){ie&&r.show(e,ie)}(n))})).on("gdb-expand-node",(e,t)=>C(t,0,e.srcElement.parentNode)).on("gdb-show-node-info",(e,t)=>Ee(t)).call(k);const E=J.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));J.insert("g").attr("class","menu-events"),(e=>{e.each((function(e){e.fontSize=n.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,X,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").text((function(e){return e.labels[0].label})),d((function(){$(".node-label-body div").each((function(e,t){let r=t.textContent.substring(0,t.textContent.length-1);let n=0;for(;n<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)r=r.substring(0,r.length-1),t.textContent=r+"…",n++}))}),50)})(E),fe.on("tick",(function(){p.attr("x1",(function(e){return U(e.source)})).attr("y1",(function(e){return H(e.source)})).attr("x2",(function(e){return U(e.target)})).attr("y2",(function(e){return H(e.target)})),y.attr("x",(function(e){let t=U(e.source),r=U(e.target);return e.x=.5*(t+r)})).attr("y",(function(e){let t=H(e.source),r=H(e.target);return e.y=.5*(t+r)})).attr("transform",(function(e){return"rotate("+function(e,t){const r={x:U(e.source),y:H(e.source)},n={x:U(e.target),y:H(e.target)};if(t)return 180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;{const e=180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"})),f.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),J.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),J.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),E.attr("x",(function(e){return e.x-1.75*e.size})).attr("y",(function(e){return e.y-3*e.fontSize/2})),d3.select(".pinned").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})),xe()})),angular.isDefined(ye)&&ye.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(r){const n=Object(o.removeSpecialChars)(r.source.iri),i=Object(o.removeSpecialChars)(r.target.iri);if(n===t&&i===e){let e=n;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),r.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),fe.alpha(.3).restart()}function xe(){t.d3alpha=fe.alpha()}const Se=new function(){function r(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(n,a){const o=Object(i.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){const r=t.target.getBoundingClientRect();return{top:r.top-20+"px",left:r.right+10+"px"}})).html((function(e){return e}));he.call(o);n.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return r(20,n)})),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--primary-color)"),this.collapseIcon.on("click",(function(){var e;(e=n).isExpanded=!1,se.removeNodeLeafLinks(e),ve()})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),d.cancel(ge),d.cancel(me)})).on("mouseout",(function(){o.hide(),me=d((function(){ke()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return r(20,n)})),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--primary-color)"),this.expandIcon.on("click",(function(){Re(n,!1,a)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){o.hide(),me=d((function(){ke()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return r(20,n)})),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--primary-color)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",n.iri)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){o.hide(),me=d((function(){ke()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return r(20,n)})),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--primary-color)"),this.copyURIIcon.on("click",(function(){e.copyToClipboard(n.iri),ke(),o.hide()})).on("mouseover",(function(e){o.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>",e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){o.hide(),me=d((function(){ke()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return r(20,n)})),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--primary-color)"),this.closeIcon.on("click",(function(){Ce(n)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){o.hide(),me=d((function(){ke()}),500)})),this.animateMenu(n)},this.animateMenu=function(e){const t=d3.easeSin;let n=0;let i=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return r(i,e)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return r(i,e)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,r(i,e)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,r(i,e)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,r(i,e)})).delay(n+=35),this.expandedState=!0}};function we(r,n,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",r.iri),!1):i.ctrlKey||i.metaKey?(Ce(r),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===r?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(Ee(r),!0)}function Ce(e){se.removeNode(e),ve()}function be(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),se=new oe,te=ee}(t),Ie(t)}function Ie(t,r,n){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(se.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));const a=[],o=se.tripleLinksCopy.values();for(let e=0;e<se.tripleLinksCopy.size;e++){o.next().value.forEach(e=>{a.push(e)})}i=_.filter(i,(function(e){return-1===_.findIndex(a,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),i=_.filter(i,(function(e){return e.source!==e.target}));const s=((e,t)=>{const r=t.map(t=>t[e]);return t.filter((t,n)=>r.indexOf(t[e])===n)})("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),c=_.map(se.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),d=se.tripleNodes.values();for(let e=0;e<se.tripleNodes.size;e++){d.next().value.forEach(e=>{c.push({iri:e.iri,isTriple:e.isTriple})})}const u=_.reject(s,(function(e){return _.some(c,e)}));if(0===u.length)(n||0===i.length)&&l.info(I.instant("graphexplore.error.node.connections")),se.addAndMatchLinks(i),ve();else{const t=[],n=[],a=N();_.forEach(u,(function(r,i){t.push(b.getInstanceNode({iri:r.isTriple?F(r.iri):r.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?a.languages:[],includeInferred:a.includeInferred,sameAsState:a.sameAsState}).then((function(e){n[i]=e.data})))})),p.all(t).then((function(){_.forEach(n,(function(e,t){const i=2*Math.PI*t/n.length,a=(r?r.x:0)+Math.cos(i)*ne/3,o=(r?r.y:0)+Math.sin(i)*ne/3;e.isTriple?se.addTriple(e,a,o):se.addNode(e,a,o)})),se.addAndMatchLinks(i),r&&(r.isExpanded=!0),ve()}))}}function Re(t,r,n){if(ye.getLoadingState())return;ye.init(t,n);const i=N(),a=t.iri;b.getInstanceNodeLinks({iri:a,linksLimit:i.linksLimit,includeInferred:i.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?i.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?i.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?i.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?i.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?i.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?i.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?i.languages:[],sameAsState:i.sameAsState,includeSchema:i.includeSchema}).then((function(e){Ie(e,t,r)}),(function(t){const r=getError(t.data);l.error(r,I.instant("graphexplore.error.exploring.node")),e.loading=!1,ye.setLoadingState(!1)}))}function ke(){angular.isDefined(Se)&&Se.expandedState&&Se.removeIcons()}function Ee(t){fe.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(F(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const r=N();b.getProperties({iri:t.isTriple?F(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState,rejectedPredicates:e.shouldShowSettings()?r.rejectedPredicates:[]}).then((function(t){e.data=_.mapKeys(t.data,(function(t,r){return e.replaceIRIWithPrefix(r)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,r){e.propertiesObj.items.push({key:r,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const r=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));r&&(e.nodeImage=r.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){l.warning(getError(e.data),"Error")}))}function Le(e){_e("predicate","var(--primary-color-dark)",e),_e("predicates","var(--primary-color-dark)",e);const t=document.getElementsByClassName("link");t&&_.each(t,(function(t){const r=t.__data__;(r.source.iri.indexOf(e.iri)>=0||r.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.style.strokeWidth=4)}));const r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(t){const r=t.__data__;(r.source.iri.indexOf(e.iri)>=0||r.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function _e(e,t,r){const n=document.getElementsByClassName(e);n&&_.each(n,(function(e){const n=e.__data__;r?((n.source.iri.indexOf(r.iri)>=0||n.target.iri.indexOf(r.iri)>=0)&&(e.style.fill=t),G(r.iri)===Q(n)&&(e.textContent=r.pred,e.style.fill=t),r.oppLinkIRI&&r.oppLinkIRI===Q(n)&&(e.textContent=r.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Ne(n))}))}function Ae(){_.each(e.predicates,(function(e){const t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));const t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),_e("predicate",""),_e("predicates","");const r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Te(e){const t=G(e);if(se.tripleNodes.has(t))return se.tripleNodes.get(t).find(t=>t.iri===e)}function Ne(e){return e.predicates.length>1?e.predicates.length+" predicates":Pe(e.predicates[0])}function Pe(t){const r=e.replaceIRIWithPrefix(t);return r.length===t.length?t.split("/")[t.split("/").length-1]:r}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],ae=null,d((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(se.tripleNodes.has(t.linkId)){Ae();const r=se.tripleNodes.get(t.linkId)[t.nodeIndex];Ee(r),e.showPredicates=!0;const n=document.getElementById(t.linkId+t.nodeIndex);n&&(n.style.fontWeight="bold");const i={},a=se.tripleLinksCopy.values();for(let e=0;e<se.tripleLinksCopy.size;e++){const e=a.next().value;e.length>1&&e.every(t=>t.source.iri===r.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=G(t.target.iri),i.oppTriplePred=Pe(t.target.iri.split(" ")[1])),i.pred=Pe(r.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==r.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=G(t.source.iri),i.oppTriplePred=Pe(t.source.iri.split(" ")[1])),i.pred=Pe(r.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=r.iri,i.pred=Pe(r.iri.split(" ")[1])),Le(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLoadingLocation=function(){return r.isLoadingLocation()},e.hasActiveLocation=function(){return r.hasActiveLocation()},e.rotate=function(e){ke();const t=10*(e?1:-1)*Math.PI/180,r=Math.cos(t),n=Math.sin(t),i=re/2,a=ne/2;d3.selectAll(".node-wrapper").each((function(e){e.x=i+(r*(e.x-i)+n*(e.y-a)),e.y=a+(-n*(e.x-i)+r*(e.y-a)),e.fixed&&(e.fx=e.x,e.fy=e.y)})),fe.alpha(1).restart()},e.openUri=function(t,r){if(!r){const r={};e.configLoaded.id!==e.defaultGraphConfig.id&&(r.config=e.configLoaded.id),r.uri=t,A(r,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(se.copyState()),r={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};r.id?e.saveGraphModal("update",r):e.saveGraphModal("new",r)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const De=function(t){w.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),l.success(I.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);l.error(t,I.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,r,n){y.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:r,graphExists:n,shared:r.shared}}}}).result.then((function(t){if(t.restart)e.saveGraphModal(t.mode,t.graph,!1);else switch(t.mode){case"new":!function(t){e.configLoaded&&(t.config=e.configLoaded.id),w.addNewSavedGraph(t).success((function(r,n,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),l.success(I.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(r,n){if(422===n)e.saveGraphModal("new",t,!0);else{const e=getError(r);l.error(e,I.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":De(t.graph)}}))},e.refreshSavedGraphs=function(){w.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);l.error(t,I.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,r){t.owner?(e.lastSavedGraphName=t.name,e.lastSavedGraphId=t.id,e.shared=t.shared,e.configLoaded=e.findConfigById(t.config)):(e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=t.shared),e.configLoaded||(e.configLoaded=e.defaultGraphConfig),f.url("?saved="+t.id),se.restoreState(JSON.parse(t.data)),r||A({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){const r=[location.protocol,"//",location.host,location.pathname,"?saved=",t.id].join("");e.copyToClipboard(r)},e.deleteSavedGraph=function(t){m.openSimpleModal({title:I.instant("common.confirm"),message:I.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){w.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),l.success(I.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);l.error(t,I.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,r){return r.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){ke();const t=angular.isUndefined(e.numberOfPinnedNodes)||e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(r){r.fixed=t,t?(e.numberOfPinnedNodes++,r.fx=r.x,r.fy=r.y):(r.fx=null,r.fy=null)})),fe.alpha(1).restart()},$("body").on("keydown",(function(t){!R.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function l(e,t,r,n){switch(e.mode=r.mode,e.graph=_.cloneDeep(r.graph),e.graphExists=r.graphExists,e.mode){case"new":e.title=n.instant("graphexplore.create.new.graph"),e.okButtonText=n.instant("common.create.btn");break;case"update":e.title=n.instant("graphexplore.update"),e.okButtonText=n.instant("common.save.btn");break;case"rename":e.title=n.instant("graphexplore.rename"),e.okButtonText=n.instant("common.save.btn")}e.ok=function(){e.form.$valid&&t.close({graph:e.graph,mode:e.mode})},e.saveNew=function(){e.graph.name=e.graph.name+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("GraphsVisualizationsCtrl",c).controller("SaveGraphModalCtrl",l).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),c.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","ClassInstanceDetailsService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","$translate","GuidesService","WorkbenchContextService","RDF4JRepositoriesService"],l.$inject=["$scope","$uibModalInstance","data","$translate"]},256:function(e,t,r){"use strict";r.r(t);r(101),r(13),r(23);var n=r(96),i=r(89),a=r(19),o=r(111),s=r(132),c=r(8);function l(e,t,r,l,d,u,p,f,h,g,m,y,v,x,S,w,C){let b;t.newConfig=new o.GraphsConfig,t.revertConfig=void 0,t.page=1,t.totalPages=5,t.helpHidden=1===y.get(v.HIDE_GRAPH_CONFIG_HELP),t.isUpdate=!1,t.shared=!1,t.canEditActiveRepo=t.canWriteActiveRepo(),t.samples=[],t.tabConfig={inference:t.newConfig.startQueryIncludeInferred,sameAs:t.newConfig.startQuerySameAs},t.isAutocompleteEnabled=void 0,t.repositoryNamespaces=void 0,t.tabsViewModel=[];const I=g.configName,R=u.getActiveRepository();t.toggleHelp=e=>{void 0===e&&(e=y.get(v.HIDE_GRAPH_CONFIG_HELP)),1!==e?(y.set(v.HIDE_GRAPH_CONFIG_HELP,1),t.helpHidden=!0):(y.set(v.HIDE_GRAPH_CONFIG_HELP,0),t.helpHidden=!1)},t.fixedVisualCallback=(e,r)=>{t.newConfig.startIRI=e,t.newConfig.startIRILabel=r,b=!0},t.isDefaultGraph=e=>e.isDefaultGraph(),t.isUserGraph=e=>!e.isDefaultGraph(),t.getSampleName=(e,t)=>{if(!e)return"";const r=e.getPropertyDescription(t);return r||(e.id?"Copy of "+e.name:e.name)},t.createGraphConfig=e=>{h.createGraphConfig(e).success((async function(){await m.showToastMessageWithDelay("graphexplore.saved.new.config"),l.url("graphs-visualizations")})).error((function(e){d.error(getError(e),x.instant("graphexplore.error.could.not.create"))}))},t.updateGraphConfig=e=>{h.updateGraphConfig(e).success((async function(){await m.showToastMessageWithDelay("graphexplore.saved.config"),l.url("graphs-visualizations")})).error((function(e){d.error(getError(e),x.instant("graphexplore.error.could.not.save"))}))},t.goToPage=e=>{t.page!==e&&N(()=>{t.showEditor(),t.page=e})},t.goToPreviousPage=()=>{t.page>1&&t.goToPage(t.page-1),M()&&(b=!1)},t.goToNextPage=()=>{$(),t.newConfig.isStartMode(o.StartMode.NODE)&&!b||t.goToPage(t.page+1)},t.saveGraphConfig=()=>{$(),M()&&!b||(t.newConfig.startQueryIncludeInferred=t.tabConfig.inference,t.newConfig.startQuerySameAs=t.tabConfig.sameAs,N(()=>{t.newConfig.name?(t.queryEditorIsDirty=!1,t.isUpdate?t.updateGraphConfig(t.newConfig.toSavePayload()):t.createGraphConfig(t.newConfig.toSavePayload())):D(x.instant("graphexplore.provide.config.name"))}))},t.setQuery=async e=>{const r=e||" ";(await k()).setQuery(r),t.markDirty()},t.markDirty=async()=>{if(t.revertConfig){const e=t.revertConfig.getQueryType(t.page),r=await A();t.queryEditorIsDirty=e!==r}},t.showEditor=()=>{t.viewMode="yasr",T(),_()},t.showPreview=()=>{t.viewMode="editor",E()},t.revertEditor=()=>{t.setQuery(t.revertConfig.getQueryType(t.page)),t.queryEditorIsDirty=!1};const k=()=>a.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor"),E=async(e,r)=>{const n=await k(),i=await n.getQueryType();if(r&&"SELECT"!==i&&"CONSTRUCT"!==i&&"DESCRIBE"!==i)return void d.warning(x.instant("query.editor.warning.msg"));"update"!==await n.getQueryMode()?t.queryIsRunning||(t.viewMode="editor",L()):d.warning(x.instant("cannot.execute.update.error"))},L=async()=>{(await k()).query(i.RenderingMode.YASR)},_=async()=>(await k()).changeRenderMode(i.RenderingMode.YASQE),A=async()=>(await k()).getQuery(),T=async()=>(await k()).abortQuery(),N=async e=>{const r=await(async()=>{const e=await k();let r=await e.getQuery();return r=r.trim(),t.newConfig.updateModel(r,t.page)})();1===t.page?r.isStartMode(o.StartMode.NODE)&&!r.startIRI?D(x.instant("graphexplore.select.start.node")):r.isStartMode(o.StartMode.QUERY)&&!r.startGraphQuery?D(x.instant("graphexplore.provide.query")):r.isStartMode(o.StartMode.QUERY)?O(e,r.startGraphQuery,"graph"):e():2===t.page?O(e,r.expandQuery,"construct",["node"]):3===t.page?O(e,r.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===t.page?O(e,r.predicateLabelQuery,"tuple",["edge"],["label"]):5===t.page&&O(e,r.resourcePropertiesQuery,"tuple",["node"],["property","value"])},P=()=>{t.tabConfig.inference=t.newConfig.startQueryIncludeInferred,t.tabConfig.sameAs=t.newConfig.startQuerySameAs,t.setQuery(t.newConfig.getQueryType(t.page))},D=e=>{d.warning(e)},O=(e,t,r,n,i,a)=>{t?h.validateQuery(t,r,n,i,a).success(()=>{e()}).error(e=>{D(getError(e))}):e()},$=()=>{M()&&t.$broadcast("addStartFixedNodeAutomatically",{startIRI:t.newConfig.startIRI})},M=()=>1===t.page&&t.newConfig.isStartMode(o.StartMode.NODE),j=()=>{h.getGraphConfigSamples().success((function(e){t.samples=Object(s.mapGraphConfigSamplesToGraphConfigs)(e).filter(e=>!e.id||t.newConfig.id!==e.id||(t.revertConfig=e,!1))})).error((function(e){d.error(getError(e),x.instant("graphexplore.error.graph.configs"))}))},G={endpoint:()=>"repositories/"+u.getActiveRepository(),showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showYasqeActionButtons:!1,yasqeActionButtons:a.INFERRED_AND_SAME_AS_BUTTONS_CONFIGURATION,showQueryButton:!1,initialQuery:" ",componentId:"graphs-config",render:i.RenderingMode.YASQE,maxPersistentResponseSize:0,showYasqeResizer:!1,yasqeMode:n.YasqeMode.PROTECTED,infer:t.newConfig.startQueryIncludeInferred,sameAs:t.newConfig.startQuerySameAs},Q=(e,r,n)=>{t.queryIsRunning=e},U=()=>{window.removeEventListener("beforeunload",H),z.forEach(e=>e())},H=e=>{t.queryEditorIsDirty&&(e.returnValue=!0)},F=()=>{t.tabsViewModel=[{page:1,label:x.instant("starting.point.label"),type:"startGraphQuery"},{page:2,label:x.instant("graph.expansion"),type:"expandQuery"},{page:3,label:x.instant("node.basics"),type:"resourceQuery"},{page:4,label:x.instant("edge.basics"),type:"predicateLabelQuery"},{page:5,label:x.instant("node.extra"),type:"resourcePropertiesQuery"}]},z=[];z.push(w.onSelectedRepositoryIdUpdated(e=>{e?C.getNamespaces(e).then(e=>{t.repositoryNamespaces=e}).catch(e=>{const t=getError(e);d.error(t,x.instant("error.getting.namespaces.for.repo"))}):t.repositoryNamespaces=new c.NamespacesListModel})),z.push(w.onAutocompleteEnabledUpdated(e=>{t.isAutocompleteEnabled=e})),z.push(t.$on("$locationChangeStart",(e,r)=>{if(t.queryEditorIsDirty){e.preventDefault();((e,t,r,n)=>{S.openSimpleModal({title:e,message:t,warning:!0}).result.then((function(){angular.isFunction(r)&&r()}),(function(){angular.isFunction(n)&&n()}))})(x.instant("common.confirm"),x.instant("visual.config.warning.unsaved.changes"),()=>{U();const e=l.absUrl().length-l.url().length,t=r.substring(e);l.path(t)})}else U()})),z.push(t.$on("$destroy",U)),z.push(t.$watch(t.getActiveRepositoryObject,()=>{(t.newConfig.isStartMode(o.StartMode.QUERY)||t.page>1)&&(t.viewMode="yasr",T().then(_))})),z.push(e.$on("$translateChangeSuccess",()=>{F()})),window.addEventListener("beforeunload",H),t.$watch("newConfig.startMode",e=>{e===o.StartMode.QUERY&&P()}),t.$watch("page",e=>{(t.newConfig.isStartMode(o.StartMode.QUERY)||e>1)&&(t.showEditor(),P())}),F(),u.getPrefixes(R).then(e=>(e=>{const r=t.$watch((function(){return t.getActiveRepositoryObject()}),(function(i){if(i){t.canEditActiveRepo=t.canWriteActiveRepo();const i=angular.extend({},G,{prefixes:e,yasqeMode:t.canWriteActiveRepo()?n.YasqeMode.WRITE:n.YasqeMode.PROTECTED});t.yasguiConfig=i,r()}}))})(e)).finally(()=>Q(!1)),I?(t.isUpdate=!0,h.getConfig(I).then((function(e){t.newConfig=e,j()})).catch(e=>{d.error(getError(e),x.instant("created.connector",{name:I}))})):(t.isUpdate=!1,j()),t.getActiveRepository()&&(Q(!0,x.instant("common.refreshing.namespaces"),x.instant("common.extra.message")),u.getPrefixes(u.getActiveRepository()).then(e=>{t.namespaces=e}).catch((function(e){t.repositoryError=getError(e)})).finally((function(){Q(!1)})))}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("GraphConfigCtrl",l),l.$inject=["$rootScope","$scope","$timeout","$location","toastr","$repositories","SparqlRestService","$filter","GraphConfigRestService","$routeParams","Notifications","LocalStorageAdapter","LSKeys","$translate","ModalService","WorkbenchContextService","RDF4JRepositoriesService"]},257:function(e,t,r){"use strict";r.r(t);var n=r(562),i=r(587),a=r(550),o=r(551);r(13);function s(e,t,r,s,c,l,d,u,p,f,h,g,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(d,y,v){!function(d,y){var v,x,S=d3.pack().size([780,780]),w=d3.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),C=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function b(){return C.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function I(){return"true"===h.get(g.CLASS_HIERARCHY_HIDE_PREFIXES)}function R(){var e=o.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.8.3");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=o.a.Export.generateBase64ImageSource("#classChart svg");d3.select(this).attrs({href:t,download:"class-hierarchy-"+l.getActiveRepository()+".svg"})}d.hidePrefixes=I();var k,E,L=b();if(!d.classHierarchyData.classCount&&l.getActiveRepository()&&!l.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=h.get("classHierarchy-selectedGraph-"+l.getActiveRepository());r.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,r,n){e.loader=!1,207===r&&u.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),d.classHierarchyData=t,d3.select("#download-svg").on("mouseover",R)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(m.instant("graphexplore.error.request.failed",{name:f,error:getError(t)}))}))}var A,T,N,P,D,O,M,j={};function G(r,o,l,u){T&&T(),N&&N(),d3.selectAll("#main-group").remove(),L=b(),i.a.SingleChild.addPlaceholders(r,!0),(x=d3.hierarchy(r)).sum((function(e){return e.size})),A=l||x,S(x);var h,g=x.descendants();A.isInFocusTransitive=!0,i.a.SingleChild.removePlaceholders(g),i.a.SingleChild.centerNodes(g),i.a.SingleChild.makePositionsRelativeToZero(g),v||(v=Object(n.a)().attr("class","d3-tip").customPosition((function(e,t){return{top:"inherit",bottom:s.innerHeight-t.clientY+"px",right:s.innerWidth-t.clientX+"px"}})).html((function(e){return e.data.name})),C.call(v));var m=L.selectAll("circle").data(g).enter().append("g");o.doFade&&m.each((function(e){a.a.Transition.fadeIn(d3.select(this),550)}));var y,I=[],R=m.append("circle").attr("class",(function(e){return e.data.role})).attr("guide-selector",(function(e){return"class-"+e.data.name})).style("fill",(function(e){return e.children?w(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.data.name!==f){var t=e.data.name;I.push({name:t}),j[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(t){o.noPrefixes||e.textHidden?v.show(e,t):v.hide(e)})),e.circle.on("mouseout",v.hide)}})).on("gdb-focus",(e,t)=>E(t)).on("gdb-zoom",(e,t)=>z(t));function P(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),y=e}function D(){d.showClassInfoPanel=!1}I&&(I=_.uniqBy(I,"name"),d.flattenedClassNames=I);var O=a.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(O),E=function(e){z(e),e.data.name===f?(D(),d3.selectAll(".selected").classed("selected",!1)):(P(e),d.selectedClass=y,d.showClassInfoPanel=!0,d.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},O.on("click",(function(e,t){t.data.id&&s.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),v.hide(),E(t)})),O.on("dblclick",(function(t,n){n!==r&&(v.hide(),P(n),e.$broadcast("goToDomainRangeGraphView",y,A),t.stopPropagation())}));var $=0;C.on("wheel",(function(e){v.hide(),e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-$>100){$=t;var r="";e.deltaY<=-1?r="in":e.deltaY>=1&&(r="out");var n=e.target.__data__;if(n||(n=A),"in"===r){if(n!==A){for(;n.parent&&!n.parent.isInFocusTransitive;)n=n.parent;n.depth<A.depth&&(n=A)}if(n===A&&n.children){for(var i=n.children[0],a=1;a<n.children.length;a++)n.children[a].sortingRank>i.sortingRank&&(i=n.children[a]);i.children&&(n=i)}else n.children||(n=n.parent);z(n,!0)}else"out"===r&&(n=A.parent)&&z(n,!0);A.data.name===f&&s.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),Q()}}));var M=L.selectAll("text").data(g).enter().append("text").attr("class",(function(e){return e.children&&e.children.length?"label":"label child-label"})).each((function(e){e.textSel=d3.select(this)}));o.noPrefixes?(M.each((function(e){var t=e.data.name.indexOf(":");e.data.name.indexOf("http://")>-1?e.noPrefixName=e.data.name:t>-1&&(e.noPrefixName=e.data.name.substring(t+1))})),M.style("font-size",(function(e){return a.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return a.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):M.style("font-size",(function(e){return a.a.Text.calcFontSize(e.data.name,e.r)})).text((function(e){return a.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r/3)})),M.style("display",(function(e){return e.parent&&e.parent.data===A.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),o.doFade&&!o.keepPrevState&&M.each((function(e){a.a.Transition.fadeIn(d3.select(this),550)})),k=function(){function e(e){e&&R.each((function(t){+e===t.data.id&&E(t)}))}var r=t.hash();s.onpopstate=function(t){t.state&&e(t.state.id)},e(r)};var G=L.selectAll("circle, text");function U(e,t){var r=800/e[2];h=e,G.attr("transform",(function(t){return"translate("+(t.x-e[0])*r+","+(t.y-e[1])*r+")"})),R.attr("r",(function(e){return e.r*r})),t&&M.each((function(e){e.data.fullName!==A.data.topLevelParentUri&&A.data.topLevelParentUri!==f||(e.textSel.style("display","none"),A.children&&A.children.length?_.each(A.children,(function(e){e.textSel.style("display","inline")})):A.textSel.style("display","inline"),A.parent&&_.each(A.parent.children,(function(e){e.data.name!==A.data.name&&e.textSel.style("display","inline")})))})),M.style("font-size",(function(e){return o.noPrefixes?a.a.Text.calcFontSize(e.noPrefixName,e.r*r):a.a.Text.calcFontSize(e.data.name,e.r*r)})).text((function(e){return o.noPrefixes?a.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*r/3):a.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*r/3)}))}function H(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function F(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display=""):(e.textHidden=!0,this.style.display="none")}function z(e,t){if(c((function(){d.showExternalElements=e.data.name===f})),A!==e&&(e.data.id&&s.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),e.children||(e=e.parent,A!==e))){if(t&&(D(),d3.selectAll(".selected").classed("selected",!1)),A.parent)for(var r=A;r;)r.isInFocusTransitive=!1,r=r.parent;for(r=e;r;)r.isInFocusTransitive=!!r.children,r=r.parent;if(2*(A=e).r/(2*A.r+20)<.3||d.currentSliderValue>d.currentBrowserLimit)U([A.x,A.y,H(A.r)]),M.each((function(e){F.call(this,e)}));else d3.transition().duration(p).tween("zoom",(function(e){var t=d3.interpolateZoom(h,[A.x,A.y,H(A.r)]);return function(e){U(t(e))}})).selectAll("text").each(F)}}U([A.x,A.y,H(A.r)],u),T=d.$on("rootFocus",(function(){s.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),E(x)})),N=d.$on("classSearch",(function(e){E(e)}))}function Q(){const t=d.classHierarchyData.classCount;let r=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!r||r>t)&&(r=t,h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,r)),e.$broadcast("classCount",t,r)}window.addEventListener("resize",Q),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",Q),window.removeEventListener("beforeunload",e)})),d.$watch("classHierarchyData",(function(){P&&P(),D&&D(),O&&O(),M&&M();var e=I();if(d.classHierarchyData.classCount){Q();var t=_.cloneDeep(d.classHierarchyData);var r,n,i=function(e){return e.descendants().sort((function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0}))}(d3.hierarchy(t));function a(e,t){const i={keepPrevState:!0,noPrefixes:I()};n=i.noPrefixes,G(r||e,i,A,!0),c((function(){h.set(g.CLASS_HIERARCHY_SWITCH_PREFIXES,t),k()}),70)}function o(e,i,o){if(!e)return;h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),r={name:f,children:[]};const s=new Set;for(let t=1;t<=e;t++)s.add(i[t].data.id),i[t].parent===i[0]&&r.children.push(i[t].data);if(function e(t){if(!t.children)return;const r=[];for(const e of t.children)s.has(e.id)&&r.push($.extend({},e));t.children=r;for(const r of t.children)e(r)}(r),o){n=angular.isUndefined(n)?I():n;G(r,{noPrefixes:n})}else a(t)}var s,l=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(l)o(l,i);else{var u={doFade:!0,keepPrevState:!0,noPrefixes:I()};G(t,u),k()}P=d.$watch("hidePrefixes",(function(r){angular.isUndefined(r)||e?e=void 0:c((function(){!function(e){angular.isUndefined(e)||h.set(g.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(r),a(t,!0)}),50)}),!0),D=d.$watch("currentSliderValue",(function(e){o(e,i,!0)}),!0),M=d.$on("onEnterKeypressSearchAction",(function(e){s&&E(s)})),O=d.$on("searchedClass",(function(e,t){(s=j[t.name])&&E(s)}))}}),!0)}(d)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",s),s.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},258:function(e,t,r){"use strict";r.r(t);var n=r(551),i=r(550);r(13);function a(e,t,r,a,o,s,c,l,d,u,p,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(u){const p=l((function(){!function(u){var p=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),g=d3.forceSimulation(),m=d3.drag().subject((function(e){return e})).on("start",(function(e,t){g.stop(),t.fx=e.x,t.fy=e.y,d3.select(this).classed("selected",!0)})).on("end",(function(e,t){t.fx=null,t.fy=null,d3.select(this).classed("selected",!1),w?(g.alpha(.2).restart(),w=!1):g.restart()})).on("drag",(function(e,t){w=!0,g.alphaTarget(0).restart(),t.fx=e.x,t.fy=e.y})),y=p.append("defs");y.append("marker").attrs({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),y.append("marker").attrs({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),y.append("marker").attrs({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var e=n.a.Export.getCSSRules("css/domain-range-graph.css?v=2.8.3");$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>");var t=n.a.Export.generateBase64ImageSource("#domain-range svg");d3.select(this).attrs({href:t,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})})),function(){var e=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");e.append("rect").attrs({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var t=16+1200/18/2.5,r=t+1200/90;e.append("circle").attrs({class:"legend-class-node",cx:(16+t)/2,cy:30,r:1200/18/4.5}),e.append("text").attrs({x:r,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node"),e.append("circle").attrs({class:"legend-object-node",cx:(16+t)/2,cy:70,r:1200/110/1.25}),e.append("text").attrs({x:r,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node"),e.append("circle").attrs({class:"legend-datatype-node",cx:(16+t)/2,cy:70+1200/45,r:1200/110/2}),e.append("text").attrs({x:r,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node"),e.append("line").attrs({class:"property-arrow",x1:16,y1:123.33333333333334,x2:t,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+o.absUrl()+"#arrow)"),e.append("text").attrs({x:r,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property"),e.append("line").attrs({class:"implicit-property-arrow",x1:16,y1:150,x2:t,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+o.absUrl()+"#arrow)"),e.append("text").attrs({x:r,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property"),e.append("line").attrs({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:t,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+o.absUrl()+"#collapsed-arrow)"),e.append("text").attrs({x:r,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property")}();var v=o.search().uri,x=o.search().name;const S=o.search().collapsed;(function(e,t){a.getDomainRangeData(e,t).success((function(e,t,r){u.domainRangeGraphData=e})).error((function(e){d.error("Request for "+x+" failed!")}))})(v,S),$(window).on("popstate",(function(){s.set(c.DOMAIN_RANGE_WENT_BACK,!0)})),t.onpopstate=function(t){t.state&&e.$broadcast("changeCollapsedEdgesState",t.state.collapsed)},u.$watch("collapseEdges",(function(){angular.isUndefined(u.collapseEdges)||(s.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,u.collapseEdges),"true"!==s.get(c.DOMAIN_RANGE_WENT_BACK)&&function(t){e.$broadcast("switchEdgeMode",{uri:v,name:x,collapsed:t})}(u.collapseEdges),s.remove(c.DOMAIN_RANGE_WENT_BACK))})),u.$watch("domainRangeGraphData",(function(){if(u.domainRangeGraphData){var r=_.cloneDeep(u.domainRangeGraphData);const P=r.nodes,D=r.links;g.nodes(P).force("x",d3.forceX(600)).force("y",d3.forceY(300)).force("charge",d3.forceManyBody().strength(-800)).force("link",d3.forceLink(D).distance(1200/3.5));var n=p.selectAll(".link").data(D).enter().append("g");function a(e){e.style("stroke",f),e.style("stroke-width",2),e.attr("marker-end","url("+o.absUrl()+"#collapsed-arrow)")}var s,c,d=0;n.each((function(e){if(e.objectPropNodeClassUri!==v)s=n.append("line").attrs({class:"link","marker-end":"url("+o.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(e){switch(e.propertyType){case"objectLeft":e.targetRadius=1200/18;break;case"objectRight":e.targetRadius=1200/110;break;case"datatype":e.targetRadius=1200/110/2;break;default:e.targetRadius=0}var t=d3.select(this);e.targetNodeEdgeCount>1?a(t):e.implicit&&t.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(c)){c=d3.select(this).append("path").attrs({d:"M 0 0 A "+1200/18/2+" "+1200/18/2+" 0 1 1 0 "+1200/18/2,class:"loop-link",fill:"none","marker-end":"url("+o.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(d+=e.targetNodeEdgeCount)>1&&a(d3.select(".loop-link"))}}));var y={};function S(){$.isEmptyObject(y)||(y.text.style("fill","black"),y.background.style("fill","#f0f0f0"))}function w(e,t){S(),y.text=d3.select(this),y.background=d3.select(this.previousSibling),y.text.style("fill","white"),y.background.style("fill",f),l((function(){u.showPredicatesInfoPanel=!0,u.selectedPredicate=t})),e.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",S)}));var C=n.append("text").attr("class",(function(e){return e.objectPropNodeClassUri===v?"loop-link-property-name":"property-name"})).attr("dx",(function(e){return 1200/18/2*("objectLeft"===e.propertyType?1:-1)})).style("text-anchor",(function(e){return"objectLeft"===e.propertyType?"end":"start"})).style("font-size",1200/90).text((function(e){return e.targetNodeEdgeCount>1?e.targetNodeEdgeCount+" predicates":e.name}));C.each((function(e){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",w):r.on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.uri),"_blank")}))}));var b=n.append("rect").attr("class",(function(e){return e.objectPropNodeClassUri!==v?"link-background":"loop-link-background"})).attr("width",(function(e){return e.calculatedWidth=this.previousSibling.getBBox().width,e.calculatedWidth+4})).attr("height",(function(e){return e.calculatedHeight=this.previousSibling.getBBox().height,e.calculatedHeight+2})).attr("transform",(function(e){var t=2-1200/18/2*("objectLeft"===e.propertyType?1:-1);return"objectLeft"===e.propertyType&&(t+=e.calculatedWidth),"translate(-"+t+",-"+(2+e.calculatedHeight/2)+")"})).on("click",(function(e){e.stopPropagation()})),I=p.selectAll(".node").data(P).enter().append("g"),R=I.filter((function(e){return e.objectPropClassUri!==v})).append("circle").each((function(e){var t=d3.select(this);"main"===e.classPosition?t.attrs({class:"class-node",r:1200/18}).attr("marker-end","url("+o.absUrl()+"#loop-link)"):null===e.objectPropClassName?t.attrs({class:"datatype-node",r:1200/110/2}):t.attrs({class:"object-prop-node",r:1200/110})})).call(m);d3.selectAll(".object-prop-node").on("dblclick",(function(t,r,n){u.$apply((function(){e.$broadcast("reloadDomainRangeGraphView",r,n)}))})),I.filter((function(e){return e.objectPropClassName&&e.objectPropClassUri!==v})).append("text").attr("class",(function(e){return e.classPosition+"-class-label"})).style("font-size",1200/90).text((function(e){return e.objectPropClassName})).on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.objectPropClassUri),"_blank")}));var k=I.select("text");p.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(e){return i.a.Text.calcFontSize(x,1200/18)})).text(x).on("click",(function(){t.open("resource?uri="+encodeURIComponent(v),"_blank")}))}));var E=p.select(".class-node + text"),L=d3.select(".class-node"),A=d3.selectAll(".loop-link-background"),T=d3.selectAll(".loop-link-property-name");if(C=d3.selectAll(".property-name"),!angular.isUndefined(c)){var N=[];A.each((function(e,t){d3.select(this);N.push({idx:t,width:e.calculatedWidth,height:e.calculatedHeight})}))}g.on("tick",(function(e){var t=8*g.alpha();function r(e){var t=e.x+1200/18*2,r=e.y-1200/18/1.9;var n=[];A.each((function(i,a){n.push(i),a<h?function(n,i){var a=$.grep(N,(function(e){return e.idx==i}));i>0&&(t+=parseFloat(i*(a[0].height/(i/1.4)))),n.attrs({transform:"rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")",width:a[0].height,height:a[0].width})}(d3.select(this),a):d3.select(this).remove()})),function(e){var t;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(r){r.target.allEdges=e,t=this.getComputedTextLength()})).on("click",w),d3.select(".view-more-preds-rect").attr("height",t+4)}(n)}s.filter((function(e){return e.objectPropNodeClassUri!==v})).attr("x1",(function(e){return e.source.x})).attr("y1",(function(e){return e.source.y})).attr("x2",(function(e){return e.targetX})).attr("y2",(function(e){return e.targetY})).each((function(e){!function(e){"objectLeft"===e.propertyType?(e.source.x-=8*t,e.source.y-=t/9):(e.target.x+=8*t,e.target.y-=t/9)}(e);var r=Math.atan2(e.target.y-e.source.y,e.target.x-e.source.x);e.targetX=e.target.x-Math.cos(r)*e.targetRadius,e.targetY=e.target.y-Math.sin(r)*e.targetRadius})),R.each((function(e){"main"!==e.classPosition||angular.isUndefined(c)||(!function(e){var t=e.x+64,r=e.y-1200/18/5.7-5;c.attr("transform","rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")")}(e),function(e){function t(t,r){var n=$.grep(N,(function(e){return e.idx==r})),i=0;r>0&&(i=parseFloat(2*r*(n[0].height/1.4)));var a=e.x,o=e.y-1200/18*2.1-i;t.attrs({x:a,y:o}).moveToFront()}T.each((function(e,r){var n=d3.select(this),i=T.size()-h;i<0?t(n,r):(0==r&&!u.collapseEdges&&i>1&&(!function(e,t,r){e.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&t.classed("view-more-preds-rect",!0)}(n,d3.select(this.nextSibling),i),t(n,r)),r<h?t(n,r):n.remove())}))}(e),r(e)),e.objectPropClassUri!==v&&d3.select(this).attr("cx",(function(e){return"main"===e.classPosition?function(e){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(e){return Math.log(e)/Math.LN10});var t=L.attr("cx")-600,r=.5*Math.log10(Math.abs(t));return e.x+=t>0?-r:r,e.x}(e):e.x})).attr("cy",(function(e){return e.y}))})),E.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).moveToFront(),b.filter((function(e){return e.objectPropNodeClassUri!==v})).attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),C.attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),k.attr("x",(function(e){return"right"===e.classPosition?e.x+1200/110*1.2:e.x-1200/110*1.2})).attr("y",(function(e){return e.y})).moveToFront()}))}}));let w=!1}(u)}),50);u.$on("$destroy",(function(){l.cancel(p)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--primary-color)").constant("ONTO_GREEN","var(--tertiary-color)").constant("ONTO_BLUE","var(--secondary-color)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",a),a.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]},259:function(e,t){function r(e,t){return{restrict:"A",scope:{},templateUrl:"js/angular/graphexplore/templates/systemRepoWarningTemplate.html",link:function(r){r.isSystemRepository=function(){return"SYSTEM"===e.getActiveRepository()},r.hasPermission=function(){return t.hasPermission()}}}}angular.module("graphdb.framework.graphexplore.directives.sysrepo",["graphdb.framework.graphexplore.controllers.class"]).directive("systemRepoWarning",r),r.$inject=["$repositories","$rootScope"]},260:function(e,t){function r(e){return{restrict:"AE",scope:{rdfsLabel:"=",rdfsComment:"=",expanded:"=",alwaysExpanded:"="},templateUrl:"js/angular/graphexplore/templates/rdfsCommentLabelTemplate.html",link:function(t,r){t.stringLimit=e,t.scrollToTop=function(){r[0].getElementsByClassName("rdfs-comment")[0].scrollTop=0},t.checkCommentLength=function(){return r[0].getElementsByClassName("rdfs-comment-text")[0].innerText.length<e},t.equalHeights=function(){const e=r[0].getElementsByClassName("rdfs-comment-text")[0].innerHeight;e<250&&t.expanded&&(r[0].getElementsByClassName("rdfs-comment")[0].innerHeight=e)},t.toggleFullComment=function(){t.expanded=!t.expanded},t.$watch("expanded || alwaysExpanded",(function(r){t.stringLimit=r?t.rdfsComment.length:e}))}}}angular.module("graphdb.framework.graphexplore.directives.rdfsdetails",[]).directive("rdfsCommentLabel",r).constant("SHORT_COMMENT_LENGTH",100),r.$inject=["SHORT_COMMENT_LENGTH"]},261:function(e,t,r){"use strict";r.r(t);var n=r(551);r(151);function i(e,t){return{restrict:"A",template:'<div id="dependencies-chord"></div>',scope:{dependenciesData:"="},link:function(r){r.$watch("dependenciesData",(function(){if(r.dependenciesData){const i=r.dependenciesData;!function(i,a){if(function(){let e=!0;for(const t of i){if(t.some(e=>0!==e)){e=!1;break}}return e}())return;const o=d3.scaleOrdinal(d3.schemeCategory10),s=d3.select("body").append("div").attr("class","tooltip").style("opacity",0);d3.select("body").on("click",(function(){s.style("opacity",0)}));const c=Math.min(800,800)/2.8,l=c-24,d=d3.arc().innerRadius(l).outerRadius(c),u=d3.chord().padAngle(.04).sortSubgroups(d3.descending).sortChords(d3.ascending),p=d3.ribbon().radius(l),f=d3.select("#dependencies-chord").append("svg").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").style("font","10px sans-serif").append("g").attr("id","circle").attr("transform","translate(400,400)");f.append("circle").attr("r",c).style("fill","none");const h=u(i),g=f.selectAll(".group").data(h.groups).enter().append("g").attr("class","group").on("mouseover",(function(){const e=g.nodes().indexOf(this);m.classed("fade",(function(t){return t.source.index!==e&&t.target.index!==e}))}));g.append("title").text((function(e,t){return a[t]})),g.append("path").attr("id",(function(e,t){return"group"+t})).attr("d",d).style("fill",(function(e,t){return o(t)})),g.append("text").each((function(e){e.angle=(e.startAngle+e.endAngle)/2})).attr("dy",".35em").attr("transform",(function(e){return"rotate("+(180*e.angle/Math.PI-90)+")translate("+(l+26)+")"+(e.angle>Math.PI?"rotate(180)":"")})).style("text-anchor",(function(e){return e.angle>Math.PI?"end":null})).text((function(e){return a[e.index]}));const m=f.selectAll(".chord").data(h).enter().append("path").attr("class","chord").style("fill",(function(e){return o(e.target.index)})).style("fill-opacity",".67").style("stroke","#000").style("stroke-width",".25px").style("cursor","pointer").attr("d",p);m.on("mouseover",(function(){d3.select(this).style("fill-opacity","1")})),m.on("mouseout",(function(){d3.select(this).style("fill-opacity",".67")})),m.on("click",(function(e,n){const i=a[n.source.index],o=a[n.target.index],c=e.pageX,l=e.pageY;t.getPredicates(i,o,r.selectedGraph&&r.selectedGraph.contextID.uri).success((function(e){let t="<div class='dependencies-tooltip'>"+("<div class='row'>"+i+" <i class='fa fa-exchange'></i> "+o+"</div>")+_.map(e.slice(0,10),(function(e){const t=" <i class='fa fa-long-arrow-"+("out"===e.direction?"right":"left")+"'></i>";return"<div class='row'>"+e.predicate+" : "+e.weight+t+" </div>"})).join("");e.length>10?t=t+"<div class='pull-right'>And "+(e.length-10).toString()+" more...</div></div>":t+="</div>",s.html(t).style("left",c+"px").style("top",l+"px")})),s.transition().duration(200).style("opacity",1)})),d3.select("#circle").on("mouseleave",(function(){f.selectAll(".chord").classed("fade",!1)})),d3.select("#download-svg").on("mouseover",(function(){const t=n.a.Export.generateBase64ImageSource(".dependencies-chord svg");d3.select(this).attrs({href:t,download:"dependencies-"+e.getActiveRepository()+".svg"})}))}(i.matrix,i.nodes,i.direction)}}))}}}angular.module("graphdb.framework.graphexplore.directives.dependencies",["graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.rest.graphexplore.data.service"]).directive("dependenciesChord",i),i.$inject=["$repositories","GraphDataRestService"]},262:function(e,t){function r(){return{restrict:"AE",scope:{filterQueryObj:"=",filterFunction:"&",listItemsObj:"=",listItemsNotFiltered:"=",searchPlaceholder:"@"},templateUrl:"js/angular/graphexplore/templates/listItemsSearchFilterTemplate.html",link:function(e){e.filterFunction=e.filterFunction(),e.$watch("filterQueryObj.query",(function(){var t,r,n,i;e.listItemsObj.items=(t=e.filterQueryObj.query,r=e.listItemsObj.items,n=e.listItemsNotFiltered,i=e.filterFunction,t.length>0?_.filter(n,i):r.length!==n.length?n:r)}))}}}angular.module("graphdb.framework.graphexplore.directives.searchfilter",[]).directive("listItemsSearchFilter",r),r.$inject=[]},263:function(e,t){function r(e,t){return{restrict:"AE",scope:{searchData:"=",searchFields:"@",titleField:"@",searchPlaceholder:"@",initialValue:"=",searchedObjCallback:"&"},templateUrl:"js/angular/graphexplore/templates/searchIconInputTemplate.html",link:function(r,n){r.searchedObjCallback=r.searchedObjCallback(),r.performSearchActionOnEnter=function(){e.$broadcast("onEnterKeypressSearchAction")},r.showInput=function(){$("#selectGraphDropdown").hide(),n.find("#search_input #search_input_value")[0].value="",n.find(".search-icon").addClass("animated bounceOut").css("z-index","-1"),n.find("#search_input .angucomplete-holder").css("display","block"),t((function(){n.find("#search_input .angucomplete-holder").css("width","250px").css("left","-215px"),t((function(){n.find(".close-icon").css("display","block").addClass("animated bounceIn").css("z-index","3"),n.find("#search_input #search_input_value").focus()}),200)}),1)},r.hideInput=function(){n.find("#search_input #search_input_value")[0].value="",n.find("#search_input .angucomplete-holder").css("width","0px").css("left","35px"),t((function(){n.find("#search_input .angucomplete-holder").css("display","none"),$("#selectGraphDropdown").show()}),250),n.find(".close-icon").addClass("animated bounceOut").removeClass("bounceOut").css("z-index","-1").css("display","none").click((function(){$(".tooltip").hide()})),t((function(){n.find(".search-icon").css("display","inline-block").removeClass("bounceOut").addClass("bounceIn").css("z-index","3")}),200)}}}}angular.module("graphdb.framework.graphexplore.directives.searchcontrols",[]).directive("searchIconInput",r),r.$inject=["$rootScope","$timeout"]},338:function(e,t,r){"use strict";r.r(t);r(9),r(46),r(40),r(41),r(806),r(807),r(538),r(562),r(314),r(323),r(808),r(572),r(550),r(587),r(551),r(151),r(248),r(249),r(250),r(251),r(252),r(253),r(254),r(255),r(256),r(257),r(258),r(259),r(260),r(261),r(262),r(263),r(140);angular.module("graphdb.framework.graphexplore",["graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.graphexplore.data.service","graphdb.framework.graphexplore.services.uiscroll","graphdb.framework.graphexplore.services.rdfsdetails","graphdb.framework.rest.graphexplore.savedgraphs.service","graphdb.framework.rest.graphconfig.service","graphdb.framework.graphexplore.controllers.class","graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.graphexplore.controllers.graphviz","graphdb.framework.graphexplore.controllers.graphviz.config","graphdb.framework.graphexplore.directives.sysrepo","graphdb.framework.graphexplore.directives.rdfsdetails","graphdb.framework.graphexplore.directives.searchfilter","graphdb.framework.graphexplore.directives.class","graphdb.framework.graphexplore.directives.domainrange","graphdb.framework.graphexplore.directives.dependencies","graphdb.framework.graphexplore.directives.searchcontrols","graphdb.framework.core.directives.yasgui-component"])},538:function(e,t,r){var n,i;n=[r(546)],void 0===(i=function(){function e(e,t){return e.each((function(){var e=t.apply(this,arguments),r=select(this);for(var n in e)r.attr(n,e[n])}))}function t(e,t){for(var r in t)e.attr(r,t[r]);return e}return"undefined"==typeof d3&&(d3=r(546)),d3.selection.prototype.attrs=function(r){return("function"==typeof r?e:t)(this,r)},d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,n))||(e.exports=i)},550:function(e,t,r){"use strict";r(538);var n=n||{};n.Text=function(){function e(e,t,r,n){r=r||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<r&&(i=r),Math.round(i)):(i<r&&(i=r),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,r,n,i){return e(t,r,n)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),n.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},n.Click=function(){const e=function(e,r){let n,i=1,a=arguments.length;for(;++i<a;)n=arguments[i],e[n]=t(e,r,r[n]);return e};function t(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}return{delayDblClick:function(){var t=d3.dispatch("click","dblclick");return e((function(e){var r,n=null;e.on("mousedown",(function(){r=d3.pointer(document.body),+new Date})),e.on("mouseup",(function(e,i){var a,o,s;(o=r,s=d3.pointer(document.body),Math.sqrt(Math.pow(o[0]-s[0],2),Math.pow(o[1]-s[1],2))>5)||(n?(window.clearTimeout(n),n=null,t.call("dblclick",e,e,i)):n=window.setTimeout((a=e,function(){t.call("click",a,a,i),n=null}),250))}))}),t,"on")}}}(),t.a=n},551:function(e,t,r){"use strict";r(538);var n=n||{};n.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let r="";return _.each(t,(function(e){r+=e.cssText})),r},generateBase64ImageSource:function(e){e||(e="svg");const t=d3.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}},t.a=n},562:function(e,t,r){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},r=function(){return" "},n=u(),i=null,a=null,o=null,s=null;function c(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,a=i.createSVGPoint(),document.body.appendChild(n)}c.show=function(){var n=Array.prototype.slice.call(arguments);n[n.length-1]instanceof SVGElement&&(o=n.pop());var i,a=r.apply(this,n),u=t.apply(this,n),f=e.apply(this,n),h=p(),g=d.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=s.apply(this,n);for(h.html(a).style("opacity",1).style("pointer-events","all");g--;)h.classed(d[g],!1);const x=n.filter(e=>e instanceof Event);return i=l.get(f).apply(this,x),v?Object.keys(v).forEach((function(e){h.style(e,v[e])})):h.classed(f,!0).style("top",i.top+u[0]+m+"px").style("left",i.left+u[1]+y+"px"),c},c.hide=function(){return p().style("opacity",0).style("pointer-events","none"),c},c.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().attr(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(p(),r),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().style(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(p(),r),c},c.direction=function(t){return arguments.length?(e=null==t?t:h(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:h(e),c):t},c.html=function(e){return arguments.length?(r=null==e?e:h(e),c):r},c.customPosition=function(e){return arguments.length?(s=null==e?e:h(e),c):s},c.destroy=function(){return n&&(p().remove(),n=null),c};var l=new Map(Object.entries({n:function(e){var t=f(e);return{top:t.n.y-n.offsetHeight,left:t.n.x-n.offsetWidth/2}},s:function(e){var t=f(e);return{top:t.s.y,left:t.s.x-n.offsetWidth/2}},e:function(e){var t=f(e);return{top:t.e.y-n.offsetHeight/2,left:t.e.x}},w:function(e){var t=f(e);return{top:t.w.y-n.offsetHeight/2,left:t.w.x-n.offsetWidth}},nw:function(e){var t=f(e);return{top:t.nw.y-n.offsetHeight,left:t.nw.x-n.offsetWidth}},ne:function(e){var t=f(e);return{top:t.ne.y-n.offsetHeight,left:t.ne.x}},sw:function(e){var t=f(e);return{top:t.sw.y,left:t.sw.x-n.offsetWidth}},se:function(e){var t=f(e);return{top:t.se.y,left:t.e.x}}})),d=l.keys();function u(){var e=d3.select(document.createElement("div"));return e.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}function p(){return null===n&&(n=u(),document.body.appendChild(n)),d3.select(n)}function f(e){for(var t=o||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var r={},n=t.getScreenCTM(),i=t.getBBox(),s=i.width,c=i.height,l=i.x,d=i.y;return a.x=l,a.y=d,r.nw=a.matrixTransform(n),a.x+=s,r.ne=a.matrixTransform(n),a.y+=c,r.se=a.matrixTransform(n),a.x-=s,r.sw=a.matrixTransform(n),a.y-=c/2,r.w=a.matrixTransform(n),a.x+=s,r.e=a.matrixTransform(n),a.x-=s/2,a.y-=c/2,r.n=a.matrixTransform(n),a.y+=c,r.s=a.matrixTransform(n),r}function h(e){return"function"==typeof e?e:function(){return e}}return c}},587:function(e,t,r){"use strict";var n=n||{};n.SingleChild={addPlaceholders:function e(t,r){if(t.children){for(var n=0;n<t.children.length;n++)e(t.children[n]);if(1===t.children.length){var i=1.2*t.size;r&&(i=.1*t.children[0].size),t.children.push({name:"placeholder",size:i})}}},removePlaceholders:function e(t){for(var r=t.length-1;r>=0;r--){var n=t[r];"placeholder"===n.data.name?t.splice(r,1):n.children&&e(n.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.children&&1===r.children.length){var n=r.x-r.children[0].x;r.children[0].x+=n,i(r.children[0],n)}}function i(e,t){if(e.children)for(var r=0;r<e.children.length;r++)e.children[r].x+=t,i(e.children[r],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,r=e[0].y,n=0;n<e.length;n++){var i=e[n];i.x-=t,i.y-=r}}},t.a=n},808:function(e,t){
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[23,41,42,43,60,61,76,98,158,159,160,161,162,163,164,166,167,200,236,244,288,297,301,326,329],{100:function(e,t,r){"use strict";r.r(t),r.d(t,"removeSpecialChars",(function(){return i})),r.d(t,"toBoolean",(function(){return a})),r.d(t,"toTitleCase",(function(){return o}));var n=r(18);const i=e=>e.replace(/[()']/g,""),a=e=>"string"==typeof e?"true"===e:Boolean(e),o=e=>e?Object(n.upperFirst)(e.toLowerCase()):e},101:function(e,t){function r(e,t){return{showToastMessageWithDelay:function(r){return new Promise(n=>{e.success(t.instant(r)),setTimeout(n,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",r),r.$inject=["toastr","$translate"]},111:function(e,t,r){"use strict";r.r(t),r.d(t,"StartMode",(function(){return n})),r.d(t,"GraphsConfig",(function(){return i}));const n={QUERY:"query",NODE:"node",SEARCH:"search"};class i{constructor(e,t,r=n.SEARCH,i,a=!0,o=!0,s,c,l,d,u,p,f,h,g,m,y,v,x,S,w){this._id=e,this._name=t,this._startMode=r,this._owner=i,this._startQueryIncludeInferred=a,this._startQuerySameAs=o,this._startGraphQuery=s,this._startIRI=c,this._startIRILabel=l,this._expandQuery=d,this._resourceQuery=u,this._predicateLabelQuery=p,this._resourcePropertiesQuery=f,this._shared=h,this._description=g,this._hint=m,this._startGraphQueryDescription=y,this._expandQueryDescription=v,this._resourceQueryDescription=x,this._predicateLabelQueryDescription=S,this._resourcePropertiesQueryDescription=w}isStartMode(e){return this.startMode===e}isDefaultGraph(){return"Minimal"===this.name||"Advanced"===this.name}getPropertyDescription(e){return this[e+"Description"]}getQueryType(e){let t;return this.isStartMode(n.QUERY)&&1===e?t=this.startGraphQuery:2===e?t=this.expandQuery:3===e?t=this.resourceQuery:4===e?t=this.predicateLabelQuery:5===e&&(t=this.resourcePropertiesQuery),t||""}updateModel(e,t){return this.isStartMode(n.QUERY)&&1===t?this.startGraphQuery=e:2===t?this.expandQuery=e:3===t?this.resourceQuery=e:4===t?this.predicateLabelQuery=e:5===t&&(this.resourcePropertiesQuery=e),this}toSavePayload(){return{id:this.id,name:this.name,startMode:this.startMode,owner:this.owner,startQueryIncludeInferred:this.startQueryIncludeInferred,startQuerySameAs:this.startQuerySameAs,startGraphQuery:this.startGraphQuery,startIRI:this.startIRI,startIRILabel:this.startIRILabel,expandQuery:this.expandQuery,resourceQuery:this.resourceQuery,predicateLabelQuery:this.predicateLabelQuery,resourcePropertiesQuery:this.resourcePropertiesQuery,shared:this.shared,description:this.description,hint:this.hint}}get id(){return this._id}set id(e){this._id=e}get name(){return this._name}set name(e){this._name=e}get startMode(){return this._startMode}set startMode(e){this._startMode=e}get owner(){return this._owner}set owner(e){this._owner=e}get startQueryIncludeInferred(){return this._startQueryIncludeInferred}set startQueryIncludeInferred(e){this._startQueryIncludeInferred=e}get startQuerySameAs(){return this._startQuerySameAs}set startQuerySameAs(e){this._startQuerySameAs=e}get startGraphQuery(){return this._startGraphQuery}set startGraphQuery(e){this._startGraphQuery=e}get startIRI(){return this._startIRI}set startIRI(e){this._startIRI=e}get startIRILabel(){return this._startIRILabel}set startIRILabel(e){this._startIRILabel=e}get expandQuery(){return this._expandQuery}set expandQuery(e){this._expandQuery=e}get resourceQuery(){return this._resourceQuery}set resourceQuery(e){this._resourceQuery=e}get predicateLabelQuery(){return this._predicateLabelQuery}set predicateLabelQuery(e){this._predicateLabelQuery=e}get resourcePropertiesQuery(){return this._resourcePropertiesQuery}set resourcePropertiesQuery(e){this._resourcePropertiesQuery=e}get shared(){return this._shared}set shared(e){this._shared=e}get description(){return this._description}set description(e){this._description=e}get hint(){return this._hint}set hint(e){this._hint=e}get startGraphQueryDescription(){return this._startGraphQueryDescription}set startGraphQueryDescription(e){this._startGraphQueryDescription=e}get expandQueryDescription(){return this._expandQueryDescription}set expandQueryDescription(e){this._expandQueryDescription=e}get resourceQueryDescription(){return this._resourceQueryDescription}set resourceQueryDescription(e){this._resourceQueryDescription=e}get predicateLabelQueryDescription(){return this._predicateLabelQueryDescription}set predicateLabelQueryDescription(e){this._predicateLabelQueryDescription=e}get resourcePropertiesQueryDescription(){return this._resourcePropertiesQueryDescription}set resourcePropertiesQueryDescription(e){this._resourcePropertiesQueryDescription=e}}},132:function(e,t,r){"use strict";r.r(t),r.d(t,"mapGraphsConfigResponseToModel",(function(){return i})),r.d(t,"mapGraphConfigSampleToGraphConfig",(function(){return a})),r.d(t,"mapGraphConfigSamplesToGraphConfigs",(function(){return o}));var n=r(111);const i=e=>new n.GraphsConfig(e.id,e.name,e.startMode,e.owner,e.startQueryIncludeInferred,e.startQuerySameAs,e.startGraphQuery,e.startIRI,e.startIRILabel,e.expandQuery,e.resourceQuery,e.predicateLabelQuery,e.resourcePropertiesQuery,e.shared,e.description,e.hint),a=e=>new n.GraphsConfig(e.id,e.name,e.startMode,e.owner,e.startQueryIncludeInferred,e.startQuerySameAs,e.startGraphQuery,e.startIRI,e.startIRILabel,e.expandQuery,e.resourceQuery,e.predicateLabelQuery,e.resourcePropertiesQuery,e.shared,e.description,e.hint,e.startGraphQueryDescription,e.expandQueryDescription,e.resourceQueryDescription,e.predicateLabelQueryDescription,e.resourcePropertiesQueryDescription),o=e=>e.map(e=>a(e))},133:function(e,t,r){"use strict";r.r(t),r.d(t,"STATIC_RULESETS",(function(){return n})),r.d(t,"REPOSITORY_TYPES",(function(){return i})),r.d(t,"FILENAME_PATTERN",(function(){return a})),r.d(t,"NUMBER_PATTERN",(function(){return o}));const n=[{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"}],i={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},a=new RegExp("^[a-zA-Z0-9-_]+$"),o=new RegExp("^[0-9]+$")},151:function(e,t){angular.module("graphdb.framework.rest.graphexplore.data.service",[]).factory("GraphDataRestService",r),r.$inject=["$http"];function r(e){return{getClassHierarchyData:function(t){return e.get("rest/class-hierarchy",{params:{graphURI:t}})},reloadClassHierarchy:function(t){return e.get("rest/class-hierarchy",{params:{doReload:!0,graphURI:t}})},getClassInstances:function(t){return e.get("rest/class-hierarchy/class-instances",{params:{targetUri:t}})},getDomainRangeData:function(t,r){return e.get("rest/domain-range",{params:{targetUri:t,collapsed:r}})},checkDomainRangeData:function(t){return e.head("rest/domain-range",{params:{targetUri:t}})},getRelationshipsData:function(t,r,n){return e.get("rest/dependencies/matrix",{params:{mode:r,classes:_.map(t,(function(e){return e.name})),graphURI:n}})},getRelationshipsClasses:function(t,r){return e.get("rest/dependencies/classes",{params:{mode:t,graphURI:r}})},getRelationshipsStatus:function(t){return e.get("rest/dependencies/status",{params:{graphURI:t}})},calculateRelationships:function(t){return e.get("rest/dependencies/update",{params:{graphURI:t}})},getPredicates:function(t,r,n){return e.get("rest/dependencies/predicates",{params:{from:t,to:r,mode:"all",graphURI:n}})},getInstanceNode:function(t){return e.get("rest/explore-graph/node",{params:t})},getInstanceNodeLinks:function(t){return e.get("rest/explore-graph/links",{params:t})},getProperties:function(t){return e.get("rest/explore-graph/properties",{params:t})},updateGraph:function(t){let r={headers:{"Content-Type":"application/json"}};return r=Object.assign(r,t),e.post("rest/explore-graph/graph",r)},getRdfsLabelAndComment:function(t,r,n){const i=n||{};return e({url:"rest/explore/details",method:"GET",params:_.extend(i,{uri:t,languages:r}),headers:{Accept:"application/json"}})}}}},248:function(e,t){function r(e){return{initLazyList:function(t,r,n,i,a){return e((function(){const e=t+i-1,o=Math.max(0-i,e),s=Math.min(e+r-1,a.length);o>s?n([]):$.isArray(a)&&n(a.slice(o,s+1))}),100,!0)}}}angular.module("graphdb.framework.graphexplore.services.uiscroll",[]).factory("UiScrollService",r),r.$inject=["$timeout"]},249:function(e,t){angular.module("graphdb.framework.graphexplore.services.rdfsdetails",[]).factory("RdfsLabelCommentService",(function(){return{processAndFilterLabelAndComment:function(e){function t(e){const t={};for(let r in e)if(e.hasOwnProperty(r)){let n=r;r.indexOf(":")>-1&&(n=r,r=r.split(":")[1].toLowerCase()),t[r]=e[n]}return t}const r=e.results.bindings,n=[],i=[];_.each(r,(function(e){let r;angular.isUndefined(e.label)||(r=t(e.label),n.push(r)),angular.isUndefined(e.comment)||(r=t(e.comment),i.push(r))}));const a=function(e){return"en"===e.lang||"de"===e.lang},o=$.grep(n,a)[0],s=$.grep(i,a)[0],c=angular.isUndefined(o)?n.length>0?n[0].value:void 0:o.value,l=angular.isUndefined(s)?i.length>0?i[0].value:void 0:s.value;return{rdfsLabel:c,rdfsComment:l}}}}))},250:function(e,t){angular.module("graphdb.framework.rest.graphexplore.savedgraphs.service",[]).factory("SavedGraphsRestService",r),r.$inject=["$http"];function r(e){return{getSavedGraphs:function(){return e.get("rest/explore-graph/saved")},getSavedGraph:function(t){return e.get("rest/explore-graph/saved/"+encodeURIComponent(t))},editSavedGraph:function(t){return e.put("rest/explore-graph/saved/"+encodeURIComponent(t.id),t)},deleteSavedGraph:function(t){return e.delete("rest/explore-graph/saved/"+encodeURIComponent(t.id))},addNewSavedGraph:function(t){return e.post("rest/explore-graph/saved",t)}}}},251:function(e,t,r){"use strict";r.r(t);var n=r(132);angular.module("graphdb.framework.rest.graphconfig.service",[]).factory("GraphConfigRestService",i);function i(e){return{getGraphConfigs:function(){return e.get("rest/explore-graph/config")},getGraphConfigSamples:function(){return e.get("rest/explore-graph/samples")},loadGraphForConfig:function(t,r,n,i){return e.get(`rest/explore-graph/config/graph/${encodeURIComponent(t.id)}?includeInferred=${r}&linksLimit=${n}&sameAsState=${i}`)},getConfig:function(t){return e.get("rest/explore-graph/config/"+encodeURIComponent(t)).then(e=>Object(n.mapGraphsConfigResponseToModel)(e.data))},createGraphConfig:function(t){return e.post("rest/explore-graph/config",t)},updateGraphConfig:function(t){return console.log("rest update",t),e.put("rest/explore-graph/config/"+encodeURIComponent(t.id),t)},deleteGraphConfig:function(t){return e.delete("rest/explore-graph/config/"+encodeURIComponent(t.id))},validateQuery:function(t,r,n,i,a){return e({method:"POST",url:"rest/explore-graph/validate",data:{query:t,queryType:r,params:n,all:i,oneOf:a}})}}}i.$inject=["$http"]},252:function(e,t,r){"use strict";r.r(t);r(13);function n(e,t,r,n,i,a,o,s,c,l,d,u,p,f,h,g,m){e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=()=>angular.noop(),e.currentBrowserLimit=2e3,p.firefox?e.currentBrowserLimit=50:(p.safari||p.msie||p.msedge)&&(e.currentBrowserLimit=400);const y={};let v=0,x=0;t.key="",y.get=function(t,r,n){return c.initLazyList(t,r,n,v,e.instancesObj.items)};let S=allGraphs;const w=function(){if(e.getActiveRepository())return g.resolveGraphs(n.getActiveRepository()).success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,C()})).error((function(t){e.repositoryError=getError(t),o.error(getError(t),m.instant("graphexplore.error.getting.graphs"))}))},C=function(){const t=f.get("classHierarchy-selectedGraph-"+n.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?S=t:f.set("classHierarchy-selectedGraph-"+n.getActiveRepository(),S)},b=function(){return e.instancesObj.items.length<1e3?m.instant("graphexplore.search.class.instances"):m.instant("graphexplore.search.first.class.instances")};t.$watch((function(){return t.key}),(function(){v=0,_.each(e.instancesObj.items,(function(e){t.key>e&&v++})),x++})),y.revision=function(){return x},e.adapterContainer={adapter:{remain:!0}};const I=[];I.push(e.$on("goToDomainRangeGraphView",(function(e,t){E(t)}))),I.push(e.$on("classCount",R)),I.push(e.$on("repositoryIsSet",(function(){if(!i.isLicenseValid())return;if(T===n.getActiveRepository())return;T=n.getActiveRepository();if(e.repositoryError=null,!T)return;S=allGraphs,w().then(N)}))),I.push(t.$on("$translateChangeSuccess",()=>{e.instancesSearchPlaceholder=b()}));function R(t,r,n){e.classCountSlider.options&&e.classCountSlider.options.ceil!==r&&(e.classCountSlider={});var i;e.classCountSlider.value||(e.showExternalElements=!0,e.classCountSlider={value:r,options:{floor:1,ceil:r,vertical:!0,showSelectionBar:!0,onChange:function(){d(k,100,!0)}}},null===f.get(h.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&r>e.currentBrowserLimit&&(i=e.currentBrowserLimit,p.chrome?o.warning(m.instant("graphexplore.disabling.animations",{classLimit:i}),m.instant("graphexplore.reducing.visual.effects")):o.warning(m.instant("graphexplore.browser.performance",{browser:p.name,classLimit:i}),m.instant("graphexplore.reducing.visual.effects"))));const a=f.get(h.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=a&&"true"!==a&&(e.showExternalElements=!0),n?e.classCountSlider.value=n:r>=1500&&(e.classCountSlider.value=1500,o.warning(m.instant("graphexplore.class.count.slider",{count:1500}),m.instant("graphexplore.reducing.class.count"))),r>=25&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=25,e.isWarningShowed=!0,o.warning(m.instant("graphexplore.class.count.browser",{count:25}),m.instant("graphexplore.reducing.class.count"))),d((function(){e.$broadcast("reCalcViewDimensions");const t=document.getElementById("rzslider");let r=0;t.addEventListener("wheel",(function(t){t.preventDefault(),t.stopPropagation();const n=(new Date).getTime();if(!(n-r>100))return;r=n;let i=e.classCountSlider.value;const a=e.classCountSlider.options.step||1;t.deltaY<=-1?i+=a:t.deltaY>=1&&(i-=a),i=Math.max(e.classCountSlider.options.floor,Math.min(e.classCountSlider.options.ceil,i)),i!==e.classCountSlider.value&&e.$apply((function(){e.classCountSlider.value=i,d(k,100,!0)}))}))}),200),k()}function k(){e.currentSliderValue=e.classCountSlider.value}function E(e){const t=e.data.fullName,n=e.data.name;s.checkDomainRangeData(t).success((function(e,i){204===i?o.warning(m.instant("graphexplore.no.domain.range",{name:n})):(f.set(h.CLASS_HIERARCHY_LAST_SELECTED_CLASS,r.hash()),r.hash("").path("domain-range-graph").search("uri",t).search("name",n))})).error((function(){o.error(m.instant("graphexplore.error.request.failed",{name:n}))}))}function L(){r.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,f.clearClassHieararchyState(),e.hidePrefixes="true"===f.get(h.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},t.$broadcast("angucomplete-alt:clearInput")}function A(){e.hasClassHierarchy()&&d((function(){$("#toolbar").removeClass("ng-hide")}),0)}I.push(e.$on("$destroy",()=>{I.forEach(e=>e())})),e.datasource=y,e.goToDomainRangeGraphView=E,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,t.$broadcast("sidePanelClosed")},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return n.getActiveRepository()},e.isSystemRepository=function(){return n.isSystemRepository()},e.confirmReloadClassHierarchy=function(){u.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){L(),e.loader=!0,e.hierarchyError=!1,s.reloadClassHierarchy(S.contextID.uri).success((function(t){e.loader=!1,e.classHierarchyData=t,A(),R()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),o.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){u.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){const r={name:e.title};t.$broadcast("searchedClass",r)}},e.instancesQueryObj.query="",e.instancesFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.instancesQueryObj.query.toLowerCase())>=0},w(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&d((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(t){const r=t.data.fullName;let n=t.data.name;if(n===r){const e=n.lastIndexOf("#");n=n.substring(e+1)}e.encodedUri=encodeURIComponent(r);const i=encodeURIComponent("prefix onto:<http://www.ontotext.com/>\nselect ?s {\n ?s a <"+r+"> .\n}");e.viewInstancesUri="sparql?name="+n+"&infer=true&sameAs=false&query="+i+"&execute=true",s.getRdfsLabelAndComment(r).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment,e.expanded=!1})).error((function(){o.error("Error getting rdfs:label and rdfs:comment")})),e.instancesQueryObj.query="",e.instancesLoader=!0,s.getClassInstances(r).success((function(t){e.instancesObj.items=[],_.each(t,(function(t,r){const n={};n.type=t.startsWith("<<")&&t.endsWith(">>")?"triple":"uri",n.absUri=encodeURIComponent(t),n.absUriNonEncoded=t,n.resolvedUri=r,e.instancesObj.items.push(n)})),e.instancesLoader=!1,e.instancesSearchPlaceholder=b(),e.instancesNotFiltered=e.instancesObj.items})).error((function(){o.error(m.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));let T=n.getActiveRepository();function N(){L(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,s.getClassHierarchyData(S.contextID.uri).success((function(t,r){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=t,207===r&&o.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),A()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),o.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.chosenGraph=function(e){S=e,N(),f.set("classHierarchy-selectedGraph-"+n.getActiveRepository(),S)},e.getSelGraphValue=function(){return S.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelGraphValue()}}angular.module("graphdb.framework.graphexplore.controllers.class",["pageslide-directive","ngAnimate","ui.scroll.jqlite","ui.scroll","angucomplete-alt","rzSlider","toastr","graphdb.framework.utils.localstorageadapter"]).controller("RdfClassHierarchyCtlr",n),n.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]},253:function(e,t,r){"use strict";r.r(t);r(13);function n(e,t,r,n,i,a,o,s,c,l,d,u,p){e.predicatesObj={},e.predicatesQueryObj={},e.predicatesObj.items=[],e.predicatesQueryObj.query="",e.predicatesListNotFiltered=[],e.predicatesSearchPlaceholder="Search predicates",e.onopen=e.onclose=()=>angular.noop();const f={};let h=0,g=0;r.key="",f.get=function(t,r,n){return l.initLazyList(t,r,n,h,e.predicatesObj.items)},r.$watch((function(){return r.key}),(function(){h=0,_.each(e.predicatesObj.items,(function(e){r.key>e&&h++})),g++})),f.revision=function(){return g},e.adapterContainer={adapter:{remain:!0}};const m=o.get(s.DOMAIN_RANGE_COLLAPSE_EDGES);function y(){const e=o.get(s.CLASS_HIERARCHY_LAST_SELECTED_CLASS);t.search("").hash(e).path("hierarchy")}e.collapseEdges=null===m||"true"===m,e.datasource=f,e.$on("reloadDomainRangeGraphView",(function(e,r){const n=r.objectPropClassUri,i=r.objectPropClassName;t.path("domain-range-graph").search("uri",n).search("name",i)})),e.$on("switchEdgeMode",(function(e,r){t.path("domain-range-graph").search("uri",r.uri).search("name",r.name).search("collapsed",r.collapsed)})),e.$on("repositoryIsSet",(function(){if(v===i.getActiveRepository())return;v=i.getActiveRepository();y()})),e.$on("changeCollapsedEdgesState",(function(t,r){e.collapseEdges=!r,o.set(s.DOMAIN_RANGE_COLLAPSE_EDGES,e.collapseEdges)})),e.goToClassHierarchyView=y,e.copyToClipboard=function(e){d.openCopyToClipboardModal(e)},e.toggleCollapseEdgesState=function(){e.collapseEdges=!e.collapseEdges,a.history.pushState({collapsed:e.collapseEdges},"domainRangePage",null)},e.predicatesListFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.predicatesQueryObj.query.toLowerCase())>=0},e.$watch("predicatesObj.items",(function(){e.predicatesObj.items>0&&n((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedPredicate",(function(){e.showPredicatesInfoPanel&&function(t){const r=t.target,n=t.source;e.encodedUri=encodeURIComponent(t.uri),e.sourceTargetObjectNodeUri=r.objectPropClassUri?r.objectPropClassUri:n.objectPropClassUri,e.encodedSourceTargetObjectNodeUri=encodeURIComponent(e.sourceTargetObjectNodeUri),e.sourceTargetObjectNodeName=r.objectPropClassName?r.objectPropClassName:n.objectPropClassName?n.objectPropClassName:"<i>Literal</i>",-1===e.sourceTargetObjectNodeName.indexOf("Literal")?c.getRdfsLabelAndComment(e.sourceTargetObjectNodeUri).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment})).error((function(){u.error(p.instant("domain.range.error.get.label.comment"))})):(e.rdfsComment=void 0,e.rdfsLabel=void 0);e.predicatesObj.items=[],e.predicatesQueryObj.query="";const i=r.allEdges?r.allEdges:n.allEdges;_.each(i,(function(t){const r={};r.absUri=encodeURIComponent(t.uri),r.absUriNonEncoded=t.uri,r.resolvedUri=t.name,r.isImplicit=t.implicit,e.predicatesObj.items.push(r)})),e.predicatesListNotFiltered=e.predicatesObj.items}(e.selectedPredicate)})),$(document).ready((function(){$(".compact-mode-toggle").click((function(){$(".tooltip").hide()}))}));let v=i.getActiveRepository()}angular.module("graphdb.framework.graphexplore.controllers.domainrange",["ui.scroll.jqlite","ui.scroll","ngSanitize","graphdb.framework.utils.localstorageadapter"]).controller("DomainRangeGraphCtlr",n),n.$inject=["$scope","$location","$rootScope","$timeout","$repositories","$window","LocalStorageAdapter","LSKeys","GraphDataRestService","UiScrollService","ModalService","toastr","$translate"]},254:function(e,t,r){(function(e){const t="WAIT",r="NO_REPO",n="READY",i="IN_PROGRESS",a="ERROR",o={contextID:{type:"all",value:"all.graphs.label",uri:""}};function s(e){if(e<1e3)return e;const t=Math.floor(Math.log(e)/Math.log(1e3));let r=e/Math.pow(1e3,t);return r=r%1>1/Math.pow(1e3,t-1)?r.toFixed(2):r.toFixed(0),r+["K","M","G","T","P","H"][t-1]}function c(e,s,c,l,d,u,p,f,h,g,m){let y=null;e.status=c.getActiveRepository()?t:r;let v=o;const x=function(){g.resolveGraphs(c.getActiveRepository()).success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,S(),e.isSystemRepository()?"READY"!==e.status&&C():(e.status="WAIT",C(!0))})).error((function(t){e.repositoryError=getError(t),l.error(getError(t),m.instant("graphexplore.error.getting.graph"))}))},S=function(){const t=h.get("dependencies-selectedGraph-"+c.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?v=t:h.set("dependencies-selectedGraph-"+c.getActiveRepository(),v)},w=function(r){d3.select("#dependencies-chord").html(""),e.status=t,u.getRelationshipsData(r,e.direction,v.contextID.uri).success((function(t){e.dependenciesData={matrix:t.right,nodes:t.left,hasLinks:_.sum(_.map(t.right,(function(e){return _.sum(e)})))>0,direction:e.direction},e.status=n})).error((function(t){e.status=n,l.error(getError(t),m.instant("graphexplore.error.dependencies.count"))}))},C=function(r){(e.status!==n||r)&&(e.status=t,u.getRelationshipsStatus(v.contextID.uri).success((function(t){if(e.status=t,e.status===i){if(null!==y)return;y=d(C,2e3)}e.status===n&&(null!==y&&(d.cancel(y),y=null),u.getRelationshipsClasses(e.direction,v.contextID.uri).success((function(t,r){e.allClasses.items=_.filter(t,k),e.allNotFilteredClasses=t,e.selectedClasses=void 0,angular.isUndefined(e.selectedClasses)&&(e.selectedClasses=t.slice(0,10)),w(e.selectedClasses),207===r&&l.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed"))}))),0===e.status.indexOf("ERROR;")&&(e.status=a,l.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})))})).error((function(t){e.status=a,l.error(getError(t),m.instant("graphexplore.error.dependencies.count.status"))})))};e.allClasses={},e.allClasses.items=[],e.allNotFilteredClasses=[],e.direction="all";const b={};let I=0,R=0;function k(t){return-1!==t.name.toLowerCase().indexOf(e.classQuery.query.toLowerCase())}s.key="",b.get=function(t,r,n){p.initLazyList(t,r,n,I,e.allClasses.items)},s.$watch((function(){return s.key}),(function(){I=0,_.each(e.allClasses.items,(function(e){s.key>e&&I++})),R++})),b.revision=function(){return R},e.datasource=b,e.adapterContainer={adapter:{remain:!0}},e.classQuery={},e.classQuery.query="",e.classFilterFunc=k,e.$watch("allClasses.items",(function(){e.allClasses.items.length>0&&d((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("direction",(function(){!c.getActiveRepository()||e.isSystemRepository()||c.isActiveRepoFedXType()||x()})),e.$on("$destroy",(function(){d.cancel(y)})),e.isLoading=function(){return e.status===i||e.status===t},e.confirmCalculateDependencies=function(){f.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.relationships"),warning:!0}).result.then((function(){e.calculateDependencies()}))},e.calculateDependencies=function(){e.status=t,e.selectedClasses=void 0,u.calculateRelationships(v.contextID.uri).success((function(t){0===t.indexOf("ERROR;")?l.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})):C()})).error((function(e){l.error(m.instant("graphexplore.error.could.not.force.count",{error:getError(e)}))}))},e.addClass=function(t){e.selectedClasses.push(t),w(e.selectedClasses)},e.removeClass=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t.name})),w(e.selectedClasses)},e.showClass=function(t){e.classToShow=t},e.isClassByNameShown=function(t){return void 0!==_.find(e.selectedClasses,{name:t})},e.addClassByName=function(t){e.selectedClasses.push(_.find(e.allClasses.items,{name:t})),w(e.selectedClasses)},e.removeClassByName=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t})),w(e.selectedClasses)},e.removeAllClasses=function(){e.selectedClasses=[],w(e.selectedClasses)},e.isSystemRepository=function(){return"SYSTEM"===c.getActiveRepository()};const E=e.$on("repositoryIsSet",(function(){e.classQuery={},e.classQuery.query="",e.repositoryError=null,v=o,c.getActiveRepository()&&!c.isActiveRepoFedXType()?x():e.status=r}));window.addEventListener("beforeunload",(function e(){E(),window.removeEventListener("beforeunload",e)})),e.selectGraph=function(e){v=e,C(!0),h.set("dependencies-selectedGraph-"+c.getActiveRepository(),v)},e.getSelectedGraphValue=function(){return v.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelectedGraphValue()}}Object.defineProperty(e,"allGraphs",{get:()=>o}),angular.module("graphdb.framework.graphexplore.controllers.dependencies",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).controller("DependenciesChordCtrl",c).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]).filter("humanize",(function(){return s})),c.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","GraphDataRestService","UiScrollService","ModalService","LocalStorageAdapter","RDF4JRepositoriesRestService","$translate"]}).call(this,r(15))},255:function(e,t,r){"use strict";r.r(t);r(9),r(23),r(47);var n=r(550),i=r(562),a=(r(13),r(133)),o=r(100),s=r(8);function c(e,t,r,c,l,d,u,p,f,h,g,m,y,v,x,S,w,C,b,I,R,k,E){e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=I.instant("visual.search.instance.placeholder"),e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=f.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=I.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=I.instant("sidepanel.invalid.limit.links.tooltip"),e.datasource=void 0,e.adapterContainer={adapter:{remain:!0}},e.hasInitedRepository=!1,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=_.cloneDeep(e.defaultSettings),e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},t.key="",e.onopen=e.onclose=()=>angular.noop(),e.goToHome=()=>{T(),f.url("graphs-visualizations")},e.shouldShowSettings=()=>e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id,e.shouldDisableSameAs=()=>{const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.propertiesFilterFunc=t=>t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0,e.toggleMoreInfo=e=>{angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=e=>{m.openCopyToClipboardModal(e)},e.resetSettings=()=>{e.settings=_.cloneDeep(e.defaultSettings),e.validateLinksLimit(),D()},e.changeLimit=t=>{let r=e.settings.linksLimit+t;r<1&&(r=1),r>1e3&&(r=1e3),e.settings.linksLimit=r},e.validateLinksLimit=()=>{e.invalidLimit=!a.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=()=>{e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),D()},e.updateSettings=()=>{e.invalidLimit?l.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,(function(e){return e.text})),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,(function(e){return e.text})),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,(function(e){return e.text})),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,(function(e){return e.text})),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,(function(e){return e.text})),e.rootNodeIri?O(e.rootNodeIri):e.queryResultsMode&&f.search().query?j(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&q(e.configLoaded),P(),e.showInfoPanel=!1,e.showFilter=!1,x.set(S.GRAPHS_VIZ,e.saveSettings))},e.getGraphConfigs=t=>{C.getGraphConfigs().success((function(r){e.graphConfigs=r,t&&t()})).error((function(e){l.error(getError(e),I.instant("graphexplore.error.graph.configs.short.msg"))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=t=>{e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=t=>{m.openSimpleModal({title:I.instant("common.confirm"),message:I.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){C.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){l.error(getError(e),I.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=e=>{A({config:e.id},{config:e}),T(),q(e)},e.replaceIRIWithPrefix=t=>{const r=e.namespaces,n=_.findLast(r,(function(e){return 0===t.indexOf(e.uri)}));return n?n.prefix+":"+t.substring(n.uri.length):t};const L=[];L.push(t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=I.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=I.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=I.instant("visual.search.instance.placeholder")}))),L.push(k.onAutocompleteEnabledUpdated(t=>{e.isAutocompleteEnabled=t})),L.push(k.onSelectedRepositoryIdUpdated(t=>{t?E.getNamespaces(t).then(t=>{e.repositoryNamespaces=t,e.namespaces=t.namespaces}).catch(e=>{const t=getError(e);l.error(t,I.instant("error.getting.namespaces.for.repo"))}):e.repositoryNamespaces=new s.NamespacesListModel})),L.push(e.$on("repositoryIsSet",(function(t,r){r.newRepo&&(e.hasInitedRepository=!1),ce(r.newRepo),r.newRepo&&(T(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),M()))})));L.push(t.$watch(()=>t.key,()=>{W=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&W++})),V++}));L.push(e.$watch("propertiesObj.items",()=>{angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&d((function(){e.adapterContainer.adapter.reload()}),500)}));e.$on("$destroy",()=>{L.forEach(e=>e())});const A=(t,r)=>{e.embedded&&(t.embedded=!0),f.search(t),f.state(r)},T=()=>{e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,Y={},K=0},N=()=>R.isActive()?e.defaultSettings:e.saveSettings,P=()=>{N().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none")},D=()=>{e.settings.languagesMap=_.map(e.settings.languages,(function(e){return{text:e}})),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,(function(e){return{text:e}})),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,(function(e){return{text:e}})),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,(function(e){return{text:e}})),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,(function(e){return{text:e}}))},O=()=>{e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},M=()=>{f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,j(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,r){e.loading=!0;const n=N();angular.isDefined(r)&&(e.rootNodeIri=r,b.getInstanceNode({iri:r,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),se=new oe;const r=se.addNode(t.data,re/2,ne/2);te=ee,Re(r,!0)})).catch((function(t){e.loading=!1,l.error(getError(t),I.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri,!0),f.search().saved&&w.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);l.error(t,I.instant("graphexplore.error.could.not.open"))}))},j=(t,r,n)=>{const i=N(),a=void 0===r?i.sameAsState:!0===r,o=void 0===n?i.includeInferred:!0===n;e.loading=!0,b.updateGraph({query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:o,sameAsState:a}).then((function(e){be(e)}),(function(t){e.loading=!1,l.error(getError(t.data),I.instant("graphexplore.error.cannot.load.graph"))}))},G=(e,t)=>{const r=e.split(" ");return t?[r[0],r[1],r[2]].join(">"):[r[0],r[2]].join(">")},Q=e=>[e.source.iri,e.target.iri].join(">"),U=e=>{if(e.isTriple){const t=document.getElementById(Object(o.removeSpecialChars)(G(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},H=e=>{if(e.isTriple){const t=document.getElementById(Object(o.removeSpecialChars)(G(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},F=e=>{const t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`},z=e=>{const t=e.source.isTriple?G(e.source.iri,!0):e.source.iri,r=e.target.isTriple?G(e.target.iri,!0):e.target.iri;return Object(o.removeSpecialChars)(`${t}>${r}>marker`)},q=t=>{e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?d((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,C.loadGraphForConfig(t,t.startQueryIncludeInferred,N().linksLimit,t.startQuerySameAs).then((function(e){be(e)}),(function(t){e.loading=!1,l.error(getError(t),I.instant("graphexplore.error.graph.load"))})))},B=function(){var t,r;f.search().config?(t=f.search().config,r=M,t===e.defaultGraphConfig.id?q(e.defaultGraphConfig):C.getConfig(t).then(e=>{q(e),r()}).catch(e=>{l.error(getError(e),I.instant("graphexplore.error.could.not.load.config",{configId:t}))})):f.search().query||f.search().uri?(q(e.defaultGraphConfig),M()):M()};v.onpopstate=function(t){T(),t.state&&(t.state.config?(q(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))},e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);let W=0,V=0,Y={},K=0;const X=16,Z=d3.zoom().scaleExtent([.1,10]);let J;const ee=d3.zoomIdentity.translate(0,-70).scale(1);Z.on("zoom",(function(e){R.isActive()||(te=e.transform,J.attr("transform",te))}));let te=ee;const re=1e3,ne=1e3;let ie,ae;function oe(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,r){return e.x=t,e.y=r,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(r){const n=r.source.iri,i=r.target.iri,a=_.min([n,i])+"|"+_.max([n,i]);t[a]||(t[a]=1,e[n]=(e[n]||0)+1,e[i]=(e[i]||0)+1)})),_.each(this.links,(function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0}))},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){let r,n;r=e.isTripleSource?Te(e.source):_.find(t,(function(t){return t.iri===e.source})),n=e.isTripleTarget?Te(e.target):_.find(t,(function(t){return t.iri===e.target}));let i={source:r,target:n,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${i.source.isTriple?G(i.source.iri):i.source.iri}>${i.target.isTriple?G(i.target.iri):i.target.iri}`;if(se.tripleLinksCopy.has(e)){let t=se.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),se.tripleLinksCopy.set(e,t),null}se.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of se.tripleLinksCopy.keys())1===se.tripleLinksCopy.get(e).length&&se.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return r(e,t).length};function r(e,t){return _.filter(t,(function(t){return t.source.iri===e.iri||t.target.iri===e.iri}))}this.countLinks=t,this.linksTypes=function(e,t){const n=r(e,t),i=_.map(n,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const n=r(e,t),i=_.map(n,(function(e){return e.predicates}));return _.uniq(_.flatten(i))},this.removeTriples=function(e){let t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,(function(r){let n=e.split(">"),i=G(r.source.iri),a=G(r.target.iri);if(i===e&&se.tripleNodes.delete(a)){let e=a.split(">");t.push({source:e[0],target:e[1]})}let o=i===e||a===e||r.source.iri===n[0]&&r.target.iri===n[1];return o&&(se.tripleLinksCopy.delete(`${i}>${a}`),se.tripleLinksCopy.delete(`${a}>${i}`)),o})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(r){let n=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===r.iri||e.target.iri===r.iri;return t&&(e.target.isTriple&&n.push(G(e.target.iri)),e.source.isTriple||e.target.isTriple||n.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(n);const i=this.links;this.nodes=_.reject(this.nodes,(function(e){return 0===t(e,i)})),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){let n=[],i=this.links;this.links=_.reject(this.links,(function(a){let o=a.source.iri===e.iri&&1===t(a.target,i)&&!a.target.isTriple||a.target.iri===e.iri&&1===t(a.source,i)&&!a.source.isTriple;if(!o){let n;if(a.source.iri!==e.iri||2!==t(a.target,i)||a.target.isTriple?a.target.iri!==e.iri||2!==t(a.source,i)||a.source.isTriple||(n=r(a.source,i)):n=r(a.target,i),!n)return!1;o=(n[0].source.iri===e.iri||n[0].target.iri)&&(n[1].source.iri===e.iri||n[1].target.iri)}return o&&(a.target.isTriple&&n.push(G(a.target.iri)),a.source.isTriple||a.target.isTriple||n.push([a.source.iri,a.target.iri].join(">"))),o})),this.removeTriples(n),i=this.links,this.nodes=_.reject(this.nodes,(function(r){return 0===t(r,i)&&r.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,r){e.x=t,e.y=r,e.weight=0;let n=G(e.iri);if(this.tripleNodes.has(n)){let t=this.tripleNodes.get(n);t.push(e),this.tripleNodes.set(n,t)}else e.weight=10,this.tripleNodes.set(n,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:_.cloneDeep(e.labels),types:_.cloneDeep(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),r=JSON.stringify(Array.from(this.tripleLinksCopy.entries()));return{nodes:e,links:_.map(this.links,(function(e){return{source:e.source.iri,isTripleSource:e.source.isTriple,target:e.target.iri,isTripleTarget:e.target.isTriple,predicates:e.predicates}})),tripleNodes:t,tripleLinksCopy:r,colorIndex:K,type2color:Y,transform:te}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=_.cloneDeep(t.nodes),this.tripleNodes=t.tripleNodes?new Map(JSON.parse(t.tripleNodes)):new Map,this.links=[],this.addAndMatchLinks(t.links),this.tripleLinksCopy=t.tripleLinksCopy?new Map(JSON.parse(t.tripleLinksCopy)):new Map,_.each(this.nodes,(function(t){t.fixed&&e.numberOfPinnedNodes++})),angular.isDefined(t.colorIndex)&&angular.isDefined(t.type2color)&&(K=t.colorIndex,Y=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(te=d3.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),ve()}}e.datasource={get:function(t,r,n){return g.initLazyList(t,r,n,W,e.propertiesObj.items)},revision:function(){return V}},p.when(h.getPrincipal()).then(t=>(t=>{const r=t.appSettings;e.defaultSettings.includeInferred=r.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=r.DEFAULT_INFERENCE&&r.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=r.DEFAULT_VIS_GRAPH_SCHEMA;const n=x.get(S.GRAPHS_VIZ);if(n&&"object"==typeof n)try{e.saveSettings=n,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch(t){e.saveSettings=_.cloneDeep(e.defaultSettings),x.set(S.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)})(t)),e.showInfoPanel=!1;let se=new oe;function ce(t){!r.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(B))}e.addedTag=function(t){return t.text.indexOf(":")<0?(l.warning(I.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const r=e.split(":"),n=r[0],i=r[1];if(!angular.isUndefined(i)){const e=u.getNamespaceUriForPrefix(t,n);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,r){if(e.text.indexOf(":")<0)return r?l.warning(I.instant("graphexplore.absolute.prefixed.iri.option"),t):l.warning(I.instant("graphexplore.absolute.prefixed.iri"),t),!1;const n=e.text.indexOf("*");if(n>=0){if(!r)return l.warning(I.instant("graphexplore.wildcards.not.allowed"),t),!1;if(n<e.text.length-1)return l.warning(I.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLicenseValid=function(){return c.isLicenseValid()},ce();const le=d3.scaleLinear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),de=d3.scaleLinear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(Y[e])&&(Y[e]=K,K++);const t=Y[e];return t>39?"#c2c2c2":t%2==0?le(t/2):de(t/2)};const ue=d3.forceX(re/2).strength(.005),pe=d3.forceY(ne/2).strength(.005),fe=d3.forceSimulation().force("x",ue).force("y",pe),he=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+re+" "+ne).attr("preserveAspectRatio","xMidYMid meet");he.append("rect").attr("width",10*re).attr("height",10*ne).attr("x",-(10*re-re)/2).attr("y",-(10*ne-ne)/2).style("fill","none").style("pointer-events","all").call(Z).on("click",(function(e){e.stopPropagation(),ke(),fe.stop()}));let ge=0,me=0;const ye=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=2.8.4-RC2").attr("x",(function(){return e.x-e.size+5})).attr("y",(function(){return e.y-e.size})).attr("width",(function(){return 2*e.size})).attr("height",(function(){return 2*e.size})).attr("class","node-loader")}};function ve(t){d3.selectAll("svg g").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),J=he.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(te)&&!t?te:""}));const r=Object(i.a)().attr("class","d3-tip").customPosition((function(){const e=ie.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let r="";return t.fixed&&(r+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?r+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):r+="<i>No types</i>",r})),a=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,r){if(0===r)return Pe(t);if(r<10)return" · "+Pe(t);if(10===r){const t=function(e){return e.predicates.length-10}(e),r=t>1?t+" predicates":t+" predicate";return" · "+I.instant("graphexplore.tip.text",{textToShow:r})}})),""),t};let s;const c=Object(i.a)().attr("class","d3-tip").customPosition((function(e){const t=s.getBoundingClientRect(),r=function(e){const t=a(e),r=document.createElement("canvas").getContext("2d");return r.font="13px Arial",e.predicates.length<10?r.measureText(t).width:r.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:r+"px"}})).html((function(e){return a(e)}));const u=function(){d.cancel(void 0),d.cancel(ge),ie=null,r.hide(),me=d((function(){ke()}),500)};he.call(r);he.call(c);let p=he.selectAll(".link"),f=he.selectAll(".node");const h=d3.forceCollide(e=>e.size+5).strength(.5),g=d3.forceManyBody().strength(-300),m=d3.forceCenter(re/2,ne/2);fe.nodes(se.nodes).force("charge",g).force("collide",h).force("center",m).force("link",d3.forceLink(se.links).distance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),r=e.predicates[0].split("/"),n=r[r.length-1];t.addClass("predicate-text").text(n),$("body").append(t);const i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness}))),J.append("defs").selectAll("marker").data(se.links).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return z(e)})).attr("viewBox","0 -5 10 10").attr("refX",(function(e){return e.target.isTriple?11:e.target.size+11})).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),p=J.selectAll(".link").data(se.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return Object(o.removeSpecialChars)(Q(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${z(e)})`}));const y=J.selectAll(".link-wrapper").append("text").text((function(e){return Ne(e)})).attr("class",(function(e){return e.predicates.length>1||se.tripleNodes.has(Q(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",N().showLinksText?"":"none").on("mouseover",(function(e,t){e.stopPropagation(),function(e,t){d.cancel(void 0);const r=s=e.target;d((function(){s===r&&t.predicates.length>1&&c.show(t,s)}),300)}(e,t)})).on("mouseout",(function(){d.cancel(void 0),s=null,c.hide()})).on("click",(function(t,r){t.stopPropagation(),function(t,r){Ae();const n=Q(r);if(1===r.predicates.length&&se.tripleNodes.has(n)){ae=null;const e=se.tripleNodes.get(n)[0];if(we(e,this,t.button)){const t={};t.iri=e.iri,t.pred=Pe(e.iri.split(" ")[1]),Le(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,ae===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(ae=null);ae=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){const r=function(e,t){const r=Q(t);return se.tripleNodes.has(r)?se.tripleNodes.get(r).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),n=r>-1;return{value:Pe(e),partOfTriple:n,linkId:n?Q(t):"",nodeIndex:r}})),e.showInfoPanel=!0)}(r)}(t,r)}));let v,x=0,S=null,w=null;const C=function(t,r,n){let i=n||this.parentNode;Array.isArray(n)&&(i=n[r]);se.countLinks(t,se.links)<=N().linksLimit?Re(t,!1,i):l.info(I.instant("graphexplore.increase.limit"),I.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function b(e,t){let r,n,i,a,o=!0;if("down"===t)r=2*e.size,n=e.size/3,i=.8,a=.3;else if("down-fixed"===t)r=2*e.size,n=e.size,i=.8,a=.66;else if("up"===t)r=e.size/3,n=2*e.size,i=.3,a=.8;else{if("fixed"!==t)return;r=e.size,i=.66,o=!1}let s=J.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",r+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",i);"fixed"!==t&&"down-fixed"!==t||(e.pin=s),o&&(s=s.transition().duration(1e3).style("font-size",(function(){return n+"px"})).attr("opacity",a),"down-fixed"!==t&&s.remove())}const k=d3.drag().subject((function(e){return e})).on("start",(function(e,t){if(R.isActive())return;0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,ke(),d3.select(this).classed("dragging",!0),fe.alphaTarget(.3).restart())})).on("drag",(function(t,r){r.isBeingDragged&&(r.fx=t.x,r.fy=t.y,r.fixed?r.beginDragging&&b(r,"fixed"):(e.numberOfPinnedNodes++,r.fixed=!0,b(r,"down-fixed")),r.pinWasFixed=!0,r.beginDragging=null)})).on("end",(function(e,t){t.isBeingDragged&&(t.pinWasFixed&&(t.pinWasFixed=null,d3.select(".pinned").remove()),t.isBeingDragged=!1,d3.select(this).classed("dragging",!1));fe.alphaTarget(0)}));f=J.selectAll(".node").data(se.nodes).enter().append("g").attr("class","node-wrapper").attr("id",(function(e){return e.iri})).append("circle").attr("class","node").attr("r",(function(e){return e.size})).style("fill",(function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])})).on("mouseover",(function(t,n){n.isBeingDragged||(d.cancel(me),ge=d(()=>{(function(t,r){if(e.showInfoPanel)return!1;(Se.closeIcon||Se.expandIcon||Se.focusIcon||Se.copyURIIcon)&&Se.removeIcons();if(fe.alpha()<.1)return Se.initIcons(t,r.parentNode),fe.stop(),xe(),!0;return!1})(n,this)&&function(e,t){d.cancel(void 0);const n=ie=t.target;d((function(){ie===n&&r.show(e,ie)}),300)}(n,t)},400))})).on("mouseout",u).on("click",(function(t,r){if(t.button&&0!==t.button)return;const n=this;if(S&&w===n)return d.cancel(S),S=null,void C(r,0,n.parentNode);w=n,u(),e.showPredicates=!1,R.isActive()||(d.cancel(S),S=d((function(){we(r,n,t),S=null}),540))})).on("touchstart",(e,t)=>function(e){x=0,v=d((function(){x<5&&Ce(e),v=null}),1e3)}(t)).on("touchmove",(function(){x++})).on("touchend",(function(){d.cancel(v),v=null})).on("contextmenu",(function(t,n){t.shiftKey||(t.preventDefault(),ke(),e.closeInfoPanel(),n.fixed?(e.numberOfPinnedNodes--,n.fixed=!1,n.fx=null,n.fy=null,b(n,"up"),fe.alpha(1).restart()):(e.numberOfPinnedNodes++,n.fixed=!0,b(n,"down")),function(e){ie&&r.show(e,ie)}(n))})).on("gdb-expand-node",(e,t)=>C(t,0,e.srcElement.parentNode)).on("gdb-show-node-info",(e,t)=>Ee(t)).call(k);const E=J.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));J.insert("g").attr("class","menu-events"),(e=>{e.each((function(e){e.fontSize=n.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,X,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").text((function(e){return e.labels[0].label})),d((function(){$(".node-label-body div").each((function(e,t){let r=t.textContent.substring(0,t.textContent.length-1);let n=0;for(;n<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)r=r.substring(0,r.length-1),t.textContent=r+"…",n++}))}),50)})(E),fe.on("tick",(function(){p.attr("x1",(function(e){return U(e.source)})).attr("y1",(function(e){return H(e.source)})).attr("x2",(function(e){return U(e.target)})).attr("y2",(function(e){return H(e.target)})),y.attr("x",(function(e){let t=U(e.source),r=U(e.target);return e.x=.5*(t+r)})).attr("y",(function(e){let t=H(e.source),r=H(e.target);return e.y=.5*(t+r)})).attr("transform",(function(e){return"rotate("+function(e,t){const r={x:U(e.source),y:H(e.source)},n={x:U(e.target),y:H(e.target)};if(t)return 180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;{const e=180*Math.atan2(n.y-r.y,n.x-r.x)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"})),f.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),J.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),J.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),E.attr("x",(function(e){return e.x-1.75*e.size})).attr("y",(function(e){return e.y-3*e.fontSize/2})),d3.select(".pinned").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})),xe()})),angular.isDefined(ye)&&ye.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(r){const n=Object(o.removeSpecialChars)(r.source.iri),i=Object(o.removeSpecialChars)(r.target.iri);if(n===t&&i===e){let e=n;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),r.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),fe.alpha(.3).restart()}function xe(){t.d3alpha=fe.alpha()}const Se=new function(){function r(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(n,a){const o=Object(i.a)().attr("class","d3-tip d3-actions-tip").customPosition((function(e,t){const r=t.target.getBoundingClientRect();return{top:r.top-20+"px",left:r.right+10+"px"}})).html((function(e){return e}));he.call(o);n.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return r(20,n)})),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--primary-color)"),this.collapseIcon.on("click",(function(){var e;(e=n).isExpanded=!1,se.removeNodeLeafLinks(e),ve()})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),d.cancel(ge),d.cancel(me)})).on("mouseout",(function(){o.hide(),me=d((function(){ke()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return r(20,n)})),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--primary-color)"),this.expandIcon.on("click",(function(){Re(n,!1,a)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){o.hide(),me=d((function(){ke()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return r(20,n)})),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--primary-color)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",n.iri)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){o.hide(),me=d((function(){ke()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return r(20,n)})),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--primary-color)"),this.copyURIIcon.on("click",(function(){e.copyToClipboard(n.iri),ke(),o.hide()})).on("mouseover",(function(e){o.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>",e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){o.hide(),me=d((function(){ke()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return r(20,n)})),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--primary-color)"),this.closeIcon.on("click",(function(){Ce(n)})).on("mouseover",(function(e){o.show(this.getAttribute("name"),e),d.cancel(me),d.cancel(ge)})).on("mouseout",(function(){o.hide(),me=d((function(){ke()}),500)})),this.animateMenu(n)},this.animateMenu=function(e){const t=d3.easeSin;let n=0;let i=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return r(i,e)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return r(i,e)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,r(i,e)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,r(i,e)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease(t).attr("transform",(function(){return i+=30,r(i,e)})).delay(n+=35),this.expandedState=!0}};function we(r,n,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",r.iri),!1):i.ctrlKey||i.metaKey?(Ce(r),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===r?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(Ee(r),!0)}function Ce(e){se.removeNode(e),ve()}function be(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),se=new oe,te=ee}(t),Ie(t)}function Ie(t,r,n){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(se.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));const a=[],o=se.tripleLinksCopy.values();for(let e=0;e<se.tripleLinksCopy.size;e++){o.next().value.forEach(e=>{a.push(e)})}i=_.filter(i,(function(e){return-1===_.findIndex(a,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),i=_.filter(i,(function(e){return e.source!==e.target}));const s=((e,t)=>{const r=t.map(t=>t[e]);return t.filter((t,n)=>r.indexOf(t[e])===n)})("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),c=_.map(se.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),d=se.tripleNodes.values();for(let e=0;e<se.tripleNodes.size;e++){d.next().value.forEach(e=>{c.push({iri:e.iri,isTriple:e.isTriple})})}const u=_.reject(s,(function(e){return _.some(c,e)}));if(0===u.length)(n||0===i.length)&&l.info(I.instant("graphexplore.error.node.connections")),se.addAndMatchLinks(i),ve();else{const t=[],n=[],a=N();_.forEach(u,(function(r,i){t.push(b.getInstanceNode({iri:r.isTriple?F(r.iri):r.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?a.languages:[],includeInferred:a.includeInferred,sameAsState:a.sameAsState}).then((function(e){n[i]=e.data})))})),p.all(t).then((function(){_.forEach(n,(function(e,t){const i=2*Math.PI*t/n.length,a=(r?r.x:0)+Math.cos(i)*ne/3,o=(r?r.y:0)+Math.sin(i)*ne/3;e.isTriple?se.addTriple(e,a,o):se.addNode(e,a,o)})),se.addAndMatchLinks(i),r&&(r.isExpanded=!0),ve()}))}}function Re(t,r,n){if(ye.getLoadingState())return;ye.init(t,n);const i=N(),a=t.iri;b.getInstanceNodeLinks({iri:a,linksLimit:i.linksLimit,includeInferred:i.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?i.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?i.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?i.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?i.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?i.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?i.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?i.languages:[],sameAsState:i.sameAsState,includeSchema:i.includeSchema}).then((function(e){Ie(e,t,r)}),(function(t){const r=getError(t.data);l.error(r,I.instant("graphexplore.error.exploring.node")),e.loading=!1,ye.setLoadingState(!1)}))}function ke(){angular.isDefined(Se)&&Se.expandedState&&Se.removeIcons()}function Ee(t){fe.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(F(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const r=N();b.getProperties({iri:t.isTriple?F(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState,rejectedPredicates:e.shouldShowSettings()?r.rejectedPredicates:[]}).then((function(t){e.data=_.mapKeys(t.data,(function(t,r){return e.replaceIRIWithPrefix(r)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,r){e.propertiesObj.items.push({key:r,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const r=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));r&&(e.nodeImage=r.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){l.warning(getError(e.data),"Error")}))}function Le(e){_e("predicate","var(--primary-color-dark)",e),_e("predicates","var(--primary-color-dark)",e);const t=document.getElementsByClassName("link");t&&_.each(t,(function(t){const r=t.__data__;(r.source.iri.indexOf(e.iri)>=0||r.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.style.strokeWidth=4)}));const r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(t){const r=t.__data__;(r.source.iri.indexOf(e.iri)>=0||r.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function _e(e,t,r){const n=document.getElementsByClassName(e);n&&_.each(n,(function(e){const n=e.__data__;r?((n.source.iri.indexOf(r.iri)>=0||n.target.iri.indexOf(r.iri)>=0)&&(e.style.fill=t),G(r.iri)===Q(n)&&(e.textContent=r.pred,e.style.fill=t),r.oppLinkIRI&&r.oppLinkIRI===Q(n)&&(e.textContent=r.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Ne(n))}))}function Ae(){_.each(e.predicates,(function(e){const t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));const t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),_e("predicate",""),_e("predicates","");const r=document.getElementsByClassName("arrow-marker");r&&_.each(r,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Te(e){const t=G(e);if(se.tripleNodes.has(t))return se.tripleNodes.get(t).find(t=>t.iri===e)}function Ne(e){return e.predicates.length>1?e.predicates.length+" predicates":Pe(e.predicates[0])}function Pe(t){const r=e.replaceIRIWithPrefix(t);return r.length===t.length?t.split("/")[t.split("/").length-1]:r}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],ae=null,d((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(se.tripleNodes.has(t.linkId)){Ae();const r=se.tripleNodes.get(t.linkId)[t.nodeIndex];Ee(r),e.showPredicates=!0;const n=document.getElementById(t.linkId+t.nodeIndex);n&&(n.style.fontWeight="bold");const i={},a=se.tripleLinksCopy.values();for(let e=0;e<se.tripleLinksCopy.size;e++){const e=a.next().value;e.length>1&&e.every(t=>t.source.iri===r.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=G(t.target.iri),i.oppTriplePred=Pe(t.target.iri.split(" ")[1])),i.pred=Pe(r.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==r.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=G(t.source.iri),i.oppTriplePred=Pe(t.source.iri.split(" ")[1])),i.pred=Pe(r.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=r.iri,i.pred=Pe(r.iri.split(" ")[1])),Le(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return r.getActiveRepository()},e.isLoadingLocation=function(){return r.isLoadingLocation()},e.hasActiveLocation=function(){return r.hasActiveLocation()},e.rotate=function(e){ke();const t=10*(e?1:-1)*Math.PI/180,r=Math.cos(t),n=Math.sin(t),i=re/2,a=ne/2;d3.selectAll(".node-wrapper").each((function(e){e.x=i+(r*(e.x-i)+n*(e.y-a)),e.y=a+(-n*(e.x-i)+r*(e.y-a)),e.fixed&&(e.fx=e.x,e.fy=e.y)})),fe.alpha(1).restart()},e.openUri=function(t,r){if(!r){const r={};e.configLoaded.id!==e.defaultGraphConfig.id&&(r.config=e.configLoaded.id),r.uri=t,A(r,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(se.copyState()),r={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};r.id?e.saveGraphModal("update",r):e.saveGraphModal("new",r)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const De=function(t){w.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),l.success(I.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);l.error(t,I.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,r,n){y.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:r,graphExists:n,shared:r.shared}}}}).result.then((function(t){if(t.restart)e.saveGraphModal(t.mode,t.graph,!1);else switch(t.mode){case"new":!function(t){e.configLoaded&&(t.config=e.configLoaded.id),w.addNewSavedGraph(t).success((function(r,n,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),l.success(I.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(r,n){if(422===n)e.saveGraphModal("new",t,!0);else{const e=getError(r);l.error(e,I.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":De(t.graph)}}))},e.refreshSavedGraphs=function(){w.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);l.error(t,I.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,r){t.owner?(e.lastSavedGraphName=t.name,e.lastSavedGraphId=t.id,e.shared=t.shared,e.configLoaded=e.findConfigById(t.config)):(e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=t.shared),e.configLoaded||(e.configLoaded=e.defaultGraphConfig),f.url("?saved="+t.id),se.restoreState(JSON.parse(t.data)),r||A({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){const r=[location.protocol,"//",location.host,location.pathname,"?saved=",t.id].join("");e.copyToClipboard(r)},e.deleteSavedGraph=function(t){m.openSimpleModal({title:I.instant("common.confirm"),message:I.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){w.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),l.success(I.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);l.error(t,I.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,r){return r.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){ke();const t=angular.isUndefined(e.numberOfPinnedNodes)||e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(r){r.fixed=t,t?(e.numberOfPinnedNodes++,r.fx=r.x,r.fy=r.y):(r.fx=null,r.fy=null)})),fe.alpha(1).restart()},$("body").on("keydown",(function(t){!R.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function l(e,t,r,n){switch(e.mode=r.mode,e.graph=_.cloneDeep(r.graph),e.graphExists=r.graphExists,e.mode){case"new":e.title=n.instant("graphexplore.create.new.graph"),e.okButtonText=n.instant("common.create.btn");break;case"update":e.title=n.instant("graphexplore.update"),e.okButtonText=n.instant("common.save.btn");break;case"rename":e.title=n.instant("graphexplore.rename"),e.okButtonText=n.instant("common.save.btn")}e.ok=function(){e.form.$valid&&t.close({graph:e.graph,mode:e.mode})},e.saveNew=function(){e.graph.name=e.graph.name+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("GraphsVisualizationsCtrl",c).controller("SaveGraphModalCtrl",l).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),c.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","ClassInstanceDetailsService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","$translate","GuidesService","WorkbenchContextService","RDF4JRepositoriesService"],l.$inject=["$scope","$uibModalInstance","data","$translate"]},256:function(e,t,r){"use strict";r.r(t);r(101),r(13),r(23);var n=r(96),i=r(89),a=r(19),o=r(111),s=r(132),c=r(8);function l(e,t,r,l,d,u,p,f,h,g,m,y,v,x,S,w,C){let b;t.newConfig=new o.GraphsConfig,t.revertConfig=void 0,t.page=1,t.totalPages=5,t.helpHidden=1===y.get(v.HIDE_GRAPH_CONFIG_HELP),t.isUpdate=!1,t.shared=!1,t.canEditActiveRepo=t.canWriteActiveRepo(),t.samples=[],t.tabConfig={inference:t.newConfig.startQueryIncludeInferred,sameAs:t.newConfig.startQuerySameAs},t.isAutocompleteEnabled=void 0,t.repositoryNamespaces=void 0,t.tabsViewModel=[];const I=g.configName,R=u.getActiveRepository();t.toggleHelp=e=>{void 0===e&&(e=y.get(v.HIDE_GRAPH_CONFIG_HELP)),1!==e?(y.set(v.HIDE_GRAPH_CONFIG_HELP,1),t.helpHidden=!0):(y.set(v.HIDE_GRAPH_CONFIG_HELP,0),t.helpHidden=!1)},t.fixedVisualCallback=(e,r)=>{t.newConfig.startIRI=e,t.newConfig.startIRILabel=r,b=!0},t.isDefaultGraph=e=>e.isDefaultGraph(),t.isUserGraph=e=>!e.isDefaultGraph(),t.getSampleName=(e,t)=>{if(!e)return"";const r=e.getPropertyDescription(t);return r||(e.id?"Copy of "+e.name:e.name)},t.createGraphConfig=e=>{h.createGraphConfig(e).success((async function(){await m.showToastMessageWithDelay("graphexplore.saved.new.config"),l.url("graphs-visualizations")})).error((function(e){d.error(getError(e),x.instant("graphexplore.error.could.not.create"))}))},t.updateGraphConfig=e=>{h.updateGraphConfig(e).success((async function(){await m.showToastMessageWithDelay("graphexplore.saved.config"),l.url("graphs-visualizations")})).error((function(e){d.error(getError(e),x.instant("graphexplore.error.could.not.save"))}))},t.goToPage=e=>{t.page!==e&&N(()=>{t.showEditor(),t.page=e})},t.goToPreviousPage=()=>{t.page>1&&t.goToPage(t.page-1),M()&&(b=!1)},t.goToNextPage=()=>{$(),t.newConfig.isStartMode(o.StartMode.NODE)&&!b||t.goToPage(t.page+1)},t.saveGraphConfig=()=>{$(),M()&&!b||(t.newConfig.startQueryIncludeInferred=t.tabConfig.inference,t.newConfig.startQuerySameAs=t.tabConfig.sameAs,N(()=>{t.newConfig.name?(t.queryEditorIsDirty=!1,t.isUpdate?t.updateGraphConfig(t.newConfig.toSavePayload()):t.createGraphConfig(t.newConfig.toSavePayload())):D(x.instant("graphexplore.provide.config.name"))}))},t.setQuery=async e=>{const r=e||" ";(await k()).setQuery(r),t.markDirty()},t.markDirty=async()=>{if(t.revertConfig){const e=t.revertConfig.getQueryType(t.page),r=await A();t.queryEditorIsDirty=e!==r}},t.showEditor=()=>{t.viewMode="yasr",T(),_()},t.showPreview=()=>{t.viewMode="editor",E()},t.revertEditor=()=>{t.setQuery(t.revertConfig.getQueryType(t.page)),t.queryEditorIsDirty=!1};const k=()=>a.YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync("#query-editor"),E=async(e,r)=>{const n=await k(),i=await n.getQueryType();if(r&&"SELECT"!==i&&"CONSTRUCT"!==i&&"DESCRIBE"!==i)return void d.warning(x.instant("query.editor.warning.msg"));"update"!==await n.getQueryMode()?t.queryIsRunning||(t.viewMode="editor",L()):d.warning(x.instant("cannot.execute.update.error"))},L=async()=>{(await k()).query(i.RenderingMode.YASR)},_=async()=>(await k()).changeRenderMode(i.RenderingMode.YASQE),A=async()=>(await k()).getQuery(),T=async()=>(await k()).abortQuery(),N=async e=>{const r=await(async()=>{const e=await k();let r=await e.getQuery();return r=r.trim(),t.newConfig.updateModel(r,t.page)})();1===t.page?r.isStartMode(o.StartMode.NODE)&&!r.startIRI?D(x.instant("graphexplore.select.start.node")):r.isStartMode(o.StartMode.QUERY)&&!r.startGraphQuery?D(x.instant("graphexplore.provide.query")):r.isStartMode(o.StartMode.QUERY)?O(e,r.startGraphQuery,"graph"):e():2===t.page?O(e,r.expandQuery,"construct",["node"]):3===t.page?O(e,r.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===t.page?O(e,r.predicateLabelQuery,"tuple",["edge"],["label"]):5===t.page&&O(e,r.resourcePropertiesQuery,"tuple",["node"],["property","value"])},P=()=>{t.tabConfig.inference=t.newConfig.startQueryIncludeInferred,t.tabConfig.sameAs=t.newConfig.startQuerySameAs,t.setQuery(t.newConfig.getQueryType(t.page))},D=e=>{d.warning(e)},O=(e,t,r,n,i,a)=>{t?h.validateQuery(t,r,n,i,a).success(()=>{e()}).error(e=>{D(getError(e))}):e()},$=()=>{M()&&t.$broadcast("addStartFixedNodeAutomatically",{startIRI:t.newConfig.startIRI})},M=()=>1===t.page&&t.newConfig.isStartMode(o.StartMode.NODE),j=()=>{h.getGraphConfigSamples().success((function(e){t.samples=Object(s.mapGraphConfigSamplesToGraphConfigs)(e).filter(e=>!e.id||t.newConfig.id!==e.id||(t.revertConfig=e,!1))})).error((function(e){d.error(getError(e),x.instant("graphexplore.error.graph.configs"))}))},G={endpoint:()=>"repositories/"+u.getActiveRepository(),showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showYasqeActionButtons:!1,yasqeActionButtons:a.INFERRED_AND_SAME_AS_BUTTONS_CONFIGURATION,showQueryButton:!1,initialQuery:" ",componentId:"graphs-config",render:i.RenderingMode.YASQE,maxPersistentResponseSize:0,showYasqeResizer:!1,yasqeMode:n.YasqeMode.PROTECTED,infer:t.newConfig.startQueryIncludeInferred,sameAs:t.newConfig.startQuerySameAs},Q=(e,r,n)=>{t.queryIsRunning=e},U=()=>{window.removeEventListener("beforeunload",H),z.forEach(e=>e())},H=e=>{t.queryEditorIsDirty&&(e.returnValue=!0)},F=()=>{t.tabsViewModel=[{page:1,label:x.instant("starting.point.label"),type:"startGraphQuery"},{page:2,label:x.instant("graph.expansion"),type:"expandQuery"},{page:3,label:x.instant("node.basics"),type:"resourceQuery"},{page:4,label:x.instant("edge.basics"),type:"predicateLabelQuery"},{page:5,label:x.instant("node.extra"),type:"resourcePropertiesQuery"}]},z=[];z.push(w.onSelectedRepositoryIdUpdated(e=>{e?C.getNamespaces(e).then(e=>{t.repositoryNamespaces=e}).catch(e=>{const t=getError(e);d.error(t,x.instant("error.getting.namespaces.for.repo"))}):t.repositoryNamespaces=new c.NamespacesListModel})),z.push(w.onAutocompleteEnabledUpdated(e=>{t.isAutocompleteEnabled=e})),z.push(t.$on("$locationChangeStart",(e,r)=>{if(t.queryEditorIsDirty){e.preventDefault();((e,t,r,n)=>{S.openSimpleModal({title:e,message:t,warning:!0}).result.then((function(){angular.isFunction(r)&&r()}),(function(){angular.isFunction(n)&&n()}))})(x.instant("common.confirm"),x.instant("visual.config.warning.unsaved.changes"),()=>{U();const e=l.absUrl().length-l.url().length,t=r.substring(e);l.path(t)})}else U()})),z.push(t.$on("$destroy",U)),z.push(t.$watch(t.getActiveRepositoryObject,()=>{(t.newConfig.isStartMode(o.StartMode.QUERY)||t.page>1)&&(t.viewMode="yasr",T().then(_))})),z.push(e.$on("$translateChangeSuccess",()=>{F()})),window.addEventListener("beforeunload",H),t.$watch("newConfig.startMode",e=>{e===o.StartMode.QUERY&&P()}),t.$watch("page",e=>{(t.newConfig.isStartMode(o.StartMode.QUERY)||e>1)&&(t.showEditor(),P())}),F(),u.getPrefixes(R).then(e=>(e=>{const r=t.$watch((function(){return t.getActiveRepositoryObject()}),(function(i){if(i){t.canEditActiveRepo=t.canWriteActiveRepo();const i=angular.extend({},G,{prefixes:e,yasqeMode:t.canWriteActiveRepo()?n.YasqeMode.WRITE:n.YasqeMode.PROTECTED});t.yasguiConfig=i,r()}}))})(e)).finally(()=>Q(!1)),I?(t.isUpdate=!0,h.getConfig(I).then((function(e){t.newConfig=e,j()})).catch(e=>{d.error(getError(e),x.instant("created.connector",{name:I}))})):(t.isUpdate=!1,j()),t.getActiveRepository()&&(Q(!0,x.instant("common.refreshing.namespaces"),x.instant("common.extra.message")),u.getPrefixes(u.getActiveRepository()).then(e=>{t.namespaces=e}).catch((function(e){t.repositoryError=getError(e)})).finally((function(){Q(!1)})))}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories"]).controller("GraphConfigCtrl",l),l.$inject=["$rootScope","$scope","$timeout","$location","toastr","$repositories","SparqlRestService","$filter","GraphConfigRestService","$routeParams","Notifications","LocalStorageAdapter","LSKeys","$translate","ModalService","WorkbenchContextService","RDF4JRepositoriesService"]},257:function(e,t,r){"use strict";r.r(t);var n=r(562),i=r(587),a=r(550),o=r(551);r(13);function s(e,t,r,s,c,l,d,u,p,f,h,g,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(d,y,v){!function(d,y){var v,x,S=d3.pack().size([780,780]),w=d3.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),C=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function b(){return C.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function I(){return"true"===h.get(g.CLASS_HIERARCHY_HIDE_PREFIXES)}function R(){var e=o.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.8.4-RC2");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=o.a.Export.generateBase64ImageSource("#classChart svg");d3.select(this).attrs({href:t,download:"class-hierarchy-"+l.getActiveRepository()+".svg"})}d.hidePrefixes=I();var k,E,L=b();if(!d.classHierarchyData.classCount&&l.getActiveRepository()&&!l.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=h.get("classHierarchy-selectedGraph-"+l.getActiveRepository());r.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,r,n){e.loader=!1,207===r&&u.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),d.classHierarchyData=t,d3.select("#download-svg").on("mouseover",R)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(m.instant("graphexplore.error.request.failed",{name:f,error:getError(t)}))}))}var A,T,N,P,D,O,M,j={};function G(r,o,l,u){T&&T(),N&&N(),d3.selectAll("#main-group").remove(),L=b(),i.a.SingleChild.addPlaceholders(r,!0),(x=d3.hierarchy(r)).sum((function(e){return e.size})),A=l||x,S(x);var h,g=x.descendants();A.isInFocusTransitive=!0,i.a.SingleChild.removePlaceholders(g),i.a.SingleChild.centerNodes(g),i.a.SingleChild.makePositionsRelativeToZero(g),v||(v=Object(n.a)().attr("class","d3-tip").customPosition((function(e,t){return{top:"inherit",bottom:s.innerHeight-t.clientY+"px",right:s.innerWidth-t.clientX+"px"}})).html((function(e){return e.data.name})),C.call(v));var m=L.selectAll("circle").data(g).enter().append("g");o.doFade&&m.each((function(e){a.a.Transition.fadeIn(d3.select(this),550)}));var y,I=[],R=m.append("circle").attr("class",(function(e){return e.data.role})).attr("guide-selector",(function(e){return"class-"+e.data.name})).style("fill",(function(e){return e.children?w(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.data.name!==f){var t=e.data.name;I.push({name:t}),j[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(t){o.noPrefixes||e.textHidden?v.show(e,t):v.hide(e)})),e.circle.on("mouseout",v.hide)}})).on("gdb-focus",(e,t)=>E(t)).on("gdb-zoom",(e,t)=>z(t));function P(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),y=e}function D(){d.showClassInfoPanel=!1}I&&(I=_.uniqBy(I,"name"),d.flattenedClassNames=I);var O=a.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(O),E=function(e){z(e),e.data.name===f?(D(),d3.selectAll(".selected").classed("selected",!1)):(P(e),d.selectedClass=y,d.showClassInfoPanel=!0,d.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},O.on("click",(function(e,t){t.data.id&&s.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),v.hide(),E(t)})),O.on("dblclick",(function(t,n){n!==r&&(v.hide(),P(n),e.$broadcast("goToDomainRangeGraphView",y,A),t.stopPropagation())}));var $=0;C.on("wheel",(function(e){v.hide(),e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-$>100){$=t;var r="";e.deltaY<=-1?r="in":e.deltaY>=1&&(r="out");var n=e.target.__data__;if(n||(n=A),"in"===r){if(n!==A){for(;n.parent&&!n.parent.isInFocusTransitive;)n=n.parent;n.depth<A.depth&&(n=A)}if(n===A&&n.children){for(var i=n.children[0],a=1;a<n.children.length;a++)n.children[a].sortingRank>i.sortingRank&&(i=n.children[a]);i.children&&(n=i)}else n.children||(n=n.parent);z(n,!0)}else"out"===r&&(n=A.parent)&&z(n,!0);A.data.name===f&&s.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),Q()}}));var M=L.selectAll("text").data(g).enter().append("text").attr("class",(function(e){return e.children&&e.children.length?"label":"label child-label"})).each((function(e){e.textSel=d3.select(this)}));o.noPrefixes?(M.each((function(e){var t=e.data.name.indexOf(":");e.data.name.indexOf("http://")>-1?e.noPrefixName=e.data.name:t>-1&&(e.noPrefixName=e.data.name.substring(t+1))})),M.style("font-size",(function(e){return a.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return a.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):M.style("font-size",(function(e){return a.a.Text.calcFontSize(e.data.name,e.r)})).text((function(e){return a.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r/3)})),M.style("display",(function(e){return e.parent&&e.parent.data===A.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),o.doFade&&!o.keepPrevState&&M.each((function(e){a.a.Transition.fadeIn(d3.select(this),550)})),k=function(){function e(e){e&&R.each((function(t){+e===t.data.id&&E(t)}))}var r=t.hash();s.onpopstate=function(t){t.state&&e(t.state.id)},e(r)};var G=L.selectAll("circle, text");function U(e,t){var r=800/e[2];h=e,G.attr("transform",(function(t){return"translate("+(t.x-e[0])*r+","+(t.y-e[1])*r+")"})),R.attr("r",(function(e){return e.r*r})),t&&M.each((function(e){e.data.fullName!==A.data.topLevelParentUri&&A.data.topLevelParentUri!==f||(e.textSel.style("display","none"),A.children&&A.children.length?_.each(A.children,(function(e){e.textSel.style("display","inline")})):A.textSel.style("display","inline"),A.parent&&_.each(A.parent.children,(function(e){e.data.name!==A.data.name&&e.textSel.style("display","inline")})))})),M.style("font-size",(function(e){return o.noPrefixes?a.a.Text.calcFontSize(e.noPrefixName,e.r*r):a.a.Text.calcFontSize(e.data.name,e.r*r)})).text((function(e){return o.noPrefixes?a.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*r/3):a.a.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*r/3)}))}function H(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function F(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display=""):(e.textHidden=!0,this.style.display="none")}function z(e,t){if(c((function(){d.showExternalElements=e.data.name===f})),A!==e&&(e.data.id&&s.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),e.children||(e=e.parent,A!==e))){if(t&&(D(),d3.selectAll(".selected").classed("selected",!1)),A.parent)for(var r=A;r;)r.isInFocusTransitive=!1,r=r.parent;for(r=e;r;)r.isInFocusTransitive=!!r.children,r=r.parent;if(2*(A=e).r/(2*A.r+20)<.3||d.currentSliderValue>d.currentBrowserLimit)U([A.x,A.y,H(A.r)]),M.each((function(e){F.call(this,e)}));else d3.transition().duration(p).tween("zoom",(function(e){var t=d3.interpolateZoom(h,[A.x,A.y,H(A.r)]);return function(e){U(t(e))}})).selectAll("text").each(F)}}U([A.x,A.y,H(A.r)],u),T=d.$on("rootFocus",(function(){s.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),E(x)})),N=d.$on("classSearch",(function(e){E(e)}))}function Q(){const t=d.classHierarchyData.classCount;let r=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!r||r>t)&&(r=t,h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,r)),e.$broadcast("classCount",t,r)}window.addEventListener("resize",Q),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",Q),window.removeEventListener("beforeunload",e)})),d.$watch("classHierarchyData",(function(){P&&P(),D&&D(),O&&O(),M&&M();var e=I();if(d.classHierarchyData.classCount){Q();var t=_.cloneDeep(d.classHierarchyData);var r,n,i=function(e){return e.descendants().sort((function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0}))}(d3.hierarchy(t));function a(e,t){const i={keepPrevState:!0,noPrefixes:I()};n=i.noPrefixes,G(r||e,i,A,!0),c((function(){h.set(g.CLASS_HIERARCHY_SWITCH_PREFIXES,t),k()}),70)}function o(e,i,o){if(!e)return;h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),r={name:f,children:[]};const s=new Set;for(let t=1;t<=e;t++)s.add(i[t].data.id),i[t].parent===i[0]&&r.children.push(i[t].data);if(function e(t){if(!t.children)return;const r=[];for(const e of t.children)s.has(e.id)&&r.push($.extend({},e));t.children=r;for(const r of t.children)e(r)}(r),o){n=angular.isUndefined(n)?I():n;G(r,{noPrefixes:n})}else a(t)}var s,l=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(l)o(l,i);else{var u={doFade:!0,keepPrevState:!0,noPrefixes:I()};G(t,u),k()}P=d.$watch("hidePrefixes",(function(r){angular.isUndefined(r)||e?e=void 0:c((function(){!function(e){angular.isUndefined(e)||h.set(g.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(r),a(t,!0)}),50)}),!0),D=d.$watch("currentSliderValue",(function(e){o(e,i,!0)}),!0),M=d.$on("onEnterKeypressSearchAction",(function(e){s&&E(s)})),O=d.$on("searchedClass",(function(e,t){(s=j[t.name])&&E(s)}))}}),!0)}(d)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",s),s.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},258:function(e,t,r){"use strict";r.r(t);var n=r(551),i=r(550);r(13);function a(e,t,r,a,o,s,c,l,d,u,p,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(u){const p=l((function(){!function(u){var p=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),g=d3.forceSimulation(),m=d3.drag().subject((function(e){return e})).on("start",(function(e,t){g.stop(),t.fx=e.x,t.fy=e.y,d3.select(this).classed("selected",!0)})).on("end",(function(e,t){t.fx=null,t.fy=null,d3.select(this).classed("selected",!1),w?(g.alpha(.2).restart(),w=!1):g.restart()})).on("drag",(function(e,t){w=!0,g.alphaTarget(0).restart(),t.fx=e.x,t.fy=e.y})),y=p.append("defs");y.append("marker").attrs({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),y.append("marker").attrs({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),y.append("marker").attrs({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attrs({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var e=n.a.Export.getCSSRules("css/domain-range-graph.css?v=2.8.4-RC2");$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>");var t=n.a.Export.generateBase64ImageSource("#domain-range svg");d3.select(this).attrs({href:t,download:"domain-range-graph-"+r.getActiveRepository()+".svg"})})),function(){var e=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");e.append("rect").attrs({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var t=16+1200/18/2.5,r=t+1200/90;e.append("circle").attrs({class:"legend-class-node",cx:(16+t)/2,cy:30,r:1200/18/4.5}),e.append("text").attrs({x:r,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node"),e.append("circle").attrs({class:"legend-object-node",cx:(16+t)/2,cy:70,r:1200/110/1.25}),e.append("text").attrs({x:r,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node"),e.append("circle").attrs({class:"legend-datatype-node",cx:(16+t)/2,cy:70+1200/45,r:1200/110/2}),e.append("text").attrs({x:r,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node"),e.append("line").attrs({class:"property-arrow",x1:16,y1:123.33333333333334,x2:t,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+o.absUrl()+"#arrow)"),e.append("text").attrs({x:r,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property"),e.append("line").attrs({class:"implicit-property-arrow",x1:16,y1:150,x2:t,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+o.absUrl()+"#arrow)"),e.append("text").attrs({x:r,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property"),e.append("line").attrs({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:t,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+o.absUrl()+"#collapsed-arrow)"),e.append("text").attrs({x:r,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property")}();var v=o.search().uri,x=o.search().name;const S=o.search().collapsed;(function(e,t){a.getDomainRangeData(e,t).success((function(e,t,r){u.domainRangeGraphData=e})).error((function(e){d.error("Request for "+x+" failed!")}))})(v,S),$(window).on("popstate",(function(){s.set(c.DOMAIN_RANGE_WENT_BACK,!0)})),t.onpopstate=function(t){t.state&&e.$broadcast("changeCollapsedEdgesState",t.state.collapsed)},u.$watch("collapseEdges",(function(){angular.isUndefined(u.collapseEdges)||(s.set(c.DOMAIN_RANGE_COLLAPSE_EDGES,u.collapseEdges),"true"!==s.get(c.DOMAIN_RANGE_WENT_BACK)&&function(t){e.$broadcast("switchEdgeMode",{uri:v,name:x,collapsed:t})}(u.collapseEdges),s.remove(c.DOMAIN_RANGE_WENT_BACK))})),u.$watch("domainRangeGraphData",(function(){if(u.domainRangeGraphData){var r=_.cloneDeep(u.domainRangeGraphData);const P=r.nodes,D=r.links;g.nodes(P).force("x",d3.forceX(600)).force("y",d3.forceY(300)).force("charge",d3.forceManyBody().strength(-800)).force("link",d3.forceLink(D).distance(1200/3.5));var n=p.selectAll(".link").data(D).enter().append("g");function a(e){e.style("stroke",f),e.style("stroke-width",2),e.attr("marker-end","url("+o.absUrl()+"#collapsed-arrow)")}var s,c,d=0;n.each((function(e){if(e.objectPropNodeClassUri!==v)s=n.append("line").attrs({class:"link","marker-end":"url("+o.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(e){switch(e.propertyType){case"objectLeft":e.targetRadius=1200/18;break;case"objectRight":e.targetRadius=1200/110;break;case"datatype":e.targetRadius=1200/110/2;break;default:e.targetRadius=0}var t=d3.select(this);e.targetNodeEdgeCount>1?a(t):e.implicit&&t.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(c)){c=d3.select(this).append("path").attrs({d:"M 0 0 A "+1200/18/2+" "+1200/18/2+" 0 1 1 0 "+1200/18/2,class:"loop-link",fill:"none","marker-end":"url("+o.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(d+=e.targetNodeEdgeCount)>1&&a(d3.select(".loop-link"))}}));var y={};function S(){$.isEmptyObject(y)||(y.text.style("fill","black"),y.background.style("fill","#f0f0f0"))}function w(e,t){S(),y.text=d3.select(this),y.background=d3.select(this.previousSibling),y.text.style("fill","white"),y.background.style("fill",f),l((function(){u.showPredicatesInfoPanel=!0,u.selectedPredicate=t})),e.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",S)}));var C=n.append("text").attr("class",(function(e){return e.objectPropNodeClassUri===v?"loop-link-property-name":"property-name"})).attr("dx",(function(e){return 1200/18/2*("objectLeft"===e.propertyType?1:-1)})).style("text-anchor",(function(e){return"objectLeft"===e.propertyType?"end":"start"})).style("font-size",1200/90).text((function(e){return e.targetNodeEdgeCount>1?e.targetNodeEdgeCount+" predicates":e.name}));C.each((function(e){var r=d3.select(this);/\d\spredicates/.test(r.text())?r.style("font-weight","bold").on("click",w):r.on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.uri),"_blank")}))}));var b=n.append("rect").attr("class",(function(e){return e.objectPropNodeClassUri!==v?"link-background":"loop-link-background"})).attr("width",(function(e){return e.calculatedWidth=this.previousSibling.getBBox().width,e.calculatedWidth+4})).attr("height",(function(e){return e.calculatedHeight=this.previousSibling.getBBox().height,e.calculatedHeight+2})).attr("transform",(function(e){var t=2-1200/18/2*("objectLeft"===e.propertyType?1:-1);return"objectLeft"===e.propertyType&&(t+=e.calculatedWidth),"translate(-"+t+",-"+(2+e.calculatedHeight/2)+")"})).on("click",(function(e){e.stopPropagation()})),I=p.selectAll(".node").data(P).enter().append("g"),R=I.filter((function(e){return e.objectPropClassUri!==v})).append("circle").each((function(e){var t=d3.select(this);"main"===e.classPosition?t.attrs({class:"class-node",r:1200/18}).attr("marker-end","url("+o.absUrl()+"#loop-link)"):null===e.objectPropClassName?t.attrs({class:"datatype-node",r:1200/110/2}):t.attrs({class:"object-prop-node",r:1200/110})})).call(m);d3.selectAll(".object-prop-node").on("dblclick",(function(t,r,n){u.$apply((function(){e.$broadcast("reloadDomainRangeGraphView",r,n)}))})),I.filter((function(e){return e.objectPropClassName&&e.objectPropClassUri!==v})).append("text").attr("class",(function(e){return e.classPosition+"-class-label"})).style("font-size",1200/90).text((function(e){return e.objectPropClassName})).on("click",(function(e,r){t.open("resource?uri="+encodeURIComponent(r.objectPropClassUri),"_blank")}));var k=I.select("text");p.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(e){return i.a.Text.calcFontSize(x,1200/18)})).text(x).on("click",(function(){t.open("resource?uri="+encodeURIComponent(v),"_blank")}))}));var E=p.select(".class-node + text"),L=d3.select(".class-node"),A=d3.selectAll(".loop-link-background"),T=d3.selectAll(".loop-link-property-name");if(C=d3.selectAll(".property-name"),!angular.isUndefined(c)){var N=[];A.each((function(e,t){d3.select(this);N.push({idx:t,width:e.calculatedWidth,height:e.calculatedHeight})}))}g.on("tick",(function(e){var t=8*g.alpha();function r(e){var t=e.x+1200/18*2,r=e.y-1200/18/1.9;var n=[];A.each((function(i,a){n.push(i),a<h?function(n,i){var a=$.grep(N,(function(e){return e.idx==i}));i>0&&(t+=parseFloat(i*(a[0].height/(i/1.4)))),n.attrs({transform:"rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")",width:a[0].height,height:a[0].width})}(d3.select(this),a):d3.select(this).remove()})),function(e){var t;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(r){r.target.allEdges=e,t=this.getComputedTextLength()})).on("click",w),d3.select(".view-more-preds-rect").attr("height",t+4)}(n)}s.filter((function(e){return e.objectPropNodeClassUri!==v})).attr("x1",(function(e){return e.source.x})).attr("y1",(function(e){return e.source.y})).attr("x2",(function(e){return e.targetX})).attr("y2",(function(e){return e.targetY})).each((function(e){!function(e){"objectLeft"===e.propertyType?(e.source.x-=8*t,e.source.y-=t/9):(e.target.x+=8*t,e.target.y-=t/9)}(e);var r=Math.atan2(e.target.y-e.source.y,e.target.x-e.source.x);e.targetX=e.target.x-Math.cos(r)*e.targetRadius,e.targetY=e.target.y-Math.sin(r)*e.targetRadius})),R.each((function(e){"main"!==e.classPosition||angular.isUndefined(c)||(!function(e){var t=e.x+64,r=e.y-1200/18/5.7-5;c.attr("transform","rotate(270, "+e.x+","+e.y+") translate("+t+","+r+")")}(e),function(e){function t(t,r){var n=$.grep(N,(function(e){return e.idx==r})),i=0;r>0&&(i=parseFloat(2*r*(n[0].height/1.4)));var a=e.x,o=e.y-1200/18*2.1-i;t.attrs({x:a,y:o}).moveToFront()}T.each((function(e,r){var n=d3.select(this),i=T.size()-h;i<0?t(n,r):(0==r&&!u.collapseEdges&&i>1&&(!function(e,t,r){e.classed("view-more-preds-label",!0).text(r+" predicates more ..."),null!==this.nextSibling&&t.classed("view-more-preds-rect",!0)}(n,d3.select(this.nextSibling),i),t(n,r)),r<h?t(n,r):n.remove())}))}(e),r(e)),e.objectPropClassUri!==v&&d3.select(this).attr("cx",(function(e){return"main"===e.classPosition?function(e){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(e){return Math.log(e)/Math.LN10});var t=L.attr("cx")-600,r=.5*Math.log10(Math.abs(t));return e.x+=t>0?-r:r,e.x}(e):e.x})).attr("cy",(function(e){return e.y}))})),E.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).moveToFront(),b.filter((function(e){return e.objectPropNodeClassUri!==v})).attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),C.attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),k.attr("x",(function(e){return"right"===e.classPosition?e.x+1200/110*1.2:e.x-1200/110*1.2})).attr("y",(function(e){return e.y})).moveToFront()}))}}));let w=!1}(u)}),50);u.$on("$destroy",(function(){l.cancel(p)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--primary-color)").constant("ONTO_GREEN","var(--tertiary-color)").constant("ONTO_BLUE","var(--secondary-color)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",a),a.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]},259:function(e,t){function r(e,t){return{restrict:"A",scope:{},templateUrl:"js/angular/graphexplore/templates/systemRepoWarningTemplate.html",link:function(r){r.isSystemRepository=function(){return"SYSTEM"===e.getActiveRepository()},r.hasPermission=function(){return t.hasPermission()}}}}angular.module("graphdb.framework.graphexplore.directives.sysrepo",["graphdb.framework.graphexplore.controllers.class"]).directive("systemRepoWarning",r),r.$inject=["$repositories","$rootScope"]},260:function(e,t){function r(e){return{restrict:"AE",scope:{rdfsLabel:"=",rdfsComment:"=",expanded:"=",alwaysExpanded:"="},templateUrl:"js/angular/graphexplore/templates/rdfsCommentLabelTemplate.html",link:function(t,r){t.stringLimit=e,t.scrollToTop=function(){r[0].getElementsByClassName("rdfs-comment")[0].scrollTop=0},t.checkCommentLength=function(){return r[0].getElementsByClassName("rdfs-comment-text")[0].innerText.length<e},t.equalHeights=function(){const e=r[0].getElementsByClassName("rdfs-comment-text")[0].innerHeight;e<250&&t.expanded&&(r[0].getElementsByClassName("rdfs-comment")[0].innerHeight=e)},t.toggleFullComment=function(){t.expanded=!t.expanded},t.$watch("expanded || alwaysExpanded",(function(r){t.stringLimit=r?t.rdfsComment.length:e}))}}}angular.module("graphdb.framework.graphexplore.directives.rdfsdetails",[]).directive("rdfsCommentLabel",r).constant("SHORT_COMMENT_LENGTH",100),r.$inject=["SHORT_COMMENT_LENGTH"]},261:function(e,t,r){"use strict";r.r(t);var n=r(551);r(151);function i(e,t){return{restrict:"A",template:'<div id="dependencies-chord"></div>',scope:{dependenciesData:"="},link:function(r){r.$watch("dependenciesData",(function(){if(r.dependenciesData){const i=r.dependenciesData;!function(i,a){if(function(){let e=!0;for(const t of i){if(t.some(e=>0!==e)){e=!1;break}}return e}())return;const o=d3.scaleOrdinal(d3.schemeCategory10),s=d3.select("body").append("div").attr("class","tooltip").style("opacity",0);d3.select("body").on("click",(function(){s.style("opacity",0)}));const c=Math.min(800,800)/2.8,l=c-24,d=d3.arc().innerRadius(l).outerRadius(c),u=d3.chord().padAngle(.04).sortSubgroups(d3.descending).sortChords(d3.ascending),p=d3.ribbon().radius(l),f=d3.select("#dependencies-chord").append("svg").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").style("font","10px sans-serif").append("g").attr("id","circle").attr("transform","translate(400,400)");f.append("circle").attr("r",c).style("fill","none");const h=u(i),g=f.selectAll(".group").data(h.groups).enter().append("g").attr("class","group").on("mouseover",(function(){const e=g.nodes().indexOf(this);m.classed("fade",(function(t){return t.source.index!==e&&t.target.index!==e}))}));g.append("title").text((function(e,t){return a[t]})),g.append("path").attr("id",(function(e,t){return"group"+t})).attr("d",d).style("fill",(function(e,t){return o(t)})),g.append("text").each((function(e){e.angle=(e.startAngle+e.endAngle)/2})).attr("dy",".35em").attr("transform",(function(e){return"rotate("+(180*e.angle/Math.PI-90)+")translate("+(l+26)+")"+(e.angle>Math.PI?"rotate(180)":"")})).style("text-anchor",(function(e){return e.angle>Math.PI?"end":null})).text((function(e){return a[e.index]}));const m=f.selectAll(".chord").data(h).enter().append("path").attr("class","chord").style("fill",(function(e){return o(e.target.index)})).style("fill-opacity",".67").style("stroke","#000").style("stroke-width",".25px").style("cursor","pointer").attr("d",p);m.on("mouseover",(function(){d3.select(this).style("fill-opacity","1")})),m.on("mouseout",(function(){d3.select(this).style("fill-opacity",".67")})),m.on("click",(function(e,n){const i=a[n.source.index],o=a[n.target.index],c=e.pageX,l=e.pageY;t.getPredicates(i,o,r.selectedGraph&&r.selectedGraph.contextID.uri).success((function(e){let t="<div class='dependencies-tooltip'>"+("<div class='row'>"+i+" <i class='fa fa-exchange'></i> "+o+"</div>")+_.map(e.slice(0,10),(function(e){const t=" <i class='fa fa-long-arrow-"+("out"===e.direction?"right":"left")+"'></i>";return"<div class='row'>"+e.predicate+" : "+e.weight+t+" </div>"})).join("");e.length>10?t=t+"<div class='pull-right'>And "+(e.length-10).toString()+" more...</div></div>":t+="</div>",s.html(t).style("left",c+"px").style("top",l+"px")})),s.transition().duration(200).style("opacity",1)})),d3.select("#circle").on("mouseleave",(function(){f.selectAll(".chord").classed("fade",!1)})),d3.select("#download-svg").on("mouseover",(function(){const t=n.a.Export.generateBase64ImageSource(".dependencies-chord svg");d3.select(this).attrs({href:t,download:"dependencies-"+e.getActiveRepository()+".svg"})}))}(i.matrix,i.nodes,i.direction)}}))}}}angular.module("graphdb.framework.graphexplore.directives.dependencies",["graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.rest.graphexplore.data.service"]).directive("dependenciesChord",i),i.$inject=["$repositories","GraphDataRestService"]},262:function(e,t){function r(){return{restrict:"AE",scope:{filterQueryObj:"=",filterFunction:"&",listItemsObj:"=",listItemsNotFiltered:"=",searchPlaceholder:"@"},templateUrl:"js/angular/graphexplore/templates/listItemsSearchFilterTemplate.html",link:function(e){e.filterFunction=e.filterFunction(),e.$watch("filterQueryObj.query",(function(){var t,r,n,i;e.listItemsObj.items=(t=e.filterQueryObj.query,r=e.listItemsObj.items,n=e.listItemsNotFiltered,i=e.filterFunction,t.length>0?_.filter(n,i):r.length!==n.length?n:r)}))}}}angular.module("graphdb.framework.graphexplore.directives.searchfilter",[]).directive("listItemsSearchFilter",r),r.$inject=[]},263:function(e,t){function r(e,t){return{restrict:"AE",scope:{searchData:"=",searchFields:"@",titleField:"@",searchPlaceholder:"@",initialValue:"=",searchedObjCallback:"&"},templateUrl:"js/angular/graphexplore/templates/searchIconInputTemplate.html",link:function(r,n){r.searchedObjCallback=r.searchedObjCallback(),r.performSearchActionOnEnter=function(){e.$broadcast("onEnterKeypressSearchAction")},r.showInput=function(){$("#selectGraphDropdown").hide(),n.find("#search_input #search_input_value")[0].value="",n.find(".search-icon").addClass("animated bounceOut").css("z-index","-1"),n.find("#search_input .angucomplete-holder").css("display","block"),t((function(){n.find("#search_input .angucomplete-holder").css("width","250px").css("left","-215px"),t((function(){n.find(".close-icon").css("display","block").addClass("animated bounceIn").css("z-index","3"),n.find("#search_input #search_input_value").focus()}),200)}),1)},r.hideInput=function(){n.find("#search_input #search_input_value")[0].value="",n.find("#search_input .angucomplete-holder").css("width","0px").css("left","35px"),t((function(){n.find("#search_input .angucomplete-holder").css("display","none"),$("#selectGraphDropdown").show()}),250),n.find(".close-icon").addClass("animated bounceOut").removeClass("bounceOut").css("z-index","-1").css("display","none").click((function(){$(".tooltip").hide()})),t((function(){n.find(".search-icon").css("display","inline-block").removeClass("bounceOut").addClass("bounceIn").css("z-index","3")}),200)}}}}angular.module("graphdb.framework.graphexplore.directives.searchcontrols",[]).directive("searchIconInput",r),r.$inject=["$rootScope","$timeout"]},338:function(e,t,r){"use strict";r.r(t);r(9),r(46),r(40),r(41),r(806),r(807),r(538),r(562),r(314),r(323),r(808),r(572),r(550),r(587),r(551),r(151),r(248),r(249),r(250),r(251),r(252),r(253),r(254),r(255),r(256),r(257),r(258),r(259),r(260),r(261),r(262),r(263),r(140);angular.module("graphdb.framework.graphexplore",["graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.graphexplore.data.service","graphdb.framework.graphexplore.services.uiscroll","graphdb.framework.graphexplore.services.rdfsdetails","graphdb.framework.rest.graphexplore.savedgraphs.service","graphdb.framework.rest.graphconfig.service","graphdb.framework.graphexplore.controllers.class","graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.graphexplore.controllers.graphviz","graphdb.framework.graphexplore.controllers.graphviz.config","graphdb.framework.graphexplore.directives.sysrepo","graphdb.framework.graphexplore.directives.rdfsdetails","graphdb.framework.graphexplore.directives.searchfilter","graphdb.framework.graphexplore.directives.class","graphdb.framework.graphexplore.directives.domainrange","graphdb.framework.graphexplore.directives.dependencies","graphdb.framework.graphexplore.directives.searchcontrols","graphdb.framework.core.directives.yasgui-component"])},538:function(e,t,r){var n,i;n=[r(546)],void 0===(i=function(){function e(e,t){return e.each((function(){var e=t.apply(this,arguments),r=select(this);for(var n in e)r.attr(n,e[n])}))}function t(e,t){for(var r in t)e.attr(r,t[r]);return e}return"undefined"==typeof d3&&(d3=r(546)),d3.selection.prototype.attrs=function(r){return("function"==typeof r?e:t)(this,r)},d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))},d3}.apply(t,n))||(e.exports=i)},550:function(e,t,r){"use strict";r(538);var n=n||{};n.Text=function(){function e(e,t,r,n){r=r||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<r&&(i=r),Math.round(i)):(i<r&&(i=r),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,r,n,i){return e(t,r,n)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),n.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},n.Click=function(){const e=function(e,r){let n,i=1,a=arguments.length;for(;++i<a;)n=arguments[i],e[n]=t(e,r,r[n]);return e};function t(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}return{delayDblClick:function(){var t=d3.dispatch("click","dblclick");return e((function(e){var r,n=null;e.on("mousedown",(function(){r=d3.pointer(document.body),+new Date})),e.on("mouseup",(function(e,i){var a,o,s;(o=r,s=d3.pointer(document.body),Math.sqrt(Math.pow(o[0]-s[0],2),Math.pow(o[1]-s[1],2))>5)||(n?(window.clearTimeout(n),n=null,t.call("dblclick",e,e,i)):n=window.setTimeout((a=e,function(){t.call("click",a,a,i),n=null}),250))}))}),t,"on")}}}(),t.a=n},551:function(e,t,r){"use strict";r(538);var n=n||{};n.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let r="";return _.each(t,(function(e){r+=e.cssText})),r},generateBase64ImageSource:function(e){e||(e="svg");const t=d3.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}},t.a=n},562:function(e,t,r){"use strict";t.a=function(){var e=function(){return"n"},t=function(){return[0,0]},r=function(){return" "},n=u(),i=null,a=null,o=null,s=null;function c(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,a=i.createSVGPoint(),document.body.appendChild(n)}c.show=function(){var n=Array.prototype.slice.call(arguments);n[n.length-1]instanceof SVGElement&&(o=n.pop());var i,a=r.apply(this,n),u=t.apply(this,n),f=e.apply(this,n),h=p(),g=d.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=s.apply(this,n);for(h.html(a).style("opacity",1).style("pointer-events","all");g--;)h.classed(d[g],!1);const x=n.filter(e=>e instanceof Event);return i=l.get(f).apply(this,x),v?Object.keys(v).forEach((function(e){h.style(e,v[e])})):h.classed(f,!0).style("top",i.top+u[0]+m+"px").style("left",i.left+u[1]+y+"px"),c},c.hide=function(){return p().style("opacity",0).style("pointer-events","none"),c},c.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().attr(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(p(),r),c},c.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return p().style(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(p(),r),c},c.direction=function(t){return arguments.length?(e=null==t?t:h(t),c):e},c.offset=function(e){return arguments.length?(t=null==e?e:h(e),c):t},c.html=function(e){return arguments.length?(r=null==e?e:h(e),c):r},c.customPosition=function(e){return arguments.length?(s=null==e?e:h(e),c):s},c.destroy=function(){return n&&(p().remove(),n=null),c};var l=new Map(Object.entries({n:function(e){var t=f(e);return{top:t.n.y-n.offsetHeight,left:t.n.x-n.offsetWidth/2}},s:function(e){var t=f(e);return{top:t.s.y,left:t.s.x-n.offsetWidth/2}},e:function(e){var t=f(e);return{top:t.e.y-n.offsetHeight/2,left:t.e.x}},w:function(e){var t=f(e);return{top:t.w.y-n.offsetHeight/2,left:t.w.x-n.offsetWidth}},nw:function(e){var t=f(e);return{top:t.nw.y-n.offsetHeight,left:t.nw.x-n.offsetWidth}},ne:function(e){var t=f(e);return{top:t.ne.y-n.offsetHeight,left:t.ne.x}},sw:function(e){var t=f(e);return{top:t.sw.y,left:t.sw.x-n.offsetWidth}},se:function(e){var t=f(e);return{top:t.se.y,left:t.e.x}}})),d=l.keys();function u(){var e=d3.select(document.createElement("div"));return e.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}function p(){return null===n&&(n=u(),document.body.appendChild(n)),d3.select(n)}function f(e){for(var t=o||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var r={},n=t.getScreenCTM(),i=t.getBBox(),s=i.width,c=i.height,l=i.x,d=i.y;return a.x=l,a.y=d,r.nw=a.matrixTransform(n),a.x+=s,r.ne=a.matrixTransform(n),a.y+=c,r.se=a.matrixTransform(n),a.x-=s,r.sw=a.matrixTransform(n),a.y-=c/2,r.w=a.matrixTransform(n),a.x+=s,r.e=a.matrixTransform(n),a.x-=s/2,a.y-=c/2,r.n=a.matrixTransform(n),a.y+=c,r.s=a.matrixTransform(n),r}function h(e){return"function"==typeof e?e:function(){return e}}return c}},587:function(e,t,r){"use strict";var n=n||{};n.SingleChild={addPlaceholders:function e(t,r){if(t.children){for(var n=0;n<t.children.length;n++)e(t.children[n]);if(1===t.children.length){var i=1.2*t.size;r&&(i=.1*t.children[0].size),t.children.push({name:"placeholder",size:i})}}},removePlaceholders:function e(t){for(var r=t.length-1;r>=0;r--){var n=t[r];"placeholder"===n.data.name?t.splice(r,1):n.children&&e(n.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.children&&1===r.children.length){var n=r.x-r.children[0].x;r.children[0].x+=n,i(r.children[0],n)}}function i(e,t){if(e.children)for(var r=0;r<e.children.length;r++)e.children[r].x+=t,i(e.children[r],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,r=e[0].y,n=0;n<e.length;n++){var i=e[n];i.x-=t,i.y-=r}}},t.a=n},808:function(e,t){
2
2
  /*! Copyright (c) 2014 Hidenari Nozaki and contributors | Licensed under the MIT license */
3
3
  !function(e,t){"use strict";!function(e){e.module("angucomplete-alt",[]).directive("angucompleteAlt",["$q","$parse","$http","$sce","$timeout","$templateCache","$interpolate",function(e,t,r,n,i,a,o){function s(t,a,o,s){var c,l,d,u,p,f,h=a.find("input"),g=3,m=null,y="autocomplete-required",v=null,x=null,S=a[0].querySelector(".angucomplete-dropdown"),w=!1,C=null;function b(e,r){e&&("object"==typeof e?(t.searchStr=E(e),k({originalObject:e})):"string"==typeof e&&e.length>0?t.searchStr=e:console&&console.error&&console.error("Tried to set "+(r?"initial":"")+" value of angucomplete to",e,"which is an invalid value"),A(!0))}function I(e){C=null,t.hideResults(e),document.body.removeEventListener("click",I)}function R(e){return e.which?e.which:e.keyCode}function k(e){"function"==typeof t.selectedObject?t.selectedObject(e,t.selectedObjectData):t.selectedObject=e,A(!!e)}function E(e){return t.titleField.split(",").map((function(t){return L(e,t)})).join(" ")}function L(e,t){var r,n;if(t){r=t.split("."),n=e;for(var i=0;i<r.length;i++)n=n[r[i]]}else n=e;return n}function _(e,r){var i,a,o;if(o=new RegExp(r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),e)return e.match&&e.replace||(e=e.toString()),i=(a=e.match(o))?e.replace(o,'<span class="'+t.matchClass+'">'+a[0]+"</span>"):e,n.trustAsHtml(i)}function A(e){t.notEmpty=e,v=t.searchStr,t.fieldRequired&&s&&t.inputName&&s[t.inputName].$setValidity(y,e)}function T(e){!t.overrideSuggestions||t.selectedObject&&t.selectedObject.originalObject===t.searchStr||(e&&e.preventDefault(),i.cancel(m),M(),k({originalObject:t.searchStr}),t.clearSelected&&(t.searchStr=null),Q())}function N(){return a[0].querySelectorAll(".angucomplete-row")[t.currentIndex]}function P(e){S.scrollTop=S.scrollTop+e}function D(){var e=t.results[t.currentIndex];t.matchClass?h.val(E(e.originalObject)):h.val(e.title)}function O(e){return function(r,n,i,a){n||i||a||!r.data||(r=r.data),t.searching=!1,F(L(l(r),t.remoteUrlDataField),e)}}function $(e,r,n,i){t.searching=!1,0!==r&&-1!==r&&(r||n||i||(r=e.status),t.remoteUrlErrorCallback?t.remoteUrlErrorCallback(e,r,n,i):console&&console.error&&console.error("http error"))}function M(){x&&x.resolve()}function j(n){var i={},a=t.remoteUrl+encodeURIComponent(n);t.remoteUrlRequestFormatter&&(i={params:t.remoteUrlRequestFormatter(n)},a=t.remoteUrl),t.remoteUrlRequestWithCredentials&&(i.withCredentials=!0),M(),x=e.defer(),i.timeout=x.promise,r.get(a,i).success(O(n)).error($)}function G(r){M(),x=e.defer(),t.remoteApiHandler(r,x.promise).then(O(r)).catch($)}function Q(){t.showDropdown=!1,t.results=[],S&&(S.scrollTop=0)}function U(){t.showDropdown=u,t.currentIndex=t.focusFirst?0:-1,t.results=[]}function H(e){!e||e.length<g||(t.localData?t.$apply((function(){var r;r=void 0!==t.localSearch()?t.localSearch()(e,t.localData):function(e){var r,n,i,a,o=t.searchFields.split(","),s=[];for(void 0!==t.parseInput()&&(e=t.parseInput()(e)),r=0;r<t.localData.length;r++){for(n=!1,i=0;i<o.length;i++)a=L(t.localData[r],o[i])||"",n=n||a.toString().toLowerCase().indexOf(e.toString().toLowerCase())>=0;n&&(s[s.length]=t.localData[r])}return s}(e),t.searching=!1,F(r,e)})):t.remoteApiHandler?G(e):j(e))}function F(e,r){var n,i,a,o,s,c;if(e&&e.length>0)for(t.results=[],n=0;n<e.length;n++)t.titleField&&""!==t.titleField&&(o=s=E(e[n])),i="",t.descriptionField&&(i=c=L(e[n],t.descriptionField)),a="",t.imageField&&(a=L(e[n],t.imageField)),t.matchClass&&(s=_(o,r),c=_(i,r)),t.results[t.results.length]={title:s,description:c,image:a,originalObject:e[n]};else t.results=[];t.autoMatch&&1===t.results.length&&function(e,r,n){if(!n)return!1;for(var i in r)if(r[i].toLowerCase()===n.toLowerCase())return t.selectResult(e),!0;return!1}(t.results[0],{title:o,desc:i||""},t.searchStr)?t.showDropdown=!1:0!==t.results.length||p?t.showDropdown=!0:t.showDropdown=!1}function z(){t.localData?F(t.localData,""):t.remoteApiHandler?G(""):j("")}a.on("mousedown",(function(e){e.target.id?(C=e.target.id)===t.id+"_dropdown"&&document.body.addEventListener("click",I):C=e.target.className})),t.currentIndex=t.focusFirst?0:null,t.searching=!1,d=t.$watch("initialValue",(function(e){e&&(d(),b(e,!0))})),t.$watch("fieldRequired",(function(e,r){e!==r&&(e?v&&-1!==t.currentIndex?A(!0):A(!1):s[t.inputName].$setValidity(y,!0))})),t.$on("angucomplete-alt:clearInput",(function(e,r){r&&r!==t.id||(t.searchStr=null,k(),A(!1),Q())})),t.$on("angucomplete-alt:changeInput",(function(e,r,n){r&&r===t.id&&b(n)})),t.onFocusHandler=function(){t.focusIn&&t.focusIn(),0!==g||t.searchStr&&0!==t.searchStr.length||(t.currentIndex=t.focusFirst?0:t.currentIndex,t.showDropdown=!0,z())},t.hideResults=function(){C&&(C===t.id+"_dropdown"||C.indexOf("angucomplete")>=0)?C=null:(c=i((function(){Q(),t.$apply((function(){t.searchStr&&t.searchStr.length>0&&h.val(t.searchStr)}))}),200),M(),t.focusOut&&t.focusOut(),t.overrideSuggestions&&t.searchStr&&t.searchStr.length>0&&-1===t.currentIndex&&T())},t.resetHideResults=function(){c&&i.cancel(c)},t.hoverRow=function(e){t.currentIndex=e},t.selectResult=function(e){t.matchClass&&(e.title=E(e.originalObject),e.description=L(e.originalObject,t.descriptionField)),t.clearSelected?t.searchStr=null:t.searchStr=e.title,k(e),Q()},t.inputChangeHandler=function(e){return e.length<g?(M(),Q()):0===e.length&&0===g&&(t.searching=!1,z()),t.inputChanged&&(e=t.inputChanged(e)),e},t.fieldRequiredClass&&""!==t.fieldRequiredClass&&(y=t.fieldRequiredClass),t.minlength&&""!==t.minlength&&(g=parseInt(t.minlength,10)),t.pause||(t.pause=500),t.clearSelected||(t.clearSelected=!1),t.overrideSuggestions||(t.overrideSuggestions=!1),t.fieldRequired&&s&&(t.initialValue?A(!0):A(!1)),t.inputType=o.type?o.type:"text",t.textSearching=o.textSearching?o.textSearching:"Searching...",t.textNoResults=o.textNoResults?o.textNoResults:"No results found",u="false"!==t.textSearching,p="false"!==t.textNoResults,t.maxlength=o.maxlength?o.maxlength:524288,h.on("keydown",(function(e){var r=R(e),n=null,i=null;13===r&&t.results?(t.currentIndex>=0&&t.currentIndex<t.results.length?(e.preventDefault(),t.selectResult(t.results[t.currentIndex])):(T(e),Q()),t.$apply()):40===r&&t.results?(e.preventDefault(),t.currentIndex+1<t.results.length&&t.showDropdown&&(t.$apply((function(){t.currentIndex++,D()})),w&&(n=N(),S.getBoundingClientRect().top+parseInt(getComputedStyle(S).maxHeight,10)<n.getBoundingClientRect().bottom&&P(function(e){var t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,10)+parseInt(t.marginBottom,10)}(n))))):38===r&&t.results?(e.preventDefault(),t.currentIndex>=1?(t.$apply((function(){t.currentIndex--,D()})),w&&(i=N().getBoundingClientRect().top-(S.getBoundingClientRect().top+parseInt(getComputedStyle(S).paddingTop,10)))<0&&P(i-1)):0===t.currentIndex&&t.$apply((function(){t.currentIndex=-1,h.val(t.searchStr)}))):9===r?t.results&&t.results.length>0&&t.showDropdown?-1===t.currentIndex&&t.overrideSuggestions?T():(-1===t.currentIndex&&(t.currentIndex=0),t.selectResult(t.results[t.currentIndex]),t.$digest()):t.searchStr&&t.searchStr.length>0&&T():27===r&&e.preventDefault()})),h.on("keyup",(function(e){var r=R(e);if(37!==r&&39!==r)if(38===r||13===r)e.preventDefault();else if(40===r)e.preventDefault(),!t.showDropdown&&t.searchStr&&t.searchStr.length>=g&&(U(),t.searching=!0,H(t.searchStr));else if(27===r)Q(),t.$apply((function(){h.val(t.searchStr)}));else{if(0===g&&!t.searchStr)return;t.searchStr&&""!==t.searchStr?t.searchStr.length>=g&&(U(),m&&i.cancel(m),t.searching=!0,m=i((function(){H(t.searchStr)}),t.pause)):t.showDropdown=!1,v&&v!==t.searchStr&&!t.clearSelected&&t.$apply((function(){k()}))}})),f="remoteUrlResponseFormatter",l=function(e){return t[f]?t[f](e):e},i((function(){var e=getComputedStyle(S);w=e.maxHeight&&"auto"===e.overflowY}))}return a.put("/angucomplete-alt/index.html",'<div class="angucomplete-holder" ng-class="{\'angucomplete-dropdown-visible\': showDropdown}"> <input id="{{id}}_value" name="{{inputName}}" tabindex="{{fieldTabindex}}" ng-class="{\'angucomplete-input-not-empty\': notEmpty}" ng-model="searchStr" ng-disabled="disableInput" type="{{inputType}}" placeholder="{{placeholder}}" maxlength="{{maxlength}}" ng-focus="onFocusHandler()" class="{{inputClass}}" ng-focus="resetHideResults()" ng-blur="hideResults($event)" autocapitalize="off" autocorrect="off" autocomplete="off" ng-change="inputChangeHandler(searchStr)"/> <div id="{{id}}_dropdown" class="angucomplete-dropdown" ng-show="showDropdown"> <div class="angucomplete-searching" ng-show="searching" ng-bind="textSearching"></div> <div class="angucomplete-searching" ng-show="!searching && (!results || results.length == 0)" ng-bind="textNoResults"></div> <div class="angucomplete-row" ng-repeat="result in results" ng-click="selectResult(result)" ng-mouseenter="hoverRow($index)" ng-class="{\'angucomplete-selected-row\': $index == currentIndex}"> <div ng-if="imageField" class="angucomplete-image-holder"> <img ng-if="result.image && result.image != \'\'" ng-src="{{result.image}}" class="angucomplete-image"/> <div ng-if="!result.image && result.image != \'\'" class="angucomplete-image-default"></div> </div> <div class="angucomplete-title" ng-if="matchClass" ng-bind-html="result.title"></div> <div class="angucomplete-title" ng-if="!matchClass">{{ result.title }}</div> <div ng-if="matchClass && result.description && result.description != \'\'" class="angucomplete-description" ng-bind-html="result.description"></div> <div ng-if="!matchClass && result.description && result.description != \'\'" class="angucomplete-description">{{result.description}}</div> </div> </div></div>'),{restrict:"EA",require:"^?form",scope:{selectedObject:"=",selectedObjectData:"=",disableInput:"=",initialValue:"=",localData:"=",localSearch:"&",remoteUrlRequestFormatter:"=",remoteUrlRequestWithCredentials:"@",remoteUrlResponseFormatter:"=",remoteUrlErrorCallback:"=",remoteApiHandler:"=",id:"@",type:"@",placeholder:"@",textSearching:"@",textNoResults:"@",remoteUrl:"@",remoteUrlDataField:"@",titleField:"@",descriptionField:"@",imageField:"@",inputClass:"@",pause:"@",searchFields:"@",minlength:"@",matchClass:"@",clearSelected:"@",overrideSuggestions:"@",fieldRequired:"=",fieldRequiredClass:"@",inputChanged:"=",autoMatch:"@",focusOut:"&",focusIn:"&",fieldTabindex:"@",inputName:"@",focusFirst:"@",parseInput:"&"},templateUrl:function(e,t){return t.templateUrl||"/angucomplete-alt/index.html"},compile:function(e){var t=o.startSymbol(),r=o.endSymbol();if("{{"!==t||"}}"!==r){var n=e.html().replace(/\{\{/g,t).replace(/\}\}/g,r);e.html(n)}return s}}}])}(window.angular)}()},89:function(e,t,r){"use strict";r.r(t),r.d(t,"RenderingMode",(function(){return n}));const n={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},96:function(e,t,r){"use strict";r.r(t),r.d(t,"YasqeMode",(function(){return n}));const n={WRITE:"WRITE",READ:"READ",PROTECTED:"PROTECTED"}}}]);