graphdb-workbench 2.0.3-RC2 → 2.0.3

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 (46) hide show
  1. package/dist/11.3957302d7a301df30dd1.bundle.js +1 -1
  2. package/dist/11.3957302d7a301df30dd1.bundle.js.map +1 -1
  3. package/dist/120.80843604737b7c260788.bundle.js +1 -1
  4. package/dist/120.80843604737b7c260788.bundle.js.map +1 -1
  5. package/dist/18.44723ea06155c72f46ae.bundle.js +1 -1
  6. package/dist/18.44723ea06155c72f46ae.bundle.js.map +1 -1
  7. package/dist/25.9e0925889b3a3f79c7fe.bundle.js +1 -1
  8. package/dist/25.9e0925889b3a3f79c7fe.bundle.js.map +1 -1
  9. package/dist/29.9bdb27c21d6eacac1341.bundle.js +1 -1
  10. package/dist/29.9bdb27c21d6eacac1341.bundle.js.map +1 -1
  11. package/dist/30.34b74ada583b1b0af913.bundle.js +1 -1
  12. package/dist/30.34b74ada583b1b0af913.bundle.js.map +1 -1
  13. package/dist/68.e25480b7770a679a9654.bundle.js +1 -1
  14. package/dist/68.e25480b7770a679a9654.bundle.js.map +1 -1
  15. package/dist/bundle.7eed91fc62aad9d30e79.bundle.js +2 -2
  16. package/dist/bundle.7eed91fc62aad9d30e79.bundle.js.map +1 -1
  17. package/dist/index.html +2 -2
  18. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  19. package/dist/pages/autocomplete.html +1 -1
  20. package/dist/pages/choose-repository-type.html +1 -1
  21. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  22. package/dist/pages/create-index.html +4 -4
  23. package/dist/pages/dependencies.html +1 -1
  24. package/dist/pages/domainRangeInfo.html +2 -2
  25. package/dist/pages/edit.html +1 -1
  26. package/dist/pages/explore.html +1 -1
  27. package/dist/pages/export.html +1 -1
  28. package/dist/pages/find.html +1 -1
  29. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  30. package/dist/pages/graphs-visualizations.html +7 -7
  31. package/dist/pages/import.html +1 -1
  32. package/dist/pages/jdbc-create.html +5 -5
  33. package/dist/pages/monitor/queries.html +1 -1
  34. package/dist/pages/monitor/resources.html +2 -2
  35. package/dist/pages/namespaces.html +2 -2
  36. package/dist/pages/plugins.html +1 -1
  37. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  38. package/dist/pages/rdfrank.html +2 -2
  39. package/dist/pages/repositories.html +2 -2
  40. package/dist/pages/repository.html +2 -2
  41. package/dist/pages/similarity-indexes.html +1 -1
  42. package/dist/pages/sparql-template-create.html +5 -5
  43. package/dist/pages/sparql.html +3 -3
  44. package/dist/pages/webapi.html +2 -2
  45. package/dist/res/swagger/index.html +27 -27
  46. package/package.json +1 -1
@@ -25,5 +25,5 @@
25
25
  */
26
26
  function(e){var t,n,r,i,o,s,a,l,u,c,p,d,f,h,g,m,v,E,x,y="sizzle"+1*new Date,T=e.document,N=0,C=0,S=oe(),I=oe(),L=oe(),A=function(e,t){return e===t&&(p=!0),0},b=1<<31,R={}.hasOwnProperty,w=[],O=w.pop,M=w.push,_=w.push,P=w.slice,D=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},k="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="[\\x20\\t\\r\\n\\f]",G="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",U="\\["+F+"*("+G+")(?:"+F+"*([*^$|!~]?=)"+F+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+G+"))|)"+F+"*\\]",B=":("+G+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",j=new RegExp(F+"+","g"),V=new RegExp("^"+F+"+|((?:^|[^\\\\])(?:\\\\.)*)"+F+"+$","g"),H=new RegExp("^"+F+"*,"+F+"*"),q=new RegExp("^"+F+"*([>+~]|"+F+")"+F+"*"),$=new RegExp("="+F+"*([^\\]'\"]*?)"+F+"*\\]","g"),z=new RegExp(B),W=new RegExp("^"+G+"$"),Q={ID:new RegExp("^#("+G+")"),CLASS:new RegExp("^\\.("+G+")"),TAG:new RegExp("^("+G+"|[*])"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+k+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,J=/[+~]/,ee=/'|\\/g,te=new RegExp("\\\\([\\da-f]{1,6}"+F+"?|("+F+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=function(){d()};try{_.apply(w=P.call(T.childNodes),T.childNodes),w[T.childNodes.length].nodeType}catch(e){_={apply:w.length?function(e,t){M.apply(e,P.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function ie(e,t,r,i){var o,a,u,c,p,h,v,E,N=t&&t.ownerDocument,C=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==C&&9!==C&&11!==C)return r;if(!i&&((t?t.ownerDocument||t:T)!==f&&d(t),t=t||f,g)){if(11!==C&&(h=Z.exec(e)))if(o=h[1]){if(9===C){if(!(u=t.getElementById(o)))return r;if(u.id===o)return r.push(u),r}else if(N&&(u=N.getElementById(o))&&x(t,u)&&u.id===o)return r.push(u),r}else{if(h[2])return _.apply(r,t.getElementsByTagName(e)),r;if((o=h[3])&&n.getElementsByClassName&&t.getElementsByClassName)return _.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!L[e+" "]&&(!m||!m.test(e))){if(1!==C)N=t,E=e;else if("object"!==t.nodeName.toLowerCase()){for((c=t.getAttribute("id"))?c=c.replace(ee,"\\$&"):t.setAttribute("id",c=y),a=(v=s(e)).length,p=W.test(c)?"#"+c:"[id='"+c+"']";a--;)v[a]=p+" "+ge(v[a]);E=v.join(","),N=J.test(e)&&fe(t.parentNode)||t}if(E)try{return _.apply(r,N.querySelectorAll(E)),r}catch(e){}finally{c===y&&t.removeAttribute("id")}}}return l(e.replace(V,"$1"),t,r,i)}function oe(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[y]=!0,e}function ae(e){var t=f.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function ue(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||b)-(~e.sourceIndex||b);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ce(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return se((function(t){return t=+t,se((function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))}))}))}function fe(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ie.support={},o=ie.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},d=ie.setDocument=function(e){var t,i,s=e?e.ownerDocument||e:T;return s!==f&&9===s.nodeType&&s.documentElement?(h=(f=s).documentElement,g=!o(f),(i=f.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ae((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ae((function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=K.test(f.getElementsByClassName),n.getById=ae((function(e){return h.appendChild(e).id=y,!f.getElementsByName||!f.getElementsByName(y).length})),n.getById?(r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}},r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],m=[],(n.qsa=K.test(f.querySelectorAll))&&(ae((function(e){h.appendChild(e).innerHTML="<a id='"+y+"'></a><select id='"+y+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+F+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+F+"*(?:value|"+k+")"),e.querySelectorAll("[id~="+y+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+y+"+*").length||m.push(".#.+[+~]")})),ae((function(e){var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+F+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")}))),(n.matchesSelector=K.test(E=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ae((function(e){n.disconnectedMatch=E.call(e,"div"),E.call(e,"[s!='']:x"),v.push("!=",B)})),m=m.length&&new RegExp(m.join("|")),v=v.length&&new RegExp(v.join("|")),t=K.test(h.compareDocumentPosition),x=t||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},A=t?function(e,t){if(e===t)return p=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===f||e.ownerDocument===T&&x(T,e)?-1:t===f||t.ownerDocument===T&&x(T,t)?1:c?D(c,e)-D(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return p=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],a=[t];if(!i||!o)return e===f?-1:t===f?1:i?-1:o?1:c?D(c,e)-D(c,t):0;if(i===o)return ue(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;s[r]===a[r];)r++;return r?ue(s[r],a[r]):s[r]===T?-1:a[r]===T?1:0},f):f},ie.matches=function(e,t){return ie(e,null,null,t)},ie.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&d(e),t=t.replace($,"='$1']"),n.matchesSelector&&g&&!L[t+" "]&&(!v||!v.test(t))&&(!m||!m.test(t)))try{var r=E.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return ie(t,f,null,[e]).length>0},ie.contains=function(e,t){return(e.ownerDocument||e)!==f&&d(e),x(e,t)},ie.attr=function(e,t){(e.ownerDocument||e)!==f&&d(e);var i=r.attrHandle[t.toLowerCase()],o=i&&R.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},ie.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ie.uniqueSort=function(e){var t,r=[],i=0,o=0;if(p=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(A),p){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=ie.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=ie.selectors={cacheLength:50,createPseudo:se,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ie.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ie.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&z.test(n)&&(t=s(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=S[e+" "];return t||(t=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&S(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=ie.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(j," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,d,f,h,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),E=!l&&!a,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(a?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?m.firstChild:m.lastChild],s&&E){for(x=(f=(u=(c=(p=(d=m)[y]||(d[y]={}))[d.uniqueID]||(p[d.uniqueID]={}))[e]||[])[0]===N&&u[1])&&u[2],d=f&&m.childNodes[f];d=++f&&d&&d[g]||(x=f=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[N,f,x];break}}else if(E&&(x=f=(u=(c=(p=(d=t)[y]||(d[y]={}))[d.uniqueID]||(p[d.uniqueID]={}))[e]||[])[0]===N&&u[1]),!1===x)for(;(d=++f&&d&&d[g]||(x=f=0)||h.pop())&&((a?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++x||(E&&((c=(p=d[y]||(d[y]={}))[d.uniqueID]||(p[d.uniqueID]={}))[e]=[N,x]),d!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ie.error("unsupported pseudo: "+e);return i[y]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se((function(e,n){for(var r,o=i(e,t),s=o.length;s--;)e[r=D(e,o[s])]=!(n[r]=o[s])})):function(e){return i(e,0,n)}):i}},pseudos:{not:se((function(e){var t=[],n=[],r=a(e.replace(V,"$1"));return r[y]?se((function(e,t,n,i){for(var o,s=r(e,null,i,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:se((function(e){return function(t){return ie(e,t).length>0}})),contains:se((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}})),lang:se((function(e){return W.test(e||"")||ie.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return X.test(e.nodeName)},input:function(e){return Y.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:de((function(){return[0]})),last:de((function(e,t){return[t-1]})),eq:de((function(e,t,n){return[n<0?n+t:n]})),even:de((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:de((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:de((function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e})),gt:de((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=ce(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pe(t);function he(){}function ge(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function me(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=C++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,s){var a,l,u,c=[N,o];if(s){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,s))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if((a=(l=(u=t[y]||(t[y]={}))[t.uniqueID]||(u[t.uniqueID]={}))[r])&&a[0]===N&&a[1]===o)return c[2]=a[2];if(l[r]=c,c[2]=e(t,n,s))return!0}}}function ve(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function Ee(e,t,n,r,i){for(var o,s=[],a=0,l=e.length,u=null!=t;a<l;a++)(o=e[a])&&(n&&!n(o,r,i)||(s.push(o),u&&t.push(a)));return s}function xe(e,t,n,r,i,o){return r&&!r[y]&&(r=xe(r)),i&&!i[y]&&(i=xe(i,o)),se((function(o,s,a,l){var u,c,p,d=[],f=[],h=s.length,g=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)ie(e,t[r],n);return n}(t||"*",a.nodeType?[a]:a,[]),m=!e||!o&&t?g:Ee(g,d,e,a,l),v=n?i||(o?e:h||r)?[]:s:m;if(n&&n(m,v,a,l),r)for(u=Ee(v,f),r(u,[],a,l),c=u.length;c--;)(p=u[c])&&(v[f[c]]=!(m[f[c]]=p));if(o){if(i||e){if(i){for(u=[],c=v.length;c--;)(p=v[c])&&u.push(m[c]=p);i(null,v=[],u,l)}for(c=v.length;c--;)(p=v[c])&&(u=i?D(o,p):d[c])>-1&&(o[u]=!(s[u]=p))}}else v=Ee(v===s?v.splice(h,v.length):v),i?i(null,s,v,l):_.apply(s,v)}))}function ye(e){for(var t,n,i,o=e.length,s=r.relative[e[0].type],a=s||r.relative[" "],l=s?1:0,c=me((function(e){return e===t}),a,!0),p=me((function(e){return D(t,e)>-1}),a,!0),d=[function(e,n,r){var i=!s&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r));return t=null,i}];l<o;l++)if(n=r.relative[e[l].type])d=[me(ve(d),n)];else{if((n=r.filter[e[l].type].apply(null,e[l].matches))[y]){for(i=++l;i<o&&!r.relative[e[i].type];i++);return xe(l>1&&ve(d),l>1&&ge(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(V,"$1"),n,l<i&&ye(e.slice(l,i)),i<o&&ye(e=e.slice(i)),i<o&&ge(e))}d.push(n)}return ve(d)}return he.prototype=r.filters=r.pseudos,r.setFilters=new he,s=ie.tokenize=function(e,t){var n,i,o,s,a,l,u,c=I[e+" "];if(c)return t?0:c.slice(0);for(a=e,l=[],u=r.preFilter;a;){for(s in n&&!(i=H.exec(a))||(i&&(a=a.slice(i[0].length)||a),l.push(o=[])),n=!1,(i=q.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(V," ")}),a=a.slice(n.length)),r.filter)!(i=Q[s].exec(a))||u[s]&&!(i=u[s](i))||(n=i.shift(),o.push({value:n,type:s,matches:i}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ie.error(e):I(e,l).slice(0)},a=ie.compile=function(e,t){var n,i=[],o=[],a=L[e+" "];if(!a){for(t||(t=s(e)),n=t.length;n--;)(a=ye(t[n]))[y]?i.push(a):o.push(a);(a=L(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,s,a,l,c){var p,h,m,v=0,E="0",x=o&&[],y=[],T=u,C=o||i&&r.find.TAG("*",c),S=N+=null==T?1:Math.random()||.1,I=C.length;for(c&&(u=s===f||s||c);E!==I&&null!=(p=C[E]);E++){if(i&&p){for(h=0,s||p.ownerDocument===f||(d(p),a=!g);m=e[h++];)if(m(p,s||f,a)){l.push(p);break}c&&(N=S)}n&&((p=!m&&p)&&v--,o&&x.push(p))}if(v+=E,n&&E!==v){for(h=0;m=t[h++];)m(x,y,s,a);if(o){if(v>0)for(;E--;)x[E]||y[E]||(y[E]=O.call(l));y=Ee(y)}_.apply(l,y),c&&!o&&y.length>0&&v+t.length>1&&ie.uniqueSort(l)}return c&&(N=S,u=T),x};return n?se(o):o}(o,i))).selector=e}return a},l=ie.select=function(e,t,i,o){var l,u,c,p,d,f="function"==typeof e&&e,h=!o&&s(e=f.selector||e);if(i=i||[],1===h.length){if((u=h[0]=h[0].slice(0)).length>2&&"ID"===(c=u[0]).type&&n.getById&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(te,ne),t)||[])[0]))return i;f&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(l=Q.needsContext.test(e)?0:u.length;l--&&(c=u[l],!r.relative[p=c.type]);)if((d=r.find[p])&&(o=d(c.matches[0].replace(te,ne),J.test(u[0].type)&&fe(t.parentNode)||t))){if(u.splice(l,1),!(e=o.length&&ge(u)))return _.apply(i,o),i;break}}return(f||a(e,h))(o,t,!g,i,!t||J.test(e)&&fe(t.parentNode)||t),i},n.sortStable=y.split("").sort(A).join("")===y,n.detectDuplicates=!!p,d(),n.sortDetached=ae((function(e){return 1&e.compareDocumentPosition(f.createElement("div"))})),ae((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||le("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ae((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||le("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ae((function(e){return null==e.getAttribute("disabled")}))||le(k,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),ie}(e);d.find=E,d.expr=E.selectors,d.expr[":"]=d.expr.pseudos,d.uniqueSort=d.unique=E.uniqueSort,d.text=E.getText,d.isXMLDoc=E.isXML,d.contains=E.contains;var x=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&d(e).is(n))break;r.push(e)}return r},y=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},T=d.expr.match.needsContext,N=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,C=/^.[^:#\[\.,]*$/;function S(e,t,n){if(d.isFunction(t))return d.grep(e,(function(e,r){return!!t.call(e,r,e)!==n}));if(t.nodeType)return d.grep(e,(function(e){return e===t!==n}));if("string"==typeof t){if(C.test(t))return d.filter(t,e,n);t=d.filter(t,e)}return d.grep(e,(function(e){return a.call(t,e)>-1!==n}))}d.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?d.find.matchesSelector(r,e)?[r]:[]:d.find.matches(e,d.grep(t,(function(e){return 1===e.nodeType})))},d.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if("string"!=typeof e)return this.pushStack(d(e).filter((function(){for(t=0;t<n;t++)if(d.contains(i[t],this))return!0})));for(t=0;t<n;t++)d.find(e,i[t],r);return(r=this.pushStack(n>1?d.unique(r):r)).selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(S(this,e||[],!1))},not:function(e){return this.pushStack(S(this,e||[],!0))},is:function(e){return!!S(this,"string"==typeof e&&T.test(e)?d(e):e||[],!1).length}});var I,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(d.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||I,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof d?t[0]:t,d.merge(this,d.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),N.test(i[1])&&d.isPlainObject(t))for(i in t)d.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&o.parentNode&&(this.length=1,this[0]=o),this.context=r,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):d.isFunction(e)?void 0!==n.ready?n.ready(e):e(d):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),d.makeArray(e,this))}).prototype=d.fn,I=d(r);var A=/^(?:parents|prev(?:Until|All))/,b={children:!0,contents:!0,next:!0,prev:!0};function R(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}d.fn.extend({has:function(e){var t=d(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(d.contains(this,t[e]))return!0}))},closest:function(e,t){for(var n,r=0,i=this.length,o=[],s=T.test(e)||"string"!=typeof e?d(e,t||this.context):0;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&d.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?d.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?a.call(d(e),this[0]):a.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(d.uniqueSort(d.merge(this.get(),d(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),d.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x(e,"parentNode")},parentsUntil:function(e,t,n){return x(e,"parentNode",n)},next:function(e){return R(e,"nextSibling")},prev:function(e){return R(e,"previousSibling")},nextAll:function(e){return x(e,"nextSibling")},prevAll:function(e){return x(e,"previousSibling")},nextUntil:function(e,t,n){return x(e,"nextSibling",n)},prevUntil:function(e,t,n){return x(e,"previousSibling",n)},siblings:function(e){return y((e.parentNode||{}).firstChild,e)},children:function(e){return y(e.firstChild)},contents:function(e){return e.contentDocument||d.merge([],e.childNodes)}},(function(e,t){d.fn[e]=function(n,r){var i=d.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=d.filter(r,i)),this.length>1&&(b[e]||d.uniqueSort(i),A.test(e)&&i.reverse()),this.pushStack(i)}}));var w,O=/\S+/g;function M(){r.removeEventListener("DOMContentLoaded",M),e.removeEventListener("load",M),d.ready()}d.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return d.each(e.match(O)||[],(function(e,n){t[n]=!0})),t}(e):d.extend({},e);var t,n,r,i,o=[],s=[],a=-1,l=function(){for(i=e.once,r=t=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},u={add:function(){return o&&(n&&!t&&(a=o.length-1,s.push(n)),function t(n){d.each(n,(function(n,r){d.isFunction(r)?e.unique&&u.has(r)||o.push(r):r&&r.length&&"string"!==d.type(r)&&t(r)}))}(arguments),n&&!t&&l()),this},remove:function(){return d.each(arguments,(function(e,t){for(var n;(n=d.inArray(t,o,n))>-1;)o.splice(n,1),n<=a&&a--})),this},has:function(e){return e?d.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},d.extend({Deferred:function(e){var t=[["resolve","done",d.Callbacks("once memory"),"resolved"],["reject","fail",d.Callbacks("once memory"),"rejected"],["notify","progress",d.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return d.Deferred((function(n){d.each(t,(function(t,o){var s=d.isFunction(e[t])&&e[t];i[o[1]]((function(){var e=s&&s.apply(this,arguments);e&&d.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,s?[e]:arguments)}))})),e=null})).promise()},promise:function(e){return null!=e?d.extend(e,r):r}},i={};return r.pipe=r.then,d.each(t,(function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add((function(){n=a}),t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith})),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,o=0,s=i.call(arguments),a=s.length,l=1!==a||e&&d.isFunction(e.promise)?a:0,u=1===l?e:d.Deferred(),c=function(e,n,r){return function(o){n[e]=this,r[e]=arguments.length>1?i.call(arguments):o,r===t?u.notifyWith(n,r):--l||u.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);o<a;o++)s[o]&&d.isFunction(s[o].promise)?s[o].promise().progress(c(o,n,t)).done(c(o,r,s)).fail(u.reject):--l;return l||u.resolveWith(r,s),u.promise()}}),d.fn.ready=function(e){return d.ready.promise().done(e),this},d.extend({isReady:!1,readyWait:1,holdReady:function(e){e?d.readyWait++:d.ready(!0)},ready:function(e){(!0===e?--d.readyWait:d.isReady)||(d.isReady=!0,!0!==e&&--d.readyWait>0||(w.resolveWith(r,[d]),d.fn.triggerHandler&&(d(r).triggerHandler("ready"),d(r).off("ready"))))}}),d.ready.promise=function(t){return w||(w=d.Deferred(),"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(d.ready):(r.addEventListener("DOMContentLoaded",M),e.addEventListener("load",M))),w.promise(t)},d.ready.promise();var _=function(e,t,n,r,i,o,s){var a=0,l=e.length,u=null==n;if("object"===d.type(n))for(a in i=!0,n)_(e,t,a,n[a],!0,o,s);else if(void 0!==r&&(i=!0,d.isFunction(r)||(s=!0),u&&(s?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(d(e),n)})),t))for(;a<l;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:u?t.call(e):l?t(e[0],n):o},P=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function D(){this.expando=d.expando+D.uid++}D.uid=1,D.prototype={register:function(e,t){var n=t||{};return e.nodeType?e[this.expando]=n:Object.defineProperty(e,this.expando,{value:n,writable:!0,configurable:!0}),e[this.expando]},cache:function(e){if(!P(e))return{};var t=e[this.expando];return t||(t={},P(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[t]=n;else for(r in t)i[r]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][t]},access:function(e,t,n){var r;return void 0===t||t&&"string"==typeof t&&void 0===n?void 0!==(r=this.get(e,t))?r:this.get(e,d.camelCase(t)):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r,i,o=e[this.expando];if(void 0!==o){if(void 0===t)this.register(e);else{d.isArray(t)?r=t.concat(t.map(d.camelCase)):(i=d.camelCase(t),r=t in o?[t,i]:(r=i)in o?[r]:r.match(O)||[]),n=r.length;for(;n--;)delete o[r[n]]}(void 0===t||d.isEmptyObject(o))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!d.isEmptyObject(t)}};var k=new D,F=new D,G=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,U=/[A-Z]/g;function B(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(U,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:G.test(n)?d.parseJSON(n):n)}catch(e){}F.set(e,t,n)}else n=void 0;return n}d.extend({hasData:function(e){return F.hasData(e)||k.hasData(e)},data:function(e,t,n){return F.access(e,t,n)},removeData:function(e,t){F.remove(e,t)},_data:function(e,t,n){return k.access(e,t,n)},_removeData:function(e,t){k.remove(e,t)}}),d.fn.extend({data:function(e,t){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(i=F.get(o),1===o.nodeType&&!k.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=d.camelCase(r.slice(5)),B(o,r,i[r]));k.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){F.set(this,e)})):_(this,(function(t){var n,r;if(o&&void 0===t)return void 0!==(n=F.get(o,e)||F.get(o,e.replace(U,"-$&").toLowerCase()))?n:(r=d.camelCase(e),void 0!==(n=F.get(o,r))?n:void 0!==(n=B(o,r,void 0))?n:void 0);r=d.camelCase(e),this.each((function(){var n=F.get(this,r);F.set(this,r,t),e.indexOf("-")>-1&&void 0!==n&&F.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){F.remove(this,e)}))}}),d.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=k.get(e,t),n&&(!r||d.isArray(n)?r=k.access(e,t,d.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=d.queue(e,t),r=n.length,i=n.shift(),o=d._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){d.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return k.get(e,n)||k.access(e,n,{empty:d.Callbacks("once memory").add((function(){k.remove(e,[t+"queue",n])}))})}}),d.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?d.queue(this[0],e):void 0===t?this:this.each((function(){var n=d.queue(this,e,t);d._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&d.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){d.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=d.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=k.get(o[s],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var j=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,V=new RegExp("^(?:([+-])=|)("+j+")([a-z%]*)$","i"),H=["Top","Right","Bottom","Left"],q=function(e,t){return e=t||e,"none"===d.css(e,"display")||!d.contains(e.ownerDocument,e)};function $(e,t,n,r){var i,o=1,s=20,a=r?function(){return r.cur()}:function(){return d.css(e,t,"")},l=a(),u=n&&n[3]||(d.cssNumber[t]?"":"px"),c=(d.cssNumber[t]||"px"!==u&&+l)&&V.exec(d.css(e,t));if(c&&c[3]!==u){u=u||c[3],n=n||[],c=+l||1;do{c/=o=o||".5",d.style(e,t,c+u)}while(o!==(o=a()/l)&&1!==o&&--s)}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}var z=/^(?:checkbox|radio)$/i,W=/<([\w:-]+)/,Q=/^$|\/(?:java|ecma)script/i,Y={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function X(e,t){var n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&d.nodeName(e,t)?d.merge([e],n):n}function K(e,t){for(var n=0,r=e.length;n<r;n++)k.set(e[n],"globalEval",!t||k.get(t[n],"globalEval"))}Y.optgroup=Y.option,Y.tbody=Y.tfoot=Y.colgroup=Y.caption=Y.thead,Y.th=Y.td;var Z,J,ee=/<|&#?\w+;/;function te(e,t,n,r,i){for(var o,s,a,l,u,c,p=t.createDocumentFragment(),f=[],h=0,g=e.length;h<g;h++)if((o=e[h])||0===o)if("object"===d.type(o))d.merge(f,o.nodeType?[o]:o);else if(ee.test(o)){for(s=s||p.appendChild(t.createElement("div")),a=(W.exec(o)||["",""])[1].toLowerCase(),l=Y[a]||Y._default,s.innerHTML=l[1]+d.htmlPrefilter(o)+l[2],c=l[0];c--;)s=s.lastChild;d.merge(f,s.childNodes),(s=p.firstChild).textContent=""}else f.push(t.createTextNode(o));for(p.textContent="",h=0;o=f[h++];)if(r&&d.inArray(o,r)>-1)i&&i.push(o);else if(u=d.contains(o.ownerDocument,o),s=X(p.appendChild(o),"script"),u&&K(s),n)for(c=0;o=s[c++];)Q.test(o.type||"")&&n.push(o);return p}Z=r.createDocumentFragment().appendChild(r.createElement("div")),(J=r.createElement("input")).setAttribute("type","radio"),J.setAttribute("checked","checked"),J.setAttribute("name","t"),Z.appendChild(J),p.checkClone=Z.cloneNode(!0).cloneNode(!0).lastChild.checked,Z.innerHTML="<textarea>x</textarea>",p.noCloneChecked=!!Z.cloneNode(!0).lastChild.defaultValue;var ne=/^key/,re=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ie=/^([^.]*)(?:\.(.+)|)/;function oe(){return!0}function se(){return!1}function ae(){try{return r.activeElement}catch(e){}}function le(e,t,n,r,i,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(r=r||n,n=void 0),t)le(e,a,n,r,t[a],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=se;else if(!i)return e;return 1===o&&(s=i,(i=function(e){return d().off(e),s.apply(this,arguments)}).guid=s.guid||(s.guid=d.guid++)),e.each((function(){d.event.add(this,t,i,r,n)}))}d.event={global:{},add:function(e,t,n,r,i){var o,s,a,l,u,c,p,f,h,g,m,v=k.get(e);if(v)for(n.handler&&(n=(o=n).handler,i=o.selector),n.guid||(n.guid=d.guid++),(l=v.events)||(l=v.events={}),(s=v.handle)||(s=v.handle=function(t){return void 0!==d&&d.event.triggered!==t.type?d.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(O)||[""]).length;u--;)h=m=(a=ie.exec(t[u])||[])[1],g=(a[2]||"").split(".").sort(),h&&(p=d.event.special[h]||{},h=(i?p.delegateType:p.bindType)||h,p=d.event.special[h]||{},c=d.extend({type:h,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&d.expr.match.needsContext.test(i),namespace:g.join(".")},o),(f=l[h])||((f=l[h]=[]).delegateCount=0,p.setup&&!1!==p.setup.call(e,r,g,s)||e.addEventListener&&e.addEventListener(h,s)),p.add&&(p.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,c):f.push(c),d.event.global[h]=!0)},remove:function(e,t,n,r,i){var o,s,a,l,u,c,p,f,h,g,m,v=k.hasData(e)&&k.get(e);if(v&&(l=v.events)){for(u=(t=(t||"").match(O)||[""]).length;u--;)if(h=m=(a=ie.exec(t[u])||[])[1],g=(a[2]||"").split(".").sort(),h){for(p=d.event.special[h]||{},f=l[h=(r?p.delegateType:p.bindType)||h]||[],a=a[2]&&new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=f.length;o--;)c=f[o],!i&&m!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,p.remove&&p.remove.call(e,c));s&&!f.length&&(p.teardown&&!1!==p.teardown.call(e,g,v.handle)||d.removeEvent(e,h,v.handle),delete l[h])}else for(h in l)d.event.remove(e,h+t[u],n,r,!0);d.isEmptyObject(l)&&k.remove(e,"handle events")}},dispatch:function(e){e=d.event.fix(e);var t,n,r,o,s,a=[],l=i.call(arguments),u=(k.get(this,"events")||{})[e.type]||[],c=d.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(a=d.event.handlers.call(this,e,u),t=0;(o=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,n=0;(s=o.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(s.namespace)||(e.handleObj=s,e.data=s.data,void 0!==(r=((d.event.special[s.origType]||{}).handle||s.handler).apply(o.elem,l))&&!1===(e.result=r)&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,l=e.target;if(a&&l.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(r=[],n=0;n<a;n++)void 0===r[i=(o=t[n]).selector+" "]&&(r[i]=o.needsContext?d(i,this).index(l)>-1:d.find(i,this,null,[l]).length),r[i]&&r.push(o);r.length&&s.push({elem:l,handlers:r})}return a<t.length&&s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,i,o,s=t.button;return null==e.pageX&&null!=t.clientX&&(i=(n=e.target.ownerDocument||r).documentElement,o=n.body,e.pageX=t.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),e.pageY=t.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)),e.which||void 0===s||(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[d.expando])return e;var t,n,i,o=e.type,s=e,a=this.fixHooks[o];for(a||(this.fixHooks[o]=a=re.test(o)?this.mouseHooks:ne.test(o)?this.keyHooks:{}),i=a.props?this.props.concat(a.props):this.props,e=new d.Event(s),t=i.length;t--;)e[n=i[t]]=s[n];return e.target||(e.target=r),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,s):e},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ae()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===ae()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&d.nodeName(this,"input"))return this.click(),!1},_default:function(e){return d.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},d.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},d.Event=function(e,t){if(!(this instanceof d.Event))return new d.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?oe:se):this.type=e,t&&d.extend(this,t),this.timeStamp=e&&e.timeStamp||d.now(),this[d.expando]=!0},d.Event.prototype={constructor:d.Event,isDefaultPrevented:se,isPropagationStopped:se,isImmediatePropagationStopped:se,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=oe,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=oe,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=oe,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},d.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){d.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||d.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}})),d.fn.extend({on:function(e,t,n,r){return le(this,e,t,n,r)},one:function(e,t,n,r){return le(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,d(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=se),this.each((function(){d.event.remove(this,e,n,t)}))}});var ue=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,ce=/<script|<style|<link/i,pe=/checked\s*(?:[^=]|=\s*.checked.)/i,de=/^true\/(.*)/,fe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function he(e,t){return d.nodeName(e,"table")&&d.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ge(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function me(e){var t=de.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function ve(e,t){var n,r,i,o,s,a,l,u;if(1===t.nodeType){if(k.hasData(e)&&(o=k.access(e),s=k.set(t,o),u=o.events))for(i in delete s.handle,s.events={},u)for(n=0,r=u[i].length;n<r;n++)d.event.add(t,i,u[i][n]);F.hasData(e)&&(a=F.access(e),l=d.extend({},a),F.set(t,l))}}function Ee(e,t,n,r){t=o.apply([],t);var i,s,a,l,u,c,f=0,h=e.length,g=h-1,m=t[0],v=d.isFunction(m);if(v||h>1&&"string"==typeof m&&!p.checkClone&&pe.test(m))return e.each((function(i){var o=e.eq(i);v&&(t[0]=m.call(this,i,o.html())),Ee(o,t,n,r)}));if(h&&(s=(i=te(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=s),s||r)){for(l=(a=d.map(X(i,"script"),ge)).length;f<h;f++)u=i,f!==g&&(u=d.clone(u,!0,!0),l&&d.merge(a,X(u,"script"))),n.call(e[f],u,f);if(l)for(c=a[a.length-1].ownerDocument,d.map(a,me),f=0;f<l;f++)u=a[f],Q.test(u.type||"")&&!k.access(u,"globalEval")&&d.contains(c,u)&&(u.src?d._evalUrl&&d._evalUrl(u.src):d.globalEval(u.textContent.replace(fe,"")))}return e}function xe(e,t,n){for(var r,i=t?d.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||d.cleanData(X(r)),r.parentNode&&(n&&d.contains(r.ownerDocument,r)&&K(X(r,"script")),r.parentNode.removeChild(r));return e}d.extend({htmlPrefilter:function(e){return e.replace(ue,"<$1></$2>")},clone:function(e,t,n){var r,i,o,s,a,l,u,c=e.cloneNode(!0),f=d.contains(e.ownerDocument,e);if(!(p.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||d.isXMLDoc(e)))for(s=X(c),r=0,i=(o=X(e)).length;r<i;r++)a=o[r],l=s[r],u=void 0,"input"===(u=l.nodeName.toLowerCase())&&z.test(a.type)?l.checked=a.checked:"input"!==u&&"textarea"!==u||(l.defaultValue=a.defaultValue);if(t)if(n)for(o=o||X(e),s=s||X(c),r=0,i=o.length;r<i;r++)ve(o[r],s[r]);else ve(e,c);return(s=X(c,"script")).length>0&&K(s,!f&&X(e,"script")),c},cleanData:function(e){for(var t,n,r,i=d.event.special,o=0;void 0!==(n=e[o]);o++)if(P(n)){if(t=n[k.expando]){if(t.events)for(r in t.events)i[r]?d.event.remove(n,r):d.removeEvent(n,r,t.handle);n[k.expando]=void 0}n[F.expando]&&(n[F.expando]=void 0)}}}),d.fn.extend({domManip:Ee,detach:function(e){return xe(this,e,!0)},remove:function(e){return xe(this,e)},text:function(e){return _(this,(function(e){return void 0===e?d.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Ee(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||he(this,e).appendChild(e)}))},prepend:function(){return Ee(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=he(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Ee(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Ee(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(d.cleanData(X(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return d.clone(this,e,t)}))},html:function(e){return _(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ce.test(e)&&!Y[(W.exec(e)||["",""])[1].toLowerCase()]){e=d.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(d.cleanData(X(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Ee(this,arguments,(function(t){var n=this.parentNode;d.inArray(this,e)<0&&(d.cleanData(X(this)),n&&n.replaceChild(t,this))}),e)}}),d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){d.fn[e]=function(e){for(var n,r=[],i=d(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),d(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}}));var ye,Te={HTML:"block",BODY:"block"};function Ne(e,t){var n=d(t.createElement(e)).appendTo(t.body),r=d.css(n[0],"display");return n.detach(),r}function Ce(e){var t=r,n=Te[e];return n||("none"!==(n=Ne(e,t))&&n||((t=(ye=(ye||d("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentDocument).write(),t.close(),n=Ne(e,t),ye.detach()),Te[e]=n),n}var Se=/^margin/,Ie=new RegExp("^("+j+")(?!px)[a-z%]+$","i"),Le=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Ae=function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=s[o];return i},be=r.documentElement;function Re(e,t,n){var r,i,o,s,a=e.style;return""!==(s=(n=n||Le(e))?n.getPropertyValue(t)||n[t]:void 0)&&void 0!==s||d.contains(e.ownerDocument,e)||(s=d.style(e,t)),n&&!p.pixelMarginRight()&&Ie.test(s)&&Se.test(t)&&(r=a.width,i=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=r,a.minWidth=i,a.maxWidth=o),void 0!==s?s+"":s}function we(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){var t,n,i,o,s=r.createElement("div"),a=r.createElement("div");function l(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",a.innerHTML="",be.appendChild(s);var r=e.getComputedStyle(a);t="1%"!==r.top,o="2px"===r.marginLeft,n="4px"===r.width,a.style.marginRight="50%",i="4px"===r.marginRight,be.removeChild(s)}a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",p.clearCloneStyle="content-box"===a.style.backgroundClip,s.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",s.appendChild(a),d.extend(p,{pixelPosition:function(){return l(),t},boxSizingReliable:function(){return null==n&&l(),n},pixelMarginRight:function(){return null==n&&l(),i},reliableMarginLeft:function(){return null==n&&l(),o},reliableMarginRight:function(){var t,n=a.appendChild(r.createElement("div"));return n.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",a.style.width="1px",be.appendChild(s),t=!parseFloat(e.getComputedStyle(n).marginRight),be.removeChild(s),a.removeChild(n),t}}))}();var Oe=/^(none|table(?!-c[ea]).+)/,Me={position:"absolute",visibility:"hidden",display:"block"},_e={letterSpacing:"0",fontWeight:"400"},Pe=["Webkit","O","Moz","ms"],De=r.createElement("div").style;function ke(e){if(e in De)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=Pe.length;n--;)if((e=Pe[n]+t)in De)return e}function Fe(e,t,n){var r=V.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ge(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;o<4;o+=2)"margin"===n&&(s+=d.css(e,n+H[o],!0,i)),r?("content"===n&&(s-=d.css(e,"padding"+H[o],!0,i)),"margin"!==n&&(s-=d.css(e,"border"+H[o]+"Width",!0,i))):(s+=d.css(e,"padding"+H[o],!0,i),"padding"!==n&&(s+=d.css(e,"border"+H[o]+"Width",!0,i)));return s}function Ue(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Le(e),s="border-box"===d.css(e,"boxSizing",!1,o);if(i<=0||null==i){if(((i=Re(e,t,o))<0||null==i)&&(i=e.style[t]),Ie.test(i))return i;r=s&&(p.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+Ge(e,t,n||(s?"border":"content"),r,o)+"px"}function Be(e,t){for(var n,r,i,o=[],s=0,a=e.length;s<a;s++)(r=e[s]).style&&(o[s]=k.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&q(r)&&(o[s]=k.access(r,"olddisplay",Ce(r.nodeName)))):(i=q(r),"none"===n&&i||k.set(r,"olddisplay",i?n:d.css(r,"display"))));for(s=0;s<a;s++)(r=e[s]).style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}function je(e,t,n,r,i){return new je.prototype.init(e,t,n,r,i)}d.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Re(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=d.camelCase(t),l=e.style;if(t=d.cssProps[a]||(d.cssProps[a]=ke(a)||a),s=d.cssHooks[t]||d.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=V.exec(n))&&i[1]&&(n=$(e,t,i),o="number"),null!=n&&n==n&&("number"===o&&(n+=i&&i[3]||(d.cssNumber[a]?"":"px")),p.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(l[t]=n))}},css:function(e,t,n,r){var i,o,s,a=d.camelCase(t);return t=d.cssProps[a]||(d.cssProps[a]=ke(a)||a),(s=d.cssHooks[t]||d.cssHooks[a])&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=Re(e,t,r)),"normal"===i&&t in _e&&(i=_e[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),d.each(["height","width"],(function(e,t){d.cssHooks[t]={get:function(e,n,r){if(n)return Oe.test(d.css(e,"display"))&&0===e.offsetWidth?Ae(e,Me,(function(){return Ue(e,t,r)})):Ue(e,t,r)},set:function(e,n,r){var i,o=r&&Le(e),s=r&&Ge(e,t,r,"border-box"===d.css(e,"boxSizing",!1,o),o);return s&&(i=V.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=d.css(e,t)),Fe(0,n,s)}}})),d.cssHooks.marginLeft=we(p.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Re(e,"marginLeft"))||e.getBoundingClientRect().left-Ae(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),d.cssHooks.marginRight=we(p.reliableMarginRight,(function(e,t){if(t)return Ae(e,{display:"inline-block"},Re,[e,"marginRight"])})),d.each({margin:"",padding:"",border:"Width"},(function(e,t){d.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+H[r]+t]=o[r]||o[r-2]||o[0];return i}},Se.test(e)||(d.cssHooks[e+t].set=Fe)})),d.fn.extend({css:function(e,t){return _(this,(function(e,t,n){var r,i,o={},s=0;if(d.isArray(t)){for(r=Le(e),i=t.length;s<i;s++)o[t[s]]=d.css(e,t[s],!1,r);return o}return void 0!==n?d.style(e,t,n):d.css(e,t)}),e,t,arguments.length>1)},show:function(){return Be(this,!0)},hide:function(){return Be(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){q(this)?d(this).show():d(this).hide()}))}}),d.Tween=je,je.prototype={constructor:je,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||d.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(d.cssNumber[n]?"":"px")},cur:function(){var e=je.propHooks[this.prop];return e&&e.get?e.get(this):je.propHooks._default.get(this)},run:function(e){var t,n=je.propHooks[this.prop];return this.options.duration?this.pos=t=d.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):je.propHooks._default.set(this),this}},je.prototype.init.prototype=je.prototype,je.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=d.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){d.fx.step[e.prop]?d.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[d.cssProps[e.prop]]&&!d.cssHooks[e.prop]?e.elem[e.prop]=e.now:d.style(e.elem,e.prop,e.now+e.unit)}}},je.propHooks.scrollTop=je.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},d.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},d.fx=je.prototype.init,d.fx.step={};var Ve,He,qe=/^(?:toggle|show|hide)$/,$e=/queueHooks$/;function ze(){return e.setTimeout((function(){Ve=void 0})),Ve=d.now()}function We(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=H[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function Qe(e,t,n){for(var r,i=(Ye.tweeners[t]||[]).concat(Ye.tweeners["*"]),o=0,s=i.length;o<s;o++)if(r=i[o].call(n,t,e))return r}function Ye(e,t,n){var r,i,o=0,s=Ye.prefilters.length,a=d.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var t=Ve||ze(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),o=0,s=u.tweens.length;o<s;o++)u.tweens[o].run(r);return a.notifyWith(e,[u,r,n]),r<1&&s?n:(a.resolveWith(e,[u]),!1)},u=a.promise({elem:e,props:d.extend({},t),opts:d.extend(!0,{specialEasing:{},easing:d.easing._default},n),originalProperties:t,originalOptions:n,startTime:Ve||ze(),duration:n.duration,tweens:[],createTween:function(t,n){var r=d.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)u.tweens[n].run(1);return t?(a.notifyWith(e,[u,1,0]),a.resolveWith(e,[u,t])):a.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var n,r,i,o,s;for(n in e)if(i=t[r=d.camelCase(n)],o=e[n],d.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(s=d.cssHooks[r])&&"expand"in s)for(n in o=s.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,u.opts.specialEasing);o<s;o++)if(r=Ye.prefilters[o].call(u,e,c,u.opts))return d.isFunction(r.stop)&&(d._queueHooks(u.elem,u.opts.queue).stop=d.proxy(r.stop,r)),r;return d.map(c,Qe,u),d.isFunction(u.opts.start)&&u.opts.start.call(e,u),d.fx.timer(d.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}d.Animation=d.extend(Ye,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return $(n.elem,e,V.exec(t),n),n}]},tweener:function(e,t){d.isFunction(e)?(t=e,e=["*"]):e=e.match(O);for(var n,r=0,i=e.length;r<i;r++)n=e[r],Ye.tweeners[n]=Ye.tweeners[n]||[],Ye.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,s,a,l,u,c=this,p={},f=e.style,h=e.nodeType&&q(e),g=k.get(e,"fxshow");for(r in n.queue||(null==(a=d._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,l=a.empty.fire,a.empty.fire=function(){a.unqueued||l()}),a.unqueued++,c.always((function(){c.always((function(){a.unqueued--,d.queue(e,"fx").length||a.empty.fire()}))}))),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],"inline"===("none"===(u=d.css(e,"display"))?k.get(e,"olddisplay")||Ce(e.nodeName):u)&&"none"===d.css(e,"float")&&(f.display="inline-block")),n.overflow&&(f.overflow="hidden",c.always((function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]}))),t)if(i=t[r],qe.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(h?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;h=!0}p[r]=g&&g[r]||d.style(e,r)}else u=void 0;if(d.isEmptyObject(p))"inline"===("none"===u?Ce(e.nodeName):u)&&(f.display=u);else for(r in g?"hidden"in g&&(h=g.hidden):g=k.access(e,"fxshow",{}),o&&(g.hidden=!h),h?d(e).show():c.done((function(){d(e).hide()})),c.done((function(){var t;for(t in k.remove(e,"fxshow"),p)d.style(e,t,p[t])})),p)s=Qe(h?g[r]:0,r,c),r in g||(g[r]=s.start,h&&(s.end=s.start,s.start="width"===r||"height"===r?1:0))}],prefilter:function(e,t){t?Ye.prefilters.unshift(e):Ye.prefilters.push(e)}}),d.speed=function(e,t,n){var r=e&&"object"==typeof e?d.extend({},e):{complete:n||!n&&t||d.isFunction(e)&&e,duration:e,easing:n&&t||t&&!d.isFunction(t)&&t};return r.duration=d.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in d.fx.speeds?d.fx.speeds[r.duration]:d.fx.speeds._default,null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){d.isFunction(r.old)&&r.old.call(this),r.queue&&d.dequeue(this,r.queue)},r},d.fn.extend({fadeTo:function(e,t,n,r){return this.filter(q).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=d.isEmptyObject(e),o=d.speed(t,n,r),s=function(){var t=Ye(this,d.extend({},e),o);(i||k.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",o=d.timers,s=k.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&$e.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||d.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=k.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=d.timers,s=r?r.length:0;for(n.finish=!0,d.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<s;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),d.each(["toggle","show","hide"],(function(e,t){var n=d.fn[t];d.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(We(t,!0),e,r,i)}})),d.each({slideDown:We("show"),slideUp:We("hide"),slideToggle:We("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){d.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),d.timers=[],d.fx.tick=function(){var e,t=0,n=d.timers;for(Ve=d.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||d.fx.stop(),Ve=void 0},d.fx.timer=function(e){d.timers.push(e),e()?d.fx.start():d.timers.pop()},d.fx.interval=13,d.fx.start=function(){He||(He=e.setInterval(d.fx.tick,d.fx.interval))},d.fx.stop=function(){e.clearInterval(He),He=null},d.fx.speeds={slow:600,fast:200,_default:400},d.fn.delay=function(t,n){return t=d.fx&&d.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}}))},function(){var e=r.createElement("input"),t=r.createElement("select"),n=t.appendChild(r.createElement("option"));e.type="checkbox",p.checkOn=""!==e.value,p.optSelected=n.selected,t.disabled=!0,p.optDisabled=!n.disabled,(e=r.createElement("input")).value="t",e.type="radio",p.radioValue="t"===e.value}();var Xe,Ke=d.expr.attrHandle;d.fn.extend({attr:function(e,t){return _(this,d.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){d.removeAttr(this,e)}))}}),d.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?d.prop(e,t,n):(1===o&&d.isXMLDoc(e)||(t=t.toLowerCase(),i=d.attrHooks[t]||(d.expr.match.bool.test(t)?Xe:void 0)),void 0!==n?null===n?void d.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=d.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!p.radioValue&&"radio"===t&&d.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(O);if(o&&1===e.nodeType)for(;n=o[i++];)r=d.propFix[n]||n,d.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)}}),Xe={set:function(e,t,n){return!1===t?d.removeAttr(e,n):e.setAttribute(n,n),n}},d.each(d.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=Ke[t]||d.find.attr;Ke[t]=function(e,t,r){var i,o;return r||(o=Ke[t],Ke[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,Ke[t]=o),i}}));var Ze=/^(?:input|select|textarea|button)$/i,Je=/^(?:a|area)$/i;d.fn.extend({prop:function(e,t){return _(this,d.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[d.propFix[e]||e]}))}}),d.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&d.isXMLDoc(e)||(t=d.propFix[t]||t,i=d.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=d.find.attr(e,"tabindex");return t?parseInt(t,10):Ze.test(e.nodeName)||Je.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),p.optSelected||(d.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),d.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){d.propFix[this.toLowerCase()]=this}));var et=/[\t\r\n\f]/g;function tt(e){return e.getAttribute&&e.getAttribute("class")||""}d.fn.extend({addClass:function(e){var t,n,r,i,o,s,a,l=0;if(d.isFunction(e))return this.each((function(t){d(this).addClass(e.call(this,t,tt(this)))}));if("string"==typeof e&&e)for(t=e.match(O)||[];n=this[l++];)if(i=tt(n),r=1===n.nodeType&&(" "+i+" ").replace(et," ")){for(s=0;o=t[s++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(a=d.trim(r))&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,r,i,o,s,a,l=0;if(d.isFunction(e))return this.each((function(t){d(this).removeClass(e.call(this,t,tt(this)))}));if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(O)||[];n=this[l++];)if(i=tt(n),r=1===n.nodeType&&(" "+i+" ").replace(et," ")){for(s=0;o=t[s++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(a=d.trim(r))&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):d.isFunction(e)?this.each((function(n){d(this).toggleClass(e.call(this,n,tt(this),t),t)})):this.each((function(){var t,r,i,o;if("string"===n)for(r=0,i=d(this),o=e.match(O)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||((t=tt(this))&&k.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":k.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+tt(n)+" ").replace(et," ").indexOf(t)>-1)return!0;return!1}});var nt=/\r/g,rt=/[\x20\t\r\n\f]+/g;d.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=d.isFunction(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,d(this).val()):e)?i="":"number"==typeof i?i+="":d.isArray(i)&&(i=d.map(i,(function(e){return null==e?"":e+""}))),(t=d.valHooks[this.type]||d.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=d.valHooks[i.type]||d.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(nt,""):null==n?"":n:void 0}}),d.extend({valHooks:{option:{get:function(e){var t=d.find.attr(e,"value");return null!=t?t:d.trim(d.text(e)).replace(rt," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,s=o?null:[],a=o?i+1:r.length,l=i<0?a:o?i:0;l<a;l++)if(((n=r[l]).selected||l===i)&&(p.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!d.nodeName(n.parentNode,"optgroup"))){if(t=d(n).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=d.makeArray(t),s=i.length;s--;)((r=i[s]).selected=d.inArray(d.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),d.each(["radio","checkbox"],(function(){d.valHooks[this]={set:function(e,t){if(d.isArray(t))return e.checked=d.inArray(d(e).val(),t)>-1}},p.checkOn||(d.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var it=/^(?:focusinfocus|focusoutblur)$/;d.extend(d.event,{trigger:function(t,n,i,o){var s,a,l,u,p,f,h,g=[i||r],m=c.call(t,"type")?t.type:t,v=c.call(t,"namespace")?t.namespace.split("."):[];if(a=l=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!it.test(m+d.event.triggered)&&(m.indexOf(".")>-1&&(v=m.split("."),m=v.shift(),v.sort()),p=m.indexOf(":")<0&&"on"+m,(t=t[d.expando]?t:new d.Event(m,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:d.makeArray(n,[t]),h=d.event.special[m]||{},o||!h.trigger||!1!==h.trigger.apply(i,n))){if(!o&&!h.noBubble&&!d.isWindow(i)){for(u=h.delegateType||m,it.test(u+m)||(a=a.parentNode);a;a=a.parentNode)g.push(a),l=a;l===(i.ownerDocument||r)&&g.push(l.defaultView||l.parentWindow||e)}for(s=0;(a=g[s++])&&!t.isPropagationStopped();)t.type=s>1?u:h.bindType||m,(f=(k.get(a,"events")||{})[t.type]&&k.get(a,"handle"))&&f.apply(a,n),(f=p&&a[p])&&f.apply&&P(a)&&(t.result=f.apply(a,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(g.pop(),n)||!P(i)||p&&d.isFunction(i[m])&&!d.isWindow(i)&&((l=i[p])&&(i[p]=null),d.event.triggered=m,i[m](),d.event.triggered=void 0,l&&(i[p]=l)),t.result}},simulate:function(e,t,n){var r=d.extend(new d.Event,n,{type:e,isSimulated:!0});d.event.trigger(r,null,t)}}),d.fn.extend({trigger:function(e,t){return this.each((function(){d.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return d.event.trigger(e,t,n,!0)}}),d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),(function(e,t){d.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}})),d.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),p.focusin="onfocusin"in e,p.focusin||d.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){d.event.simulate(t,e.target,d.event.fix(e))};d.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=k.access(r,t);i||r.addEventListener(e,n,!0),k.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=k.access(r,t)-1;i?k.access(r,t,i):(r.removeEventListener(e,n,!0),k.remove(r,t))}}}));var ot=e.location,st=d.now(),at=/\?/;d.parseJSON=function(e){return JSON.parse(e+"")},d.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||d.error("Invalid XML: "+t),n};var lt=/#.*$/,ut=/([?&])_=[^&]*/,ct=/^(.*?):[ \t]*([^\r\n]*)$/gm,pt=/^(?:GET|HEAD)$/,dt=/^\/\//,ft={},ht={},gt="*/".concat("*"),mt=r.createElement("a");function vt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(O)||[];if(d.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Et(e,t,n,r){var i={},o=e===ht;function s(a){var l;return i[a]=!0,d.each(e[a]||[],(function(e,a){var u=a(t,n,r);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),s(u),!1)})),l}return s(t.dataTypes[0])||!i["*"]&&s("*")}function xt(e,t){var n,r,i=d.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&d.extend(!0,e,r),e}mt.href=ot.href,d.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ot.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ot.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":gt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?xt(xt(e,d.ajaxSettings),t):xt(d.ajaxSettings,e)},ajaxPrefilter:vt(ft),ajaxTransport:vt(ht),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,s,a,l,u,c,p,f=d.ajaxSetup({},n),h=f.context||f,g=f.context&&(h.nodeType||h.jquery)?d(h):d.event,m=d.Deferred(),v=d.Callbacks("once memory"),E=f.statusCode||{},x={},y={},T=0,N="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===T){if(!a)for(a={};t=ct.exec(s);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===T?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return T||(e=y[n]=y[n]||e,x[e]=t),this},overrideMimeType:function(e){return T||(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(T<2)for(t in e)E[t]=[E[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||N;return i&&i.abort(t),S(0,t),this}};if(m.promise(C).complete=v.add,C.success=C.done,C.error=C.fail,f.url=((t||f.url||ot.href)+"").replace(lt,"").replace(dt,ot.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=d.trim(f.dataType||"*").toLowerCase().match(O)||[""],null==f.crossDomain){u=r.createElement("a");try{u.href=f.url,u.href=u.href,f.crossDomain=mt.protocol+"//"+mt.host!=u.protocol+"//"+u.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=d.param(f.data,f.traditional)),Et(ft,f,n,C),2===T)return C;for(p in(c=d.event&&f.global)&&0==d.active++&&d.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!pt.test(f.type),o=f.url,f.hasContent||(f.data&&(o=f.url+=(at.test(o)?"&":"?")+f.data,delete f.data),!1===f.cache&&(f.url=ut.test(o)?o.replace(ut,"$1_="+st++):o+(at.test(o)?"&":"?")+"_="+st++)),f.ifModified&&(d.lastModified[o]&&C.setRequestHeader("If-Modified-Since",d.lastModified[o]),d.etag[o]&&C.setRequestHeader("If-None-Match",d.etag[o])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&C.setRequestHeader("Content-Type",f.contentType),C.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+gt+"; q=0.01":""):f.accepts["*"]),f.headers)C.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(!1===f.beforeSend.call(h,C,f)||2===T))return C.abort();for(p in N="abort",{success:1,error:1,complete:1})C[p](f[p]);if(i=Et(ht,f,n,C)){if(C.readyState=1,c&&g.trigger("ajaxSend",[C,f]),2===T)return C;f.async&&f.timeout>0&&(l=e.setTimeout((function(){C.abort("timeout")}),f.timeout));try{T=1,i.send(x,S)}catch(e){if(!(T<2))throw e;S(-1,e)}}else S(-1,"No Transport");function S(t,n,r,a){var u,p,x,y,N,S=n;2!==T&&(T=2,l&&e.clearTimeout(l),i=void 0,s=a||"",C.readyState=t>0?4:0,u=t>=200&&t<300||304===t,r&&(y=function(e,t,n){for(var r,i,o,s,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}s||(s=i)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),n[o]}(f,C,r)),y=function(e,t,n,r){var i,o,s,a,l,u={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)u[s.toLowerCase()]=e.converters[s];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(s=u[l+" "+o]||u["* "+o]))for(i in u)if((a=i.split(" "))[1]===o&&(s=u[l+" "+a[0]]||u["* "+a[0]])){!0===s?s=u[i]:!0!==u[i]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(f,y,C,u),u?(f.ifModified&&((N=C.getResponseHeader("Last-Modified"))&&(d.lastModified[o]=N),(N=C.getResponseHeader("etag"))&&(d.etag[o]=N)),204===t||"HEAD"===f.type?S="nocontent":304===t?S="notmodified":(S=y.state,p=y.data,u=!(x=y.error))):(x=S,!t&&S||(S="error",t<0&&(t=0))),C.status=t,C.statusText=(n||S)+"",u?m.resolveWith(h,[p,S,C]):m.rejectWith(h,[C,S,x]),C.statusCode(E),E=void 0,c&&g.trigger(u?"ajaxSuccess":"ajaxError",[C,f,u?p:x]),v.fireWith(h,[C,S]),c&&(g.trigger("ajaxComplete",[C,f]),--d.active||d.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return d.get(e,t,n,"json")},getScript:function(e,t){return d.get(e,void 0,t,"script")}}),d.each(["get","post"],(function(e,t){d[t]=function(e,n,r,i){return d.isFunction(n)&&(i=i||r,r=n,n=void 0),d.ajax(d.extend({url:e,type:t,dataType:i,data:n,success:r},d.isPlainObject(e)&&e))}})),d._evalUrl=function(e){return d.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},d.fn.extend({wrapAll:function(e){var t;return d.isFunction(e)?this.each((function(t){d(this).wrapAll(e.call(this,t))})):(this[0]&&(t=d(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this)},wrapInner:function(e){return d.isFunction(e)?this.each((function(t){d(this).wrapInner(e.call(this,t))})):this.each((function(){var t=d(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=d.isFunction(e);return this.each((function(n){d(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(){return this.parent().each((function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)})).end()}}),d.expr.filters.hidden=function(e){return!d.expr.filters.visible(e)},d.expr.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0};var yt=/%20/g,Tt=/\[\]$/,Nt=/\r?\n/g,Ct=/^(?:submit|button|image|reset|file)$/i,St=/^(?:input|select|textarea|keygen)/i;function It(e,t,n,r){var i;if(d.isArray(t))d.each(t,(function(t,i){n||Tt.test(e)?r(e,i):It(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==d.type(t))r(e,t);else for(i in t)It(e+"["+i+"]",t[i],n,r)}d.param=function(e,t){var n,r=[],i=function(e,t){t=d.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=d.ajaxSettings&&d.ajaxSettings.traditional),d.isArray(e)||e.jquery&&!d.isPlainObject(e))d.each(e,(function(){i(this.name,this.value)}));else for(n in e)It(n,e[n],t,i);return r.join("&").replace(yt,"+")},d.fn.extend({serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=d.prop(this,"elements");return e?d.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!d(this).is(":disabled")&&St.test(this.nodeName)&&!Ct.test(e)&&(this.checked||!z.test(e))})).map((function(e,t){var n=d(this).val();return null==n?null:d.isArray(n)?d.map(n,(function(e){return{name:t.name,value:e.replace(Nt,"\r\n")}})):{name:t.name,value:n.replace(Nt,"\r\n")}})).get()}}),d.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Lt={0:200,1223:204},At=d.ajaxSettings.xhr();p.cors=!!At&&"withCredentials"in At,p.ajax=At=!!At,d.ajaxTransport((function(t){var n,r;if(p.cors||At&&!t.crossDomain)return{send:function(i,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(s,i[s]);n=function(e){return function(){n&&(n=r=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Lt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),r=a.onerror=n("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout((function(){n&&r()}))},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}})),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return d.globalEval(e),e}}}),d.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),d.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain)return{send:function(i,o){t=d("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}}));var bt=[],Rt=/(=)\?(?=&|$)|\?\?/;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=bt.pop()||d.expando+"_"+st++;return this[e]=!0,e}}),d.ajaxPrefilter("json jsonp",(function(t,n,r){var i,o,s,a=!1!==t.jsonp&&(Rt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Rt.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=d.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Rt,"$1"+i):!1!==t.jsonp&&(t.url+=(at.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||d.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always((function(){void 0===o?d(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,bt.push(i)),s&&d.isFunction(o)&&o(s[0]),s=o=void 0})),"script"})),d.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||r;var i=N.exec(e),o=!n&&[];return i?[t.createElement(i[1])]:(i=te([e],t,o),o&&o.length&&d(o).remove(),d.merge([],i.childNodes))};var wt=d.fn.load;function Ot(e){return d.isWindow(e)?e:9===e.nodeType&&e.defaultView}d.fn.load=function(e,t,n){if("string"!=typeof e&&wt)return wt.apply(this,arguments);var r,i,o,s=this,a=e.indexOf(" ");return a>-1&&(r=d.trim(e.slice(a)),e=e.slice(0,a)),d.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),s.length>0&&d.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){o=arguments,s.html(r?d("<div>").append(d.parseHTML(e)).find(r):e)})).always(n&&function(e,t){s.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},d.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){d.fn[t]=function(e){return this.on(t,e)}})),d.expr.filters.animated=function(e){return d.grep(d.timers,(function(t){return e===t.elem})).length},d.offset={setOffset:function(e,t,n){var r,i,o,s,a,l,u=d.css(e,"position"),c=d(e),p={};"static"===u&&(e.style.position="relative"),a=c.offset(),o=d.css(e,"top"),l=d.css(e,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(s=(r=c.position()).top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(l)||0),d.isFunction(t)&&(t=t.call(e,n,d.extend({},a))),null!=t.top&&(p.top=t.top-a.top+s),null!=t.left&&(p.left=t.left-a.left+i),"using"in t?t.using.call(e,p):c.css(p)}},d.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){d.offset.setOffset(this,e,t)}));var t,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;return o?(t=o.documentElement,d.contains(t,r)?(i=r.getBoundingClientRect(),n=Ot(o),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i):void 0},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===d.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),d.nodeName(e[0],"html")||(r=e.offset()),r.top+=d.css(e[0],"borderTopWidth",!0),r.left+=d.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-d.css(n,"marginTop",!0),left:t.left-r.left-d.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===d.css(e,"position");)e=e.offsetParent;return e||be}))}}),d.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;d.fn[e]=function(r){return _(this,(function(e,r,i){var o=Ot(e);if(void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i}),e,r,arguments.length)}})),d.each(["top","left"],(function(e,t){d.cssHooks[t]=we(p.pixelPosition,(function(e,n){if(n)return n=Re(e,t),Ie.test(n)?d(e).position()[t]+"px":n}))})),d.each({Height:"height",Width:"width"},(function(e,t){d.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){d.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),s=n||(!0===r||!0===i?"margin":"border");return _(this,(function(t,n,r){var i;return d.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?d.css(t,n,s):d.style(t,n,r,s)}),t,o?r:void 0,o,null)}}))})),d.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},size:function(){return this.length}}),d.fn.andSelf=d.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],(function(){return d}));var Mt=e.jQuery,_t=e.$;return d.noConflict=function(t){return e.$===d&&(e.$=_t),t&&e.jQuery===d&&(e.jQuery=Mt),d},t||(e.jQuery=e.$=d),d}))},{}],17:[function(e,t,n){var r=e("../src/store-engine"),i=e("../storages/all"),o=[e("../plugins/json2")];t.exports=r.createStore(i,o)},{"../plugins/json2":18,"../src/store-engine":20,"../storages/all":22}],18:[function(e,t,n){t.exports=function(){return e("./lib/json2"),{}}},{"./lib/json2":19}],19:[function(require,module,exports){"object"!=typeof JSON&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta,rep;function f(e){return e<10?"0"+e:e}function this_value(){return this.valueOf()}function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,(function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function str(e,t){var n,r,i,o,s,a=gap,l=t[e];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(e)),"function"==typeof rep&&(l=rep.call(t,e,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,s=[],"[object Array]"===Object.prototype.toString.apply(l)){for(o=l.length,n=0;n<o;n+=1)s[n]=str(n,l)||"null";return i=0===s.length?"[]":gap?"[\n"+gap+s.join(",\n"+gap)+"\n"+a+"]":"["+s.join(",")+"]",gap=a,i}if(rep&&"object"==typeof rep)for(o=rep.length,n=0;n<o;n+=1)"string"==typeof rep[n]&&(i=str(r=rep[n],l))&&s.push(quote(r)+(gap?": ":":")+i);else for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(i=str(r,l))&&s.push(quote(r)+(gap?": ":":")+i);return i=0===s.length?"{}":gap?"{\n"+gap+s.join(",\n"+gap)+"\n"+a+"}":"{"+s.join(",")+"}",gap=a,i}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value),"function"!=typeof JSON.stringify&&(meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(e,t,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;r<n;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){var j;function walk(e,t){var n,r,i=e[t];if(i&&"object"==typeof i)for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(void 0!==(r=walk(i,n))?i[n]=r:delete i[n]);return reviver.call(e,t,i)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},{}],20:[function(e,t,n){var r=e("./util"),i=r.slice,o=r.pluck,s=r.each,a=r.bind,l=r.create,u=r.isList,c=r.isFunction,p=r.isObject;t.exports={createStore:f};var d={version:"2.0.12",enabled:!1,get:function(e,t){var n=this.storage.read(this._namespacePrefix+e);return this._deserialize(n,t)},set:function(e,t){return void 0===t?this.remove(e):(this.storage.write(this._namespacePrefix+e,this._serialize(t)),t)},remove:function(e){this.storage.remove(this._namespacePrefix+e)},each:function(e){var t=this;this.storage.each((function(n,r){e.call(t,t._deserialize(n),(r||"").replace(t._namespaceRegexp,""))}))},clearAll:function(){this.storage.clearAll()},hasNamespace:function(e){return this._namespacePrefix=="__storejs_"+e+"_"},createStore:function(){return f.apply(this,arguments)},addPlugin:function(e){this._addPlugin(e)},namespace:function(e){return f(this.storage,this.plugins,e)}};function f(e,t,n){n||(n=""),e&&!u(e)&&(e=[e]),t&&!u(t)&&(t=[t]);var r=n?"__storejs_"+n+"_":"",f=n?new RegExp("^"+r):null;if(!/^[a-zA-Z0-9_\-]*$/.test(n))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var h=l({_namespacePrefix:r,_namespaceRegexp:f,_testStorage:function(e){try{var t="__storejs__test__";e.write(t,t);var n=e.read(t)===t;return e.remove(t),n}catch(e){return!1}},_assignPluginFnProp:function(e,t){var n=this[t];this[t]=function(){var t=i(arguments,0),r=this;function o(){if(n)return s(arguments,(function(e,n){t[n]=e})),n.apply(r,t)}var a=[o].concat(t);return e.apply(r,a)}},_serialize:function(e){return JSON.stringify(e)},_deserialize:function(e,t){if(!e)return t;var n="";try{n=JSON.parse(e)}catch(t){n=e}return void 0!==n?n:t},_addStorage:function(e){this.enabled||this._testStorage(e)&&(this.storage=e,this.enabled=!0)},_addPlugin:function(e){var t=this;if(u(e))s(e,(function(e){t._addPlugin(e)}));else if(!o(this.plugins,(function(t){return e===t}))){if(this.plugins.push(e),!c(e))throw new Error("Plugins must be function values that return objects");var n=e.call(this);if(!p(n))throw new Error("Plugins must return an object of function properties");s(n,(function(n,r){if(!c(n))throw new Error("Bad plugin property: "+r+" from plugin "+e.name+". Plugins should only return functions.");t._assignPluginFnProp(n,r)}))}},addStorage:function(e){!function(){var e="undefined"==typeof console?null:console;e&&(e.warn?e.warn:e.log).apply(e,arguments)}("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(e)}},d,{plugins:[]});return h.raw={},s(h,(function(e,t){c(e)&&(h.raw[t]=a(h,e))})),s(e,(function(e){h._addStorage(e)})),s(t,(function(e){h._addPlugin(e)})),h}},{"./util":21}],21:[function(e,t,n){(function(e){(function(){var n=Object.assign?Object.assign:function(e,t,n,r){for(var i=1;i<arguments.length;i++)a(Object(arguments[i]),(function(t,n){e[n]=t}));return e},r=function(){if(Object.create)return function(e,t,r,i){var o=s(arguments,1);return n.apply(this,[Object.create(e)].concat(o))};{function e(){}return function(t,r,i,o){var a=s(arguments,1);return e.prototype=t,n.apply(this,[new e].concat(a))}}}(),i=String.prototype.trim?function(e){return String.prototype.trim.call(e)}:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},o="undefined"!=typeof window?window:e;function s(e,t){return Array.prototype.slice.call(e,t||0)}function a(e,t){l(e,(function(e,n){return t(e,n),!1}))}function l(e,t){if(u(e)){for(var n=0;n<e.length;n++)if(t(e[n],n))return e[n]}else for(var r in e)if(e.hasOwnProperty(r)&&t(e[r],r))return e[r]}function u(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length}t.exports={assign:n,create:r,trim:i,bind:function(e,t){return function(){return t.apply(e,Array.prototype.slice.call(arguments,0))}},slice:s,each:a,map:function(e,t){var n=u(e)?[]:{};return l(e,(function(e,r){return n[r]=t(e,r),!1})),n},pluck:l,isList:u,isFunction:function(e){return e&&"[object Function]"==={}.toString.call(e)},isObject:function(e){return e&&"[object Object]"==={}.toString.call(e)},Global:o}}).call(this)}).call(this,void 0!==global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],22:[function(e,t,n){t.exports=[e("./localStorage"),e("./oldFF-globalStorage"),e("./oldIE-userDataStorage"),e("./cookieStorage"),e("./sessionStorage"),e("./memoryStorage")]},{"./cookieStorage":23,"./localStorage":24,"./memoryStorage":25,"./oldFF-globalStorage":26,"./oldIE-userDataStorage":27,"./sessionStorage":28}],23:[function(e,t,n){var r=e("../src/util"),i=r.Global,o=r.trim;t.exports={name:"cookieStorage",read:function(e){if(!e||!u(e))return null;var t="(?:^|.*;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(s.cookie.replace(new RegExp(t),"$1"))},write:function(e,t){e&&(s.cookie=escape(e)+"="+escape(t)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")},each:a,remove:l,clearAll:function(){a((function(e,t){l(t)}))}};var s=i.document;function a(e){for(var t=s.cookie.split(/; ?/g),n=t.length-1;n>=0;n--)if(o(t[n])){var r=t[n].split("="),i=unescape(r[0]);e(unescape(r[1]),i)}}function l(e){e&&u(e)&&(s.cookie=escape(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function u(e){return new RegExp("(?:^|;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(s.cookie)}},{"../src/util":21}],24:[function(e,t,n){var r=e("../src/util").Global;function i(){return r.localStorage}function o(e){return i().getItem(e)}t.exports={name:"localStorage",read:o,write:function(e,t){return i().setItem(e,t)},each:function(e){for(var t=i().length-1;t>=0;t--){var n=i().key(t);e(o(n),n)}},remove:function(e){return i().removeItem(e)},clearAll:function(){return i().clear()}}},{"../src/util":21}],25:[function(e,t,n){t.exports={name:"memoryStorage",read:function(e){return r[e]},write:function(e,t){r[e]=t},each:function(e){for(var t in r)r.hasOwnProperty(t)&&e(r[t],t)},remove:function(e){delete r[e]},clearAll:function(e){r={}}};var r={}},{}],26:[function(e,t,n){var r=e("../src/util").Global;t.exports={name:"oldFF-globalStorage",read:function(e){return i[e]},write:function(e,t){i[e]=t},each:o,remove:function(e){return i.removeItem(e)},clearAll:function(){o((function(e,t){delete i[e]}))}};var i=r.globalStorage;function o(e){for(var t=i.length-1;t>=0;t--){var n=i.key(t);e(i[n],n)}}},{"../src/util":21}],27:[function(e,t,n){var r=e("../src/util").Global;t.exports={name:"oldIE-userDataStorage",write:function(e,t){if(!a){var n=u(e);s((function(e){e.setAttribute(n,t),e.save(i)}))}},read:function(e){if(!a){var t=u(e),n=null;return s((function(e){n=e.getAttribute(t)})),n}},each:function(e){s((function(t){for(var n=t.XMLDocument.documentElement.attributes,r=n.length-1;r>=0;r--){var i=n[r];e(t.getAttribute(i.name),i.name)}}))},remove:function(e){var t=u(e);s((function(e){e.removeAttribute(t),e.save(i)}))},clearAll:function(){s((function(e){var t=e.XMLDocument.documentElement.attributes;e.load(i);for(var n=t.length-1;n>=0;n--)e.removeAttribute(t[n].name);e.save(i)}))}};var i="storejs",o=r.document,s=function(){if(!o||!o.documentElement||!o.documentElement.addBehavior)return null;var e,t,n;try{(t=new ActiveXObject("htmlfile")).open(),t.write('<script>document.w=window<\/script><iframe src="/favicon.ico"></iframe>'),t.close(),e=t.w.frames[0].document,n=e.createElement("div")}catch(t){n=o.createElement("div"),e=o.body}return function(t){var r=[].slice.call(arguments,0);r.unshift(n),e.appendChild(n),n.addBehavior("#default#userData"),n.load(i),t.apply(this,r),e.removeChild(n)}}(),a=(r.navigator?r.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./),l=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function u(e){return e.replace(/^\d/,"___$&").replace(l,"___")}},{"../src/util":21}],28:[function(e,t,n){var r=e("../src/util").Global;function i(){return r.sessionStorage}function o(e){return i().getItem(e)}t.exports={name:"sessionStorage",read:o,write:function(e,t){return i().setItem(e,t)},each:function(e){for(var t=i().length-1;t>=0;t--){var n=i().key(t);e(o(n),n)}},remove:function(e){return i().removeItem(e)},clearAll:function(){return i().clear()}}},{"../src/util":21}],29:[function(e,t,n){t.exports={_args:[[{raw:"yasgui-utils@^1.6.0",scope:null,escapedName:"yasgui-utils",name:"yasgui-utils",rawSpec:"^1.6.0",spec:">=1.6.0 <2.0.0",type:"range"},"/home/sava/IntellijProjects/YASQE-Ontotext"]],_from:"yasgui-utils@>=1.6.0 <2.0.0",_id:"yasgui-utils@1.6.7",_inCache:!0,_location:"/yasgui-utils",_nodeVersion:"7.10.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/yasgui-utils-1.6.7.tgz_1495459781202_0.06725964159704745"},_npmUser:{name:"laurens.rietveld",email:"laurens.rietveld@gmail.com"},_npmVersion:"4.2.0",_phantomChildren:{},_requested:{raw:"yasgui-utils@^1.6.0",scope:null,escapedName:"yasgui-utils",name:"yasgui-utils",rawSpec:"^1.6.0",spec:">=1.6.0 <2.0.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/yasgui-utils/-/yasgui-utils-1.6.7.tgz",_shasum:"2bcfc5a315688de3ae6057883d9ae342b205f267",_shrinkwrap:null,_spec:"yasgui-utils@^1.6.0",_where:"/home/sava/IntellijProjects/YASQE-Ontotext",author:{name:"Laurens Rietveld"},bugs:{url:"https://github.com/YASGUI/Utils/issues"},dependencies:{store:"^2.0.4"},description:"Utils for YASGUI libs",devDependencies:{},directories:{},dist:{shasum:"2bcfc5a315688de3ae6057883d9ae342b205f267",tarball:"https://registry.npmjs.org/yasgui-utils/-/yasgui-utils-1.6.7.tgz"},gitHead:"6031b1cb732d390b29cd5376dceb9a9d665bbd11",homepage:"https://github.com/YASGUI/Utils",licenses:[{type:"MIT",url:"http://yasgui.github.io/license.txt"}],main:"src/main.js",maintainers:[{name:"laurens.rietveld",email:"laurens.rietveld@gmail.com"}],name:"yasgui-utils",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/YASGUI/Utils.git"},scripts:{},version:"1.6.7"}},{}],30:[function(e,t,n){window.console=window.console||{log:function(){}},t.exports={storage:e("./storage.js"),svg:e("./svg.js"),version:{"yasgui-utils":e("../package.json").version},nestedExists:function(e){for(var t=Array.prototype.slice.call(arguments,1),n=0;n<t.length;n++){if(!e||!e.hasOwnProperty(t[n]))return!1;e=e[t[n]]}return!0}}},{"../package.json":29,"./storage.js":31,"./svg.js":32}],31:[function(e,t,n){var r=e("store"),i={day:function(){return 864e5},month:function(){i.day()},year:function(){i.month()}},o=t.exports={set:function(e,t,n,o){if(r.enabled&&e&&void 0!==t){"string"==typeof n&&(n=i[n]()),t.documentElement&&(t=(new XMLSerializer).serializeToString(t.documentElement));try{r.set(e,{val:t,exp:n,time:(new Date).getTime()})}catch(e){if(e.quotaExceeded=function(e){var t=!1;if(e)if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t}(e),!e.quotaExceeded||!o)throw e;o(e)}}},remove:function(e){r.enabled&&e&&r.remove(e)},removeAll:function(e){r.enabled&&(e?"function"==typeof e&&r.each((function(t,n){e(n,t)&&o.remove(n)})):r.clearAll())},get:function(e){if(!r.enabled)return null;if(e){var t=r.get(e);return t?t.exp&&(new Date).getTime()-t.time>t.exp?null:t.val:null}return null}}},{store:17}],32:[function(e,t,n){t.exports={draw:function(e,n){if(e){var r=t.exports.getElement(n);r&&(e.append?e.append(r):e.appendChild(r))}},getElement:function(e){if(e&&0==e.indexOf("<svg")){var t=(new DOMParser).parseFromString(e,"text/xml").documentElement,n=document.createElement("div");return n.className="svgImg",n.appendChild(t),n}return!1}}},{}],33:[function(e,t,n){t.exports={name:"yasgui-yasqe",description:"Yet Another SPARQL Query Editor",version:"2.10.5",main:"src/main.js",license:"MIT",author:"Laurens Rietveld",homepage:"http://yasqe.yasgui.org",scripts:{dev:"gulp serve",build:"gulp",patch:"gulp patch",minor:"gulp minor",major:"gulp major"},devDependencies:{"gulp-bump":"^2.2.0","gulp-connect":"^4.2.0","gulp-embedlr":"^0.5.2","gulp-git":"^1.10.0","gulp-livereload":"^3.8.1","gulp-tag-version":"^1.3.0",watchify:"^3.7.0"},bugs:"https://github.com/YASGUI/YASQE/issues/",keywords:["JavaScript","SPARQL","Editor","Semantic Web","Linked Data"],maintainers:[{name:"Laurens Rietveld",email:"laurens.rietveld@gmail.com",web:"http://laurensrietveld.nl"}],repository:{type:"git",url:"https://github.com/YASGUI/YASQE.git"},dependencies:{"bootstrap-sass":"~3.3.1",browserify:"^13.1.0","browserify-transform-tools":"^1.6.0",codemirror:"5.17.0",exorcist:"^0.4.0",gulp:"~3.9.0","gulp-autoprefixer":"^3.1.0","gulp-concat":"^2.6.0","gulp-cssimport":"^3.1.0","gulp-cssnano":"^2.1.2","gulp-filter":"^4.0.0","gulp-jsvalidate":"^2.1.0","gulp-notify":"^2.2.0","gulp-rename":"^1.2.2","gulp-sass":"^2.2.0","gulp-sourcemaps":"^1.6.0","gulp-streamify":"1.0.2","gulp-uglify":"~0.2.1",jquery:"^2.2.4","require-dir":"^0.3.0","run-sequence":"^1.2.2","vinyl-buffer":"^1.0.0","vinyl-source-stream":"~1.1.0","vinyl-transform":"1.0.0","yasgui-utils":"^1.6.0"},optionalShim:{codemirror:{require:"codemirror",global:"CodeMirror"},jquery:{require:"jquery",global:"jQuery"},"../../lib/codemirror":{require:"codemirror",global:"CodeMirror"}}}},{}],34:[function(e,t,n){"use strict";var r=e("jquery"),i=e("../utils.js"),o=e("yasgui-utils"),s=e("../../lib/trie.js");e("../main.js"),t.exports=function(t,n){var l={},u={},c={},p=!1;n.translate=e("../translate.js")(n),n.on("cursorActivity",(function(e,t){d(!0)})),n.on("keyHandled",(function(e,t,n){"Esc"===t&&(p=!1)})),n.on("change",(function(e,t,n){void 0!==n&&" "==n.text&&(p=!1);var i=[];for(var o in l)l[o].is(":visible")&&i.push(l[o]);if(i.length>0){var s=r(e.getWrapperElement()).find(".CodeMirror-vscrollbar"),a=0;s.is(":visible")&&(a=s.outerWidth()),i.forEach((function(e){e.css("right",a)}))}}));var d=function(e){if(!n.somethingSelected()){n.fromAutoShow=e;var i=function(r){if(e&&!p)return!1;if(e&&!r.autoShow)return!1;e||(p=!0);var i={closeCharacters:/(?=a)b/,completeSingle:!1};return!r.bulk&&r.async&&(i.async=!0),t.showHint(n,(function(e,t){return f(r,t)}),i),!0};for(var o in u)if(-1!=r.inArray(o,n.options.autocompleters)){var s=u[o];if(s.isValidCompletionPosition)if(s.isValidCompletionPosition()){if((!s.callbacks||!s.callbacks.validPosition||!1!==s.callbacks.validPosition(n,s))&&i(s))break}else s.callbacks&&s.callbacks.invalidPosition&&s.callbacks.invalidPosition(n,s)}}},f=function(e,t){var r=n.getCompleteToken();if(e.preProcessToken&&(r=e.preProcessToken(r)),r){if(e.bulk||!e.async)return function(t){var n=t.autocompletionString||t.string,r=[];if(c[e.name])r=c[e.name].autoComplete(n);else if("function"==typeof e.get&&0==e.async)r=e.get(n);else if("object"==typeof e.get)for(var i=n.length,o=0;o<e.get.length;o++){var s=e.get[o];s.slice(0,i)==n&&r.push(s)}return g(r,e,t)}(r);e.get(r,(function(n){t(g(n,e,r))}))}},h=function(e,t,n){return e.replace(new RegExp(t,"g"),n)},g=function(e,i,o){for(var s,l=[],u=0;u<e.length;u++){var c=e[u];if(c.value){var d=c.value,f=c.description;if("prefix"===c.type?d+=":":i.postProcessToken&&(d=i.postProcessToken(o,d)),(!d.startsWith("<")||!d.endsWith(">"))&&d.indexOf(":")>0){var g=d.indexOf(":");d=d.substring(0,g+1)+((s=d.substring(g+1)).trim().startsWith("<")&&s.trim().endsWith(">")?s:(s=encodeURIComponent(s),s=h(s,"[*]","%2a"),s=h(s,"[!]","%21"),s=h(s,"[(]","%28"),s=h(s,"[)]","%29"),s=h(s,"[~]","%7e"),s=h(s,"[']","%27")))}l.push({text:d,displayText:f,hint:function(e,t,n){p=!1,a(e,t,n)},render:function(e,t,n){r(e).append(n.displayText)}})}}var m=n.getCursor(),v={completionToken:o.string,list:l,from:{line:m.line,ch:o.start},to:{line:m.line,ch:o.end}};if(i.callbacks)for(var E in i.callbacks)i.callbacks[E]&&t.on(v,E,i.callbacks[E]);return v};return{init:function(e,t){var r=u[e]=new t(n,e);if(r.name=e,r.bulk){var a=function(e){e&&e instanceof Array&&e.length>0&&function(e,t){c[e.name]=new s;for(var r=0;r<t.length;r++)c[e.name].insert(t[r]);var a=i.getPersistencyId(n,e.persistent);a&&o.storage.set(a,t,"month")}(r,e)};if(r.get instanceof Array)a(r.get);else{var l=null,p=i.getPersistencyId(n,r.persistent);p&&(l=o.storage.get(p)),l&&l.length>0?a(l):r.get instanceof Function&&(r.async?r.get(null,a):a(r.get()))}}},completers:u,notifications:{getEl:function(e){return r(l[e.name])},show:function(e,t){t.autoshow||(l[t.name]||(l[t.name]=r("<div class='completionNotification'></div>")),r("#keyboardShortcuts").hide(),l[t.name].show().text(e.translate("yasqe.autocompleterBase.message")).appendTo(r(e.getWrapperElement())))},hide:function(e,t){l[t.name]&&(l[t.name].hide(),r("#keyboardShortcuts").show())}},autoComplete:d,getTrie:function(e){return"string"==typeof e?c[e]:c[e.name]}}};var a=function(e,t,n){n.text!=e.getTokenAt(e.getCursor()).string&&e.replaceRange(n.text,t.from,t.to)}},{"../../lib/trie.js":4,"../main.js":48,"../translate.js":54,"../utils.js":55,jquery:16,"yasgui-utils":30}],35:[function(e,t,n){"use strict";e("jquery"),t.exports=function(n,r){return{isValidCompletionPosition:function(){return t.exports.isValidCompletionPosition(n)},get:function(t,r){return e("./utils").fetchFromLov(n,this,t,r)},preProcessToken:function(e){return t.exports.preProcessToken(n,e)},postProcessToken:function(e,r){return t.exports.postProcessToken(n,e,r)},async:!0,bulk:!1,autoShow:!1,persistent:r,callbacks:{validPosition:n.autocompleters.notifications.show,invalidPosition:n.autocompleters.notifications.hide}}},t.exports.isValidCompletionPosition=function(e){var t=e.getCompleteToken();if(0==t.string.indexOf("?"))return!1;var n=e.getCursor(),r=e.getPreviousNonWsToken(n.line,t);return"a"==r.string||"rdf:type"==r.string||"rdfs:domain"==r.string||"rdfs:range"==r.string},t.exports.preProcessToken=function(t,n){return e("./utils.js").preprocessResourceTokenForCompletion(t,n)},t.exports.postProcessToken=function(t,n,r){return e("./utils.js").postprocessResourceTokenForCompletion(t,n,r)}},{"./utils":40,"./utils.js":40,jquery:16}],36:[function(e,t,n){"use strict";var r,i,o=e("jquery");t.exports=function(e,n){return e.on("repositoryOrAuthorizationChanged",(function(e,t){i=e,r=t})),{isValidCompletionPosition:function(){return t.exports.isValidCompletionPosition(e)},get:function(n,r){return t.exports.fetchAutocomplete(e,n,r)},preProcessToken:function(n){return t.exports.preProcessToken(e,n)},postProcessToken:function(n,r){return t.exports.postProcessToken(e,n,r)},async:!0,bulk:!1,autoShow:!0,persistent:n,callbacks:{validPosition:e.autocompleters.notifications.show,invalidPosition:e.autocompleters.notifications.hide}}},t.exports.fetchAutocomplete=function(e,t,n){if(i&&"SYSTEM"!==i){if(!t||!t.string||0===t.string.trim().length)return!1;var s;s=t.tokenPrefix?t.tokenPrefixUri+";"+t.string.substring(t.tokenPrefix.length):t.autocompletionString.startsWith("http://")?t.autocompletionString+";":t.autocompletionString;var a={"X-GraphDB-Repository":i};r&&(a.Authorization=r),o.get({url:"rest/autocomplete/query",data:{q:s},success:function(t,r,i){204!==i.status||e.fromAutoShow?t&&n(t.suggestions):e.toastBuildIndex()},dataType:"json",headers:a}).fail((function(t){e.fromAutoShow||e.toastError(t)}))}},t.exports.isValidCompletionPosition=function(e){var t=e.getCursor();if(e.getTokenAt(t),0==e.getLine(t.line).toUpperCase().trim().indexOf("PREFIX"))return!1;var n=e.getCompleteToken();return-1!=o.inArray("IRI_REF",n.state.possibleCurrent)&&0!=n.string.length&&0!=n.string.indexOf("?")},t.exports.preProcessToken=function(t,n){return e("./utils.js").preprocessResourceTokenForCompletion(t,n)},t.exports.postProcessToken=function(t,n,r){return e("./utils.js").postprocessResourceTokenForCompletion(t,n,r)}},{"./utils.js":40,jquery:16}],37:[function(e,t,n){"use strict";var r=e("jquery");t.exports=function(n,r){return{isValidCompletionPosition:function(){return t.exports.isValidCompletionPosition(n)},get:function(t,r){return e("./utils").fetchFromLov(n,this,t,r)},preProcessToken:function(e){return t.exports.preProcessToken(n,e)},postProcessToken:function(e,r){return t.exports.postProcessToken(n,e,r)},async:!0,bulk:!1,autoShow:!1,persistent:r,callbacks:{validPosition:n.autocompleters.notifications.show,invalidPosition:n.autocompleters.notifications.hide}}},t.exports.isValidCompletionPosition=function(e){var t=e.getCompleteToken();if(0==t.string.length)return!1;if(0==t.string.indexOf("?"))return!1;if(r.inArray("a",t.state.possibleCurrent)>=0)return!0;var n=e.getCursor();return"rdfs:subPropertyOf"==e.getPreviousNonWsToken(n.line,t).string},t.exports.preProcessToken=function(t,n){return e("./utils.js").preprocessResourceTokenForCompletion(t,n)},t.exports.postProcessToken=function(t,n,r){return e("./utils.js").postprocessResourceTokenForCompletion(t,n,r)}},{"./utils":40,"./utils.js":40,jquery:16}],38:[function(e,t,n){"use strict";var r,i=e("jquery"),o=(e("./utils"),{"string-2":"prefixed",atom:"var"});t.exports=function(e,n){return e.on("change",(function(){t.exports.appendPrefixIfNeeded(e,n)})),e.on("namespacesChanged",(function(n){t.exports.updateNamespaces(e,n)})),{isValidCompletionPosition:function(){return t.exports.isValidCompletionPosition(e)},get:function(e,t){r=t},preProcessToken:function(n){return t.exports.preprocessPrefixTokenForCompletion(e,n)},async:!0,bulk:!0,autoShow:!0,persistent:null}},t.exports.isValidCompletionPosition=function(e){var t=e.getCursor(),n=e.getTokenAt(t);if(e.getLine(t.line).length>t.ch)return!1;if("ws"!=n.type&&(n=e.getCompleteToken()),0==!n.string.indexOf("a")&&-1==i.inArray("PNAME_NS",n.state.possibleCurrent))return!1;var r=e.getPreviousNonWsToken(t.line,n);return!(!r||"PREFIX"!=r.string.toUpperCase())},t.exports.preprocessPrefixTokenForCompletion=function(e,t){var n=e.getPreviousNonWsToken(e.getCursor().line,t);return n&&n.string&&":"==n.string.slice(-1)&&(t={start:n.start,end:t.end,string:n.string+" "+t.string,state:t.state}),t},t.exports.appendPrefixIfNeeded=function(e,t){if(e.autocompleters.getTrie(t)&&e.options.autocompleters&&-1!=e.options.autocompleters.indexOf(t)){var n=e.getCursor(),r=e.getTokenAt(n);if("prefixed"==o[r.type]){var i=r.string.indexOf(":");if(-1!==i){var s=e.getPreviousNonWsToken(n.line,r).string.toUpperCase(),a=e.getTokenAt({line:n.line,ch:r.start});if("PREFIX"!=s&&("ws"==a.type||null==a.type)){var l=r.string.substring(0,i+1);if(null==e.getPrefixesFromQuery()[l.slice(0,-1)]){var u=e.autocompleters.getTrie(t).autoComplete(l);u.length>0&&e.addPrefixes(u[0])}}}}}},t.exports.updateNamespaces=function(e,t){var n=!1,o=i.map(t,(function(e,t){return"onto"===t&&(n=!0),t+": <"+e+">"}));n||o.push("onto: <http://www.ontotext.com/>"),o.sort(),r(o)}},{"./utils":40,jquery:16}],39:[function(e,t,n){t.exports=function(e,t){return{isValidCompletionPosition:function(){var t=e.getTokenAt(e.getCursor());return"ws"!=t.type&&(t=e.getCompleteToken()).string.length>1},get:function(e,t){for(var n=["COUNT","SUM","MIN","MAX","AVG","SAMPLE","STR","LANG","LANGMATCHES","DATATYPE","BOUND","IRI","URI","BNODE","RAND","ABS","CEIL","FLOOR","ROUND","CONCAT","SUBSTR","STRLEN","REPLACE","UCASE","LCASE","ENCODE_FOR_URI","CONTAINS","STRSTARTS","STRENDS","STRBEFORE","STRAFTER","YEAR","MONTH","DAY","HOURS","MINUTES","SECONDS","TIMEZONE","TZ","NOW","UUID","STRUUID","MD5","SHA1","SHA256","SHA384","SHA512","COALESCE","IF","STRLANG","STRDT","sameTerm","isIRI","isURI","isBLANK","isLITERAL","isNUMERIC","REGEX","EXISTS","FILTER"],r=[],i=0;i<n.length;i++){var o=n[i],s=o.toLowerCase(),a=e.toLowerCase();0===s.indexOf(a)&&r.push(o+"(")}return r.sort(),r},preProcessToken:null,postProcessToken:null,async:!1,bulk:!1,autoShow:!0,persistent:null,handlers:{validPosition:null,invalidPosition:null,shown:null,select:null,pick:null,close:null}}}},{}],40:[function(e,t,n){"use strict";var r=e("jquery"),i=(e("./utils.js"),e("yasgui-utils")),o=0===window.location.protocol.indexOf("http")?"//":"http://";t.exports={fetchFromLov:function(t,n,s,a){if(!s||!s.string||0==s.string.trim().length)return t.autocompleters.notifications.getEl(n).empty().append(t.translate("yasqe.utils.message1")),!1;var l={q:s.autocompletionString,page:1};"classes"==n.name?l.type="class":l.type="property";var u=[],c="",p=function(){c=o+"lov.okfn.org/dataset/lov/api/v2/autocomplete/terms?"+r.param(l)};p();var d=function(){r.get(c,(function(e){for(var i=0;i<e.results.length;i++)r.isArray(e.results[i].uri)&&e.results[i].uri.length>0?u.push(e.results[i].uri[0]):u.push(e.results[i].uri);u.length<e.total_results&&u.length<50?(l.page++,p(),d()):(u.length>0?t.autocompleters.notifications.hide(t,n):t.autocompleters.notifications.getEl(n).text(t.translate("yasqe.utils.message2")),a(u))})).fail((function(e,r,i){t.autocompleters.notifications.getEl(n).empty().append(t.translate("yasqe.utils.message3"))}))};t.autocompleters.notifications.getEl(n).empty().append(r("<span>Fetchting autocompletions &nbsp;</span>")).append(r(i.svg.getElement(e("../imgs.js").loader)).addClass("notificationLoader")),d()},preprocessResourceTokenForCompletion:function(t,n){var r=t.getPrefixesFromQuery();if(0==!n.string.indexOf("<")&&(n.tokenPrefix=n.string.substring(0,n.string.indexOf(":")+1),null!=r[n.tokenPrefix.slice(0,-1)]&&(n.tokenPrefixUri=r[n.tokenPrefix.slice(0,-1)])),t.translate=e("../translate.js")(t),n.autocompletionString=n.string.trim(),0==!n.string.indexOf("<")&&n.string.indexOf(":")>-1)for(var i in r)if(0==n.string.indexOf(i)){n.autocompletionString=r[i],n.autocompletionString+=n.string.substring(i.length+1);break}return 0==n.autocompletionString.indexOf("<")&&(n.autocompletionString=n.autocompletionString.substring(1)),-1!==n.autocompletionString.indexOf(">",n.length-1)&&(n.autocompletionString=n.autocompletionString.substring(0,n.autocompletionString.length-1)),n},postprocessResourceTokenForCompletion:function(e,t,n){if(t.tokenPrefix&&t.autocompletionString&&t.tokenPrefixUri)n=t.tokenPrefix+n.substring(t.tokenPrefixUri.length);else{var r=e.getPrefixesFromQuery(),i=_.filter(_.values(r),(function(e){return n.startsWith(e)}));if(i.length>0){var o=_.findKey(r,(function(e){return e===i[0]}));n=o+":"+n.substring(r[o].length)}else{if(0===n.indexOf("<b>"+t.string))return n;if(n.startsWith("<<")&&n.endsWith(">>"))return n;n="<"+n+">"}}return n}}},{"../imgs.js":47,"../translate.js":54,"./utils.js":40,jquery:16,"yasgui-utils":30}],41:[function(e,t,n){"use strict";var r=e("jquery");t.exports=function(e){return{isValidCompletionPosition:function(){var t=e.getTokenAt(e.getCursor());return!("ws"==t.type||!(t=e.getCompleteToken(t))||0!=t.string.indexOf("?"))},get:function(t){if(0==t.trim().length)return[];var n={};r(e.getWrapperElement()).find(".cm-atom").each((function(){var e=this.innerHTML;if(0==e.indexOf("?")){var i=r(this).next();if(i.attr("class")&&i.attr("class").indexOf("cm-atom")>=0&&(e+=i.text()),e.length<=1)return;if(0!==e.indexOf(t))return;if(e==t)return;n[e]=!0}}));var i=[];for(var o in n)i.push(o);return i.sort(),i},async:!1,bulk:!1,autoShow:!0}}},{jquery:16}],42:[function(e,t,n){var r=e("./sparql.js"),i=e("jquery"),o=function(e){return"'"+e+"'"};t.exports={createCurlString:function(e,t){var n=r.getAjaxConfig(e,t),s=n.url;0!==n.url.indexOf("http")&&(s=window.location.protocol+"//"+window.location.host,0===n.url.indexOf("/")?s+=n.url:s+=window.location.pathname+n.url);var a=["curl",s,"-X",e.options.sparql.requestMethod];for(var l in"POST"==e.options.sparql.requestMethod&&a.push("--data "+o(i.param(n.data))),n.headers)a.push("-H "+o(l+": "+n.headers[l]));return a.join(" ")}}},{"./sparql.js":51,jquery:16}],43:[function(e,t,n){var r=e("jquery"),i=e("./main.js");i.defaults=r.extend(!0,{},i.defaults,{mode:"sparql11",value:"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nSELECT * WHERE {\n ?sub ?pred ?obj .\n} \nLIMIT 10",highlightSelectionMatches:{showToken:/\w/},tabMode:"indent",autoCloseBrackets:!0,lineNumbers:!0,lineWrapping:!0,backdrop:!1,foldGutter:{rangeFinder:new i.fold.combine(i.fold.brace,i.fold.prefix)},collapsePrefixesOnLoad:!1,gutters:["gutterErrorBar","CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,fixedGutter:!0,syntaxErrorCheck:!0,extraKeys:{"Alt-Enter":i.autoComplete,"Ctrl-Space":i.autoComplete,"Cmd-Space":i.autoComplete,"Ctrl-D":i.deleteLine,"Ctrl-K":i.deleteLine,"Cmd-D":i.deleteLine,"Cmd-K":i.deleteLine,"Ctrl-/":i.commentLines,"Cmd-/":i.commentLines,"Ctrl-Alt-Down":i.copyLineDown,"Ctrl-Alt-Up":i.copyLineUp,"Cmd-Alt-Down":i.copyLineDown,"Cmd-Alt-Up":i.copyLineUp,"Shift-Ctrl-F":i.doAutoFormat,"Shift-Cmd-F":i.doAutoFormat,"Ctrl-]":i.indentMore,"Cmd-]":i.indentMore,"Ctrl-[":i.indentLess,"Cmd-[":i.indentLess,"Ctrl-S":i.storeQuery,"Cmd-S":i.storeQuery,"Ctrl-Enter":i.executeQuery,"Cmd-Enter":i.executeQuery,F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}},cursorHeight:.9,createShareLink:i.createShareLink,createShortLink:null,consumeShareLink:i.consumeShareLink,persistent:function(e){return"yasqe_"+r(e.getWrapperElement()).closest("[id]").attr("id")+"_queryVal"},sparql:{queryName:function(e){return e.getQueryMode()},showQueryButton:!1,endpoint:"http://dbpedia.org/sparql",requestMethod:"POST",acceptHeaderGraph:"text/turtle,*/*;q=0.9",acceptHeaderSelect:"application/sparql-results+json,*/*;q=0.9",acceptHeaderUpdate:"text/plain,*/*;q=0.9",namedGraphs:[],defaultGraphs:[],args:[],headers:{},getQueryForAjax:null,callbacks:{beforeSend:null,complete:null,error:null,success:null},handlers:{}}})},{"./main.js":48,jquery:16}],44:[function(e,t,n){t.exports=e("./main.js")},{"./main.js":48}],45:[function(e,t,n){t.exports={"yasqe.invalid.line":"This line is invalid. Expected: ","yasqe.btn.title.fullscreen":"Set editor full screen","yasqe.btn.title.normalsize":"Set editor to normal size","yasqe.btn.title.share":"Share your query","yasqe.btn.lbl.curl":"CURL","yasqe.btn.lbl.shorten":"Shorten","yasqe.autocompleterBase.message":"Press Alt+Enter to autocomplete","yasqe.utils.message1":"Nothing to autocomplete yet!","yasqe.utils.message2":"0 matches found...","yasqe.utils.message3":"Failed fetching suggestions.."}},{}],46:[function(e,t,n){t.exports={"yasqe.invalid.line":"Cette ligne n'est pas valide. Attendu:","yasqe.btn.title.fullscreen":"Configurer l'éditeur en plein écran","yasqe.btn.title.normalsize":"Configurer l'éditeur à la taille normale","yasqe.btn.title.share":"Partagez votre requête","yasqe.btn.lbl.curl":"CURL","yasqe.btn.lbl.shorten":"Raccourcir","yasqe.autocompleterBase.message":"Appuyez sur Alt+Enter pour l'autocomplétion.","yasqe.utils.message1":"Rien à autocompléter encore !","yasqe.utils.message2":"0 correspondances trouvées ...","yasqe.utils.message3":"Échec de la récupération des suggestions..."}},{}],47:[function(e,t,n){"use strict";t.exports={query:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 80 80" enable-background="new 0 0 80 80" xml:space="preserve"><g ></g><g >\t<path d="M64.622,2.411H14.995c-6.627,0-12,5.373-12,12v49.897c0,6.627,5.373,12,12,12h49.627c6.627,0,12-5.373,12-12V14.411 C76.622,7.783,71.249,2.411,64.622,2.411z M24.125,63.906V15.093L61,39.168L24.125,63.906z"/></g></svg>',queryInvalid:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 73.627 73.897" enable-background="new 0 0 80 80" xml:space="preserve" inkscape:version="0.48.4 r9939" sodipodi:docname="warning.svg"><metadata ><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs /><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1855" inkscape:window-height="1056" showgrid="false" inkscape:zoom="3.1936344" inkscape:cx="36.8135" inkscape:cy="36.9485" inkscape:window-x="2625" inkscape:window-y="24" inkscape:window-maximized="1" inkscape:current-layer="svg2" /><g transform="translate(-2.995,-2.411)" /><g transform="translate(-2.995,-2.411)" ><path d="M 64.622,2.411 H 14.995 c -6.627,0 -12,5.373 -12,12 v 49.897 c 0,6.627 5.373,12 12,12 h 49.627 c 6.627,0 12,-5.373 12,-12 V 14.411 c 0,-6.628 -5.373,-12 -12,-12 z M 24.125,63.906 V 15.093 L 61,39.168 24.125,63.906 z" inkscape:connector-curvature="0" /></g><path d="M 66.129381,65.903784 H 49.769875 c -1.64721,0 -2.889385,-0.581146 -3.498678,-1.63595 -0.609293,-1.055608 -0.491079,-2.422161 0.332391,-3.848223 l 8.179753,-14.167069 c 0.822934,-1.42633 1.9477,-2.211737 3.166018,-2.211737 1.218319,0 2.343086,0.785407 3.166019,2.211737 l 8.179751,14.167069 c 0.823472,1.426062 0.941686,2.792615 0.33239,3.848223 -0.609023,1.054804 -1.851197,1.63595 -3.498138,1.63595 z M 59.618815,60.91766 c 0,-0.850276 -0.68944,-1.539719 -1.539717,-1.539719 -0.850276,0 -1.539718,0.689443 -1.539718,1.539719 0,0.850277 0.689442,1.539718 1.539718,1.539718 0.850277,0 1.539717,-0.689441 1.539717,-1.539718 z m 0.04155,-9.265919 c 0,-0.873061 -0.707939,-1.580998 -1.580999,-1.580998 -0.873061,0 -1.580999,0.707937 -1.580999,1.580998 l 0.373403,5.610965 h 0.0051 c 0.05415,0.619747 0.568548,1.10761 1.202504,1.10761 0.586239,0 1.075443,-0.415756 1.188563,-0.968489 0.0092,-0.04476 0.0099,-0.09248 0.01392,-0.138854 h 0.01072 l 0.367776,-5.611232 z" inkscape:connector-curvature="0" style="fill:#aa8800" /></svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 100 100" xml:space="preserve"><g ></g><g >\t<path fill-rule="evenodd" fill="#000000" d="M88,84v-2c0-2.961-0.859-4-4-4H16c-2.961,0-4,0.98-4,4v2c0,3.102,1.039,4,4,4h68 C87.02,88,88,87.039,88,84z M58,12H42c-5,0-6,0.941-6,6v22H16l34,34l34-34H64V18C64,12.941,62.939,12,58,12z"/></g></svg>',share:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve"><path d="M36.764,50c0,0.308-0.07,0.598-0.088,0.905l32.247,16.119c2.76-2.338,6.293-3.797,10.195-3.797 C87.89,63.228,95,70.338,95,79.109C95,87.89,87.89,95,79.118,95c-8.78,0-15.882-7.11-15.882-15.891c0-0.316,0.07-0.598,0.088-0.905 L31.077,62.085c-2.769,2.329-6.293,3.788-10.195,3.788C12.11,65.873,5,58.771,5,50c0-8.78,7.11-15.891,15.882-15.891 c3.902,0,7.427,1.468,10.195,3.797l32.247-16.119c-0.018-0.308-0.088-0.598-0.088-0.914C63.236,12.11,70.338,5,79.118,5 C87.89,5,95,12.11,95,20.873c0,8.78-7.11,15.891-15.882,15.891c-3.911,0-7.436-1.468-10.195-3.806L36.676,49.086 C36.693,49.394,36.764,49.684,36.764,50z"/></svg>',warning:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" viewBox="0 0 66.399998 66.399998" enable-background="new 0 0 69.3 69.3" xml:space="preserve" height="100%" width="100%" inkscape:version="0.48.4 r9939" ><g transform="translate(-1.5,-1.5)" style="fill:#ff0000"><path d="M 34.7,1.5 C 16.4,1.5 1.5,16.4 1.5,34.7 1.5,53 16.4,67.9 34.7,67.9 53,67.9 67.9,53 67.9,34.7 67.9,16.4 53,1.5 34.7,1.5 z m 0,59.4 C 20.2,60.9 8.5,49.1 8.5,34.7 8.5,20.2 20.3,8.5 34.7,8.5 c 14.4,0 26.2,11.8 26.2,26.2 0,14.4 -11.8,26.2 -26.2,26.2 z" inkscape:connector-curvature="0" style="fill:#ff0000" /><path d="m 34.6,47.1 c -1.4,0 -2.5,0.5 -3.5,1.5 -0.9,1 -1.4,2.2 -1.4,3.6 0,1.6 0.5,2.8 1.5,3.8 1,0.9 2.1,1.3 3.4,1.3 1.3,0 2.4,-0.5 3.4,-1.4 1,-0.9 1.5,-2.2 1.5,-3.7 0,-1.4 -0.5,-2.6 -1.4,-3.6 -0.9,-1 -2.1,-1.5 -3.5,-1.5 z" inkscape:connector-curvature="0" style="fill:#ff0000" /><path d="m 34.8,13.9 c -1.5,0 -2.8,0.5 -3.7,1.6 -0.9,1 -1.4,2.4 -1.4,4.2 0,1.1 0.1,2.9 0.2,5.6 l 0.8,13.1 c 0.2,1.8 0.4,3.2 0.9,4.1 0.5,1.2 1.5,1.8 2.9,1.8 1.3,0 2.3,-0.7 2.9,-1.9 0.5,-1 0.7,-2.3 0.9,-4 L 39.4,25 c 0.1,-1.3 0.2,-2.5 0.2,-3.8 0,-2.2 -0.3,-3.9 -0.8,-5.1 -0.5,-1 -1.6,-2.2 -4,-2.2 z" inkscape:connector-curvature="0" style="fill:#ff0000" /></g></svg>',fullscreen:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="5 -10 74.074074 100" enable-background="new 0 0 100 100" xml:space="preserve" inkscape:version="0.48.4 r9939" sodipodi:docname="noun_2186_cc.svg"><metadata ><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs /><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="640" inkscape:window-height="480" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" inkscape:zoom="2.36" inkscape:cx="44.101509" inkscape:cy="31.481481" inkscape:window-x="65" inkscape:window-y="24" inkscape:window-maximized="0" inkscape:current-layer="Layer_1" /><path d="m -7.962963,-10 v 38.889 l 16.667,-16.667 16.667,16.667 5.555,-5.555 -16.667,-16.667 16.667,-16.667 h -38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 92.037037,-10 v 38.889 l -16.667,-16.667 -16.666,16.667 -5.556,-5.555 16.666,-16.667 -16.666,-16.667 h 38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="M -7.962963,90 V 51.111 l 16.667,16.666 16.667,-16.666 5.555,5.556 -16.667,16.666 16.667,16.667 h -38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="M 92.037037,90 V 51.111 l -16.667,16.666 -16.666,-16.666 -5.556,5.556 16.666,16.666 -16.666,16.667 h 38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /></svg>',smallscreen:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="5 -10 74.074074 100" enable-background="new 0 0 100 100" xml:space="preserve" inkscape:version="0.48.4 r9939" sodipodi:docname="noun_2186_cc.svg"><metadata ><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs /><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1855" inkscape:window-height="1056" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" inkscape:zoom="2.36" inkscape:cx="44.101509" inkscape:cy="31.481481" inkscape:window-x="65" inkscape:window-y="24" inkscape:window-maximized="1" inkscape:current-layer="Layer_1" /><path d="m 30.926037,28.889 0,-38.889 -16.667,16.667 -16.667,-16.667 -5.555,5.555 16.667,16.667 -16.667,16.667 38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 53.148037,28.889 0,-38.889 16.667,16.667 16.666,-16.667 5.556,5.555 -16.666,16.667 16.666,16.667 -38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 30.926037,51.111 0,38.889 -16.667,-16.666 -16.667,16.666 -5.555,-5.556 16.667,-16.666 -16.667,-16.667 38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 53.148037,51.111 0,38.889 16.667,-16.666 16.666,16.666 5.556,-5.556 -16.666,-16.666 16.666,-16.667 -38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /></svg>'}},{}],48:[function(e,t,n){"use strict";window.console=window.console||{log:function(){}};var r=e("jquery"),i=e("codemirror"),o=e("./utils.js"),s=e("yasgui-utils"),a=e("./imgs.js");e("../lib/deparam.js"),e("codemirror/addon/fold/foldcode.js"),e("codemirror/addon/fold/foldgutter.js"),e("codemirror/addon/fold/xml-fold.js"),e("codemirror/addon/fold/brace-fold.js"),e("./prefixFold.js"),e("codemirror/addon/hint/show-hint.js"),e("codemirror/addon/search/searchcursor.js"),e("codemirror/addon/edit/matchbrackets.js"),e("codemirror/addon/runmode/runmode.js"),e("codemirror/addon/display/fullscreen.js"),e("../lib/grammar/tokenizer.js"),e("codemirror/addon/edit/closebrackets.js");var l=t.exports=function(e,t){var n=r("<div>",{class:"yasqe"}).appendTo(r(e));t=u(t);var o=c(i(n[0],t));return f(o),o},u=function(e){return r.extend(!0,{},l.defaults,e)},c=function(t){t.translate=e("./translate.js")(t),t.autocompleters=e("./autocompleters/autocompleterBase.js")(l,t),t.options.autocompleters&&t.options.autocompleters.forEach((function(e){l.Autocompleters[e]&&t.autocompleters.init(e,l.Autocompleters[e])})),t.lastQueryDuration=null,t.getCompleteToken=function(n,r){return e("./tokenUtils.js").getCompleteToken(t,n,r)},t.getPreviousNonWsToken=function(n,r){return e("./tokenUtils.js").getPreviousNonWsToken(t,n,r)},t.getNextNonWsToken=function(n,r){return e("./tokenUtils.js").getNextNonWsToken(t,n,r)},t.collapsePrefixes=function(n){void 0===n&&(n=!0),t.foldCode(e("./prefixFold.js").findFirstPrefixLine(t),l.fold.prefix,n?"fold":"unfold")};var n=null,i=null;return t.setBackdrop=function(e){(t.options.backdrop||0===t.options.backdrop||"0"===t.options.backdrop)&&(null===i&&1==(i=+t.options.backdrop)&&(i=400),n||(n=r("<div>",{class:"backdrop"}).click((function(){r(this).hide()})).insertAfter(r(t.getWrapperElement()))),e?n.show(i):n.hide(i))},t.query=function(e){l.executeQuery(t,e)},t.getUrlArguments=function(e){return l.getUrlArguments(t,e)},t.getPrefixesFromQuery=function(){return e("./prefixUtils.js").getPrefixesFromQuery(t)},t.addPrefixes=function(n){return e("./prefixUtils.js").addPrefixes(t,n)},t.removePrefixes=function(n){return e("./prefixUtils.js").removePrefixes(t,n)},t.getValueWithoutComments=function(){var e="";return l.runMode(t.getValue(),"sparql11",(function(t,n){"comment"!=n&&(e+=t)})),e},t.getQueryType=function(){return t.queryType},t.getQueryMode=function(){var e=t.getQueryType();return"INSERT"==e||"DELETE"==e||"LOAD"==e||"CLEAR"==e||"CREATE"==e||"DROP"==e||"COPY"==e||"MOVE"==e||"ADD"==e?"update":"query"},t.setCheckSyntaxErrors=function(e){t.options.syntaxErrorCheck=e,m(t)},t.enableCompleter=function(e){p(t.options,e),l.Autocompleters[e]&&t.autocompleters.init(e,l.Autocompleters[e])},t.disableCompleter=function(e){d(t.options,e)},t},p=function(e,t){e.autocompleters||(e.autocompleters=[]),e.autocompleters.push(t)},d=function(e,t){if("object"==typeof e.autocompleters){var n=r.inArray(t,e.autocompleters);n>=0&&(e.autocompleters.splice(n,1),d(e,t))}},f=function(e){var t=o.getPersistencyId(e,e.options.persistent);if(t){var n=s.storage.get(t);n&&e.setValue(n)}l.drawButtons(e),e.on("blur",(function(e,t){l.storeQuery(e)})),e.on("change",(function(e,t){m(e),l.updateQueryButton(e),l.positionButtons(e)})),e.on("changes",(function(){m(e),l.updateQueryButton(e),l.positionButtons(e)})),e.on("language-changed",(function(){m(e),l.drawButtons(e),l.autoComplete(e)})),e.on("cursorActivity",(function(e,t){g(e)})),e.prevQueryValid=!1,m(e),l.positionButtons(e),r(e.getWrapperElement()).on("mouseenter",".cm-atom",(function(){var t=r(this).text();r(e.getWrapperElement()).find(".cm-atom").filter((function(){return r(this).text()===t})).addClass("matchingVar")})).on("mouseleave",".cm-atom",(function(){r(e.getWrapperElement()).find(".matchingVar").removeClass("matchingVar")})),e.options.consumeShareLink&&(e.options.consumeShareLink(e,h()),window.addEventListener("hashchange",(function(){e.options.consumeShareLink(e,h())}))),e.options.collapsePrefixesOnLoad&&e.collapsePrefixes(!0)},h=function(){var e=null;return window.location.hash.length>1&&(e=r.deparam(location.href.split("#")[1])),e&&"query"in e||!(window.location.search.length>1)||(e=r.deparam(window.location.search.substring(1))),e},g=function(e){e.cursor=r(".CodeMirror-cursor"),e.buttons&&e.buttons.is(":visible")&&e.cursor.length>0&&(o.elementsOverlap(e.cursor,e.buttons)?e.buttons.find("svg").attr("opacity","0.2"):e.buttons.find("svg").attr("opacity","1.0"))},m=function(t,n){t.queryValid=!0,t.clearGutter("gutterErrorBar");for(var i=null,o=0;o<t.lineCount();++o){var l=!1;if(t.prevQueryValid||(l=!0),i=t.getTokenAt({line:o,ch:t.getLine(o).length},l).state,t.queryType=i.queryType,0==i.OK){if(!t.options.syntaxErrorCheck)return void r(t.getWrapperElement).find(".sp-error").css("color","black");var u=s.svg.getElement(a.warning);i.possibleCurrent&&i.possibleCurrent.length>0&&e("./tooltip")(t,u,(function(){var e=[];return i.possibleCurrent.forEach((function(t){e.push("<strong style='text-decoration:underline'>"+r("<div/>").text(t).html()+"</strong>")})),t.translate("yasqe.invalid.line")+e.join(", ")})),u.style.marginTop="2px",u.style.marginLeft="2px",u.className="parseErrorIcon",t.setGutterMarker(o,"gutterErrorBar",u),t.queryValid=!1;break}}if(t.prevQueryValid=t.queryValid,n&&null!=i&&null!=i.stack){var c=i.stack,p=i.stack.length;p>1?t.queryValid=!1:1==p&&"solutionModifier"!=c[0]&&"?limitOffsetClauses"!=c[0]&&"?offsetClause"!=c[0]&&(t.queryValid=!1)}};r.extend(l,i),l.Autocompleters={},l.registerAutocompleter=function(e,t){l.Autocompleters[e]=t,p(l.defaults,e)},l.autoComplete=function(e){e.autocompleters.autoComplete(!1)},l.registerAutocompleter("sesame-prefixes",e("./autocompleters/sesame-prefixes.js")),l.registerAutocompleter("localNames",e("./autocompleters/localNames.js")),l.registerAutocompleter("properties",e("./autocompleters/properties.js")),l.registerAutocompleter("classes",e("./autocompleters/classes.js")),l.registerAutocompleter("standard",e("./autocompleters/standard.js")),l.registerAutocompleter("variables",e("./autocompleters/variables.js")),l.positionButtons=function(e){var t=r(e.getWrapperElement()).find(".CodeMirror-vscrollbar"),n=0;t.is(":visible")&&(n=t.outerWidth()),e.buttons.is(":visible")&&e.buttons.css("right",n+4)},l.createShareLink=function(e){var t={};return window.location.hash.length>1&&(t=r.deparam(window.location.hash.substring(1))),t.query=e.getValue(),t},l.getAsCurl=function(t,n){return e("./curl.js").createCurlString(t,n)},l.consumeShareLink=function(e,t){t&&t.query&&e.setValue(t.query)},l.drawButtons=function(e){if(e.buttons=r("<div class='yasqe_buttons'></div>").appendTo(r(e.getWrapperElement())),e.options.createShareLink){var t=r(s.svg.getElement(a.share));t.click((function(n){n.stopPropagation();var i=r("<div class='yasqe_sharePopup'></div>").appendTo(e.buttons);r("html").click((function(){i&&i.remove()})),i.click((function(e){e.stopPropagation()}));var o=r("<input>").val(location.protocol+"//"+location.host+location.pathname+location.search+"#"+r.param(e.options.createShareLink(e)));if(o.focus((function(){var e=r(this);e.select(),e.mouseup((function(){return e.unbind("mouseup"),!1}))})),i.empty().append(r("<div>",{class:"inputWrapper"}).append(o)),e.options.createShortLink){i.addClass("enableShort");const t=e.translate("yasqe.btn.lbl.shorten");r("<button>"+t+"</button>").addClass("yasqe_btn yasqe_btn-sm yasqe_btn-primary").click((function(){r(this).parent().find("button").attr("disabled","disabled"),e.options.createShortLink(o.val(),(function(e,t){e?(o.remove(),i.find(".inputWrapper").append(r("<span>",{class:"shortlinkErr"}).text(e))):o.val(t).focus()}))})).appendTo(i)}const s=e.translate("yasqe.btn.lbl.curl");r("<button>"+s+"</button>").addClass("yasqe_btn yasqe_btn-sm yasqe_btn-primary").click((function(){r(this).parent().find("button").attr("disabled","disabled"),o.val(l.getAsCurl(e)).focus()})).appendTo(i);var a=t.position();i.css("top",a.top+t.outerHeight()+parseInt(i.css("padding-top"))+"px").css("left",a.left+t.outerWidth()-i.outerWidth()+"px"),o.focus()})).addClass("yasqe_share").attr("title",e.translate("yasqe.btn.title.share")).appendTo(e.buttons)}var n=r("<div>",{class:"fullscreenToggleBtns"}).append(r(s.svg.getElement(a.fullscreen)).addClass("yasqe_fullscreenBtn").attr("title",e.translate("yasqe.btn.title.fullscreen")).click((function(){e.setOption("fullScreen",!0)}))).append(r(s.svg.getElement(a.smallscreen)).addClass("yasqe_smallscreenBtn").attr("title",e.translate("yasqe.btn.title.normalsize")).click((function(){e.setOption("fullScreen",!1)})));e.buttons.append(n),e.options.sparql.showQueryButton&&(r("<div>",{class:"yasqe_queryButton"}).click((function(){r(this).hasClass("query_busy")?(e.xhr&&e.xhr.abort(),l.updateQueryButton(e)):e.query()})).appendTo(e.buttons),l.updateQueryButton(e))};var v={busy:"loader",valid:"query",error:"queryInvalid"};l.updateQueryButton=function(e,t){var n=r(e.getWrapperElement()).find(".yasqe_queryButton");0!=n.length&&(t||(t="valid",!1===e.queryValid&&(t="error")),t!=e.queryStatus&&(n.empty().removeClass((function(e,t){return t.split(" ").filter((function(e){return 0==e.indexOf("query_")})).join(" ")})),"busy"==t?(n.append(r("<div>",{class:"loader"})),e.queryStatus=t):"valid"!=t&&"error"!=t||(n.addClass("query_"+t),s.svg.draw(n,a[v[t]]),e.queryStatus=t)))},l.fromTextArea=function(e,t){t=u(t),r("<div>",{class:"yasqe"}).insertBefore(r(e)).append(r(e));var n=c(i.fromTextArea(e,t));return f(n),n},l.storeQuery=function(e){var t=o.getPersistencyId(e,e.options.persistent);t&&s.storage.set(t,e.getValue(),"month")},l.commentLines=function(e){for(var t=e.getCursor(!0).line,n=e.getCursor(!1).line,r=Math.min(t,n),i=Math.max(t,n),o=!0,s=r;s<=i;s++){var a=e.getLine(s);if(0==a.length||"#"!=a.substring(0,1)){o=!1;break}}for(s=r;s<=i;s++)o?e.replaceRange("",{line:s,ch:0},{line:s,ch:1}):e.replaceRange("#",{line:s,ch:0})},l.copyLineUp=function(e){var t=e.getCursor(),n=e.lineCount();e.replaceRange("\n",{line:n-1,ch:e.getLine(n-1).length});for(var r=n;r>t.line;r--){var i=e.getLine(r-1);e.replaceRange(i,{line:r,ch:0},{line:r,ch:e.getLine(r).length})}},l.copyLineDown=function(e){l.copyLineUp(e);var t=e.getCursor();t.line++,e.setCursor(t)},l.doAutoFormat=function(e){if(e.somethingSelected()){var t={line:e.getCursor(!1).line,ch:e.getSelection().length};E(e,e.getCursor(!0),t)}else{var n=e.lineCount(),r=e.getTextArea().value.length;E(e,{line:0,ch:0},{line:n,ch:r})}};var E=function(e,t,n){var r=e.indexFromPos(t),i=e.indexFromPos(n),o=x(e.getValue(),r,i);e.operation((function(){e.replaceRange(o,t,n);for(var i=e.posFromIndex(r).line,s=e.posFromIndex(r+o.length).line,a=i;a<=s;a++)e.indentLine(a,"smart")}))},x=function(e,t,n){e=e.substring(t,n);var o=[["keyword","ws","prefixed","ws","uri"],["keyword","ws","uri"]],s=["{",".",";"],a=["}"],l="",u="",c=[];return i.runMode(e,"sparql11",(function(e,t){c.push(t);var n=function(e,t){for(var n=0;n<o.length;n++)if(c.valueOf().toString()==o[n].valueOf().toString())return 1;for(n=0;n<s.length;n++)if(e==s[n])return 1;for(n=0;n<a.length;n++)if(""!=r.trim(u)&&e==a[n])return-1;return 0}(e);0!=n?(1==n?(l+=e+"\n",u=""):(l+="\n"+e,u=e),c=[]):(u+=e,l+=e),1==c.length&&"sp-ws"==c[0]&&(c=[])})),r.trim(l.replace(/\n\s*\n/g,"\n"))};e("./sparql.js"),e("./defaults.js"),l.$=r,l.version={CodeMirror:i.version,YASQE:e("../package.json").version,jquery:r.fn.jquery,"yasgui-utils":s.version}},{"../lib/deparam.js":1,"../lib/grammar/tokenizer.js":3,"../package.json":33,"./autocompleters/autocompleterBase.js":34,"./autocompleters/classes.js":35,"./autocompleters/localNames.js":36,"./autocompleters/properties.js":37,"./autocompleters/sesame-prefixes.js":38,"./autocompleters/standard.js":39,"./autocompleters/variables.js":41,"./curl.js":42,"./defaults.js":43,"./imgs.js":47,"./prefixFold.js":49,"./prefixUtils.js":50,"./sparql.js":51,"./tokenUtils.js":52,"./tooltip":53,"./translate.js":54,"./utils.js":55,codemirror:15,"codemirror/addon/display/fullscreen.js":5,"codemirror/addon/edit/closebrackets.js":6,"codemirror/addon/edit/matchbrackets.js":7,"codemirror/addon/fold/brace-fold.js":8,"codemirror/addon/fold/foldcode.js":9,"codemirror/addon/fold/foldgutter.js":10,"codemirror/addon/fold/xml-fold.js":11,"codemirror/addon/hint/show-hint.js":12,"codemirror/addon/runmode/runmode.js":13,"codemirror/addon/search/searchcursor.js":14,jquery:16,"yasgui-utils":30}],49:[function(e,t,n){var r=e("codemirror"),i=e("./tokenUtils.js"),o="PREFIX";function s(e,t,n,i){if(!i||!("#"===i.charAt(0)||i.startsWith('"')&&i.endsWith('"'))){n||(n=0),i||(i=e.getLine(t));for(var s=(i=i.toUpperCase()).length+1,a=n,l=0;;){var u=i.indexOf(o,a);if(u===s)return;if(s=u,-1!=u){if(1==l&&u<n)break;if(i.length-u>o.length&&":"===i.charAt(u+o.length))return;if(u>0&&":"===i.charAt(u-1))return;var c=e.getTokenTypeAt(r.Pos(t,u+1));if(!/^(comment|string)/.test(c))return u+1;a=u-1}else{if(1==l)break;l=1,a=i.length}}}}t.exports={findFirstPrefixLine:function(e){for(var t=e.lastLine(),n=0;n<=t;++n)if(s(e,n)>=0)return n}},r.registerHelper("fold","prefix",(function(e,t){if(t){var n=t.line,a=e.getLine(n),l=function(t,n){var o=e.getTokenAt(r.Pos(t,n+1));if(!o||"keyword"!=o.type)return-1;var s=i.getNextNonWsToken(e,t,o.end+1);if(!s||"string-2"!=s.type)return-1;var a=i.getNextNonWsToken(e,t,s.end+1);return a&&"variable-3"==a.type?a.end:-1};if(!function(){for(var t=!1,r=n-1;r>=0;r--)if(e.getLine(r).toUpperCase().indexOf(o)>=0){t=!0;break}return t}()){var u=s(e,n,t.ch,a);if(null!=u){for(var c,p=!1,d=e.lastLine(),f=l(n,u),h=n,g=n;g<=d&&!p;++g)for(var m=e.getLine(g),v=g==n?u+1:0;;){!p&&m.indexOf("{")>=0&&(p=!0);var E=m.toUpperCase().indexOf(o,v);if(!(E>=0))break;(c=l(g,E))>0&&(h=g,v=f=c),v++}return{from:r.Pos(n,u+o.length),to:r.Pos(h,f)}}}}}))},{"./tokenUtils.js":52,codemirror:15}],50:[function(e,t,n){"use strict";var r=function(e,t){for(var n=null,r=0,o=e.lineCount(),s=0;s<o;s++){var a=e.getNextNonWsToken(s);null==a||"PREFIX"!=a.string&&"BASE"!=a.string||(n=a,r=s)}if(null==n)e.replaceRange("PREFIX "+t+"\n",{line:0,ch:0});else{var l=i(e,r);e.replaceRange("\n"+l+"PREFIX "+t,{line:r})}e.collapsePrefixes(!1)},i=function(e,t,n){null==n&&(n=1);var r=e.getTokenAt({line:t,ch:n});return null==r||null==r||"ws"!=r.type?"":r.string+i(e,t,r.end+1)};t.exports={addPrefixes:function(e,t){var n=e.getPrefixesFromQuery();if("string"==typeof t)r(e,t);else for(var i in t)i in n||r(e,i+": <"+t[i]+">");e.collapsePrefixes(!1)},getPrefixesFromQuery:function(e){for(var t={},n=!0,r=function(i,s){if(n){s||(s=1);var a=e.getNextNonWsToken(o,s);if(a)if(-1==a.state.possibleCurrent.indexOf("PREFIX")&&-1==a.state.possibleNext.indexOf("PREFIX")&&(n=!1),"PREFIX"==a.string.toUpperCase()){var l=e.getNextNonWsToken(o,a.end+1);if(l){var u=e.getNextNonWsToken(o,l.end+1);if(u){var c=u.string;0==c.indexOf("<")&&(c=c.substring(1)),">"==c.slice(-1)&&(c=c.substring(0,c.length-1)),t[l.string.slice(0,-1)]=c,r(i,u.end+1)}else r(i,l.end+1)}else r(i,a.end+1)}else r(i,a.end+1)}},i=e.lineCount(),o=0;o<i&&n;o++)r(o);return t},removePrefixes:function(e,t){for(var n in t)e.setValue(e.getValue().replace(new RegExp("PREFIX\\s*"+n+":\\s*"+("<"+t[n]+">").replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"\\s*","ig"),""));e.collapsePrefixes(!1)}}},{}],51:[function(e,t,n){"use strict";var r=e("jquery"),i=e("./utils.js"),o=e("./main.js");o.getAjaxConfig=function(t,n){var i="function"==typeof n?n:null,a="object"==typeof n?n:{};if(t.options.sparql&&(a=r.extend({},t.options.sparql,a)),a.handlers&&r.extend(!0,a.callbacks,a.handlers),a.endpoint&&0!=a.endpoint.length){var l={url:"function"==typeof a.endpoint?a.endpoint(t):a.endpoint,type:"function"==typeof a.requestMethod?a.requestMethod(t):a.requestMethod,headers:{Accept:s(t,a)}};a.xhrFields&&(l.xhrFields=a.xhrFields);var u=!1;if(a.callbacks)for(var c in a.callbacks)a.callbacks[c]&&(u=!0,l[c]=a.callbacks[c]);if("GET"===l.type){var p=!0;r.each(t.getUrlArguments(a),(function(e,t){l.url+=(p?"?":"&")+t.name+"="+encodeURIComponent(t.value),p=!1}))}else l.data=t.getUrlArguments(a),a.setQueryLimit&&"function"==typeof a.setQueryLimit&&l.data.forEach((function(e){"query"==e.name&&(e.value=a.setQueryLimit(e.value))}));if(u||i){i&&(l.complete=i),a.headers&&!r.isEmptyObject(a.headers)&&r.extend(l.headers,a.headers);var d=new Date,f=[function(){e("./main.js").signal(t,"queryFinish",arguments)},function(){t.lastQueryDuration=new Date-d,o.updateQueryButton(t),t.setBackdrop(!1)}];return l.complete&&(f.push(l.complete),f.push((function(e,t,n){var i={};r.extend(!0,i,l),"update"===window.editor.getQueryMode()&&"ASK"===window.editor.getQueryType()||a.callbacks.countCallback&&"function"==typeof a.callbacks.countCallback&&(i.data=i.data.filter((function(e){return"offset"!==e.name&&"limit"!==e.name})),i.data.push({name:"count",value:"1"}),i.complete=a.callbacks.countCallback),window.editor&&200===e.status&&r.ajax(i)}))),l.complete=f,l}}},o.executeQuery=function(e,t){o.signal(e,"query",e,t),o.updateQueryButton(e,"busy"),e.setBackdrop(!0),e.xhr=r.ajax(o.getAjaxConfig(e,t))},o.getUrlArguments=function(e,t){var n=e.getQueryMode(),o=[{name:i.getString(e,e.options.sparql.queryName),value:t.getQueryForAjax?t.getQueryForAjax(e):e.getValue()}];if(t.namedGraphs&&t.namedGraphs.length>0)for(var s="query"==n?"named-graph-uri":"using-named-graph-uri ",a=0;a<t.namedGraphs.length;a++)o.push({name:s,value:t.namedGraphs[a]});if(t.defaultGraphs&&t.defaultGraphs.length>0)for(s="query"==n?"default-graph-uri":"using-graph-uri ",a=0;a<t.defaultGraphs.length;a++)o.push({name:s,value:t.defaultGraphs[a]});return t.args&&t.args.length>0&&r.merge(o,t.args),o};var s=function(e,t){var n=null;if(!t.acceptHeader||t.acceptHeaderGraph||t.acceptHeaderSelect||t.acceptHeaderUpdate)if("update"==e.getQueryMode())n="function"==typeof t.acceptHeader?t.acceptHeaderUpdate(e):t.acceptHeaderUpdate;else{var r=e.getQueryType();n="DESCRIBE"==r||"CONSTRUCT"==r?"function"==typeof t.acceptHeaderGraph?t.acceptHeaderGraph(e):t.acceptHeaderGraph:"function"==typeof t.acceptHeaderSelect?t.acceptHeaderSelect(e):t.acceptHeaderSelect}else n="function"==typeof t.acceptHeader?t.acceptHeader(e):t.acceptHeader;return n};t.exports={getAjaxConfig:o.getAjaxConfig}},{"./main.js":48,"./utils.js":55,jquery:16}],52:[function(e,t,n){"use strict";var r=function(e,t,n){n||(n=e.getCursor()),t||(t=e.getTokenAt(n));var i=e.getTokenAt({line:n.line,ch:t.start});return null!=i.type&&"ws"!=i.type&&"punc"!=i.type&&null!=t.type&&"ws"!=t.type?(t.start=i.start,t.string=i.string+t.string,r(e,t,{line:n.line,ch:i.start})):null!=t.type&&"ws"==t.type?(t.start=t.start+1,t.string=t.string.substring(1),t):t},i=function(e,t,n){var r=e.getTokenAt({line:t,ch:n.start});return null!=r&&"ws"==r.type&&(r=i(e,t,r)),r},o=function(e,t,n){null==n&&(n=1);var r=e.getTokenAt({line:t,ch:n});return null==r||null==r||r.end<n?null:"ws"==r.type?o(e,t,r.end+1):r};t.exports={getPreviousNonWsToken:i,getCompleteToken:r,getNextNonWsToken:o}},{}],53:[function(e,t,n){"use strict";var r=e("jquery");e("./utils.js"),t.exports=function(e,t,n){var i;(t=r(t)).hover((function(){"function"==typeof n&&(n=n()),i=r("<div>").addClass("yasqe_tooltip").html(n).appendTo(t),o()}),(function(){r(".yasqe_tooltip").remove()}));var o=function(){r(e.getWrapperElement()).offset().top>=i.offset().top&&(i.css("bottom","auto"),i.css("top","26px"))}}},{"./utils.js":55,jquery:16}],54:[function(e,t,n){const r={en:e("./i18n/locale-en"),fr:e("./i18n/locale-fr")};var i="en",o=function(e){const t=i;if(!r||!r[t])return console.warn("Missing locale file for ["+t+"]"),e;let n=r[t][e];return n||(n=r.en[e]),n};t.exports=function(e){return e.on("language-changed",(function(){i=e.options.locale})),e.options.locale&&(i=e.options.locale),o}},{"./i18n/locale-en":45,"./i18n/locale-fr":46}],55:[function(e,t,n){"use strict";var r=e("jquery"),i=function(){function e(e){var t,n,i;return t=r(e).offset(),n=r(e).width(),i=r(e).height(),[[t.left,t.left+n],[t.top,t.top+i]]}function t(e,t){var n,r;return n=e[0]<t[0]?e:t,r=e[0]<t[0]?t:e,n[1]>r[0]||n[0]===r[0]}return function(n,r){var i=e(n),o=e(r);return t(i[0],o[0])&&t(i[1],o[1])}}();t.exports={keyExists:function(e,t){var n=!1;try{void 0!==e[t]&&(n=!0)}catch(e){}return n},getPersistencyId:function(e,t){var n=null;return t&&(n="string"==typeof t?t:t(e)),n},elementsOverlap:i,getString:function(e,t){return"function"==typeof t?t(e):t}}},{jquery:16}]},{},[44])(44)},module.exports=f()}).call(this,__webpack_require__(5))},228:function(e,t,n){var r,i;!function(){var o={version:"3.5.12"},s=[].slice,a=function(e){return s.call(e)},l=this.document;function u(e){return e&&(e.ownerDocument||e.document||e).documentElement}function c(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(l)try{a(l.documentElement.childNodes)[0].nodeType}catch(e){a=function(e){for(var t=e.length,n=new Array(t);t--;)n[t]=e[t];return n}}if(Date.now||(Date.now=function(){return+new Date}),l)try{l.createElement("DIV").style.setProperty("opacity",0,"")}catch(e){var p=this.Element.prototype,d=p.setAttribute,f=p.setAttributeNS,h=this.CSSStyleDeclaration.prototype,g=h.setProperty;p.setAttribute=function(e,t){d.call(this,e,t+"")},p.setAttributeNS=function(e,t,n){f.call(this,e,t,n+"")},h.setProperty=function(e,t,n){g.call(this,e,t+"",n)}}function m(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function v(e){return null===e?NaN:+e}function E(e){return!isNaN(e)}function x(e){return{left:function(t,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}o.ascending=m,o.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},o.min=function(e,t){var n,r,i=-1,o=e.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=e[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=e[i])&&n>r&&(n=r)}else{for(;++i<o;)if(null!=(r=t.call(e,e[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=t.call(e,e[i],i))&&n>r&&(n=r)}return n},o.max=function(e,t){var n,r,i=-1,o=e.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=e[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=e[i])&&r>n&&(n=r)}else{for(;++i<o;)if(null!=(r=t.call(e,e[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=t.call(e,e[i],i))&&r>n&&(n=r)}return n},o.extent=function(e,t){var n,r,i,o=-1,s=e.length;if(1===arguments.length){for(;++o<s;)if(null!=(r=e[o])&&r>=r){n=i=r;break}for(;++o<s;)null!=(r=e[o])&&(n>r&&(n=r),i<r&&(i=r))}else{for(;++o<s;)if(null!=(r=t.call(e,e[o],o))&&r>=r){n=i=r;break}for(;++o<s;)null!=(r=t.call(e,e[o],o))&&(n>r&&(n=r),i<r&&(i=r))}return[n,i]},o.sum=function(e,t){var n,r=0,i=e.length,o=-1;if(1===arguments.length)for(;++o<i;)E(n=+e[o])&&(r+=n);else for(;++o<i;)E(n=+t.call(e,e[o],o))&&(r+=n);return r},o.mean=function(e,t){var n,r=0,i=e.length,o=-1,s=i;if(1===arguments.length)for(;++o<i;)E(n=v(e[o]))?r+=n:--s;else for(;++o<i;)E(n=v(t.call(e,e[o],o)))?r+=n:--s;if(s)return r/s},o.quantile=function(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],o=n-r;return o?i+o*(e[r]-i):i},o.median=function(e,t){var n,r=[],i=e.length,s=-1;if(1===arguments.length)for(;++s<i;)E(n=v(e[s]))&&r.push(n);else for(;++s<i;)E(n=v(t.call(e,e[s],s)))&&r.push(n);if(r.length)return o.quantile(r.sort(m),.5)},o.variance=function(e,t){var n,r,i=e.length,o=0,s=0,a=-1,l=0;if(1===arguments.length)for(;++a<i;)E(n=v(e[a]))&&(s+=(r=n-o)*(n-(o+=r/++l)));else for(;++a<i;)E(n=v(t.call(e,e[a],a)))&&(s+=(r=n-o)*(n-(o+=r/++l)));if(l>1)return s/(l-1)},o.deviation=function(){var e=o.variance.apply(this,arguments);return e?Math.sqrt(e):e};var y=x(m);function T(e){return e.length}o.bisectLeft=y.left,o.bisect=o.bisectRight=y.right,o.bisector=function(e){return x(1===e.length?function(t,n){return m(e(t),n)}:e)},o.shuffle=function(e,t,n){(o=arguments.length)<3&&(n=e.length,o<2&&(t=0));for(var r,i,o=n-t;o;)i=Math.random()*o--|0,r=e[o+t],e[o+t]=e[i+t],e[i+t]=r;return e},o.permute=function(e,t){for(var n=t.length,r=new Array(n);n--;)r[n]=e[t[n]];return r},o.pairs=function(e){for(var t=0,n=e.length-1,r=e[0],i=new Array(n<0?0:n);t<n;)i[t]=[r,r=e[++t]];return i},o.zip=function(){if(!(r=arguments.length))return[];for(var e=-1,t=o.min(arguments,T),n=new Array(t);++e<t;)for(var r,i=-1,s=n[e]=new Array(r);++i<r;)s[i]=arguments[i][e];return n},o.transpose=function(e){return o.zip.apply(o,e)},o.keys=function(e){var t=[];for(var n in e)t.push(n);return t},o.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},o.entries=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t},o.merge=function(e){for(var t,n,r,i=e.length,o=-1,s=0;++o<i;)s+=e[o].length;for(n=new Array(s);--i>=0;)for(t=(r=e[i]).length;--t>=0;)n[--s]=r[t];return n};var N=Math.abs;function C(e){for(var t=1;e*t%1;)t*=10;return t}function S(e,t){for(var n in t)Object.defineProperty(e.prototype,n,{value:t[n],enumerable:!1})}function I(){this._=Object.create(null)}o.range=function(e,t,n){if(arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0)),(t-e)/n==1/0)throw new Error("infinite range");var r,i=[],o=C(N(n)),s=-1;if(e*=o,t*=o,(n*=o)<0)for(;(r=e+n*++s)>t;)i.push(r/o);else for(;(r=e+n*++s)<t;)i.push(r/o);return i},o.map=function(e,t){var n=new I;if(e instanceof I)e.forEach((function(e,t){n.set(e,t)}));else if(Array.isArray(e)){var r,i=-1,o=e.length;if(1===arguments.length)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t.call(e,r=e[i],i),r)}else for(var s in e)n.set(s,e[s]);return n};var L="__proto__",A="\0";function b(e){return(e+="")===L||e[0]===A?A+e:e}function R(e){return(e+="")[0]===A?e.slice(1):e}function w(e){return b(e)in this._}function O(e){return(e=b(e))in this._&&delete this._[e]}function M(){var e=[];for(var t in this._)e.push(R(t));return e}function _(){var e=0;for(var t in this._)++e;return e}function P(){for(var e in this._)return!1;return!0}function D(){this._=Object.create(null)}function k(e){return e}function F(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}function G(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var n=0,r=U.length;n<r;++n){var i=U[n]+t;if(i in e)return i}}S(I,{has:w,get:function(e){return this._[b(e)]},set:function(e,t){return this._[b(e)]=t},remove:O,keys:M,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:R(t),value:this._[t]});return e},size:_,empty:P,forEach:function(e){for(var t in this._)e.call(this,R(t),this._[t])}}),o.nest=function(){var e,t,n={},r=[],i=[];function s(i,o,a){if(a>=r.length)return t?t.call(n,o):e?o.sort(e):o;for(var l,u,c,p,d=-1,f=o.length,h=r[a++],g=new I;++d<f;)(p=g.get(l=h(u=o[d])))?p.push(u):g.set(l,[u]);return i?(u=i(),c=function(e,t){u.set(e,s(i,t,a))}):(u={},c=function(e,t){u[e]=s(i,t,a)}),g.forEach(c),u}return n.map=function(e,t){return s(t,e,0)},n.entries=function(e){return function e(t,n){if(n>=r.length)return t;var o=[],s=i[n++];return t.forEach((function(t,r){o.push({key:t,values:e(r,n)})})),s?o.sort((function(e,t){return s(e.key,t.key)})):o}(s(o.map,e,0),0)},n.key=function(e){return r.push(e),n},n.sortKeys=function(e){return i[r.length-1]=e,n},n.sortValues=function(t){return e=t,n},n.rollup=function(e){return t=e,n},n},o.set=function(e){var t=new D;if(e)for(var n=0,r=e.length;n<r;++n)t.add(e[n]);return t},S(D,{has:w,add:function(e){return this._[b(e+="")]=!0,e},remove:O,values:M,size:_,empty:P,forEach:function(e){for(var t in this._)e.call(this,R(t))}}),o.behavior={},o.rebind=function(e,t){for(var n,r=1,i=arguments.length;++r<i;)e[n=arguments[r]]=F(e,t,t[n]);return e};var U=["webkit","ms","moz","Moz","o","O"];function B(){}function j(){}function V(e){var t=[],n=new I;function r(){for(var n,r=t,i=-1,o=r.length;++i<o;)(n=r[i].on)&&n.apply(this,arguments);return e}return r.on=function(r,i){var o,s=n.get(r);return arguments.length<2?s&&s.on:(s&&(s.on=null,t=t.slice(0,o=t.indexOf(s)).concat(t.slice(o+1)),n.remove(r)),i&&t.push(n.set(r,{on:i})),e)},r}function H(){o.event.preventDefault()}function q(){for(var e,t=o.event;e=t.sourceEvent;)t=e;return t}function $(e){for(var t=new j,n=0,r=arguments.length;++n<r;)t[arguments[n]]=V(t);return t.of=function(n,r){return function(i){try{var s=i.sourceEvent=o.event;i.target=e,o.event=i,t[i.type].apply(n,r)}finally{o.event=s}}},t}o.dispatch=function(){for(var e=new j,t=-1,n=arguments.length;++t<n;)e[arguments[t]]=V(e);return e},j.prototype.on=function(e,t){var n=e.indexOf("."),r="";if(n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),e)return arguments.length<2?this[e].on(r):this[e].on(r,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(r,null);return this}},o.event=null,o.requote=function(e){return e.replace(z,"\\$&")};var z=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,W={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]};function Q(e){return W(e,Z),e}var Y=function(e,t){return t.querySelector(e)},X=function(e,t){return t.querySelectorAll(e)},K=function(e,t){var n=e.matches||e[G(e,"matchesSelector")];return(K=function(e,t){return n.call(e,t)})(e,t)};"function"==typeof Sizzle&&(Y=function(e,t){return Sizzle(e,t)[0]||null},X=Sizzle,K=Sizzle.matchesSelector),o.selection=function(){return o.select(l.documentElement)};var Z=o.selection.prototype=[];function J(e){return"function"==typeof e?e:function(){return Y(e,this)}}function ee(e){return"function"==typeof e?e:function(){return X(e,this)}}Z.select=function(e){var t,n,r,i,o=[];e=J(e);for(var s=-1,a=this.length;++s<a;){o.push(t=[]),t.parentNode=(r=this[s]).parentNode;for(var l=-1,u=r.length;++l<u;)(i=r[l])?(t.push(n=e.call(i,i.__data__,l,s)),n&&"__data__"in i&&(n.__data__=i.__data__)):t.push(null)}return Q(o)},Z.selectAll=function(e){var t,n,r=[];e=ee(e);for(var i=-1,o=this.length;++i<o;)for(var s=this[i],l=-1,u=s.length;++l<u;)(n=s[l])&&(r.push(t=a(e.call(n,n.__data__,l,i))),t.parentNode=n);return Q(r)};var te={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ne(e,t){return e=o.ns.qualify(e),null==t?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof t?e.local?function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}:function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}:e.local?function(){this.setAttributeNS(e.space,e.local,t)}:function(){this.setAttribute(e,t)}}function re(e){return e.trim().replace(/\s+/g," ")}function ie(e){return new RegExp("(?:^|\\s+)"+o.requote(e)+"(?:\\s+|$)","g")}function oe(e){return(e+"").trim().split(/^|\s+/)}function se(e,t){var n=(e=oe(e).map(ae)).length;return"function"==typeof t?function(){for(var r=-1,i=t.apply(this,arguments);++r<n;)e[r](this,i)}:function(){for(var r=-1;++r<n;)e[r](this,t)}}function ae(e){var t=ie(e);return function(n,r){if(i=n.classList)return r?i.add(e):i.remove(e);var i=n.getAttribute("class")||"";r?(t.lastIndex=0,t.test(i)||n.setAttribute("class",re(i+" "+e))):n.setAttribute("class",re(i.replace(t," ")))}}function le(e,t,n){return null==t?function(){this.style.removeProperty(e)}:"function"==typeof t?function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}:function(){this.style.setProperty(e,t,n)}}function ue(e,t){return null==t?function(){delete this[e]}:"function"==typeof t?function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}:function(){this[e]=t}}function ce(e){return"function"==typeof e?e:(e=o.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,n=this.namespaceURI;return n?t.createElementNS(n,e):t.createElement(e)}}function pe(){var e=this.parentNode;e&&e.removeChild(this)}function de(e){return{__data__:e}}function fe(e){return function(){return K(this,e)}}function he(e){return arguments.length||(e=m),function(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}}function ge(e,t){for(var n=0,r=e.length;n<r;n++)for(var i,o=e[n],s=0,a=o.length;s<a;s++)(i=o[s])&&t(i,s,n);return e}function me(e){return W(e,ve),e}o.ns={prefix:te,qualify:function(e){var t=e.indexOf(":"),n=e;return t>=0&&"xmlns"!==(n=e.slice(0,t))&&(e=e.slice(t+1)),te.hasOwnProperty(n)?{space:te[n],local:e}:e}},Z.attr=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=o.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(t in e)this.each(ne(t,e[t]));return this}return this.each(ne(e,t))},Z.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node(),r=(e=oe(e)).length,i=-1;if(t=n.classList){for(;++i<r;)if(!t.contains(e[i]))return!1}else for(t=n.getAttribute("class");++i<r;)if(!ie(e[i]).test(t))return!1;return!0}for(t in e)this.each(se(t,e[t]));return this}return this.each(se(e,t))},Z.style=function(e,t,n){var r=arguments.length;if(r<3){if("string"!=typeof e){for(n in r<2&&(t=""),e)this.each(le(n,e[n],t));return this}if(r<2){var i=this.node();return c(i).getComputedStyle(i,null).getPropertyValue(e)}n=""}return this.each(le(e,t,n))},Z.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(ue(t,e[t]));return this}return this.each(ue(e,t))},Z.text=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},Z.html=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},Z.append=function(e){return e=ce(e),this.select((function(){return this.appendChild(e.apply(this,arguments))}))},Z.insert=function(e,t){return e=ce(e),t=J(t),this.select((function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)}))},Z.remove=function(){return this.each(pe)},Z.data=function(e,t){var n,r,i=-1,o=this.length;if(!arguments.length){for(e=new Array(o=(n=this[0]).length);++i<o;)(r=n[i])&&(e[i]=r.__data__);return e}function s(e,n){var r,i,o,s=e.length,c=n.length,p=Math.min(s,c),d=new Array(c),f=new Array(c),h=new Array(s);if(t){var g,m=new I,v=new Array(s);for(r=-1;++r<s;)(i=e[r])&&(m.has(g=t.call(i,i.__data__,r))?h[r]=i:m.set(g,i),v[r]=g);for(r=-1;++r<c;)(i=m.get(g=t.call(n,o=n[r],r)))?!0!==i&&(d[r]=i,i.__data__=o):f[r]=de(o),m.set(g,!0);for(r=-1;++r<s;)r in v&&!0!==m.get(v[r])&&(h[r]=e[r])}else{for(r=-1;++r<p;)i=e[r],o=n[r],i?(i.__data__=o,d[r]=i):f[r]=de(o);for(;r<c;++r)f[r]=de(n[r]);for(;r<s;++r)h[r]=e[r]}f.update=d,f.parentNode=d.parentNode=h.parentNode=e.parentNode,a.push(f),l.push(d),u.push(h)}var a=me([]),l=Q([]),u=Q([]);if("function"==typeof e)for(;++i<o;)s(n=this[i],e.call(n,n.parentNode.__data__,i));else for(;++i<o;)s(n=this[i],e);return l.enter=function(){return a},l.exit=function(){return u},l},Z.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},Z.filter=function(e){var t,n,r,i=[];"function"!=typeof e&&(e=fe(e));for(var o=0,s=this.length;o<s;o++){i.push(t=[]),t.parentNode=(n=this[o]).parentNode;for(var a=0,l=n.length;a<l;a++)(r=n[a])&&e.call(r,r.__data__,a,o)&&t.push(r)}return Q(i)},Z.order=function(){for(var e=-1,t=this.length;++e<t;)for(var n,r=this[e],i=r.length-1,o=r[i];--i>=0;)(n=r[i])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},Z.sort=function(e){e=he.apply(this,arguments);for(var t=-1,n=this.length;++t<n;)this[t].sort(e);return this.order()},Z.each=function(e){return ge(this,(function(t,n,r){e.call(t,t.__data__,n,r)}))},Z.call=function(e){var t=a(arguments);return e.apply(t[0]=this,t),this},Z.empty=function(){return!this.node()},Z.node=function(){for(var e=0,t=this.length;e<t;e++)for(var n=this[e],r=0,i=n.length;r<i;r++){var o=n[r];if(o)return o}return null},Z.size=function(){var e=0;return ge(this,(function(){++e})),e};var ve=[];function Ee(e){var t,n;return function(r,i,o){var s,a=e[o].update,l=a.length;for(o!=n&&(n=o,t=0),i>=t&&(t=i+1);!(s=a[t])&&++t<l;);return s}}function xe(e,t,n){var r="__on"+e,i=e.indexOf("."),s=Te;i>0&&(e=e.slice(0,i));var l=ye.get(e);function u(){var t=this[r];t&&(this.removeEventListener(e,t,t.$),delete this[r])}return l&&(e=l,s=Ne),i?t?function(){var i=s(t,a(arguments));u.call(this),this.addEventListener(e,this[r]=i,i.$=n),i._=t}:u:t?B:function(){var t,n=new RegExp("^__on([^.]+)"+o.requote(e)+"$");for(var r in this)if(t=r.match(n)){var i=this[r];this.removeEventListener(t[1],i,i.$),delete this[r]}}}o.selection.enter=me,o.selection.enter.prototype=ve,ve.append=Z.append,ve.empty=Z.empty,ve.node=Z.node,ve.call=Z.call,ve.size=Z.size,ve.select=function(e){for(var t,n,r,i,o,s=[],a=-1,l=this.length;++a<l;){r=(i=this[a]).update,s.push(t=[]),t.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)(o=i[u])?(t.push(r[u]=n=e.call(i.parentNode,o.__data__,u,a)),n.__data__=o.__data__):t.push(null)}return Q(s)},ve.insert=function(e,t){return arguments.length<2&&(t=Ee(this)),Z.insert.call(this,e,t)},o.select=function(e){var t;return"string"==typeof e?(t=[Y(e,l)]).parentNode=l.documentElement:(t=[e]).parentNode=u(e),Q([t])},o.selectAll=function(e){var t;return"string"==typeof e?(t=a(X(e,l))).parentNode=l.documentElement:(t=a(e)).parentNode=null,Q([t])},Z.on=function(e,t,n){var r=arguments.length;if(r<3){if("string"!=typeof e){for(n in r<2&&(t=!1),e)this.each(xe(n,e[n],t));return this}if(r<2)return(r=this.node()["__on"+e])&&r._;n=!1}return this.each(xe(e,t,n))};var ye=o.map({mouseenter:"mouseover",mouseleave:"mouseout"});function Te(e,t){return function(n){var r=o.event;o.event=n,t[0]=this.__data__;try{e.apply(this,t)}finally{o.event=r}}}function Ne(e,t){var n=Te(e,t);return function(e){var t=e.relatedTarget;t&&(t===this||8&t.compareDocumentPosition(this))||n.call(this,e)}}l&&ye.forEach((function(e){"on"+e in l&&ye.remove(e)}));var Ce,Se=0;function Ie(e){var t=".dragsuppress-"+ ++Se,n="click"+t,r=o.select(c(e)).on("touchmove"+t,H).on("dragstart"+t,H).on("selectstart"+t,H);if(null==Ce&&(Ce=!("onselectstart"in e)&&G(e.style,"userSelect")),Ce){var i=u(e).style,s=i[Ce];i[Ce]="none"}return function(e){if(r.on(t,null),Ce&&(i[Ce]=s),e){var o=function(){r.on(n,null)};r.on(n,(function(){H(),o()}),!0),setTimeout(o,0)}}}o.mouse=function(e){return Ae(e,q())};var Le=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Ae(e,t){t.changedTouches&&(t=t.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();if(Le<0){var i=c(e);if(i.scrollX||i.scrollY){var s=(n=o.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();Le=!(s.f||s.e),n.remove()}}return Le?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}var a=e.getBoundingClientRect();return[t.clientX-a.left-e.clientLeft,t.clientY-a.top-e.clientTop]}function be(){return o.event.changedTouches[0].identifier}o.touch=function(e,t,n){if(arguments.length<3&&(n=t,t=q().changedTouches),t)for(var r,i=0,o=t.length;i<o;++i)if((r=t[i]).identifier===n)return Ae(e,r)},o.behavior.drag=function(){var e=$(i,"drag","dragstart","dragend"),t=null,n=s(B,o.mouse,c,"mousemove","mouseup"),r=s(be,o.touch,k,"touchmove","touchend");function i(){this.on("mousedown.drag",n).on("touchstart.drag",r)}function s(n,r,i,s,a){return function(){var l,u=this,c=o.event.target,p=u.parentNode,d=e.of(u,arguments),f=0,h=n(),g=".drag"+(null==h?"":"-"+h),m=o.select(i(c)).on(s+g,x).on(a+g,y),v=Ie(c),E=r(p,h);function x(){var e,t,n=r(p,h);n&&(e=n[0]-E[0],t=n[1]-E[1],f|=e|t,E=n,d({type:"drag",x:n[0]+l[0],y:n[1]+l[1],dx:e,dy:t}))}function y(){r(p,h)&&(m.on(s+g,null).on(a+g,null),v(f),d({type:"dragend"}))}l=t?[(l=t.apply(u,arguments)).x-E[0],l.y-E[1]]:[0,0],d({type:"dragstart"})}}return i.origin=function(e){return arguments.length?(t=e,i):t},o.rebind(i,e,"on")},o.touches=function(e,t){return arguments.length<2&&(t=q().touches),t?a(t).map((function(t){var n=Ae(e,t);return n.identifier=t.identifier,n})):[]};var Re=1e-6,we=Re*Re,Oe=Math.PI,Me=2*Oe,_e=Me-Re,Pe=Oe/2,De=Oe/180,ke=180/Oe;function Fe(e){return e>0?1:e<0?-1:0}function Ge(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function Ue(e){return e>1?0:e<-1?Oe:Math.acos(e)}function Be(e){return e>1?Pe:e<-1?-Pe:Math.asin(e)}function je(e){return((e=Math.exp(e))+1/e)/2}function Ve(e){return(e=Math.sin(e/2))*e}var He=Math.SQRT2;o.interpolateZoom=function(e,t){var n,r,i=e[0],o=e[1],s=e[2],a=t[0],l=t[1],u=t[2],c=a-i,p=l-o,d=c*c+p*p;if(d<we)r=Math.log(u/s)/He,n=function(e){return[i+e*c,o+e*p,s*Math.exp(He*e*r)]};else{var f=Math.sqrt(d),h=(u*u-s*s+4*d)/(2*s*2*f),g=(u*u-s*s-4*d)/(2*u*2*f),m=Math.log(Math.sqrt(h*h+1)-h),v=Math.log(Math.sqrt(g*g+1)-g);r=(v-m)/He,n=function(e){var t,n=e*r,a=je(m),l=s/(2*f)*(a*(t=He*n+m,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(m));return[i+l*c,o+l*p,s*a/je(He*n+m)]}}return n.duration=1e3*r,n},o.behavior.zoom=function(){var e,t,n,r,i,s,a,u,p,d={x:0,y:0,k:1},f=[960,500],h=ze,g=250,m=0,v="mousedown.zoom",E="mousemove.zoom",x="mouseup.zoom",y="touchstart.zoom",T=$(N,"zoomstart","zoom","zoomend");function N(e){e.on(v,O).on($e+".zoom",_).on("dblclick.zoom",P).on(y,M)}function C(e){return[(e[0]-d.x)/d.k,(e[1]-d.y)/d.k]}function S(e){d.k=Math.max(h[0],Math.min(h[1],e))}function I(e,t){t=function(e){return[e[0]*d.k+d.x,e[1]*d.k+d.y]}(t),d.x+=e[0]-t[0],d.y+=e[1]-t[1]}function L(e,n,r,i){e.__chart__={x:d.x,y:d.y,k:d.k},S(Math.pow(2,i)),I(t=n,r),e=o.select(e),g>0&&(e=e.transition().duration(g)),e.call(N.event)}function A(){a&&a.domain(s.range().map((function(e){return(e-d.x)/d.k})).map(s.invert)),p&&p.domain(u.range().map((function(e){return(e-d.y)/d.k})).map(u.invert))}function b(e){m++||e({type:"zoomstart"})}function R(e){A(),e({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function w(e){--m||(e({type:"zoomend"}),t=null)}function O(){var e=this,t=T.of(e,arguments),n=0,r=o.select(c(e)).on(E,(function(){n=1,I(o.mouse(e),i),R(t)})).on(x,(function(){r.on(E,null).on(x,null),s(n),w(t)})),i=C(o.mouse(e)),s=Ie(e);La.call(e),b(t)}function M(){var e,t=this,n=T.of(t,arguments),r={},s=0,a=".zoom-"+o.event.changedTouches[0].identifier,l="touchmove"+a,u="touchend"+a,c=[],p=o.select(t),f=Ie(t);function h(){var n=o.touches(t);return e=d.k,n.forEach((function(e){e.identifier in r&&(r[e.identifier]=C(e))})),n}function g(){var e=o.event.target;o.select(e).on(l,m).on(u,E),c.push(e);for(var n=o.event.changedTouches,a=0,p=n.length;a<p;++a)r[n[a].identifier]=null;var f=h(),g=Date.now();if(1===f.length){if(g-i<500){var v=f[0];L(t,v,r[v.identifier],Math.floor(Math.log(d.k)/Math.LN2)+1),H()}i=g}else if(f.length>1){v=f[0];var x=f[1],y=v[0]-x[0],T=v[1]-x[1];s=y*y+T*T}}function m(){var a,l,u,c,p=o.touches(t);La.call(t);for(var d=0,f=p.length;d<f;++d,c=null)if(u=p[d],c=r[u.identifier]){if(l)break;a=u,l=c}if(c){var h=(h=u[0]-a[0])*h+(h=u[1]-a[1])*h,g=s&&Math.sqrt(h/s);a=[(a[0]+u[0])/2,(a[1]+u[1])/2],l=[(l[0]+c[0])/2,(l[1]+c[1])/2],S(g*e)}i=null,I(a,l),R(n)}function E(){if(o.event.touches.length){for(var e=o.event.changedTouches,t=0,i=e.length;t<i;++t)delete r[e[t].identifier];for(var s in r)return void h()}o.selectAll(c).on(a,null),p.on(v,O).on(y,M),f(),w(n)}g(),b(n),p.on(v,null).on(y,g)}function _(){var i=T.of(this,arguments);r?clearTimeout(r):(La.call(this),e=C(t=n||o.mouse(this)),b(i)),r=setTimeout((function(){r=null,w(i)}),50),H(),S(Math.pow(2,.002*qe())*d.k),I(t,e),R(i)}function P(){var e=o.mouse(this),t=Math.log(d.k)/Math.LN2;L(this,e,C(e),o.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}return $e||($e="onwheel"in l?(qe=function(){return-o.event.deltaY*(o.event.deltaMode?120:1)},"wheel"):"onmousewheel"in l?(qe=function(){return o.event.wheelDelta},"mousewheel"):(qe=function(){return-o.event.detail},"MozMousePixelScroll")),N.event=function(e){e.each((function(){var e=T.of(this,arguments),n=d;Ra?o.select(this).transition().each("start.zoom",(function(){d=this.__chart__||{x:0,y:0,k:1},b(e)})).tween("zoom:zoom",(function(){var r=f[0],i=f[1],s=t?t[0]:r/2,a=t?t[1]:i/2,l=o.interpolateZoom([(s-d.x)/d.k,(a-d.y)/d.k,r/d.k],[(s-n.x)/n.k,(a-n.y)/n.k,r/n.k]);return function(t){var n=l(t),i=r/n[2];this.__chart__=d={x:s-n[0]*i,y:a-n[1]*i,k:i},R(e)}})).each("interrupt.zoom",(function(){w(e)})).each("end.zoom",(function(){w(e)})):(this.__chart__=d,b(e),R(e),w(e))}))},N.translate=function(e){return arguments.length?(d={x:+e[0],y:+e[1],k:d.k},A(),N):[d.x,d.y]},N.scale=function(e){return arguments.length?(d={x:d.x,y:d.y,k:null},S(+e),A(),N):d.k},N.scaleExtent=function(e){return arguments.length?(h=null==e?ze:[+e[0],+e[1]],N):h},N.center=function(e){return arguments.length?(n=e&&[+e[0],+e[1]],N):n},N.size=function(e){return arguments.length?(f=e&&[+e[0],+e[1]],N):f},N.duration=function(e){return arguments.length?(g=+e,N):g},N.x=function(e){return arguments.length?(a=e,s=e.copy(),d={x:0,y:0,k:1},N):a},N.y=function(e){return arguments.length?(p=e,u=e.copy(),d={x:0,y:0,k:1},N):p},o.rebind(N,T,"on")};var qe,$e,ze=[0,1/0];function We(){}function Qe(e,t,n){return this instanceof Qe?(this.h=+e,this.s=+t,void(this.l=+n)):arguments.length<2?e instanceof Qe?new Qe(e.h,e.s,e.l):mt(""+e,vt,Qe):new Qe(e,t,n)}o.color=We,We.prototype.toString=function(){return this.rgb()+""},o.hsl=Qe;var Ye=Qe.prototype=new We;function Xe(e,t,n){var r,i;function o(e){return Math.round(255*function(e){return e>360?e-=360:e<0&&(e+=360),e<60?r+(i-r)*e/60:e<180?i:e<240?r+(i-r)*(240-e)/60:r}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)?0:t<0?0:t>1?1:t,r=2*(n=n<0?0:n>1?1:n)-(i=n<=.5?n*(1+t):n+t-n*t),new pt(o(e+120),o(e),o(e-120))}function Ke(e,t,n){return this instanceof Ke?(this.h=+e,this.c=+t,void(this.l=+n)):arguments.length<2?e instanceof Ke?new Ke(e.h,e.c,e.l):at(e instanceof et?e.l:(e=Et((e=o.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ke(e,t,n)}Ye.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Qe(this.h,this.s,this.l/e)},Ye.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Qe(this.h,this.s,e*this.l)},Ye.rgb=function(){return Xe(this.h,this.s,this.l)},o.hcl=Ke;var Ze=Ke.prototype=new We;function Je(e,t,n){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new et(n,Math.cos(e*=De)*t,Math.sin(e)*t)}function et(e,t,n){return this instanceof et?(this.l=+e,this.a=+t,void(this.b=+n)):arguments.length<2?e instanceof et?new et(e.l,e.a,e.b):e instanceof Ke?Je(e.h,e.c,e.l):Et((e=pt(e)).r,e.g,e.b):new et(e,t,n)}Ze.brighter=function(e){return new Ke(this.h,this.c,Math.min(100,this.l+tt*(arguments.length?e:1)))},Ze.darker=function(e){return new Ke(this.h,this.c,Math.max(0,this.l-tt*(arguments.length?e:1)))},Ze.rgb=function(){return Je(this.h,this.c,this.l).rgb()},o.lab=et;var tt=18,nt=.95047,rt=1,it=1.08883,ot=et.prototype=new We;function st(e,t,n){var r=(e+16)/116,i=r+t/500,o=r-n/200;return new pt(ct(3.2404542*(i=lt(i)*nt)-1.5371385*(r=lt(r)*rt)-.4985314*(o=lt(o)*it)),ct(-.969266*i+1.8760108*r+.041556*o),ct(.0556434*i-.2040259*r+1.0572252*o))}function at(e,t,n){return e>0?new Ke(Math.atan2(n,t)*ke,Math.sqrt(t*t+n*n),e):new Ke(NaN,NaN,e)}function lt(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function ut(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function ct(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function pt(e,t,n){return this instanceof pt?(this.r=~~e,this.g=~~t,void(this.b=~~n)):arguments.length<2?e instanceof pt?new pt(e.r,e.g,e.b):mt(""+e,pt,Xe):new pt(e,t,n)}function dt(e){return new pt(e>>16,e>>8&255,255&e)}function ft(e){return dt(e)+""}ot.brighter=function(e){return new et(Math.min(100,this.l+tt*(arguments.length?e:1)),this.a,this.b)},ot.darker=function(e){return new et(Math.max(0,this.l-tt*(arguments.length?e:1)),this.a,this.b)},ot.rgb=function(){return st(this.l,this.a,this.b)},o.rgb=pt;var ht=pt.prototype=new We;function gt(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function mt(e,t,n){var r,i,o,s=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(yt(i[0]),yt(i[1]),yt(i[2]))}return(o=Tt.get(e))?t(o.r,o.g,o.b):(null==e||"#"!==e.charAt(0)||isNaN(o=parseInt(e.slice(1),16))||(4===e.length?(s=(3840&o)>>4,s|=s>>4,a=240&o,a|=a>>4,l=15&o,l|=l<<4):7===e.length&&(s=(16711680&o)>>16,a=(65280&o)>>8,l=255&o)),t(s,a,l))}function vt(e,t,n){var r,i,o=Math.min(e/=255,t/=255,n/=255),s=Math.max(e,t,n),a=s-o,l=(s+o)/2;return a?(i=l<.5?a/(s+o):a/(2-s-o),r=e==s?(t-n)/a+(t<n?6:0):t==s?(n-e)/a+2:(e-t)/a+4,r*=60):(r=NaN,i=l>0&&l<1?0:r),new Qe(r,i,l)}function Et(e,t,n){var r=ut((.4124564*(e=xt(e))+.3575761*(t=xt(t))+.1804375*(n=xt(n)))/nt),i=ut((.2126729*e+.7151522*t+.072175*n)/rt);return et(116*i-16,500*(r-i),200*(i-ut((.0193339*e+.119192*t+.9503041*n)/it)))}function xt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function yt(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}ht.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,n=this.g,r=this.b,i=30;return t||n||r?(t&&t<i&&(t=i),n&&n<i&&(n=i),r&&r<i&&(r=i),new pt(Math.min(255,t/e),Math.min(255,n/e),Math.min(255,r/e))):new pt(i,i,i)},ht.darker=function(e){return new pt((e=Math.pow(.7,arguments.length?e:1))*this.r,e*this.g,e*this.b)},ht.hsl=function(){return vt(this.r,this.g,this.b)},ht.toString=function(){return"#"+gt(this.r)+gt(this.g)+gt(this.b)};var Tt=o.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function Nt(e){return"function"==typeof e?e:function(){return e}}function Ct(e){return function(t,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),St(t,n,e,r)}}function St(e,t,n,r){var i={},s=o.dispatch("beforesend","progress","load","error"),l={},u=new XMLHttpRequest,c=null;function p(){var e,t=u.status;if(!t&&function(e){var t=e.responseType;return t&&"text"!==t?e.response:e.responseText}(u)||t>=200&&t<300||304===t){try{e=n.call(i,u)}catch(e){return void s.error.call(i,e)}s.load.call(i,e)}else s.error.call(i,u)}return!this.XDomainRequest||"withCredentials"in u||!/^(http(s)?:)?\/\//.test(e)||(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=p:u.onreadystatechange=function(){u.readyState>3&&p()},u.onprogress=function(e){var t=o.event;o.event=e;try{s.progress.call(i,u)}finally{o.event=t}},i.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?l[e]:(null==t?delete l[e]:l[e]=t+"",i)},i.mimeType=function(e){return arguments.length?(t=null==e?null:e+"",i):t},i.responseType=function(e){return arguments.length?(c=e,i):c},i.response=function(e){return n=e,i},["get","post"].forEach((function(e){i[e]=function(){return i.send.apply(i,[e].concat(a(arguments)))}})),i.send=function(n,r,o){if(2===arguments.length&&"function"==typeof r&&(o=r,r=null),u.open(n,e,!0),null==t||"accept"in l||(l.accept=t+",*/*"),u.setRequestHeader)for(var a in l)u.setRequestHeader(a,l[a]);return null!=t&&u.overrideMimeType&&u.overrideMimeType(t),null!=c&&(u.responseType=c),null!=o&&i.on("error",o).on("load",(function(e){o(null,e)})),s.beforesend.call(i,u),u.send(null==r?null:r),i},i.abort=function(){return u.abort(),i},o.rebind(i,s,"on"),null==r?i:i.get(function(e){return 1===e.length?function(t,n){e(null==t?n:null)}:e}(r))}Tt.forEach((function(e,t){Tt.set(e,dt(t))})),o.functor=Nt,o.xhr=Ct(k),o.dsv=function(e,t){var n=new RegExp('["'+e+"\n]"),r=e.charCodeAt(0);function i(e,n,r){arguments.length<3&&(r=n,n=null);var i=St(e,t,null==n?o:s(n),r);return i.row=function(e){return arguments.length?i.response(null==(n=e)?o:s(e)):n},i}function o(e){return i.parse(e.responseText)}function s(e){return function(t){return i.parse(t.responseText,e)}}function a(t){return t.map(l).join(e)}function l(e){return n.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return i.parse=function(e,t){var n;return i.parseRows(e,(function(e,r){if(n)return n(e,r-1);var i=new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+"]"})).join(",")+"}");n=t?function(e,n){return t(i(e),n)}:i}))},i.parseRows=function(e,t){var n,i,o={},s={},a=[],l=e.length,u=0,c=0;function p(){if(u>=l)return s;if(i)return i=!1,o;var t=u;if(34===e.charCodeAt(t)){for(var n=t;n++<l;)if(34===e.charCodeAt(n)){if(34!==e.charCodeAt(n+1))break;++n}return u=n+2,13===(a=e.charCodeAt(n+1))?(i=!0,10===e.charCodeAt(n+2)&&++u):10===a&&(i=!0),e.slice(t+1,n).replace(/""/g,'"')}for(;u<l;){var a,c=1;if(10===(a=e.charCodeAt(u++)))i=!0;else if(13===a)i=!0,10===e.charCodeAt(u)&&(++u,++c);else if(a!==r)continue;return e.slice(t,u-c)}return e.slice(t)}for(;(n=p())!==s;){for(var d=[];n!==o&&n!==s;)d.push(n),n=p();t&&null==(d=t(d,c++))||a.push(d)}return a},i.format=function(t){if(Array.isArray(t[0]))return i.formatRows(t);var n=new D,r=[];return t.forEach((function(e){for(var t in e)n.has(t)||r.push(n.add(t))})),[r.map(l).join(e)].concat(t.map((function(t){return r.map((function(e){return l(t[e])})).join(e)}))).join("\n")},i.formatRows=function(e){return e.map(a).join("\n")},i},o.csv=o.dsv(",","text/csv"),o.tsv=o.dsv("\t","text/tab-separated-values");var It,Lt,At,bt,Rt=this[G(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};function wt(e,t,n){var r=arguments.length;r<2&&(t=0),r<3&&(n=Date.now());var i={c:e,t:n+t,n:null};return Lt?Lt.n=i:It=i,Lt=i,At||(bt=clearTimeout(bt),At=1,Rt(Ot)),i}function Ot(){var e=Mt(),t=_t()-e;t>24?(isFinite(t)&&(clearTimeout(bt),bt=setTimeout(Ot,t)),At=0):(At=1,Rt(Ot))}function Mt(){for(var e=Date.now(),t=It;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function _t(){for(var e,t=It,n=1/0;t;)t.c?(t.t<n&&(n=t.t),t=(e=t).n):t=e?e.n=t.n:It=t.n;return Lt=e,n}function Pt(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}o.timer=function(){wt.apply(this,arguments)},o.timer.flush=function(){Mt(),_t()},o.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var Dt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map((function(e,t){var n=Math.pow(10,3*N(8-t));return{scale:t>8?function(e){return e/n}:function(e){return e*n},symbol:e}}));function kt(e){var t=e.decimal,n=e.thousands,r=e.grouping,i=e.currency,s=r&&n?function(e,t){for(var i=e.length,o=[],s=0,a=r[0],l=0;i>0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),o.push(e.substring(i-=a,i+a)),!((l+=a+1)>t));)a=r[s=(s+1)%r.length];return o.reverse().join(n)}:k;return function(e){var n=Ft.exec(e),r=n[1]||" ",a=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],p=+n[6],d=n[7],f=n[8],h=n[9],g=1,m="",v="",E=!1,x=!0;switch(f&&(f=+f.substring(1)),(c||"0"===r&&"="===a)&&(c=r="0",a="="),h){case"n":d=!0,h="g";break;case"%":g=100,v="%",h="f";break;case"p":g=100,v="%",h="r";break;case"b":case"o":case"x":case"X":"#"===u&&(m="0"+h.toLowerCase());case"c":x=!1;case"d":E=!0,f=0;break;case"s":g=-1,h="r"}"$"===u&&(m=i[0],v=i[1]),"r"!=h||f||(h="g"),null!=f&&("g"==h?f=Math.max(1,Math.min(21,f)):"e"!=h&&"f"!=h||(f=Math.max(0,Math.min(20,f)))),h=Gt.get(h)||Ut;var y=c&&d;return function(e){var n=v;if(E&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(g<0){var u=o.formatPrefix(e,f);e=u.scale(e),n=u.symbol+v}else e*=g;var T,N,C=(e=h(e,f)).lastIndexOf(".");if(C<0){var S=x?e.lastIndexOf("e"):-1;S<0?(T=e,N=""):(T=e.substring(0,S),N=e.substring(S))}else T=e.substring(0,C),N=t+e.substring(C+1);!c&&d&&(T=s(T,1/0));var I=m.length+T.length+N.length+(y?0:i.length),L=I<p?new Array(I=p-I+1).join(r):"";return y&&(T=s(L+T,L.length?p-N.length:1/0)),i+=m,e=T+N,("<"===a?i+e+L:">"===a?L+i+e:"^"===a?L.substring(0,I>>=1)+i+e+L.substring(I):i+(y?e:L+e))+n}}}o.formatPrefix=function(e,t){var n=0;return(e=+e)&&(e<0&&(e*=-1),t&&(e=o.round(e,Pt(e,t))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Dt[8+n/3]};var Ft=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Gt=o.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(e,t){return(e=o.round(e,Pt(e,t))).toFixed(Math.max(0,Math.min(20,Pt(e*(1+1e-15),t))))}});function Ut(e){return e+""}var Bt=o.time={},jt=Date;function Vt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Vt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Ht.setUTCDate.apply(this._,arguments)},setDay:function(){Ht.setUTCDay.apply(this._,arguments)},setFullYear:function(){Ht.setUTCFullYear.apply(this._,arguments)},setHours:function(){Ht.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Ht.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Ht.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Ht.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Ht.setUTCSeconds.apply(this._,arguments)},setTime:function(){Ht.setTime.apply(this._,arguments)}};var Ht=Date.prototype;function qt(e,t,n){function r(t){var n=e(t),r=o(n,1);return t-n<r-t?n:r}function i(n){return t(n=e(new jt(n-1)),1),n}function o(e,n){return t(e=new jt(+e),n),e}function s(e,r,o){var s=i(e),a=[];if(o>1)for(;s<r;)n(s)%o||a.push(new Date(+s)),t(s,1);else for(;s<r;)a.push(new Date(+s)),t(s,1);return a}e.floor=e,e.round=r,e.ceil=i,e.offset=o,e.range=s;var a=e.utc=$t(e);return a.floor=a,a.round=$t(r),a.ceil=$t(i),a.offset=$t(o),a.range=function(e,t,n){try{jt=Vt;var r=new Vt;return r._=e,s(r,t,n)}finally{jt=Date}},e}function $t(e){return function(t,n){try{jt=Vt;var r=new Vt;return r._=t,e(r,n)._}finally{jt=Date}}}function zt(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,l=e.months,u=e.shortMonths;function c(e){var t=e.length;function n(n){for(var r,i,o,s=[],a=-1,l=0;++a<t;)37===e.charCodeAt(a)&&(s.push(e.slice(l,a)),null!=(i=Wt[r=e.charAt(++a)])&&(r=e.charAt(++a)),(o=T[r])&&(r=o(n,null==i?"e"===r?" ":"0":i)),s.push(r),l=a+1);return s.push(e.slice(l,a)),s.join("")}return n.parse=function(t){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(p(n,e,t,0)!=t.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var r=null!=n.Z&&jt!==Vt,i=new(r?Vt:jt);return"j"in n?i.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),i.setFullYear(n.y,0,1),i.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(i.getDay()+5)%7:n.w+7*n.U-(i.getDay()+6)%7)):i.setFullYear(n.y,n.m,n.d),i.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),r?i._:i},n.toString=function(){return e},n}function p(e,t,n,r){for(var i,o,s,a=0,l=t.length,u=n.length;a<l;){if(r>=u)return-1;if(37===(i=t.charCodeAt(a++))){if(s=t.charAt(a++),!(o=N[s in Wt?t.charAt(a++):s])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}c.utc=function(e){var t=c(e);function n(e){try{var n=new(jt=Vt);return n._=e,t(n)}finally{jt=Date}}return n.parse=function(e){try{jt=Vt;var n=t.parse(e);return n&&n._}finally{jt=Date}},n.toString=t.toString,n},c.multi=c.utc.multi=gn;var d=o.map(),f=Kt(s),h=Zt(s),g=Kt(a),m=Zt(a),v=Kt(l),E=Zt(l),x=Kt(u),y=Zt(u);i.forEach((function(e,t){d.set(e.toLowerCase(),t)}));var T={a:function(e){return a[e.getDay()]},A:function(e){return s[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return l[e.getMonth()]},c:c(t),d:function(e,t){return Xt(e.getDate(),t,2)},e:function(e,t){return Xt(e.getDate(),t,2)},H:function(e,t){return Xt(e.getHours(),t,2)},I:function(e,t){return Xt(e.getHours()%12||12,t,2)},j:function(e,t){return Xt(1+Bt.dayOfYear(e),t,3)},L:function(e,t){return Xt(e.getMilliseconds(),t,3)},m:function(e,t){return Xt(e.getMonth()+1,t,2)},M:function(e,t){return Xt(e.getMinutes(),t,2)},p:function(e){return i[+(e.getHours()>=12)]},S:function(e,t){return Xt(e.getSeconds(),t,2)},U:function(e,t){return Xt(Bt.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return Xt(Bt.mondayOfYear(e),t,2)},x:c(n),X:c(r),y:function(e,t){return Xt(e.getFullYear()%100,t,2)},Y:function(e,t){return Xt(e.getFullYear()%1e4,t,4)},Z:fn,"%":function(){return"%"}},N={a:function(e,t,n){g.lastIndex=0;var r=g.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){f.lastIndex=0;var r=f.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){x.lastIndex=0;var r=x.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){v.lastIndex=0;var r=v.exec(t.slice(n));return r?(e.m=E.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,t,n){return p(e,T.c.toString(),t,n)},d:an,e:an,H:un,I:un,j:ln,L:dn,m:sn,M:cn,p:function(e,t,n){var r=d.get(t.slice(n,n+=2).toLowerCase());return null==r?-1:(e.p=r,n)},S:pn,U:en,w:Jt,W:tn,x:function(e,t,n){return p(e,T.x.toString(),t,n)},X:function(e,t,n){return p(e,T.X.toString(),t,n)},y:rn,Y:nn,Z:on,"%":hn};return c}Bt.year=qt((function(e){return(e=Bt.day(e)).setMonth(0,1),e}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e){return e.getFullYear()})),Bt.years=Bt.year.range,Bt.years.utc=Bt.year.utc.range,Bt.day=qt((function(e){var t=new jt(2e3,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e){return e.getDate()-1})),Bt.days=Bt.day.range,Bt.days.utc=Bt.day.utc.range,Bt.dayOfYear=function(e){var t=Bt.year(e);return Math.floor((e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach((function(e,t){t=7-t;var n=Bt[e]=qt((function(e){return(e=Bt.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e}),(function(e,t){e.setDate(e.getDate()+7*Math.floor(t))}),(function(e){var n=Bt.year(e).getDay();return Math.floor((Bt.dayOfYear(e)+(n+t)%7)/7)-(n!==t)}));Bt[e+"s"]=n.range,Bt[e+"s"].utc=n.utc.range,Bt[e+"OfYear"]=function(e){var n=Bt.year(e).getDay();return Math.floor((Bt.dayOfYear(e)+(n+t)%7)/7)}})),Bt.week=Bt.sunday,Bt.weeks=Bt.sunday.range,Bt.weeks.utc=Bt.sunday.utc.range,Bt.weekOfYear=Bt.sundayOfYear;var Wt={"-":"",_:" ",0:"0"},Qt=/^\s*\d+/,Yt=/^%/;function Xt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function Kt(e){return new RegExp("^(?:"+e.map(o.requote).join("|")+")","i")}function Zt(e){for(var t=new I,n=-1,r=e.length;++n<r;)t.set(e[n].toLowerCase(),n);return t}function Jt(e,t,n){Qt.lastIndex=0;var r=Qt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function en(e,t,n){Qt.lastIndex=0;var r=Qt.exec(t.slice(n));return r?(e.U=+r[0],n+r[0].length):-1}function tn(e,t,n){Qt.lastIndex=0;var r=Qt.exec(t.slice(n));return r?(e.W=+r[0],n+r[0].length):-1}function nn(e,t,n){Qt.lastIndex=0;var r=Qt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function rn(e,t,n){Qt.lastIndex=0;var r,i=Qt.exec(t.slice(n,n+2));return i?(e.y=(r=+i[0])+(r>68?1900:2e3),n+i[0].length):-1}function on(e,t,n){return/^[+-]\d{4}$/.test(t=t.slice(n,n+5))?(e.Z=-t,n+5):-1}function sn(e,t,n){Qt.lastIndex=0;var r=Qt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function an(e,t,n){Qt.lastIndex=0;var r=Qt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function ln(e,t,n){Qt.lastIndex=0;var r=Qt.exec(t.slice(n,n+3));return r?(e.j=+r[0],n+r[0].length):-1}function un(e,t,n){Qt.lastIndex=0;var r=Qt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function cn(e,t,n){Qt.lastIndex=0;var r=Qt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function pn(e,t,n){Qt.lastIndex=0;var r=Qt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function dn(e,t,n){Qt.lastIndex=0;var r=Qt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function fn(e){var t=e.getTimezoneOffset(),n=t>0?"-":"+",r=N(t)/60|0,i=N(t)%60;return n+Xt(r,"0",2)+Xt(i,"0",2)}function hn(e,t,n){Yt.lastIndex=0;var r=Yt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function gn(e){for(var t=e.length,n=-1;++n<t;)e[n][0]=this(e[n][0]);return function(t){for(var n=0,r=e[n];!r[1](t);)r=e[++n];return r[0](t)}}o.locale=function(e){return{numberFormat:kt(e),timeFormat:zt(e)}};var mn=o.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function vn(){}o.format=mn.numberFormat,o.geo={},vn.prototype={s:0,t:0,add:function(e){xn(e,this.t,En),xn(En.s,this.s,this),this.s?this.t+=En.t:this.s=En.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var En=new vn;function xn(e,t,n){var r=n.s=e+t,i=r-e,o=r-i;n.t=e-o+(t-i)}function yn(e,t){e&&Nn.hasOwnProperty(e.type)&&Nn[e.type](e,t)}o.geo.stream=function(e,t){e&&Tn.hasOwnProperty(e.type)?Tn[e.type](e,t):yn(e,t)};var Tn={Feature:function(e,t){yn(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)yn(n[r].geometry,t)}},Nn={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Cn(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Cn(n[r],t,0)},Polygon:function(e,t){Sn(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Sn(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)yn(n[r],t)}};function Cn(e,t,n){var r,i=-1,o=e.length-n;for(t.lineStart();++i<o;)r=e[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function Sn(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Cn(e[n],t,1);t.polygonEnd()}o.geo.area=function(e){return In=0,o.geo.stream(e,Gn),In};var In,Ln,An,bn,Rn,wn,On,Mn,_n,Pn,Dn,kn,Fn=new vn,Gn={sphere:function(){In+=4*Oe},point:B,lineStart:B,lineEnd:B,polygonStart:function(){Fn.reset(),Gn.lineStart=Un},polygonEnd:function(){var e=2*Fn;In+=e<0?4*Oe+e:e,Gn.lineStart=Gn.lineEnd=Gn.point=B}};function Un(){var e,t,n,r,i;function o(e,t){t=t*De/2+Oe/4;var o=(e*=De)-n,s=o>=0?1:-1,a=s*o,l=Math.cos(t),u=Math.sin(t),c=i*u,p=r*l+c*Math.cos(a),d=c*s*Math.sin(a);Fn.add(Math.atan2(d,p)),n=e,r=l,i=u}Gn.point=function(s,a){Gn.point=o,n=(e=s)*De,r=Math.cos(a=(t=a)*De/2+Oe/4),i=Math.sin(a)},Gn.lineEnd=function(){o(e,t)}}function Bn(e){var t=e[0],n=e[1],r=Math.cos(n);return[r*Math.cos(t),r*Math.sin(t),Math.sin(n)]}function jn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Vn(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Hn(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function qn(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function $n(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function zn(e){return[Math.atan2(e[1],e[0]),Be(e[2])]}function Wn(e,t){return N(e[0]-t[0])<Re&&N(e[1]-t[1])<Re}o.geo.bounds=function(){var e,t,n,r,i,s,a,l,u,c,p,d={point:f,lineStart:g,lineEnd:m,polygonStart:function(){d.point=v,d.lineStart=E,d.lineEnd=x,u=0,Gn.polygonStart()},polygonEnd:function(){Gn.polygonEnd(),d.point=f,d.lineStart=g,d.lineEnd=m,Fn<0?(e=-(n=180),t=-(r=90)):u>Re?r=90:u<-Re&&(t=-90),p[0]=e,p[1]=n}};function f(i,o){c.push(p=[e=i,n=i]),o<t&&(t=o),o>r&&(r=o)}function h(o,s){var a=Bn([o*De,s*De]);if(l){var u=Vn(l,a),c=Vn([u[1],-u[0],0],u);$n(c),c=zn(c);var p=o-i,d=p>0?1:-1,h=c[0]*ke*d,g=N(p)>180;if(g^(d*i<h&&h<d*o))(m=c[1]*ke)>r&&(r=m);else if(g^(d*i<(h=(h+360)%360-180)&&h<d*o)){var m;(m=-c[1]*ke)<t&&(t=m)}else s<t&&(t=s),s>r&&(r=s);g?o<i?y(e,o)>y(e,n)&&(n=o):y(o,n)>y(e,n)&&(e=o):n>=e?(o<e&&(e=o),o>n&&(n=o)):o>i?y(e,o)>y(e,n)&&(n=o):y(o,n)>y(e,n)&&(e=o)}else f(o,s);l=a,i=o}function g(){d.point=h}function m(){p[0]=e,p[1]=n,d.point=f,l=null}function v(e,t){if(l){var n=e-i;u+=N(n)>180?n+(n>0?360:-360):n}else s=e,a=t;Gn.point(e,t),h(e,t)}function E(){Gn.lineStart()}function x(){v(s,a),Gn.lineEnd(),N(u)>Re&&(e=-(n=180)),p[0]=e,p[1]=n,l=null}function y(e,t){return(t-=e)<0?t+360:t}function T(e,t){return e[0]-t[0]}function C(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}return function(i){if(r=n=-(e=t=1/0),c=[],o.geo.stream(i,d),u=c.length){c.sort(T);for(var s=1,a=[g=c[0]];s<u;++s)C((f=c[s])[0],g)||C(f[1],g)?(y(g[0],f[1])>y(g[0],g[1])&&(g[1]=f[1]),y(f[0],g[1])>y(g[0],g[1])&&(g[0]=f[0])):a.push(g=f);for(var l,u,f,h=-1/0,g=(s=0,a[u=a.length-1]);s<=u;g=f,++s)f=a[s],(l=y(g[1],f[0]))>h&&(h=l,e=f[0],n=g[1])}return c=p=null,e===1/0||t===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,t],[n,r]]}}(),o.geo.centroid=function(e){Ln=An=bn=Rn=wn=On=Mn=_n=Pn=Dn=kn=0,o.geo.stream(e,Qn);var t=Pn,n=Dn,r=kn,i=t*t+n*n+r*r;return i<we&&(t=On,n=Mn,r=_n,An<Re&&(t=bn,n=Rn,r=wn),(i=t*t+n*n+r*r)<we)?[NaN,NaN]:[Math.atan2(n,t)*ke,Be(r/Math.sqrt(i))*ke]};var Qn={sphere:B,point:Yn,lineStart:Kn,lineEnd:Zn,polygonStart:function(){Qn.lineStart=Jn},polygonEnd:function(){Qn.lineStart=Kn}};function Yn(e,t){e*=De;var n=Math.cos(t*=De);Xn(n*Math.cos(e),n*Math.sin(e),Math.sin(t))}function Xn(e,t,n){++Ln,bn+=(e-bn)/Ln,Rn+=(t-Rn)/Ln,wn+=(n-wn)/Ln}function Kn(){var e,t,n;function r(r,i){r*=De;var o=Math.cos(i*=De),s=o*Math.cos(r),a=o*Math.sin(r),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=t*l-n*a)*u+(u=n*s-e*l)*u+(u=e*a-t*s)*u),e*s+t*a+n*l);An+=u,On+=u*(e+(e=s)),Mn+=u*(t+(t=a)),_n+=u*(n+(n=l)),Xn(e,t,n)}Qn.point=function(i,o){i*=De;var s=Math.cos(o*=De);e=s*Math.cos(i),t=s*Math.sin(i),n=Math.sin(o),Qn.point=r,Xn(e,t,n)}}function Zn(){Qn.point=Yn}function Jn(){var e,t,n,r,i;function o(e,t){e*=De;var o=Math.cos(t*=De),s=o*Math.cos(e),a=o*Math.sin(e),l=Math.sin(t),u=r*l-i*a,c=i*s-n*l,p=n*a-r*s,d=Math.sqrt(u*u+c*c+p*p),f=n*s+r*a+i*l,h=d&&-Ue(f)/d,g=Math.atan2(d,f);Pn+=h*u,Dn+=h*c,kn+=h*p,An+=g,On+=g*(n+(n=s)),Mn+=g*(r+(r=a)),_n+=g*(i+(i=l)),Xn(n,r,i)}Qn.point=function(s,a){e=s,t=a,Qn.point=o,s*=De;var l=Math.cos(a*=De);n=l*Math.cos(s),r=l*Math.sin(s),i=Math.sin(a),Xn(n,r,i)},Qn.lineEnd=function(){o(e,t),Qn.lineEnd=Zn,Qn.point=Yn}}function er(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return(n=t.invert(n,r))&&e.invert(n[0],n[1])}),n}function tr(){return!0}function nr(e,t,n,r,i){var o=[],s=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,n=e[0],r=e[t];if(Wn(n,r)){i.lineStart();for(var a=0;a<t;++a)i.point((n=e[a])[0],n[1]);i.lineEnd()}else{var l=new ir(n,e,null,!0),u=new ir(n,null,l,!1);l.o=u,o.push(l),s.push(u),l=new ir(r,e,null,!1),u=new ir(r,null,l,!0),l.o=u,o.push(l),s.push(u)}}})),s.sort(t),rr(o),rr(s),o.length){for(var a=0,l=n,u=s.length;a<u;++a)s[a].e=l=!l;for(var c,p,d=o[0];;){for(var f=d,h=!0;f.v;)if((f=f.n)===d)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(h)for(a=0,u=c.length;a<u;++a)i.point((p=c[a])[0],p[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(h)for(a=(c=f.p.z).length-1;a>=0;--a)i.point((p=c[a])[0],p[1]);else r(f.x,f.p.x,-1,i);f=f.p}c=(f=f.o).z,h=!h}while(!f.v);i.lineEnd()}}}function rr(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r<t;)i.n=n=e[r],n.p=i,i=n;i.n=n=e[0],n.p=i}}function ir(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function or(e,t,n,r){return function(i,s){var a,l=t(s),u=i.invert(r[0],r[1]),c={point:p,lineStart:f,lineEnd:h,polygonStart:function(){c.point=y,c.lineStart=T,c.lineEnd=N,a=[],g=[]},polygonEnd:function(){c.point=p,c.lineStart=f,c.lineEnd=h,a=o.merge(a);var e=function(e,t){var n=e[0],r=e[1],i=[Math.sin(n),-Math.cos(n),0],o=0,s=0;Fn.reset();for(var a=0,l=t.length;a<l;++a){var u=t[a],c=u.length;if(c)for(var p=u[0],d=p[0],f=p[1]/2+Oe/4,h=Math.sin(f),g=Math.cos(f),m=1;;){m===c&&(m=0);var v=(e=u[m])[0],E=e[1]/2+Oe/4,x=Math.sin(E),y=Math.cos(E),T=v-d,N=T>=0?1:-1,C=N*T,S=C>Oe,I=h*x;if(Fn.add(Math.atan2(I*N*Math.sin(C),g*y+I*Math.cos(C))),o+=S?T+N*Me:T,S^d>=n^v>=n){var L=Vn(Bn(p),Bn(e));$n(L);var A=Vn(i,L);$n(A);var b=(S^T>=0?-1:1)*Be(A[2]);(r>b||r===b&&(L[0]||L[1]))&&(s+=S^T>=0?1:-1)}if(!m++)break;d=v,h=x,g=y,p=e}}return(o<-Re||o<Re&&Fn<0)^1&s}(u,g);a.length?(x||(s.polygonStart(),x=!0),nr(a,lr,e,n,s)):e&&(x||(s.polygonStart(),x=!0),s.lineStart(),n(null,null,1,s),s.lineEnd()),x&&(s.polygonEnd(),x=!1),a=g=null},sphere:function(){s.polygonStart(),s.lineStart(),n(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function p(t,n){var r=i(t,n);e(t=r[0],n=r[1])&&s.point(t,n)}function d(e,t){var n=i(e,t);l.point(n[0],n[1])}function f(){c.point=d,l.lineStart()}function h(){c.point=p,l.lineEnd()}var g,m,v=ar(),E=t(v),x=!1;function y(e,t){m.push([e,t]);var n=i(e,t);E.point(n[0],n[1])}function T(){E.lineStart(),m=[]}function N(){y(m[0][0],m[0][1]),E.lineEnd();var e,t=E.clean(),n=v.buffer(),r=n.length;if(m.pop(),g.push(m),m=null,r)if(1&t){var i,o=-1;if((r=(e=n[0]).length-1)>0){for(x||(s.polygonStart(),x=!0),s.lineStart();++o<r;)s.point((i=e[o])[0],i[1]);s.lineEnd()}}else r>1&&2&t&&n.push(n.pop().concat(n.shift())),a.push(n.filter(sr))}return c}}function sr(e){return e.length>1}function ar(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(t,n){e.push([t,n])},lineEnd:B,buffer:function(){var n=t;return t=[],e=null,n},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function lr(e,t){return((e=e.x)[0]<0?e[1]-Pe-Re:Pe-e[1])-((t=t.x)[0]<0?t[1]-Pe-Re:Pe-t[1])}var ur=or(tr,(function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,s){var a=o>0?Oe:-Oe,l=N(o-n);N(l-Oe)<Re?(e.point(n,r=(r+s)/2>0?Pe:-Pe),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(a,r),e.point(o,r),t=0):i!==a&&l>=Oe&&(N(n-i)<Re&&(n-=i*Re),N(o-a)<Re&&(o-=a*Re),r=function(e,t,n,r){var i,o,s=Math.sin(e-n);return N(s)>Re?Math.atan((Math.sin(t)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(t))*Math.sin(e))/(i*o*s)):(t+r)/2}(n,r,o,s),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(a,r),t=0),e.point(n=o,r=s),i=a},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}),(function(e,t,n,r){var i;if(null==e)i=n*Pe,r.point(-Oe,i),r.point(0,i),r.point(Oe,i),r.point(Oe,0),r.point(Oe,-i),r.point(0,-i),r.point(-Oe,-i),r.point(-Oe,0),r.point(-Oe,i);else if(N(e[0]-t[0])>Re){var o=e[0]<t[0]?Oe:-Oe;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}),[-Oe,-Oe/2]);function cr(e){var t=Math.cos(e),n=t>0,r=N(t)>Re;return or(i,(function(e){var t,a,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(p,d){var f,h=[p,d],g=i(p,d),m=n?g?0:s(p,d):g?s(p+(p<0?Oe:-Oe),d):0;if(!t&&(u=l=g)&&e.lineStart(),g!==l&&(f=o(t,h),(Wn(t,f)||Wn(h,f))&&(h[0]+=Re,h[1]+=Re,g=i(h[0],h[1]))),g!==l)c=0,g?(e.lineStart(),f=o(h,t),e.point(f[0],f[1])):(f=o(t,h),e.point(f[0],f[1]),e.lineEnd()),t=f;else if(r&&t&&n^g){var v;m&a||!(v=o(h,t,!0))||(c=0,n?(e.lineStart(),e.point(v[0][0],v[0][1]),e.point(v[1][0],v[1][1]),e.lineEnd()):(e.point(v[1][0],v[1][1]),e.lineEnd(),e.lineStart(),e.point(v[0][0],v[0][1])))}!g||t&&Wn(t,h)||e.point(h[0],h[1]),t=h,l=g,a=m},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return c|(u&&l)<<1}}}),Wr(e,6*De),n?[0,-e]:[-Oe,e-Oe]);function i(e,n){return Math.cos(e)*Math.cos(n)>t}function o(e,n,r){var i=[1,0,0],o=Vn(Bn(e),Bn(n)),s=jn(o,o),a=o[0],l=s-a*a;if(!l)return!r&&e;var u=t*s/l,c=-t*a/l,p=Vn(i,o),d=qn(i,u);Hn(d,qn(o,c));var f=p,h=jn(d,f),g=jn(f,f),m=h*h-g*(jn(d,d)-1);if(!(m<0)){var v=Math.sqrt(m),E=qn(f,(-h-v)/g);if(Hn(E,d),E=zn(E),!r)return E;var x,y=e[0],T=n[0],C=e[1],S=n[1];T<y&&(x=y,y=T,T=x);var I=T-y,L=N(I-Oe)<Re;if(!L&&S<C&&(x=C,C=S,S=x),L||I<Re?L?C+S>0^E[1]<(N(E[0]-y)<Re?C:S):C<=E[1]&&E[1]<=S:I>Oe^(y<=E[0]&&E[0]<=T)){var A=qn(f,(-h+v)/g);return Hn(A,d),[E,zn(A)]}}}function s(t,r){var i=n?e:Oe-e,o=0;return t<-i?o|=1:t>i&&(o|=2),r<-i?o|=4:r>i&&(o|=8),o}}function pr(e,t,n,r){return function(i){var o,s=i.a,a=i.b,l=s.x,u=s.y,c=0,p=1,d=a.x-l,f=a.y-u;if(o=e-l,d||!(o>0)){if(o/=d,d<0){if(o<c)return;o<p&&(p=o)}else if(d>0){if(o>p)return;o>c&&(c=o)}if(o=n-l,d||!(o<0)){if(o/=d,d<0){if(o>p)return;o>c&&(c=o)}else if(d>0){if(o<c)return;o<p&&(p=o)}if(o=t-u,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<p&&(p=o)}else if(f>0){if(o>p)return;o>c&&(c=o)}if(o=r-u,f||!(o<0)){if(o/=f,f<0){if(o>p)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<p&&(p=o)}return c>0&&(i.a={x:l+c*d,y:u+c*f}),p<1&&(i.b={x:l+p*d,y:u+p*f}),i}}}}}}var dr=1e9;function fr(e,t,n,r){return function(l){var u,c,p,d,f,h,g,m,v,E,x,y=l,T=ar(),N=pr(e,t,n,r),C={point:L,lineStart:function(){C.point=A,c&&c.push(p=[]);E=!0,v=!1,g=m=NaN},lineEnd:function(){u&&(A(d,f),h&&v&&T.rejoin(),u.push(T.buffer()));C.point=L,v&&l.lineEnd()},polygonStart:function(){l=T,u=[],c=[],x=!0},polygonEnd:function(){l=y,u=o.merge(u);var t=function(e){for(var t=0,n=c.length,r=e[1],i=0;i<n;++i)for(var o,s=1,a=c[i],l=a.length,u=a[0];s<l;++s)o=a[s],u[1]<=r?o[1]>r&&Ge(u,o,e)>0&&++t:o[1]<=r&&Ge(u,o,e)<0&&--t,u=o;return 0!==t}([e,r]),n=x&&t,i=u.length;(n||i)&&(l.polygonStart(),n&&(l.lineStart(),S(null,null,1,l),l.lineEnd()),i&&nr(u,s,t,S,l),l.polygonEnd()),u=c=p=null}};function S(o,s,l,u){var c=0,p=0;if(null==o||(c=i(o,l))!==(p=i(s,l))||a(o,s)<0^l>0)do{u.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+l+4)%4)!==p);else u.point(s[0],s[1])}function I(i,o){return e<=i&&i<=n&&t<=o&&o<=r}function L(e,t){I(e,t)&&l.point(e,t)}function A(e,t){var n=I(e=Math.max(-dr,Math.min(dr,e)),t=Math.max(-dr,Math.min(dr,t)));if(c&&p.push([e,t]),E)d=e,f=t,h=n,E=!1,n&&(l.lineStart(),l.point(e,t));else if(n&&v)l.point(e,t);else{var r={a:{x:g,y:m},b:{x:e,y:t}};N(r)?(v||(l.lineStart(),l.point(r.a.x,r.a.y)),l.point(r.b.x,r.b.y),n||l.lineEnd(),x=!1):n&&(l.lineStart(),l.point(e,t),x=!1)}g=e,m=t,v=n}return C};function i(r,i){return N(r[0]-e)<Re?i>0?0:3:N(r[0]-n)<Re?i>0?2:1:N(r[1]-t)<Re?i>0?1:0:i>0?3:2}function s(e,t){return a(e.x,t.x)}function a(e,t){var n=i(e,1),r=i(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}}function hr(e){var t=0,n=Oe/3,r=Ur(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*Oe/180,n=e[1]*Oe/180):[t/Oe*180,n/Oe*180]},i}function gr(e,t){var n=Math.sin(e),r=(n+Math.sin(t))/2,i=1+n*(2*r-n),o=Math.sqrt(i)/r;function s(e,t){var n=Math.sqrt(i-2*r*Math.sin(t))/r;return[n*Math.sin(e*=r),o-n*Math.cos(e)]}return s.invert=function(e,t){var n=o-t;return[Math.atan2(e,n)/r,Be((i-(e*e+n*n)*r*r)/(2*r))]},s}o.geo.clipExtent=function(){var e,t,n,r,i,o,s={stream:function(e){return i&&(i.valid=!1),(i=o(e)).valid=!0,i},extent:function(a){return arguments.length?(o=fr(e=+a[0][0],t=+a[0][1],n=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),s):[[e,t],[n,r]]}};return s.extent([[0,0],[960,500]])},(o.geo.conicEqualArea=function(){return hr(gr)}).raw=gr,o.geo.albers=function(){return o.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},o.geo.albersUsa=function(){var e,t,n,r,i=o.geo.albers(),s=o.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=o.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,n){e=[t,n]}};function u(i){var o=i[0],s=i[1];return e=null,t(o,s),e||(n(o,s),e)||r(o,s),e}return u.invert=function(e){var t=i.scale(),n=i.translate(),r=(e[0]-n[0])/t,o=(e[1]-n[1])/t;return(o>=.12&&o<.234&&r>=-.425&&r<-.214?s:o>=.166&&o<.234&&r>=-.214&&r<-.115?a:i).invert(e)},u.stream=function(e){var t=i.stream(e),n=s.stream(e),r=a.stream(e);return{point:function(e,i){t.point(e,i),n.point(e,i),r.point(e,i)},sphere:function(){t.sphere(),n.sphere(),r.sphere()},lineStart:function(){t.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},u.precision=function(e){return arguments.length?(i.precision(e),s.precision(e),a.precision(e),u):i.precision()},u.scale=function(e){return arguments.length?(i.scale(e),s.scale(.35*e),a.scale(e),u.translate(i.translate())):i.scale()},u.translate=function(e){if(!arguments.length)return i.translate();var o=i.scale(),c=+e[0],p=+e[1];return t=i.translate(e).clipExtent([[c-.455*o,p-.238*o],[c+.455*o,p+.238*o]]).stream(l).point,n=s.translate([c-.307*o,p+.201*o]).clipExtent([[c-.425*o+Re,p+.12*o+Re],[c-.214*o-Re,p+.234*o-Re]]).stream(l).point,r=a.translate([c-.205*o,p+.212*o]).clipExtent([[c-.214*o+Re,p+.166*o+Re],[c-.115*o-Re,p+.234*o-Re]]).stream(l).point,u},u.scale(1070)};var mr,vr,Er,xr,yr,Tr,Nr={point:B,lineStart:B,lineEnd:B,polygonStart:function(){vr=0,Nr.lineStart=Cr},polygonEnd:function(){Nr.lineStart=Nr.lineEnd=Nr.point=B,mr+=N(vr/2)}};function Cr(){var e,t,n,r;function i(e,t){vr+=r*e-n*t,n=e,r=t}Nr.point=function(o,s){Nr.point=i,e=n=o,t=r=s},Nr.lineEnd=function(){i(e,t)}}var Sr={point:function(e,t){e<Er&&(Er=e);e>yr&&(yr=e);t<xr&&(xr=t);t>Tr&&(Tr=t)},lineStart:B,lineEnd:B,polygonStart:B,polygonEnd:B};function Ir(){var e=Lr(4.5),t=[],n={point:r,lineStart:function(){n.point=i},lineEnd:s,polygonStart:function(){n.lineEnd=a},polygonEnd:function(){n.lineEnd=s,n.point=r},pointRadius:function(t){return e=Lr(t),n},result:function(){if(t.length){var e=t.join("");return t=[],e}}};function r(n,r){t.push("M",n,",",r,e)}function i(e,r){t.push("M",e,",",r),n.point=o}function o(e,n){t.push("L",e,",",n)}function s(){n.point=r}function a(){t.push("Z")}return n}function Lr(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}var Ar,br={point:Rr,lineStart:wr,lineEnd:Or,polygonStart:function(){br.lineStart=Mr},polygonEnd:function(){br.point=Rr,br.lineStart=wr,br.lineEnd=Or}};function Rr(e,t){bn+=e,Rn+=t,++wn}function wr(){var e,t;function n(n,r){var i=n-e,o=r-t,s=Math.sqrt(i*i+o*o);On+=s*(e+n)/2,Mn+=s*(t+r)/2,_n+=s,Rr(e=n,t=r)}br.point=function(r,i){br.point=n,Rr(e=r,t=i)}}function Or(){br.point=Rr}function Mr(){var e,t,n,r;function i(e,t){var i=e-n,o=t-r,s=Math.sqrt(i*i+o*o);On+=s*(n+e)/2,Mn+=s*(r+t)/2,_n+=s,Pn+=(s=r*e-n*t)*(n+e),Dn+=s*(r+t),kn+=3*s,Rr(n=e,r=t)}br.point=function(o,s){br.point=i,Rr(e=n=o,t=r=s)},br.lineEnd=function(){i(e,t)}}function _r(e){var t=4.5,n={point:r,lineStart:function(){n.point=i},lineEnd:s,polygonStart:function(){n.lineEnd=a},polygonEnd:function(){n.lineEnd=s,n.point=r},pointRadius:function(e){return t=e,n},result:B};function r(n,r){e.moveTo(n+t,r),e.arc(n,r,t,0,Me)}function i(t,r){e.moveTo(t,r),n.point=o}function o(t,n){e.lineTo(t,n)}function s(){n.point=r}function a(){e.closePath()}return n}function Pr(e){var t=.5,n=Math.cos(30*De),r=16;function i(e){return(r?s:o)(e)}function o(t){return Fr(t,(function(n,r){n=e(n,r),t.point(n[0],n[1])}))}function s(t){var n,i,o,s,l,u,c,p,d,f,h,g,m={point:v,lineStart:E,lineEnd:y,polygonStart:function(){t.polygonStart(),m.lineStart=T},polygonEnd:function(){t.polygonEnd(),m.lineStart=E}};function v(n,r){n=e(n,r),t.point(n[0],n[1])}function E(){p=NaN,m.point=x,t.lineStart()}function x(n,i){var o=Bn([n,i]),s=e(n,i);a(p,d,c,f,h,g,p=s[0],d=s[1],c=n,f=o[0],h=o[1],g=o[2],r,t),t.point(p,d)}function y(){m.point=v,t.lineEnd()}function T(){E(),m.point=N,m.lineEnd=C}function N(e,t){x(n=e,t),i=p,o=d,s=f,l=h,u=g,m.point=x}function C(){a(p,d,c,f,h,g,i,o,n,s,l,u,r,t),m.lineEnd=y,y()}return m}function a(r,i,o,s,l,u,c,p,d,f,h,g,m,v){var E=c-r,x=p-i,y=E*E+x*x;if(y>4*t&&m--){var T=s+f,C=l+h,S=u+g,I=Math.sqrt(T*T+C*C+S*S),L=Math.asin(S/=I),A=N(N(S)-1)<Re||N(o-d)<Re?(o+d)/2:Math.atan2(C,T),b=e(A,L),R=b[0],w=b[1],O=R-r,M=w-i,_=x*O-E*M;(_*_/y>t||N((E*O+x*M)/y-.5)>.3||s*f+l*h+u*g<n)&&(a(r,i,o,s,l,u,R,w,A,T/=I,C/=I,S,m,v),v.point(R,w),a(R,w,A,T,C,S,c,p,d,f,h,g,m,v))}}return i.precision=function(e){return arguments.length?(r=(t=e*e)>0&&16,i):Math.sqrt(t)},i}function Dr(e){var t=Pr((function(t,n){return e([t*ke,n*ke])}));return function(e){return Br(t(e))}}function kr(e){this.stream=e}function Fr(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function Gr(e){return Ur((function(){return e}))()}function Ur(e){var t,n,r,i,s,a,l=Pr((function(e,n){return[(e=t(e,n))[0]*u+i,s-e[1]*u]})),u=150,c=480,p=250,d=0,f=0,h=0,g=0,m=0,v=ur,E=k,x=null,y=null;function T(e){return[(e=r(e[0]*De,e[1]*De))[0]*u+i,s-e[1]*u]}function N(e){return(e=r.invert((e[0]-i)/u,(s-e[1])/u))&&[e[0]*ke,e[1]*ke]}function C(){r=er(n=Hr(h,g,m),t);var e=t(d,f);return i=c-e[0]*u,s=p+e[1]*u,S()}function S(){return a&&(a.valid=!1,a=null),T}return T.stream=function(e){return a&&(a.valid=!1),(a=Br(v(n,l(E(e))))).valid=!0,a},T.clipAngle=function(e){return arguments.length?(v=null==e?(x=e,ur):cr((x=+e)*De),S()):x},T.clipExtent=function(e){return arguments.length?(y=e,E=e?fr(e[0][0],e[0][1],e[1][0],e[1][1]):k,S()):y},T.scale=function(e){return arguments.length?(u=+e,C()):u},T.translate=function(e){return arguments.length?(c=+e[0],p=+e[1],C()):[c,p]},T.center=function(e){return arguments.length?(d=e[0]%360*De,f=e[1]%360*De,C()):[d*ke,f*ke]},T.rotate=function(e){return arguments.length?(h=e[0]%360*De,g=e[1]%360*De,m=e.length>2?e[2]%360*De:0,C()):[h*ke,g*ke,m*ke]},o.rebind(T,l,"precision"),function(){return t=e.apply(this,arguments),T.invert=t.invert&&N,C()}}function Br(e){return Fr(e,(function(t,n){e.point(t*De,n*De)}))}function jr(e,t){return[e,t]}function Vr(e,t){return[e>Oe?e-Me:e<-Oe?e+Me:e,t]}function Hr(e,t,n){return e?t||n?er($r(e),zr(t,n)):$r(e):t||n?zr(t,n):Vr}function qr(e){return function(t,n){return[(t+=e)>Oe?t-Me:t<-Oe?t+Me:t,n]}}function $r(e){var t=qr(e);return t.invert=qr(-e),t}function zr(e,t){var n=Math.cos(e),r=Math.sin(e),i=Math.cos(t),o=Math.sin(t);function s(e,t){var s=Math.cos(t),a=Math.cos(e)*s,l=Math.sin(e)*s,u=Math.sin(t),c=u*n+a*r;return[Math.atan2(l*i-c*o,a*n-u*r),Be(c*i+l*o)]}return s.invert=function(e,t){var s=Math.cos(t),a=Math.cos(e)*s,l=Math.sin(e)*s,u=Math.sin(t),c=u*i-l*o;return[Math.atan2(l*i+u*o,a*n+c*r),Be(c*n-a*r)]},s}function Wr(e,t){var n=Math.cos(e),r=Math.sin(e);return function(i,o,s,a){var l=s*t;null!=i?(i=Qr(n,i),o=Qr(n,o),(s>0?i<o:i>o)&&(i+=s*Me)):(i=e+s*Me,o=e-.5*l);for(var u,c=i;s>0?c>o:c<o;c-=l)a.point((u=zn([n,-r*Math.cos(c),-r*Math.sin(c)]))[0],u[1])}}function Qr(e,t){var n=Bn(t);n[0]-=e,$n(n);var r=Ue(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Re)%(2*Math.PI)}function Yr(e,t,n){var r=o.range(e,t-Re,n).concat(t);return function(e){return r.map((function(t){return[e,t]}))}}function Xr(e,t,n){var r=o.range(e,t-Re,n).concat(t);return function(e){return r.map((function(t){return[t,e]}))}}function Kr(e){return e.source}function Zr(e){return e.target}o.geo.path=function(){var e,t,n,r,i,s=4.5;function a(e){return e&&("function"==typeof s&&r.pointRadius(+s.apply(this,arguments)),i&&i.valid||(i=n(r)),o.geo.stream(e,i)),r.result()}function l(){return i=null,a}return a.area=function(e){return mr=0,o.geo.stream(e,n(Nr)),mr},a.centroid=function(e){return bn=Rn=wn=On=Mn=_n=Pn=Dn=kn=0,o.geo.stream(e,n(br)),kn?[Pn/kn,Dn/kn]:_n?[On/_n,Mn/_n]:wn?[bn/wn,Rn/wn]:[NaN,NaN]},a.bounds=function(e){return yr=Tr=-(Er=xr=1/0),o.geo.stream(e,n(Sr)),[[Er,xr],[yr,Tr]]},a.projection=function(t){return arguments.length?(n=(e=t)?t.stream||Dr(t):k,l()):e},a.context=function(e){return arguments.length?(r=null==(t=e)?new Ir:new _r(e),"function"!=typeof s&&r.pointRadius(s),l()):t},a.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(r.pointRadius(+e),+e),a):s},a.projection(o.geo.albersUsa()).context(null)},o.geo.transform=function(e){return{stream:function(t){var n=new kr(t);for(var r in e)n[r]=e[r];return n}}},kr.prototype={point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},o.geo.projection=Gr,o.geo.projectionMutator=Ur,(o.geo.equirectangular=function(){return Gr(jr)}).raw=jr.invert=jr,o.geo.rotation=function(e){function t(t){return(t=e(t[0]*De,t[1]*De))[0]*=ke,t[1]*=ke,t}return e=Hr(e[0]%360*De,e[1]*De,e.length>2?e[2]*De:0),t.invert=function(t){return(t=e.invert(t[0]*De,t[1]*De))[0]*=ke,t[1]*=ke,t},t},Vr.invert=jr,o.geo.circle=function(){var e,t,n=[0,0],r=6;function i(){var e="function"==typeof n?n.apply(this,arguments):n,r=Hr(-e[0]*De,-e[1]*De,0).invert,i=[];return t(null,null,1,{point:function(e,t){i.push(e=r(e,t)),e[0]*=ke,e[1]*=ke}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(e){return arguments.length?(n=e,i):n},i.angle=function(n){return arguments.length?(t=Wr((e=+n)*De,r*De),i):e},i.precision=function(n){return arguments.length?(t=Wr(e*De,(r=+n)*De),i):r},i.angle(90)},o.geo.distance=function(e,t){var n,r=(t[0]-e[0])*De,i=e[1]*De,o=t[1]*De,s=Math.sin(r),a=Math.cos(r),l=Math.sin(i),u=Math.cos(i),c=Math.sin(o),p=Math.cos(o);return Math.atan2(Math.sqrt((n=p*s)*n+(n=u*c-l*p*a)*n),l*c+u*p*a)},o.geo.graticule=function(){var e,t,n,r,i,s,a,l,u,c,p,d,f=10,h=f,g=90,m=360,v=2.5;function E(){return{type:"MultiLineString",coordinates:x()}}function x(){return o.range(Math.ceil(r/g)*g,n,g).map(p).concat(o.range(Math.ceil(l/m)*m,a,m).map(d)).concat(o.range(Math.ceil(t/f)*f,e,f).filter((function(e){return N(e%g)>Re})).map(u)).concat(o.range(Math.ceil(s/h)*h,i,h).filter((function(e){return N(e%m)>Re})).map(c))}return E.lines=function(){return x().map((function(e){return{type:"LineString",coordinates:e}}))},E.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(d(a).slice(1),p(n).reverse().slice(1),d(l).reverse().slice(1))]}},E.extent=function(e){return arguments.length?E.majorExtent(e).minorExtent(e):E.minorExtent()},E.majorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],l=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),l>a&&(e=l,l=a,a=e),E.precision(v)):[[r,l],[n,a]]},E.minorExtent=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],s=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),s>i&&(n=s,s=i,i=n),E.precision(v)):[[t,s],[e,i]]},E.step=function(e){return arguments.length?E.majorStep(e).minorStep(e):E.minorStep()},E.majorStep=function(e){return arguments.length?(g=+e[0],m=+e[1],E):[g,m]},E.minorStep=function(e){return arguments.length?(f=+e[0],h=+e[1],E):[f,h]},E.precision=function(o){return arguments.length?(v=+o,u=Yr(s,i,90),c=Xr(t,e,v),p=Yr(l,a,90),d=Xr(r,n,v),E):v},E.majorExtent([[-180,-90+Re],[180,90-Re]]).minorExtent([[-180,-80-Re],[180,80+Re]])},o.geo.greatArc=function(){var e,t,n=Kr,r=Zr;function i(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),t||r.apply(this,arguments)]}}return i.distance=function(){return o.geo.distance(e||n.apply(this,arguments),t||r.apply(this,arguments))},i.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,i):n},i.target=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,i):r},i.precision=function(){return arguments.length?i:0},i},o.geo.interpolate=function(e,t){return n=e[0]*De,r=e[1]*De,i=t[0]*De,o=t[1]*De,s=Math.cos(r),a=Math.sin(r),l=Math.cos(o),u=Math.sin(o),c=s*Math.cos(n),p=s*Math.sin(n),d=l*Math.cos(i),f=l*Math.sin(i),h=2*Math.asin(Math.sqrt(Ve(o-r)+s*l*Ve(i-n))),g=1/Math.sin(h),(m=h?function(e){var t=Math.sin(e*=h)*g,n=Math.sin(h-e)*g,r=n*c+t*d,i=n*p+t*f,o=n*a+t*u;return[Math.atan2(i,r)*ke,Math.atan2(o,Math.sqrt(r*r+i*i))*ke]}:function(){return[n*ke,r*ke]}).distance=h,m;var n,r,i,o,s,a,l,u,c,p,d,f,h,g,m},o.geo.length=function(e){return Ar=0,o.geo.stream(e,Jr),Ar};var Jr={sphere:B,point:B,lineStart:function(){var e,t,n;function r(r,i){var o=Math.sin(i*=De),s=Math.cos(i),a=N((r*=De)-e),l=Math.cos(a);Ar+=Math.atan2(Math.sqrt((a=s*Math.sin(a))*a+(a=n*o-t*s*l)*a),t*o+n*s*l),e=r,t=o,n=s}Jr.point=function(i,o){e=i*De,t=Math.sin(o*=De),n=Math.cos(o),Jr.point=r},Jr.lineEnd=function(){Jr.point=Jr.lineEnd=B}},lineEnd:B,polygonStart:B,polygonEnd:B};function ei(e,t){function n(t,n){var r=Math.cos(t),i=Math.cos(n),o=e(r*i);return[o*i*Math.sin(t),o*Math.sin(n)]}return n.invert=function(e,n){var r=Math.sqrt(e*e+n*n),i=t(r),o=Math.sin(i),s=Math.cos(i);return[Math.atan2(e*o,r*s),Math.asin(r&&n*o/r)]},n}var ti=ei((function(e){return Math.sqrt(2/(1+e))}),(function(e){return 2*Math.asin(e/2)}));(o.geo.azimuthalEqualArea=function(){return Gr(ti)}).raw=ti;var ni=ei((function(e){var t=Math.acos(e);return t&&t/Math.sin(t)}),k);function ri(e,t){var n=Math.cos(e),r=function(e){return Math.tan(Oe/4+e/2)},i=e===t?Math.sin(e):Math.log(n/Math.cos(t))/Math.log(r(t)/r(e)),o=n*Math.pow(r(e),i)/i;if(!i)return si;function s(e,t){o>0?t<-Pe+Re&&(t=-Pe+Re):t>Pe-Re&&(t=Pe-Re);var n=o/Math.pow(r(t),i);return[n*Math.sin(i*e),o-n*Math.cos(i*e)]}return s.invert=function(e,t){var n=o-t,r=Fe(i)*Math.sqrt(e*e+n*n);return[Math.atan2(e,n)/i,2*Math.atan(Math.pow(o/r,1/i))-Pe]},s}function ii(e,t){var n=Math.cos(e),r=e===t?Math.sin(e):(n-Math.cos(t))/(t-e),i=n/r+e;if(N(r)<Re)return jr;function o(e,t){var n=i-t;return[n*Math.sin(r*e),i-n*Math.cos(r*e)]}return o.invert=function(e,t){var n=i-t;return[Math.atan2(e,n)/r,i-Fe(r)*Math.sqrt(e*e+n*n)]},o}(o.geo.azimuthalEquidistant=function(){return Gr(ni)}).raw=ni,(o.geo.conicConformal=function(){return hr(ri)}).raw=ri,(o.geo.conicEquidistant=function(){return hr(ii)}).raw=ii;var oi=ei((function(e){return 1/e}),Math.atan);function si(e,t){return[e,Math.log(Math.tan(Oe/4+t/2))]}function ai(e){var t,n=Gr(e),r=n.scale,i=n.translate,o=n.clipExtent;return n.scale=function(){var e=r.apply(n,arguments);return e===n?t?n.clipExtent(null):n:e},n.translate=function(){var e=i.apply(n,arguments);return e===n?t?n.clipExtent(null):n:e},n.clipExtent=function(e){var s=o.apply(n,arguments);if(s===n){if(t=null==e){var a=Oe*r(),l=i();o([[l[0]-a,l[1]-a],[l[0]+a,l[1]+a]])}}else t&&(s=null);return s},n.clipExtent(null)}(o.geo.gnomonic=function(){return Gr(oi)}).raw=oi,si.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-Pe]},(o.geo.mercator=function(){return ai(si)}).raw=si;var li=ei((function(){return 1}),Math.asin);(o.geo.orthographic=function(){return Gr(li)}).raw=li;var ui=ei((function(e){return 1/(1+e)}),(function(e){return 2*Math.atan(e)}));function ci(e,t){return[Math.log(Math.tan(Oe/4+t/2)),-e]}function pi(e){return e[0]}function di(e){return e[1]}function fi(e){for(var t=e.length,n=[0,1],r=2,i=2;i<t;i++){for(;r>1&&Ge(e[n[r-2]],e[n[r-1]],e[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function hi(e,t){return e[0]-t[0]||e[1]-t[1]}(o.geo.stereographic=function(){return Gr(ui)}).raw=ui,ci.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-Pe]},(o.geo.transverseMercator=function(){var e=ai(ci),t=e.center,n=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return e?n([e[0],e[1],e.length>2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90])}).raw=ci,o.geom={},o.geom.hull=function(e){var t=pi,n=di;if(arguments.length)return r(e);function r(e){if(e.length<3)return[];var r,i=Nt(t),o=Nt(n),s=e.length,a=[],l=[];for(r=0;r<s;r++)a.push([+i.call(this,e[r],r),+o.call(this,e[r],r),r]);for(a.sort(hi),r=0;r<s;r++)l.push([a[r][0],-a[r][1]]);var u=fi(a),c=fi(l),p=c[0]===u[0],d=c[c.length-1]===u[u.length-1],f=[];for(r=u.length-1;r>=0;--r)f.push(e[a[u[r]][2]]);for(r=+p;r<c.length-d;++r)f.push(e[a[c[r]][2]]);return f}return r.x=function(e){return arguments.length?(t=e,r):t},r.y=function(e){return arguments.length?(n=e,r):n},r},o.geom.polygon=function(e){return W(e,gi),e};var gi=o.geom.polygon.prototype=[];function mi(e,t,n){return(n[0]-t[0])*(e[1]-t[1])<(n[1]-t[1])*(e[0]-t[0])}function vi(e,t,n,r){var i=e[0],o=n[0],s=t[0]-i,a=r[0]-o,l=e[1],u=n[1],c=t[1]-l,p=r[1]-u,d=(a*(l-u)-p*(i-o))/(p*s-a*c);return[i+d*s,l+d*c]}function Ei(e){var t=e[0],n=e[e.length-1];return!(t[0]-n[0]||t[1]-n[1])}gi.area=function(){for(var e,t=-1,n=this.length,r=this[n-1],i=0;++t<n;)e=r,r=this[t],i+=e[1]*r[0]-e[0]*r[1];return.5*i},gi.centroid=function(e){var t,n,r=-1,i=this.length,o=0,s=0,a=this[i-1];for(arguments.length||(e=-1/(6*this.area()));++r<i;)t=a,a=this[r],n=t[0]*a[1]-a[0]*t[1],o+=(t[0]+a[0])*n,s+=(t[1]+a[1])*n;return[o*e,s*e]},gi.clip=function(e){for(var t,n,r,i,o,s,a=Ei(e),l=-1,u=this.length-Ei(this),c=this[u-1];++l<u;){for(t=e.slice(),e.length=0,i=this[l],o=t[(r=t.length-a)-1],n=-1;++n<r;)mi(s=t[n],c,i)?(mi(o,c,i)||e.push(vi(o,s,c,i)),e.push(s)):mi(o,c,i)&&e.push(vi(o,s,c,i)),o=s;a&&e.push(e[0]),c=i}return e};var xi,yi,Ti,Ni,Ci,Si=[],Ii=[];function Li(){$i(this),this.edge=this.site=this.circle=null}function Ai(e){var t=Si.pop()||new Li;return t.site=e,t}function bi(e){Fi(e),Ti.remove(e),Si.push(e),$i(e)}function Ri(e){var t=e.circle,n=t.x,r=t.cy,i={x:n,y:r},o=e.P,s=e.N,a=[e];bi(e);for(var l=o;l.circle&&N(n-l.circle.x)<Re&&N(r-l.circle.cy)<Re;)o=l.P,a.unshift(l),bi(l),l=o;a.unshift(l),Fi(l);for(var u=s;u.circle&&N(n-u.circle.x)<Re&&N(r-u.circle.cy)<Re;)s=u.N,a.push(u),bi(u),u=s;a.push(u),Fi(u);var c,p=a.length;for(c=1;c<p;++c)u=a[c],l=a[c-1],Vi(u.edge,l.site,u.site,i);l=a[0],(u=a[p-1]).edge=Bi(l.site,u.site,null,i),ki(l),ki(u)}function wi(e){for(var t,n,r,i,o=e.x,s=e.y,a=Ti._;a;)if((r=Oi(a,s)-o)>Re)a=a.L;else{if(!((i=o-Mi(a,s))>Re)){r>-Re?(t=a.P,n=a):i>-Re?(t=a,n=a.N):t=n=a;break}if(!a.R){t=a;break}a=a.R}var l=Ai(e);if(Ti.insert(t,l),t||n){if(t===n)return Fi(t),n=Ai(t.site),Ti.insert(l,n),l.edge=n.edge=Bi(t.site,l.site),ki(t),void ki(n);if(n){Fi(t),Fi(n);var u=t.site,c=u.x,p=u.y,d=e.x-c,f=e.y-p,h=n.site,g=h.x-c,m=h.y-p,v=2*(d*m-f*g),E=d*d+f*f,x=g*g+m*m,y={x:(m*E-f*x)/v+c,y:(d*x-g*E)/v+p};Vi(n.edge,u,h,y),l.edge=Bi(u,e,null,y),n.edge=Bi(e,h,null,y),ki(t),ki(n)}else l.edge=Bi(t.site,l.site)}}function Oi(e,t){var n=e.site,r=n.x,i=n.y,o=i-t;if(!o)return r;var s=e.P;if(!s)return-1/0;var a=(n=s.site).x,l=n.y,u=l-t;if(!u)return a;var c=a-r,p=1/o-1/u,d=c/u;return p?(-d+Math.sqrt(d*d-2*p*(c*c/(-2*u)-l+u/2+i-o/2)))/p+r:(r+a)/2}function Mi(e,t){var n=e.N;if(n)return Oi(n,t);var r=e.site;return r.y===t?r.x:1/0}function _i(e){this.site=e,this.edges=[]}function Pi(e,t){return t.angle-e.angle}function Di(){$i(this),this.x=this.y=this.arc=this.site=this.cy=null}function ki(e){var t=e.P,n=e.N;if(t&&n){var r=t.site,i=e.site,o=n.site;if(r!==o){var s=i.x,a=i.y,l=r.x-s,u=r.y-a,c=o.x-s,p=2*(l*(m=o.y-a)-u*c);if(!(p>=-we)){var d=l*l+u*u,f=c*c+m*m,h=(m*d-u*f)/p,g=(l*f-c*d)/p,m=g+a,v=Ii.pop()||new Di;v.arc=e,v.site=i,v.x=h+s,v.y=m+Math.sqrt(h*h+g*g),v.cy=m,e.circle=v;for(var E=null,x=Ci._;x;)if(v.y<x.y||v.y===x.y&&v.x<=x.x){if(!x.L){E=x.P;break}x=x.L}else{if(!x.R){E=x;break}x=x.R}Ci.insert(E,v),E||(Ni=v)}}}}function Fi(e){var t=e.circle;t&&(t.P||(Ni=t.N),Ci.remove(t),Ii.push(t),$i(t),e.circle=null)}function Gi(e,t){var n=e.b;if(n)return!0;var r,i,o=e.a,s=t[0][0],a=t[1][0],l=t[0][1],u=t[1][1],c=e.l,p=e.r,d=c.x,f=c.y,h=p.x,g=p.y,m=(d+h)/2,v=(f+g)/2;if(g===f){if(m<s||m>=a)return;if(d>h){if(o){if(o.y>=u)return}else o={x:m,y:l};n={x:m,y:u}}else{if(o){if(o.y<l)return}else o={x:m,y:u};n={x:m,y:l}}}else if(i=v-(r=(d-h)/(g-f))*m,r<-1||r>1)if(d>h){if(o){if(o.y>=u)return}else o={x:(l-i)/r,y:l};n={x:(u-i)/r,y:u}}else{if(o){if(o.y<l)return}else o={x:(u-i)/r,y:u};n={x:(l-i)/r,y:l}}else if(f<g){if(o){if(o.x>=a)return}else o={x:s,y:r*s+i};n={x:a,y:r*a+i}}else{if(o){if(o.x<s)return}else o={x:a,y:r*a+i};n={x:s,y:r*s+i}}return e.a=o,e.b=n,!0}function Ui(e,t){this.l=e,this.r=t,this.a=this.b=null}function Bi(e,t,n,r){var i=new Ui(e,t);return xi.push(i),n&&Vi(i,e,t,n),r&&Vi(i,t,e,r),yi[e.i].edges.push(new Hi(i,e,t)),yi[t.i].edges.push(new Hi(i,t,e)),i}function ji(e,t,n){var r=new Ui(e,null);return r.a=t,r.b=n,xi.push(r),r}function Vi(e,t,n,r){e.a||e.b?e.l===n?e.b=r:e.a=r:(e.a=r,e.l=t,e.r=n)}function Hi(e,t,n){var r=e.a,i=e.b;this.edge=e,this.site=t,this.angle=n?Math.atan2(n.y-t.y,n.x-t.x):e.l===t?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function qi(){this._=null}function $i(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function zi(e,t){var n=t,r=t.R,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Wi(e,t){var n=t,r=t.L,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Qi(e){for(;e.L;)e=e.L;return e}function Yi(e,t){var n,r,i,o=e.sort(Xi).pop();for(xi=[],yi=new Array(e.length),Ti=new qi,Ci=new qi;;)if(i=Ni,o&&(!i||o.y<i.y||o.y===i.y&&o.x<i.x))o.x===n&&o.y===r||(yi[o.i]=new _i(o),wi(o),n=o.x,r=o.y),o=e.pop();else{if(!i)break;Ri(i.arc)}t&&(function(e){for(var t,n=xi,r=pr(e[0][0],e[0][1],e[1][0],e[1][1]),i=n.length;i--;)(!Gi(t=n[i],e)||!r(t)||N(t.a.x-t.b.x)<Re&&N(t.a.y-t.b.y)<Re)&&(t.a=t.b=null,n.splice(i,1))}(t),function(e){for(var t,n,r,i,o,s,a,l,u,c,p=e[0][0],d=e[1][0],f=e[0][1],h=e[1][1],g=yi,m=g.length;m--;)if((o=g[m])&&o.prepare())for(l=(a=o.edges).length,s=0;s<l;)r=(c=a[s].end()).x,i=c.y,t=(u=a[++s%l].start()).x,n=u.y,(N(r-t)>Re||N(i-n)>Re)&&(a.splice(s,0,new Hi(ji(o.site,c,N(r-p)<Re&&h-i>Re?{x:p,y:N(t-p)<Re?n:h}:N(i-h)<Re&&d-r>Re?{x:N(n-h)<Re?t:d,y:h}:N(r-d)<Re&&i-f>Re?{x:d,y:N(t-d)<Re?n:f}:N(i-f)<Re&&r-p>Re?{x:N(n-f)<Re?t:p,y:f}:null),o.site,null)),++l)}(t));var s={cells:yi,edges:xi};return Ti=Ci=xi=yi=null,s}function Xi(e,t){return t.y-e.y||t.x-e.x}_i.prototype.prepare=function(){for(var e,t=this.edges,n=t.length;n--;)(e=t[n].edge).b&&e.a||t.splice(n,1);return t.sort(Pi),t.length},Hi.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},qi.prototype={insert:function(e,t){var n,r,i;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=Qi(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);for(t.L=t.R=null,t.U=n,t.C=!0,e=t;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.R&&(zi(this,n),n=(e=n).U),n.C=!1,r.C=!0,Wi(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.L&&(Wi(this,n),n=(e=n).U),n.C=!1,r.C=!0,zi(this,r)),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,n,r,i=e.U,o=e.L,s=e.R;if(n=o?s?Qi(s):o:s,i?i.L===e?i.L=n:i.R=n:this._=n,o&&s?(r=n.C,n.C=e.C,n.L=o,o.U=n,n!==s?(i=n.U,n.U=e.U,e=n.R,i.L=e,n.R=s,s.U=n):(n.U=i,i=n,e=n.R)):(r=e.C,e=n),e&&(e.U=i),!r)if(e&&e.C)e.C=!1;else{do{if(e===this._)break;if(e===i.L){if((t=i.R).C&&(t.C=!1,i.C=!0,zi(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,Wi(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,zi(this,i),e=this._;break}}else if((t=i.L).C&&(t.C=!1,i.C=!0,Wi(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,zi(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,Wi(this,i),e=this._;break}t.C=!0,e=i,i=i.U}while(!e.C);e&&(e.C=!1)}}},o.geom.voronoi=function(e){var t=pi,n=di,r=t,i=n,o=Ki;if(e)return s(e);function s(e){var t=new Array(e.length),n=o[0][0],r=o[0][1],i=o[1][0],s=o[1][1];return Yi(a(e),o).cells.forEach((function(o,a){var l=o.edges,u=o.site;(t[a]=l.length?l.map((function(e){var t=e.start();return[t.x,t.y]})):u.x>=n&&u.x<=i&&u.y>=r&&u.y<=s?[[n,s],[i,s],[i,r],[n,r]]:[]).point=e[a]})),t}function a(e){return e.map((function(e,t){return{x:Math.round(r(e,t)/Re)*Re,y:Math.round(i(e,t)/Re)*Re,i:t}}))}return s.links=function(e){return Yi(a(e)).edges.filter((function(e){return e.l&&e.r})).map((function(t){return{source:e[t.l.i],target:e[t.r.i]}}))},s.triangles=function(e){var t=[];return Yi(a(e)).cells.forEach((function(n,r){for(var i,o,s,a,l=n.site,u=n.edges.sort(Pi),c=-1,p=u.length,d=u[p-1].edge,f=d.l===l?d.r:d.l;++c<p;)d,i=f,f=(d=u[c].edge).l===l?d.r:d.l,r<i.i&&r<f.i&&(s=i,a=f,((o=l).x-a.x)*(s.y-o.y)-(o.x-s.x)*(a.y-o.y)<0)&&t.push([e[r],e[i.i],e[f.i]])})),t},s.x=function(e){return arguments.length?(r=Nt(t=e),s):t},s.y=function(e){return arguments.length?(i=Nt(n=e),s):n},s.clipExtent=function(e){return arguments.length?(o=null==e?Ki:e,s):o===Ki?null:o},s.size=function(e){return arguments.length?s.clipExtent(e&&[[0,0],e]):o===Ki?null:o&&o[1]},s};var Ki=[[-1e6,-1e6],[1e6,1e6]];function Zi(e){return e.x}function Ji(e){return e.y}function eo(e,t,n,r,i,o){if(!e(t,n,r,i,o)){var s=.5*(n+i),a=.5*(r+o),l=t.nodes;l[0]&&eo(e,l[0],n,r,s,a),l[1]&&eo(e,l[1],s,r,i,a),l[2]&&eo(e,l[2],n,a,s,o),l[3]&&eo(e,l[3],s,a,i,o)}}function to(e,t,n,r,i,o,s){var a,l=1/0;return function e(u,c,p,d,f){if(!(c>o||p>s||d<r||f<i)){if(h=u.point){var h,g=t-u.x,m=n-u.y,v=g*g+m*m;if(v<l){var E=Math.sqrt(l=v);r=t-E,i=n-E,o=t+E,s=n+E,a=h}}for(var x=u.nodes,y=.5*(c+d),T=.5*(p+f),N=(n>=T)<<1|t>=y,C=N+4;N<C;++N)if(u=x[3&N])switch(3&N){case 0:e(u,c,p,y,T);break;case 1:e(u,y,p,d,T);break;case 2:e(u,c,T,y,f);break;case 3:e(u,y,T,d,f)}}}(e,r,i,o,s),a}function no(e,t){e=o.rgb(e),t=o.rgb(t);var n=e.r,r=e.g,i=e.b,s=t.r-n,a=t.g-r,l=t.b-i;return function(e){return"#"+gt(Math.round(n+s*e))+gt(Math.round(r+a*e))+gt(Math.round(i+l*e))}}function ro(e,t){var n,r={},i={};for(n in e)n in t?r[n]=lo(e[n],t[n]):i[n]=e[n];for(n in t)n in e||(i[n]=t[n]);return function(e){for(n in r)i[n]=r[n](e);return i}}function io(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function oo(e,t){var n,r,i,o=so.lastIndex=ao.lastIndex=0,s=-1,a=[],l=[];for(e+="",t+="";(n=so.exec(e))&&(r=ao.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:io(n,r)})),o=ao.lastIndex;return o<t.length&&(i=t.slice(o),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?(t=l[0].x,function(e){return t(e)+""}):function(){return t}:(t=l.length,function(e){for(var n,r=0;r<t;++r)a[(n=l[r]).i]=n.x(e);return a.join("")})}o.geom.delaunay=function(e){return o.geom.voronoi().triangles(e)},o.geom.quadtree=function(e,t,n,r,i){var o,s=pi,a=di;if(o=arguments.length)return s=Zi,a=Ji,3===o&&(i=n,r=t,n=t=0),l(e);function l(e){var l,u,c,p,d,f,h,g,m,v=Nt(s),E=Nt(a);if(null!=t)f=t,h=n,g=r,m=i;else if(g=m=-(f=h=1/0),u=[],c=[],d=e.length,o)for(p=0;p<d;++p)(l=e[p]).x<f&&(f=l.x),l.y<h&&(h=l.y),l.x>g&&(g=l.x),l.y>m&&(m=l.y),u.push(l.x),c.push(l.y);else for(p=0;p<d;++p){var x=+v(l=e[p],p),y=+E(l,p);x<f&&(f=x),y<h&&(h=y),x>g&&(g=x),y>m&&(m=y),u.push(x),c.push(y)}var T=g-f,C=m-h;function S(e,t,n,r,i,o,s,a){if(!isNaN(n)&&!isNaN(r))if(e.leaf){var l=e.x,u=e.y;if(null!=l)if(N(l-n)+N(u-r)<.01)I(e,t,n,r,i,o,s,a);else{var c=e.point;e.x=e.y=e.point=null,I(e,c,l,u,i,o,s,a),I(e,t,n,r,i,o,s,a)}else e.x=n,e.y=r,e.point=t}else I(e,t,n,r,i,o,s,a)}function I(e,t,n,r,i,o,s,a){var l=.5*(i+s),u=.5*(o+a),c=n>=l,p=r>=u,d=p<<1|c;e.leaf=!1,c?i=l:s=l,p?o=u:a=u,S(e=e.nodes[d]||(e.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,n,r,i,o,s,a)}T>C?m=h+T:g=f+C;var L={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){S(L,e,+v(e,++p),+E(e,p),f,h,g,m)},visit:function(e){eo(e,L,f,h,g,m)},find:function(e){return to(L,e[0],e[1],f,h,g,m)}};if(p=-1,null==t){for(;++p<d;)S(L,e[p],u[p],c[p],f,h,g,m);--p}else e.forEach(L.add);return u=c=e=l=null,L}return l.x=function(e){return arguments.length?(s=e,l):s},l.y=function(e){return arguments.length?(a=e,l):a},l.extent=function(e){return arguments.length?(null==e?t=n=r=i=null:(t=+e[0][0],n=+e[0][1],r=+e[1][0],i=+e[1][1]),l):null==t?null:[[t,n],[r,i]]},l.size=function(e){return arguments.length?(null==e?t=n=r=i=null:(t=n=0,r=+e[0],i=+e[1]),l):null==t?null:[r-t,i-n]},l},o.interpolateRgb=no,o.interpolateObject=ro,o.interpolateNumber=io,o.interpolateString=oo;var so=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ao=new RegExp(so.source,"g");function lo(e,t){for(var n,r=o.interpolators.length;--r>=0&&!(n=o.interpolators[r](e,t)););return n}function uo(e,t){var n,r=[],i=[],o=e.length,s=t.length,a=Math.min(e.length,t.length);for(n=0;n<a;++n)r.push(lo(e[n],t[n]));for(;n<o;++n)i[n]=e[n];for(;n<s;++n)i[n]=t[n];return function(e){for(n=0;n<a;++n)i[n]=r[n](e);return i}}o.interpolate=lo,o.interpolators=[function(e,t){var n=typeof t;return("string"===n?Tt.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?no:oo:t instanceof We?no:Array.isArray(t)?uo:"object"===n&&isNaN(t)?ro:io)(e,t)}],o.interpolateArray=uo;var co=function(){return k},po=o.map({linear:co,poly:function(e){return function(t){return Math.pow(t,e)}},quad:function(){return vo},cubic:function(){return Eo},sin:function(){return yo},exp:function(){return To},circle:function(){return No},elastic:function(e,t){var n;arguments.length<2&&(t=.45);arguments.length?n=t/Me*Math.asin(1/e):(e=1,n=t/4);return function(r){return 1+e*Math.pow(2,-10*r)*Math.sin((r-n)*Me/t)}},back:function(e){e||(e=1.70158);return function(t){return t*t*((e+1)*t-e)}},bounce:function(){return Co}}),fo=o.map({in:k,out:go,"in-out":mo,"out-in":function(e){return mo(go(e))}});function ho(e){return function(t){return t<=0?0:t>=1?1:e(t)}}function go(e){return function(t){return 1-e(1-t)}}function mo(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function vo(e){return e*e}function Eo(e){return e*e*e}function xo(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function yo(e){return 1-Math.cos(e*Pe)}function To(e){return Math.pow(2,10*(e-1))}function No(e){return 1-Math.sqrt(1-e*e)}function Co(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function So(e,t){return t-=e,function(n){return Math.round(e+t*n)}}function Io(e){var t,n,r,i=[e.a,e.b],o=[e.c,e.d],s=Ao(i),a=Lo(i,o),l=Ao(((t=o)[0]+=(r=-a)*(n=i)[0],t[1]+=r*n[1],t))||0;i[0]*o[1]<o[0]*i[1]&&(i[0]*=-1,i[1]*=-1,s*=-1,a*=-1),this.rotate=(s?Math.atan2(i[1],i[0]):Math.atan2(-o[0],o[1]))*ke,this.translate=[e.e,e.f],this.scale=[s,l],this.skew=l?Math.atan2(a,l)*ke:0}function Lo(e,t){return e[0]*t[0]+e[1]*t[1]}function Ao(e){var t=Math.sqrt(Lo(e,e));return t&&(e[0]/=t,e[1]/=t),t}o.ease=function(e){var t=e.indexOf("-"),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t+1):"in";return n=po.get(n)||co,ho((r=fo.get(r)||k)(n.apply(null,s.call(arguments,1))))},o.interpolateHcl=function(e,t){e=o.hcl(e),t=o.hcl(t);var n=e.h,r=e.c,i=e.l,s=t.h-n,a=t.c-r,l=t.l-i;isNaN(a)&&(a=0,r=isNaN(r)?t.c:r);isNaN(s)?(s=0,n=isNaN(n)?t.h:n):s>180?s-=360:s<-180&&(s+=360);return function(e){return Je(n+s*e,r+a*e,i+l*e)+""}},o.interpolateHsl=function(e,t){e=o.hsl(e),t=o.hsl(t);var n=e.h,r=e.s,i=e.l,s=t.h-n,a=t.s-r,l=t.l-i;isNaN(a)&&(a=0,r=isNaN(r)?t.s:r);isNaN(s)?(s=0,n=isNaN(n)?t.h:n):s>180?s-=360:s<-180&&(s+=360);return function(e){return Xe(n+s*e,r+a*e,i+l*e)+""}},o.interpolateHslLong=function(e,t){e=o.hsl(e),t=o.hsl(t);var n=e.h,r=e.s,i=e.l,s=t.h-n,a=t.s-r,l=t.l-i;isNaN(a)&&(a=0,r=isNaN(r)?t.s:r);isNaN(s)&&(s=0,n=isNaN(n)?t.h:n);return function(e){return Xe(n+s*e,r+a*e,i+l*e)+""}},o.interpolateLab=function(e,t){e=o.lab(e),t=o.lab(t);var n=e.l,r=e.a,i=e.b,s=t.l-n,a=t.a-r,l=t.b-i;return function(e){return st(n+s*e,r+a*e,i+l*e)+""}},o.interpolateRound=So,o.transform=function(e){var t=l.createElementNS(o.ns.prefix.svg,"g");return(o.transform=function(e){if(null!=e){t.setAttribute("transform",e);var n=t.transform.baseVal.consolidate()}return new Io(n?n.matrix:bo)})(e)},Io.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var bo={a:1,b:0,c:0,d:1,e:0,f:0};function Ro(e){return e.length?e.pop()+",":""}function wo(e,t){var n=[],r=[];return e=o.transform(e),t=o.transform(t),function(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push("translate(",null,",",null,")");r.push({i:i-4,x:io(e[0],t[0])},{i:i-2,x:io(e[1],t[1])})}else(t[0]||t[1])&&n.push("translate("+t+")")}(e.translate,t.translate,n,r),function(e,t,n,r){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),r.push({i:n.push(Ro(n)+"rotate(",null,")")-2,x:io(e,t)})):t&&n.push(Ro(n)+"rotate("+t+")")}(e.rotate,t.rotate,n,r),function(e,t,n,r){e!==t?r.push({i:n.push(Ro(n)+"skewX(",null,")")-2,x:io(e,t)}):t&&n.push(Ro(n)+"skewX("+t+")")}(e.skew,t.skew,n,r),function(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push(Ro(n)+"scale(",null,",",null,")");r.push({i:i-4,x:io(e[0],t[0])},{i:i-2,x:io(e[1],t[1])})}else 1===t[0]&&1===t[1]||n.push(Ro(n)+"scale("+t+")")}(e.scale,t.scale,n,r),e=t=null,function(e){for(var t,i=-1,o=r.length;++i<o;)n[(t=r[i]).i]=t.x(e);return n.join("")}}function Oo(e,t){return t=(t-=e=+e)||1/t,function(n){return(n-e)/t}}function Mo(e,t){return t=(t-=e=+e)||1/t,function(n){return Math.max(0,Math.min(1,(n-e)/t))}}function _o(e){for(var t=e.source,n=e.target,r=function(e,t){if(e===t)return e;var n=Po(e),r=Po(t),i=n.pop(),o=r.pop(),s=null;for(;i===o;)s=i,i=n.pop(),o=r.pop();return s}(t,n),i=[t];t!==r;)t=t.parent,i.push(t);for(var o=i.length;n!==r;)i.splice(o,0,n),n=n.parent;return i}function Po(e){for(var t=[],n=e.parent;null!=n;)t.push(e),e=n,n=n.parent;return t.push(e),t}function Do(e){e.fixed|=2}function ko(e){e.fixed&=-7}function Fo(e){e.fixed|=4,e.px=e.x,e.py=e.y}function Go(e){e.fixed&=-5}o.interpolateTransform=wo,o.layout={},o.layout.bundle=function(){return function(e){for(var t=[],n=-1,r=e.length;++n<r;)t.push(_o(e[n]));return t}},o.layout.chord=function(){var e,t,n,r,i,s,a,l={},u=0;function c(){var l,c,d,f,h,g={},m=[],v=o.range(r),E=[];for(e=[],t=[],l=0,f=-1;++f<r;){for(c=0,h=-1;++h<r;)c+=n[f][h];m.push(c),E.push(o.range(r)),l+=c}for(i&&v.sort((function(e,t){return i(m[e],m[t])})),s&&E.forEach((function(e,t){e.sort((function(e,r){return s(n[t][e],n[t][r])}))})),l=(Me-u*r)/l,c=0,f=-1;++f<r;){for(d=c,h=-1;++h<r;){var x=v[f],y=E[x][h],T=n[x][y],N=c,C=c+=T*l;g[x+"-"+y]={index:x,subindex:y,startAngle:N,endAngle:C,value:T}}t[x]={index:x,startAngle:d,endAngle:c,value:m[x]},c+=u}for(f=-1;++f<r;)for(h=f-1;++h<r;){var S=g[f+"-"+h],I=g[h+"-"+f];(S.value||I.value)&&e.push(S.value<I.value?{source:I,target:S}:{source:S,target:I})}a&&p()}function p(){e.sort((function(e,t){return a((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)}))}return l.matrix=function(i){return arguments.length?(r=(n=i)&&n.length,e=t=null,l):n},l.padding=function(n){return arguments.length?(u=n,e=t=null,l):u},l.sortGroups=function(n){return arguments.length?(i=n,e=t=null,l):i},l.sortSubgroups=function(t){return arguments.length?(s=t,e=null,l):s},l.sortChords=function(t){return arguments.length?(a=t,e&&p(),l):a},l.chords=function(){return e||c(),e},l.groups=function(){return t||c(),t},l},o.layout.force=function(){var e,t,n,r,i,s,a={},l=o.dispatch("start","tick","end"),u=[1,1],c=.9,p=Uo,d=Bo,f=-30,h=jo,g=.1,m=.64,v=[],E=[];function x(e){return function(t,n,r,i){if(t.point!==e){var o=t.cx-e.x,s=t.cy-e.y,a=i-n,l=o*o+s*s;if(a*a/m<l){if(l<h){var u=t.charge/l;e.px-=o*u,e.py-=s*u}return!0}if(t.point&&l&&l<h){u=t.pointCharge/l;e.px-=o*u,e.py-=s*u}}return!t.charge}}function y(e){e.px=o.event.x,e.py=o.event.y,a.resume()}return a.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:"end",alpha:n=0}),!0;var t,a,p,d,h,m,y,T,N,C=v.length,S=E.length;for(a=0;a<S;++a)d=(p=E[a]).source,(m=(T=(h=p.target).x-d.x)*T+(N=h.y-d.y)*N)&&(T*=m=n*i[a]*((m=Math.sqrt(m))-r[a])/m,N*=m,h.x-=T*(y=d.weight+h.weight?d.weight/(d.weight+h.weight):.5),h.y-=N*y,d.x+=T*(y=1-y),d.y+=N*y);if((y=n*g)&&(T=u[0]/2,N=u[1]/2,a=-1,y))for(;++a<C;)(p=v[a]).x+=(T-p.x)*y,p.y+=(N-p.y)*y;if(f)for(!function e(t,n,r){var i=0,o=0;if(t.charge=0,!t.leaf)for(var s,a=t.nodes,l=a.length,u=-1;++u<l;)null!=(s=a[u])&&(e(s,n,r),t.charge+=s.charge,i+=s.charge*s.cx,o+=s.charge*s.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var c=n*r[t.point.index];t.charge+=t.pointCharge=c,i+=c*t.point.x,o+=c*t.point.y}t.cx=i/t.charge,t.cy=o/t.charge}(t=o.geom.quadtree(v),n,s),a=-1;++a<C;)(p=v[a]).fixed||t.visit(x(p));for(a=-1;++a<C;)(p=v[a]).fixed?(p.x=p.px,p.y=p.py):(p.x-=(p.px-(p.px=p.x))*c,p.y-=(p.py-(p.py=p.y))*c);l.tick({type:"tick",alpha:n})},a.nodes=function(e){return arguments.length?(v=e,a):v},a.links=function(e){return arguments.length?(E=e,a):E},a.size=function(e){return arguments.length?(u=e,a):u},a.linkDistance=function(e){return arguments.length?(p="function"==typeof e?e:+e,a):p},a.distance=a.linkDistance,a.linkStrength=function(e){return arguments.length?(d="function"==typeof e?e:+e,a):d},a.friction=function(e){return arguments.length?(c=+e,a):c},a.charge=function(e){return arguments.length?(f="function"==typeof e?e:+e,a):f},a.chargeDistance=function(e){return arguments.length?(h=e*e,a):Math.sqrt(h)},a.gravity=function(e){return arguments.length?(g=+e,a):g},a.theta=function(e){return arguments.length?(m=e*e,a):Math.sqrt(m)},a.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=wt(a.tick)),a):n},a.start=function(){var e,t,n,o=v.length,l=E.length,c=u[0],h=u[1];for(e=0;e<o;++e)(n=v[e]).index=e,n.weight=0;for(e=0;e<l;++e)"number"==typeof(n=E[e]).source&&(n.source=v[n.source]),"number"==typeof n.target&&(n.target=v[n.target]),++n.source.weight,++n.target.weight;for(e=0;e<o;++e)n=v[e],isNaN(n.x)&&(n.x=g("x",c)),isNaN(n.y)&&(n.y=g("y",h)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(r=[],"function"==typeof p)for(e=0;e<l;++e)r[e]=+p.call(this,E[e],e);else for(e=0;e<l;++e)r[e]=p;if(i=[],"function"==typeof d)for(e=0;e<l;++e)i[e]=+d.call(this,E[e],e);else for(e=0;e<l;++e)i[e]=d;if(s=[],"function"==typeof f)for(e=0;e<o;++e)s[e]=+f.call(this,v[e],e);else for(e=0;e<o;++e)s[e]=f;function g(n,r){if(!t){for(t=new Array(o),u=0;u<o;++u)t[u]=[];for(u=0;u<l;++u){var i=E[u];t[i.source.index].push(i.target),t[i.target.index].push(i.source)}}for(var s,a=t[e],u=-1,c=a.length;++u<c;)if(!isNaN(s=a[u][n]))return s;return Math.random()*r}return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){if(t||(t=o.behavior.drag().origin(k).on("dragstart.force",Do).on("drag.force",y).on("dragend.force",ko)),!arguments.length)return t;this.on("mouseover.force",Fo).on("mouseout.force",Go).call(t)},o.rebind(a,l,"on")};var Uo=20,Bo=1,jo=1/0;function Vo(e,t){return o.rebind(e,t,"sort","children","value"),e.nodes=e,e.links=Qo,e}function Ho(e,t){for(var n=[e];null!=(e=n.pop());)if(t(e),(i=e.children)&&(r=i.length))for(var r,i;--r>=0;)n.push(i[r])}function qo(e,t){for(var n=[e],r=[];null!=(e=n.pop());)if(r.push(e),(o=e.children)&&(i=o.length))for(var i,o,s=-1;++s<i;)n.push(o[s]);for(;null!=(e=r.pop());)t(e)}function $o(e){return e.children}function zo(e){return e.value}function Wo(e,t){return t.value-e.value}function Qo(e){return o.merge(e.map((function(e){return(e.children||[]).map((function(t){return{source:e,target:t}}))})))}o.layout.hierarchy=function(){var e=Wo,t=$o,n=zo;function r(i){var o,s=[i],a=[];for(i.depth=0;null!=(o=s.pop());)if(a.push(o),(u=t.call(r,o,o.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)s.push(c=u[l]),c.parent=o,c.depth=o.depth+1;n&&(o.value=0),o.children=u}else n&&(o.value=+n.call(r,o,o.depth)||0),delete o.children;return qo(i,(function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)})),a}return r.sort=function(t){return arguments.length?(e=t,r):e},r.children=function(e){return arguments.length?(t=e,r):t},r.value=function(e){return arguments.length?(n=e,r):n},r.revalue=function(e){return n&&(Ho(e,(function(e){e.children&&(e.value=0)})),qo(e,(function(e){var t;e.children||(e.value=+n.call(r,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},r},o.layout.partition=function(){var e=o.layout.hierarchy(),t=[1,1];function n(n,r){var i=e.call(this,n,r);return function e(t,n,r,i){var o=t.children;if(t.x=n,t.y=t.depth*i,t.dx=r,t.dy=i,o&&(s=o.length)){var s,a,l,u=-1;for(r=t.value?r/t.value:0;++u<s;)e(a=o[u],n,l=a.value*r,i),n+=l}}(i[0],0,t[0],t[1]/function e(t){var n=t.children,r=0;if(n&&(i=n.length))for(var i,o=-1;++o<i;)r=Math.max(r,e(n[o]));return 1+r}(i[0])),i}return n.size=function(e){return arguments.length?(t=e,n):t},Vo(n,e)},o.layout.pie=function(){var e=Number,t=Yo,n=0,r=Me,i=0;function s(a){var l,u=a.length,c=a.map((function(t,n){return+e.call(s,t,n)})),p=+("function"==typeof n?n.apply(this,arguments):n),d=("function"==typeof r?r.apply(this,arguments):r)-p,f=Math.min(Math.abs(d)/u,+("function"==typeof i?i.apply(this,arguments):i)),h=f*(d<0?-1:1),g=o.sum(c),m=g?(d-u*h)/g:0,v=o.range(u),E=[];return null!=t&&v.sort(t===Yo?function(e,t){return c[t]-c[e]}:function(e,n){return t(a[e],a[n])}),v.forEach((function(e){E[e]={data:a[e],value:l=c[e],startAngle:p,endAngle:p+=l*m+h,padAngle:f}})),E}return s.value=function(t){return arguments.length?(e=t,s):e},s.sort=function(e){return arguments.length?(t=e,s):t},s.startAngle=function(e){return arguments.length?(n=e,s):n},s.endAngle=function(e){return arguments.length?(r=e,s):r},s.padAngle=function(e){return arguments.length?(i=e,s):i},s};var Yo={};function Xo(e){return e.x}function Ko(e){return e.y}function Zo(e,t,n){e.y0=t,e.y=n}o.layout.stack=function(){var e=k,t=ts,n=ns,r=Zo,i=Xo,s=Ko;function a(l,u){if(!(f=l.length))return l;var c=l.map((function(t,n){return e.call(a,t,n)})),p=c.map((function(e){return e.map((function(e,t){return[i.call(a,e,t),s.call(a,e,t)]}))})),d=t.call(a,p,u);c=o.permute(c,d),p=o.permute(p,d);var f,h,g,m,v=n.call(a,p,u),E=c[0].length;for(g=0;g<E;++g)for(r.call(a,c[0][g],m=v[g],p[0][g][1]),h=1;h<f;++h)r.call(a,c[h][g],m+=p[h-1][g][1],p[h][g][1]);return l}return a.values=function(t){return arguments.length?(e=t,a):e},a.order=function(e){return arguments.length?(t="function"==typeof e?e:Jo.get(e)||ts,a):t},a.offset=function(e){return arguments.length?(n="function"==typeof e?e:es.get(e)||ns,a):n},a.x=function(e){return arguments.length?(i=e,a):i},a.y=function(e){return arguments.length?(s=e,a):s},a.out=function(e){return arguments.length?(r=e,a):r},a};var Jo=o.map({"inside-out":function(e){var t,n,r=e.length,i=e.map(rs),s=e.map(is),a=o.range(r).sort((function(e,t){return i[e]-i[t]})),l=0,u=0,c=[],p=[];for(t=0;t<r;++t)n=a[t],l<u?(l+=s[n],c.push(n)):(u+=s[n],p.push(n));return p.reverse().concat(c)},reverse:function(e){return o.range(e.length).reverse()},default:ts}),es=o.map({silhouette:function(e){var t,n,r,i=e.length,o=e[0].length,s=[],a=0,l=[];for(n=0;n<o;++n){for(t=0,r=0;t<i;t++)r+=e[t][n][1];r>a&&(a=r),s.push(r)}for(n=0;n<o;++n)l[n]=(a-s[n])/2;return l},wiggle:function(e){var t,n,r,i,o,s,a,l,u,c=e.length,p=e[0],d=p.length,f=[];for(f[0]=l=u=0,n=1;n<d;++n){for(t=0,i=0;t<c;++t)i+=e[t][n][1];for(t=0,o=0,a=p[n][0]-p[n-1][0];t<c;++t){for(r=0,s=(e[t][n][1]-e[t][n-1][1])/(2*a);r<t;++r)s+=(e[r][n][1]-e[r][n-1][1])/a;o+=s*e[t][n][1]}f[n]=l-=i?o/i*a:0,l<u&&(u=l)}for(n=0;n<d;++n)f[n]-=u;return f},expand:function(e){var t,n,r,i=e.length,o=e[0].length,s=1/i,a=[];for(n=0;n<o;++n){for(t=0,r=0;t<i;t++)r+=e[t][n][1];if(r)for(t=0;t<i;t++)e[t][n][1]/=r;else for(t=0;t<i;t++)e[t][n][1]=s}for(n=0;n<o;++n)a[n]=0;return a},zero:ns});function ts(e){return o.range(e.length)}function ns(e){for(var t=-1,n=e[0].length,r=[];++t<n;)r[t]=0;return r}function rs(e){for(var t,n=1,r=0,i=e[0][1],o=e.length;n<o;++n)(t=e[n][1])>i&&(r=n,i=t);return r}function is(e){return e.reduce(os,0)}function os(e,t){return e+t[1]}function ss(e,t){return as(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function as(e,t){for(var n=-1,r=+e[0],i=(e[1]-r)/t,o=[];++n<=t;)o[n]=i*n+r;return o}function ls(e){return[o.min(e),o.max(e)]}function us(e,t){return e.value-t.value}function cs(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function ps(e,t){e._pack_next=t,t._pack_prev=e}function ds(e,t){var n=t.x-e.x,r=t.y-e.y,i=e.r+t.r;return.999*i*i>n*n+r*r}function fs(e){if((t=e.children)&&(l=t.length)){var t,n,r,i,o,s,a,l,u=1/0,c=-1/0,p=1/0,d=-1/0;if(t.forEach(hs),(n=t[0]).x=-n.r,n.y=0,x(n),l>1&&((r=t[1]).x=r.r,r.y=0,x(r),l>2))for(ms(n,r,i=t[2]),x(i),cs(n,i),n._pack_prev=i,cs(i,r),r=n._pack_next,o=3;o<l;o++){ms(n,r,i=t[o]);var f=0,h=1,g=1;for(s=r._pack_next;s!==r;s=s._pack_next,h++)if(ds(s,i)){f=1;break}if(1==f)for(a=n._pack_prev;a!==s._pack_prev&&!ds(a,i);a=a._pack_prev,g++);f?(h<g||h==g&&r.r<n.r?ps(n,r=s):ps(n=a,r),o--):(cs(n,i),r=i,x(i))}var m=(u+c)/2,v=(p+d)/2,E=0;for(o=0;o<l;o++)(i=t[o]).x-=m,i.y-=v,E=Math.max(E,i.r+Math.sqrt(i.x*i.x+i.y*i.y));e.r=E,t.forEach(gs)}function x(e){u=Math.min(e.x-e.r,u),c=Math.max(e.x+e.r,c),p=Math.min(e.y-e.r,p),d=Math.max(e.y+e.r,d)}}function hs(e){e._pack_next=e._pack_prev=e}function gs(e){delete e._pack_next,delete e._pack_prev}function ms(e,t,n){var r=e.r+n.r,i=t.x-e.x,o=t.y-e.y;if(r&&(i||o)){var s=t.r+n.r,a=i*i+o*o,l=.5+((r*=r)-(s*=s))/(2*a),u=Math.sqrt(Math.max(0,2*s*(r+a)-(r-=a)*r-s*s))/(2*a);n.x=e.x+l*i+u*o,n.y=e.y+l*o-u*i}else n.x=e.x+r,n.y=e.y}function vs(e,t){return e.parent==t.parent?1:2}function Es(e){var t=e.children;return t.length?t[0]:e.t}function xs(e){var t,n=e.children;return(t=n.length)?n[t-1]:e.t}function ys(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Ts(e,t,n){return e.a.parent===t.parent?e.a:n}function Ns(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function Cs(e,t){var n=e.x+t[3],r=e.y+t[0],i=e.dx-t[1]-t[3],o=e.dy-t[0]-t[2];return i<0&&(n+=i/2,i=0),o<0&&(r+=o/2,o=0),{x:n,y:r,dx:i,dy:o}}function Ss(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function Is(e){return e.rangeExtent?e.rangeExtent():Ss(e.range())}function Ls(e,t,n,r){var i=n(e[0],e[1]),o=r(t[0],t[1]);return function(e){return o(i(e))}}function As(e,t){var n,r=0,i=e.length-1,o=e[r],s=e[i];return s<o&&(n=r,r=i,i=n,n=o,o=s,s=n),e[r]=t.floor(o),e[i]=t.ceil(s),e}function bs(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:Rs}o.layout.histogram=function(){var e=!0,t=Number,n=ls,r=ss;function i(i,s){for(var a,l,u=[],c=i.map(t,this),p=n.call(this,c,s),d=r.call(this,p,c,s),f=(s=-1,c.length),h=d.length-1,g=e?1:1/f;++s<h;)(a=u[s]=[]).dx=d[s+1]-(a.x=d[s]),a.y=0;if(h>0)for(s=-1;++s<f;)(l=c[s])>=p[0]&&l<=p[1]&&((a=u[o.bisect(d,l,1,h)-1]).y+=g,a.push(i[s]));return u}return i.value=function(e){return arguments.length?(t=e,i):t},i.range=function(e){return arguments.length?(n=Nt(e),i):n},i.bins=function(e){return arguments.length?(r="number"==typeof e?function(t){return as(t,e)}:Nt(e),i):r},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},o.layout.pack=function(){var e,t=o.layout.hierarchy().sort(us),n=0,r=[1,1];function i(i,o){var s=t.call(this,i,o),a=s[0],l=r[0],u=r[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(a.x=a.y=0,qo(a,(function(e){e.r=+c(e.value)})),qo(a,fs),n){var p=n*(e?1:Math.max(2*a.r/l,2*a.r/u))/2;qo(a,(function(e){e.r+=p})),qo(a,fs),qo(a,(function(e){e.r-=p}))}return function e(t,n,r,i){var o=t.children;if(t.x=n+=i*t.x,t.y=r+=i*t.y,t.r*=i,o)for(var s=-1,a=o.length;++s<a;)e(o[s],n,r,i)}(a,l/2,u/2,e?1:1/Math.max(2*a.r/l,2*a.r/u)),s}return i.size=function(e){return arguments.length?(r=e,i):r},i.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,i):e},i.padding=function(e){return arguments.length?(n=+e,i):n},Vo(i,t)},o.layout.tree=function(){var e=o.layout.hierarchy().sort(null).value(null),t=vs,n=[1,1],r=null;function i(i,o){var u=e.call(this,i,o),c=u[0],p=function(e){var t,n={A:null,children:[e]},r=[n];for(;null!=(t=r.pop());)for(var i,o=t.children,s=0,a=o.length;s<a;++s)r.push((o[s]=i={_:o[s],parent:t,children:(i=o[s].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:s}).a=i);return n.children[0]}(c);if(qo(p,s),p.parent.m=-p.z,Ho(p,a),r)Ho(c,l);else{var d=c,f=c,h=c;Ho(c,(function(e){e.x<d.x&&(d=e),e.x>f.x&&(f=e),e.depth>h.depth&&(h=e)}));var g=t(d,f)/2-d.x,m=n[0]/(f.x+t(f,d)/2+g),v=n[1]/(h.depth||1);Ho(c,(function(e){e.x=(e.x+g)*m,e.y=e.depth*v}))}return u}function s(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n.length){!function(e){var t,n=0,r=0,i=e.children,o=i.length;for(;--o>=0;)(t=i[o]).z+=n,t.m+=n,n+=t.s+(r+=t.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,s=e,a=n,l=o.parent.children[0],u=o.m,c=s.m,p=a.m,d=l.m;a=xs(a),o=Es(o),a&&o;)l=Es(l),(s=xs(s)).a=e,(i=a.z+p-o.z-u+t(a._,o._))>0&&(ys(Ts(a,e,r),e,i),u+=i,c+=i),p+=a.m,u+=o.m,d+=l.m,c+=s.m;a&&!xs(s)&&(s.t=a,s.m+=p-c),o&&!Es(l)&&(l.t=o,l.m+=u-d,r=e)}return r}(e,i,e.parent.A||r[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=n[0],e.y=e.depth*n[1]}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(r=null==(n=e)?l:null,i):r?null:n},i.nodeSize=function(e){return arguments.length?(r=null==(n=e)?null:l,i):r?n:null},Vo(i,e)},o.layout.cluster=function(){var e=o.layout.hierarchy().sort(null).value(null),t=vs,n=[1,1],r=!1;function i(i,s){var a,l=e.call(this,i,s),u=l[0],c=0;qo(u,(function(e){var n=e.children;n&&n.length?(e.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(n),e.y=function(e){return 1+o.max(e,(function(e){return e.y}))}(n)):(e.x=a?c+=t(e,a):0,e.y=0,a=e)}));var p=function e(t){var n=t.children;return n&&n.length?e(n[0]):t}(u),d=function e(t){var n,r=t.children;return r&&(n=r.length)?e(r[n-1]):t}(u),f=p.x-t(p,d)/2,h=d.x+t(d,p)/2;return qo(u,r?function(e){e.x=(e.x-u.x)*n[0],e.y=(u.y-e.y)*n[1]}:function(e){e.x=(e.x-f)/(h-f)*n[0],e.y=(1-(u.y?e.y/u.y:1))*n[1]}),l}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(r=null==(n=e),i):r?null:n},i.nodeSize=function(e){return arguments.length?(r=null!=(n=e),i):r?n:null},Vo(i,e)},o.layout.treemap=function(){var e,t=o.layout.hierarchy(),n=Math.round,r=[1,1],i=null,s=Ns,a=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(e,t){for(var n,r,i=-1,o=e.length;++i<o;)r=(n=e[i]).value*(t<0?0:t),n.area=isNaN(r)||r<=0?0:r}function p(e){var t=e.children;if(t&&t.length){var n,r,i,o=s(e),a=[],u=t.slice(),d=1/0,g="slice"===l?o.dx:"dice"===l?o.dy:"slice-dice"===l?1&e.depth?o.dy:o.dx:Math.min(o.dx,o.dy);for(c(u,o.dx*o.dy/e.value),a.area=0;(i=u.length)>0;)a.push(n=u[i-1]),a.area+=n.area,"squarify"!==l||(r=f(a,g))<=d?(u.pop(),d=r):(a.area-=a.pop().area,h(a,g,o,!1),g=Math.min(o.dx,o.dy),a.length=a.area=0,d=1/0);a.length&&(h(a,g,o,!0),a.length=a.area=0),t.forEach(p)}}function d(e){var t=e.children;if(t&&t.length){var n,r=s(e),i=t.slice(),o=[];for(c(i,r.dx*r.dy/e.value),o.area=0;n=i.pop();)o.push(n),o.area+=n.area,null!=n.z&&(h(o,n.z?r.dx:r.dy,r,!i.length),o.length=o.area=0);t.forEach(d)}}function f(e,t){for(var n,r=e.area,i=0,o=1/0,s=-1,a=e.length;++s<a;)(n=e[s].area)&&(n<o&&(o=n),n>i&&(i=n));return t*=t,(r*=r)?Math.max(t*i*u/r,r/(t*o*u)):1/0}function h(e,t,r,i){var o,s=-1,a=e.length,l=r.x,u=r.y,c=t?n(e.area/t):0;if(t==r.dx){for((i||c>r.dy)&&(c=r.dy);++s<a;)(o=e[s]).x=l,o.y=u,o.dy=c,l+=o.dx=Math.min(r.x+r.dx-l,c?n(o.area/c):0);o.z=!0,o.dx+=r.x+r.dx-l,r.y+=c,r.dy-=c}else{for((i||c>r.dx)&&(c=r.dx);++s<a;)(o=e[s]).x=l,o.y=u,o.dx=c,u+=o.dy=Math.min(r.y+r.dy-u,c?n(o.area/c):0);o.z=!1,o.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function g(n){var i=e||t(n),o=i[0];return o.x=o.y=0,o.value?(o.dx=r[0],o.dy=r[1]):o.dx=o.dy=0,e&&t.revalue(o),c([o],o.dx*o.dy/o.value),(e?d:p)(o),a&&(e=i),i}return g.size=function(e){return arguments.length?(r=e,g):r},g.padding=function(e){if(!arguments.length)return i;function t(t){var n=e.call(g,t,t.depth);return null==n?Ns(t):Cs(t,"number"==typeof n?[n,n,n,n]:n)}function n(t){return Cs(t,e)}var r;return s=null==(i=e)?Ns:"function"==(r=typeof e)?t:"number"===r?(e=[e,e,e,e],n):n,g},g.round=function(e){return arguments.length?(n=e?Math.round:Number,g):n!=Number},g.sticky=function(t){return arguments.length?(a=t,e=null,g):a},g.ratio=function(e){return arguments.length?(u=e,g):u},g.mode=function(e){return arguments.length?(l=e+"",g):l},Vo(g,t)},o.random={normal:function(e,t){var n=arguments.length;return n<2&&(t=1),n<1&&(e=0),function(){var n,r,i;do{i=(n=2*Math.random()-1)*n+(r=2*Math.random()-1)*r}while(!i||i>1);return e+t*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=o.random.normal.apply(o,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=o.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(e){return function(){for(var t=0,n=0;n<e;n++)t+=Math.random();return t}}},o.scale={};var Rs={floor:k,ceil:k};function ws(e,t,n,r){var i=[],s=[],a=0,l=Math.min(e.length,t.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<=l;)i.push(n(e[a-1],e[a])),s.push(r(t[a-1],t[a]));return function(t){var n=o.bisect(e,t,1,l)-1;return s[n](i[n](t))}}function Os(e,t){return o.rebind(e,t,"range","rangeRound","interpolate","clamp")}function Ms(e,t){return As(e,bs(_s(e,t)[2])),As(e,bs(_s(e,t)[2])),e}function _s(e,t){null==t&&(t=10);var n=Ss(e),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),o=t/r*i;return o<=.15?i*=10:o<=.35?i*=5:o<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function Ps(e,t){return o.range.apply(o,_s(e,t))}function Ds(e,t,n){var r=_s(e,t);if(n){var i=Ft.exec(n);if(i.shift(),"s"===i[8]){var s=o.formatPrefix(Math.max(N(r[0]),N(r[1])));return i[7]||(i[7]="."+Fs(s.scale(r[2]))),i[8]="f",n=o.format(i.join("")),function(e){return n(s.scale(e))+s.symbol}}i[7]||(i[7]="."+function(e,t){var n=Fs(t[2]);return e in ks?Math.abs(n-Fs(Math.max(N(t[0]),N(t[1]))))+ +("e"!==e):n-2*("%"===e)}(i[8],r)),n=i.join("")}else n=",."+Fs(r[2])+"f";return o.format(n)}o.scale.linear=function(){return function e(t,n,r,i){var o,s;function a(){var e=Math.min(t.length,n.length)>2?ws:Ls,a=i?Mo:Oo;return o=e(t,n,a,r),s=e(n,t,a,lo),l}function l(e){return o(e)}return l.invert=function(e){return s(e)},l.domain=function(e){return arguments.length?(t=e.map(Number),a()):t},l.range=function(e){return arguments.length?(n=e,a()):n},l.rangeRound=function(e){return l.range(e).interpolate(So)},l.clamp=function(e){return arguments.length?(i=e,a()):i},l.interpolate=function(e){return arguments.length?(r=e,a()):r},l.ticks=function(e){return Ps(t,e)},l.tickFormat=function(e,n){return Ds(t,e,n)},l.nice=function(e){return Ms(t,e),a()},l.copy=function(){return e(t,n,r,i)},a()}([0,1],[0,1],lo,!1)};var ks={s:1,g:1,p:1,r:1,e:1};function Fs(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}o.scale.log=function(){return function e(t,n,r,i){function s(e){return(r?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(n)}function a(e){return r?Math.pow(n,e):-Math.pow(n,-e)}function l(e){return t(s(e))}return l.invert=function(e){return a(t.invert(e))},l.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((i=e.map(Number)).map(s)),l):i},l.base=function(e){return arguments.length?(n=+e,t.domain(i.map(s)),l):n},l.nice=function(){var e=As(i.map(s),r?Math:Us);return t.domain(e),i=e.map(a),l},l.ticks=function(){var e=Ss(i),t=[],o=e[0],l=e[1],u=Math.floor(s(o)),c=Math.ceil(s(l)),p=n%1?2:n;if(isFinite(c-u)){if(r){for(;u<c;u++)for(var d=1;d<p;d++)t.push(a(u)*d);t.push(a(u))}else for(t.push(a(u));u++<c;)for(d=p-1;d>0;d--)t.push(a(u)*d);for(u=0;t[u]<o;u++);for(c=t.length;t[c-1]>l;c--);t=t.slice(u,c)}return t},l.tickFormat=function(e,t){if(!arguments.length)return Gs;arguments.length<2?t=Gs:"function"!=typeof t&&(t=o.format(t));var r=Math.max(1,n*e/l.ticks().length);return function(e){var i=e/a(Math.round(s(e)));return i*n<n-.5&&(i*=n),i<=r?t(e):""}},l.copy=function(){return e(t.copy(),n,r,i)},Os(l,t)}(o.scale.linear().domain([0,1]),10,!0,[1,10])};var Gs=o.format(".0e"),Us={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function Bs(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}o.scale.pow=function(){return function e(t,n,r){var i=Bs(n),o=Bs(1/n);function s(e){return t(i(e))}return s.invert=function(e){return o(t.invert(e))},s.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(i)),s):r},s.ticks=function(e){return Ps(r,e)},s.tickFormat=function(e,t){return Ds(r,e,t)},s.nice=function(e){return s.domain(Ms(r,e))},s.exponent=function(e){return arguments.length?(i=Bs(n=e),o=Bs(1/n),t.domain(r.map(i)),s):n},s.copy=function(){return e(t.copy(),n,r)},Os(s,t)}(o.scale.linear(),1,[0,1])},o.scale.sqrt=function(){return o.scale.pow().exponent(.5)},o.scale.ordinal=function(){return function e(t,n){var r,i,s;function a(e){return i[((r.get(e)||("range"===n.t?r.set(e,t.push(e)):NaN))-1)%i.length]}function l(e,n){return o.range(t.length).map((function(t){return e+n*t}))}return a.domain=function(e){if(!arguments.length)return t;t=[],r=new I;for(var i,o=-1,s=e.length;++o<s;)r.has(i=e[o])||r.set(i,t.push(i));return a[n.t].apply(a,n.a)},a.range=function(e){return arguments.length?(i=e,s=0,n={t:"range",a:arguments},a):i},a.rangePoints=function(e,r){arguments.length<2&&(r=0);var o=e[0],u=e[1],c=t.length<2?(o=(o+u)/2,0):(u-o)/(t.length-1+r);return i=l(o+c*r/2,c),s=0,n={t:"rangePoints",a:arguments},a},a.rangeRoundPoints=function(e,r){arguments.length<2&&(r=0);var o=e[0],u=e[1],c=t.length<2?(o=u=Math.round((o+u)/2),0):(u-o)/(t.length-1+r)|0;return i=l(o+Math.round(c*r/2+(u-o-(t.length-1+r)*c)/2),c),s=0,n={t:"rangeRoundPoints",a:arguments},a},a.rangeBands=function(e,r,o){arguments.length<2&&(r=0),arguments.length<3&&(o=r);var u=e[1]<e[0],c=e[u-0],p=e[1-u],d=(p-c)/(t.length-r+2*o);return i=l(c+d*o,d),u&&i.reverse(),s=d*(1-r),n={t:"rangeBands",a:arguments},a},a.rangeRoundBands=function(e,r,o){arguments.length<2&&(r=0),arguments.length<3&&(o=r);var u=e[1]<e[0],c=e[u-0],p=e[1-u],d=Math.floor((p-c)/(t.length-r+2*o));return i=l(c+Math.round((p-c-(t.length-r)*d)/2),d),u&&i.reverse(),s=Math.round(d*(1-r)),n={t:"rangeRoundBands",a:arguments},a},a.rangeBand=function(){return s},a.rangeExtent=function(){return Ss(n.a[0])},a.copy=function(){return e(t,n)},a.domain(t)}([],{t:"range",a:[[]]})},o.scale.category10=function(){return o.scale.ordinal().range(js)},o.scale.category20=function(){return o.scale.ordinal().range(Vs)},o.scale.category20b=function(){return o.scale.ordinal().range(Hs)},o.scale.category20c=function(){return o.scale.ordinal().range(qs)};var js=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ft),Vs=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ft),Hs=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ft),qs=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ft);function $s(){return 0}o.scale.quantile=function(){return function e(t,n){var r;function i(){var e=0,i=n.length;for(r=[];++e<i;)r[e-1]=o.quantile(t,e/i);return s}function s(e){if(!isNaN(e=+e))return n[o.bisect(r,e)]}return s.domain=function(e){return arguments.length?(t=e.map(v).filter(E).sort(m),i()):t},s.range=function(e){return arguments.length?(n=e,i()):n},s.quantiles=function(){return r},s.invertExtent=function(e){return(e=n.indexOf(e))<0?[NaN,NaN]:[e>0?r[e-1]:t[0],e<r.length?r[e]:t[t.length-1]]},s.copy=function(){return e(t,n)},i()}([],[])},o.scale.quantize=function(){return function e(t,n,r){var i,o;function s(e){return r[Math.max(0,Math.min(o,Math.floor(i*(e-t))))]}function a(){return i=r.length/(n-t),o=r.length-1,s}return s.domain=function(e){return arguments.length?(t=+e[0],n=+e[e.length-1],a()):[t,n]},s.range=function(e){return arguments.length?(r=e,a()):r},s.invertExtent=function(e){return[e=(e=r.indexOf(e))<0?NaN:e/i+t,e+1/i]},s.copy=function(){return e(t,n,r)},a()}(0,1,[0,1])},o.scale.threshold=function(){return function e(t,n){function r(e){if(e<=e)return n[o.bisect(t,e)]}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(e){return arguments.length?(n=e,r):n},r.invertExtent=function(e){return e=n.indexOf(e),[t[e-1],t[e]]},r.copy=function(){return e(t,n)},r}([.5],[0,1])},o.scale.identity=function(){return function e(t){function n(e){return+e}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=e.map(n),n):t},n.ticks=function(e){return Ps(t,e)},n.tickFormat=function(e,n){return Ds(t,e,n)},n.copy=function(){return e(t)},n}([0,1])},o.svg={},o.svg.arc=function(){var e=Ws,t=Qs,n=$s,r=zs,i=Ys,o=Xs,s=Ks;function a(){var a=Math.max(0,+e.apply(this,arguments)),u=Math.max(0,+t.apply(this,arguments)),c=i.apply(this,arguments)-Pe,p=o.apply(this,arguments)-Pe,d=Math.abs(p-c),f=c>p?0:1;if(u<a&&(h=u,u=a,a=h),d>=_e)return l(u,f)+(a?l(a,1-f):"")+"Z";var h,g,m,v,E,x,y,T,N,C,S,I,L=0,A=0,b=[];if((v=(+s.apply(this,arguments)||0)/2)&&(m=r===zs?Math.sqrt(a*a+u*u):+r.apply(this,arguments),f||(A*=-1),u&&(A=Be(m/u*Math.sin(v))),a&&(L=Be(m/a*Math.sin(v)))),u){E=u*Math.cos(c+A),x=u*Math.sin(c+A),y=u*Math.cos(p-A),T=u*Math.sin(p-A);var R=Math.abs(p-c-2*A)<=Oe?0:1;if(A&&Zs(E,x,y,T)===f^R){var w=(c+p)/2;E=u*Math.cos(w),x=u*Math.sin(w),y=T=null}}else E=x=0;if(a){N=a*Math.cos(p-L),C=a*Math.sin(p-L),S=a*Math.cos(c+L),I=a*Math.sin(c+L);var O=Math.abs(c-p+2*L)<=Oe?0:1;if(L&&Zs(N,C,S,I)===1-f^O){var M=(c+p)/2;N=a*Math.cos(M),C=a*Math.sin(M),S=I=null}}else N=C=0;if(d>Re&&(h=Math.min(Math.abs(u-a)/2,+n.apply(this,arguments)))>.001){g=a<u^f?0:1;var _=h,P=h;if(d<Oe){var D=null==S?[N,C]:null==y?[E,x]:vi([E,x],[S,I],[y,T],[N,C]),k=E-D[0],F=x-D[1],G=y-D[0],U=T-D[1],B=1/Math.sin(Math.acos((k*G+F*U)/(Math.sqrt(k*k+F*F)*Math.sqrt(G*G+U*U)))/2),j=Math.sqrt(D[0]*D[0]+D[1]*D[1]);P=Math.min(h,(a-j)/(B-1)),_=Math.min(h,(u-j)/(B+1))}if(null!=y){var V=Js(null==S?[N,C]:[S,I],[E,x],u,_,f),H=Js([y,T],[N,C],u,_,f);h===_?b.push("M",V[0],"A",_,",",_," 0 0,",g," ",V[1],"A",u,",",u," 0 ",1-f^Zs(V[1][0],V[1][1],H[1][0],H[1][1]),",",f," ",H[1],"A",_,",",_," 0 0,",g," ",H[0]):b.push("M",V[0],"A",_,",",_," 0 1,",g," ",H[0])}else b.push("M",E,",",x);if(null!=S){var q=Js([E,x],[S,I],a,-P,f),$=Js([N,C],null==y?[E,x]:[y,T],a,-P,f);h===P?b.push("L",$[0],"A",P,",",P," 0 0,",g," ",$[1],"A",a,",",a," 0 ",f^Zs($[1][0],$[1][1],q[1][0],q[1][1]),",",1-f," ",q[1],"A",P,",",P," 0 0,",g," ",q[0]):b.push("L",$[0],"A",P,",",P," 0 0,",g," ",q[0])}else b.push("L",N,",",C)}else b.push("M",E,",",x),null!=y&&b.push("A",u,",",u," 0 ",R,",",f," ",y,",",T),b.push("L",N,",",C),null!=S&&b.push("A",a,",",a," 0 ",O,",",1-f," ",S,",",I);return b.push("Z"),b.join("")}function l(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+-e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}return a.innerRadius=function(t){return arguments.length?(e=Nt(t),a):e},a.outerRadius=function(e){return arguments.length?(t=Nt(e),a):t},a.cornerRadius=function(e){return arguments.length?(n=Nt(e),a):n},a.padRadius=function(e){return arguments.length?(r=e==zs?zs:Nt(e),a):r},a.startAngle=function(e){return arguments.length?(i=Nt(e),a):i},a.endAngle=function(e){return arguments.length?(o=Nt(e),a):o},a.padAngle=function(e){return arguments.length?(s=Nt(e),a):s},a.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Pe;return[Math.cos(r)*n,Math.sin(r)*n]},a};var zs="auto";function Ws(e){return e.innerRadius}function Qs(e){return e.outerRadius}function Ys(e){return e.startAngle}function Xs(e){return e.endAngle}function Ks(e){return e&&e.padAngle}function Zs(e,t,n,r){return(e-n)*t-(t-r)*e>0?0:1}function Js(e,t,n,r,i){var o=e[0]-t[0],s=e[1]-t[1],a=(i?r:-r)/Math.sqrt(o*o+s*s),l=a*s,u=-a*o,c=e[0]+l,p=e[1]+u,d=t[0]+l,f=t[1]+u,h=(c+d)/2,g=(p+f)/2,m=d-c,v=f-p,E=m*m+v*v,x=n-r,y=c*f-d*p,T=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*E-y*y)),N=(y*v-m*T)/E,C=(-y*m-v*T)/E,S=(y*v+m*T)/E,I=(-y*m+v*T)/E,L=N-h,A=C-g,b=S-h,R=I-g;return L*L+A*A>b*b+R*R&&(N=S,C=I),[[N-l,C-u],[N*n/x,C*n/x]]}function ea(e){var t=pi,n=di,r=tr,i=na,o=i.key,s=.7;function a(o){var a,l=[],u=[],c=-1,p=o.length,d=Nt(t),f=Nt(n);function h(){l.push("M",i(e(u),s))}for(;++c<p;)r.call(this,a=o[c],c)?u.push([+d.call(this,a,c),+f.call(this,a,c)]):u.length&&(h(),u=[]);return u.length&&h(),l.length?l.join(""):null}return a.x=function(e){return arguments.length?(t=e,a):t},a.y=function(e){return arguments.length?(n=e,a):n},a.defined=function(e){return arguments.length?(r=e,a):r},a.interpolate=function(e){return arguments.length?(o="function"==typeof e?i=e:(i=ta.get(e)||na).key,a):o},a.tension=function(e){return arguments.length?(s=e,a):s},a}o.svg.line=function(){return ea(k)};var ta=o.map({linear:na,"linear-closed":ra,step:function(e){var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];for(;++t<n;)i.push("H",(r[0]+(r=e[t])[0])/2,"V",r[1]);n>1&&i.push("H",r[0]);return i.join("")},"step-before":ia,"step-after":oa,basis:la,"basis-open":function(e){if(e.length<4)return na(e);var t,n=[],r=-1,i=e.length,o=[0],s=[0];for(;++r<3;)t=e[r],o.push(t[0]),s.push(t[1]);n.push(ua(da,o)+","+ua(da,s)),--r;for(;++r<i;)t=e[r],o.shift(),o.push(t[0]),s.shift(),s.push(t[1]),fa(n,o,s);return n.join("")},"basis-closed":function(e){var t,n,r=-1,i=e.length,o=i+4,s=[],a=[];for(;++r<4;)n=e[r%i],s.push(n[0]),a.push(n[1]);t=[ua(da,s),",",ua(da,a)],--r;for(;++r<o;)n=e[r%i],s.shift(),s.push(n[0]),a.shift(),a.push(n[1]),fa(t,s,a);return t.join("")},bundle:function(e,t){var n=e.length-1;if(n)for(var r,i,o=e[0][0],s=e[0][1],a=e[n][0]-o,l=e[n][1]-s,u=-1;++u<=n;)r=e[u],i=u/n,r[0]=t*r[0]+(1-t)*(o+i*a),r[1]=t*r[1]+(1-t)*(s+i*l);return la(e)},cardinal:function(e,t){return e.length<3?na(e):e[0]+sa(e,aa(e,t))},"cardinal-open":function(e,t){return e.length<4?na(e):e[1]+sa(e.slice(1,-1),aa(e,t))},"cardinal-closed":function(e,t){return e.length<3?ra(e):e[0]+sa((e.push(e[0]),e),aa([e[e.length-2]].concat(e,[e[1]]),t))},monotone:function(e){return e.length<3?na(e):e[0]+sa(e,function(e){var t,n,r,i,o=[],s=function(e){var t=0,n=e.length-1,r=[],i=e[0],o=e[1],s=r[0]=ha(i,o);for(;++t<n;)r[t]=(s+(s=ha(i=o,o=e[t+1])))/2;return r[t]=s,r}(e),a=-1,l=e.length-1;for(;++a<l;)t=ha(e[a],e[a+1]),N(t)<Re?s[a]=s[a+1]=0:(n=s[a]/t,r=s[a+1]/t,(i=n*n+r*r)>9&&(i=3*t/Math.sqrt(i),s[a]=i*n,s[a+1]=i*r));a=-1;for(;++a<=l;)i=(e[Math.min(l,a+1)][0]-e[Math.max(0,a-1)][0])/(6*(1+s[a]*s[a])),o.push([i||0,s[a]*i||0]);return o}(e))}});function na(e){return e.length>1?e.join("L"):e+"Z"}function ra(e){return e.join("L")+"Z"}function ia(e){for(var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];++t<n;)i.push("V",(r=e[t])[1],"H",r[0]);return i.join("")}function oa(e){for(var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];++t<n;)i.push("H",(r=e[t])[0],"V",r[1]);return i.join("")}function sa(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return na(e);var n=e.length!=t.length,r="",i=e[0],o=e[1],s=t[0],a=s,l=1;if(n&&(r+="Q"+(o[0]-2*s[0]/3)+","+(o[1]-2*s[1]/3)+","+o[0]+","+o[1],i=e[1],l=2),t.length>1){a=t[1],o=e[l],l++,r+="C"+(i[0]+s[0])+","+(i[1]+s[1])+","+(o[0]-a[0])+","+(o[1]-a[1])+","+o[0]+","+o[1];for(var u=2;u<t.length;u++,l++)o=e[l],a=t[u],r+="S"+(o[0]-a[0])+","+(o[1]-a[1])+","+o[0]+","+o[1]}if(n){var c=e[l];r+="Q"+(o[0]+2*a[0]/3)+","+(o[1]+2*a[1]/3)+","+c[0]+","+c[1]}return r}function aa(e,t){for(var n,r=[],i=(1-t)/2,o=e[0],s=e[1],a=1,l=e.length;++a<l;)n=o,o=s,s=e[a],r.push([i*(s[0]-n[0]),i*(s[1]-n[1])]);return r}function la(e){if(e.length<3)return na(e);var t=1,n=e.length,r=e[0],i=r[0],o=r[1],s=[i,i,i,(r=e[1])[0]],a=[o,o,o,r[1]],l=[i,",",o,"L",ua(da,s),",",ua(da,a)];for(e.push(e[n-1]);++t<=n;)r=e[t],s.shift(),s.push(r[0]),a.shift(),a.push(r[1]),fa(l,s,a);return e.pop(),l.push("L",r),l.join("")}function ua(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}ta.forEach((function(e,t){t.key=e,t.closed=/-closed$/.test(e)}));var ca=[0,2/3,1/3,0],pa=[0,1/3,2/3,0],da=[0,1/6,2/3,1/6];function fa(e,t,n){e.push("C",ua(ca,t),",",ua(ca,n),",",ua(pa,t),",",ua(pa,n),",",ua(da,t),",",ua(da,n))}function ha(e,t){return(t[1]-e[1])/(t[0]-e[0])}function ga(e){for(var t,n,r,i=-1,o=e.length;++i<o;)n=(t=e[i])[0],r=t[1]-Pe,t[0]=n*Math.cos(r),t[1]=n*Math.sin(r);return e}function ma(e){var t=pi,n=pi,r=0,i=di,o=tr,s=na,a=s.key,l=s,u="L",c=.7;function p(a){var p,d,f,h=[],g=[],m=[],v=-1,E=a.length,x=Nt(t),y=Nt(r),T=t===n?function(){return d}:Nt(n),N=r===i?function(){return f}:Nt(i);function C(){h.push("M",s(e(m),c),u,l(e(g.reverse()),c),"Z")}for(;++v<E;)o.call(this,p=a[v],v)?(g.push([d=+x.call(this,p,v),f=+y.call(this,p,v)]),m.push([+T.call(this,p,v),+N.call(this,p,v)])):g.length&&(C(),g=[],m=[]);return g.length&&C(),h.length?h.join(""):null}return p.x=function(e){return arguments.length?(t=n=e,p):n},p.x0=function(e){return arguments.length?(t=e,p):t},p.x1=function(e){return arguments.length?(n=e,p):n},p.y=function(e){return arguments.length?(r=i=e,p):i},p.y0=function(e){return arguments.length?(r=e,p):r},p.y1=function(e){return arguments.length?(i=e,p):i},p.defined=function(e){return arguments.length?(o=e,p):o},p.interpolate=function(e){return arguments.length?(a="function"==typeof e?s=e:(s=ta.get(e)||na).key,l=s.reverse||s,u=s.closed?"M":"L",p):a},p.tension=function(e){return arguments.length?(c=e,p):c},p}function va(e){return e.radius}function Ea(e){return[e.x,e.y]}function xa(e){return function(){var t=e.apply(this,arguments),n=t[0],r=t[1]-Pe;return[n*Math.cos(r),n*Math.sin(r)]}}function ya(){return 64}function Ta(){return"circle"}function Na(e){var t=Math.sqrt(e/Oe);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}o.svg.line.radial=function(){var e=ea(ga);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},ia.reverse=oa,oa.reverse=ia,o.svg.area=function(){return ma(k)},o.svg.area.radial=function(){var e=ma(ga);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},o.svg.chord=function(){var e=Kr,t=Zr,n=va,r=Ys,i=Xs;function o(n,r){var i,o,u=s(this,e,n,r),c=s(this,t,n,r),p=function(e){return!(Math.abs(1e3*e.p0[0]-1e3*e.p1[0])<1&&Math.abs(1e3*e.p0[1]-1e3*e.p1[1])<1)};return"M"+u.p0+(p(u)?a(u.r,u.p1,u.a1-u.a0):"")+(o=c,(i=u).a0==o.a0&&i.a1==o.a1?l(u.r,u.p1,u.r,u.p0):l(u.r,u.p1,c.r,c.p0)+(p(c)?a(c.r,c.p1,c.a1-c.a0):"")+l(c.r,c.p1,u.r,u.p0))+"Z"}function s(e,t,o,s){var a=t.call(e,o,s),l=n.call(e,a,s),u=r.call(e,a,s)-Pe,c=i.call(e,a,s)-Pe;return{r:l,a0:u,a1:c,p0:[l*Math.cos(u),l*Math.sin(u)],p1:[l*Math.cos(c),l*Math.sin(c)]}}function a(e,t,n){return"A"+e+","+e+" 0 "+ +(n>Oe)+",1 "+t}function l(e,t,n,r){return"Q 0,0 "+r}return o.radius=function(e){return arguments.length?(n=Nt(e),o):n},o.source=function(t){return arguments.length?(e=Nt(t),o):e},o.target=function(e){return arguments.length?(t=Nt(e),o):t},o.startAngle=function(e){return arguments.length?(r=Nt(e),o):r},o.endAngle=function(e){return arguments.length?(i=Nt(e),o):i},o},o.svg.diagonal=function(){var e=Kr,t=Zr,n=Ea;function r(r,i){var o=e.call(this,r,i),s=t.call(this,r,i),a=(o.y+s.y)/2,l=[o,{x:o.x,y:a},{x:s.x,y:a},s];return"M"+(l=l.map(n))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return r.source=function(t){return arguments.length?(e=Nt(t),r):e},r.target=function(e){return arguments.length?(t=Nt(e),r):t},r.projection=function(e){return arguments.length?(n=e,r):n},r},o.svg.diagonal.radial=function(){var e=o.svg.diagonal(),t=Ea,n=e.projection;return e.projection=function(e){return arguments.length?n(xa(t=e)):t},e},o.svg.symbol=function(){var e=Ta,t=ya;function n(n,r){return(Ca.get(e.call(this,n,r))||Na)(t.call(this,n,r))}return n.type=function(t){return arguments.length?(e=Nt(t),n):e},n.size=function(e){return arguments.length?(t=Nt(e),n):t},n};var Ca=o.map({circle:Na,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Ia)),n=t*Ia;return"M0,"+-t+"L"+n+",0 0,"+t+" "+-n+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Sa),n=t*Sa/2;return"M0,"+n+"L"+t+","+-n+" "+-t+","+-n+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Sa),n=t*Sa/2;return"M0,"+-n+"L"+t+","+n+" "+-t+","+n+"Z"}});o.svg.symbolTypes=Ca.keys();var Sa=Math.sqrt(3),Ia=Math.tan(30*De);Z.transition=function(e){for(var t,n,r=Ra||++Ma,i=Da(e),o=[],s=wa||{time:Date.now(),ease:xo,delay:0,duration:250},a=-1,l=this.length;++a<l;){o.push(t=[]);for(var u=this[a],c=-1,p=u.length;++c<p;)(n=u[c])&&ka(n,c,i,r,s),t.push(n)}return ba(o,i,r)},Z.interrupt=function(e){return this.each(null==e?La:Aa(Da(e)))};var La=Aa(Da());function Aa(e){return function(){var t,n,r;(t=this[e])&&(r=t[n=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[n]:delete this[e],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function ba(e,t,n){return W(e,Oa),e.namespace=t,e.id=n,e}var Ra,wa,Oa=[],Ma=0;function _a(e,t,n,r){var i=e.id,o=e.namespace;return ge(e,"function"==typeof n?function(e,s,a){e[o][i].tween.set(t,r(n.call(e,e.__data__,s,a)))}:(n=r(n),function(e){e[o][i].tween.set(t,n)}))}function Pa(e){return null==e&&(e=""),function(){this.textContent=e}}function Da(e){return null==e?"__transition__":"__transition_"+e+"__"}function ka(e,t,n,r,i){var o,s,a,l,u,c=e[n]||(e[n]={active:0,count:0}),p=c[r];function d(n){var i=c.active,d=c[i];for(var h in d&&(d.timer.c=null,d.timer.t=NaN,--c.count,delete c[i],d.event&&d.event.interrupt.call(e,e.__data__,d.index)),c)if(+h<r){var g=c[h];g.timer.c=null,g.timer.t=NaN,--c.count,delete c[h]}s.c=f,wt((function(){return s.c&&f(n||1)&&(s.c=null,s.t=NaN),1}),0,o),c.active=r,p.event&&p.event.start.call(e,e.__data__,t),u=[],p.tween.forEach((function(n,r){(r=r.call(e,e.__data__,t))&&u.push(r)})),l=p.ease,a=p.duration}function f(i){for(var o=i/a,s=l(o),d=u.length;d>0;)u[--d].call(e,s);if(o>=1)return p.event&&p.event.end.call(e,e.__data__,t),--c.count?delete c[r]:delete e[n],1}p||(o=i.time,s=wt((function(e){var t=p.delay;if(s.t=t+o,t<=e)return d(e-t);s.c=d}),0,o),p=c[r]={tween:new I,time:o,timer:s,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++c.count)}Oa.call=Z.call,Oa.empty=Z.empty,Oa.node=Z.node,Oa.size=Z.size,o.transition=function(e,t){return e&&e.transition?Ra?e.transition(t):e:o.selection().transition(e)},o.transition.prototype=Oa,Oa.select=function(e){var t,n,r,i=this.id,o=this.namespace,s=[];e=J(e);for(var a=-1,l=this.length;++a<l;){s.push(t=[]);for(var u=this[a],c=-1,p=u.length;++c<p;)(r=u[c])&&(n=e.call(r,r.__data__,c,a))?("__data__"in r&&(n.__data__=r.__data__),ka(n,c,o,i,r[o][i]),t.push(n)):t.push(null)}return ba(s,o,i)},Oa.selectAll=function(e){var t,n,r,i,o,s=this.id,a=this.namespace,l=[];e=ee(e);for(var u=-1,c=this.length;++u<c;)for(var p=this[u],d=-1,f=p.length;++d<f;)if(r=p[d]){o=r[a][s],n=e.call(r,r.__data__,d,u),l.push(t=[]);for(var h=-1,g=n.length;++h<g;)(i=n[h])&&ka(i,h,a,s,o),t.push(i)}return ba(l,a,s)},Oa.filter=function(e){var t,n,r=[];"function"!=typeof e&&(e=fe(e));for(var i=0,o=this.length;i<o;i++){r.push(t=[]);for(var s,a=0,l=(s=this[i]).length;a<l;a++)(n=s[a])&&e.call(n,n.__data__,a,i)&&t.push(n)}return ba(r,this.namespace,this.id)},Oa.tween=function(e,t){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(e):ge(this,null==t?function(t){t[r][n].tween.remove(e)}:function(i){i[r][n].tween.set(e,t)})},Oa.attr=function(e,t){if(arguments.length<2){for(t in e)this.attr(t,e[t]);return this}var n="transform"==e?wo:lo,r=o.ns.qualify(e);function i(){this.removeAttribute(r)}function s(){this.removeAttributeNS(r.space,r.local)}function a(e){return null==e?i:(e+="",function(){var t,i=this.getAttribute(r);return i!==e&&(t=n(i,e),function(e){this.setAttribute(r,t(e))})})}function l(e){return null==e?s:(e+="",function(){var t,i=this.getAttributeNS(r.space,r.local);return i!==e&&(t=n(i,e),function(e){this.setAttributeNS(r.space,r.local,t(e))})})}return _a(this,"attr."+e,t,r.local?l:a)},Oa.attrTween=function(e,t){var n=o.ns.qualify(e);return this.tween("attr."+e,n.local?function(e,r){var i=t.call(this,e,r,this.getAttributeNS(n.space,n.local));return i&&function(e){this.setAttributeNS(n.space,n.local,i(e))}}:function(e,r){var i=t.call(this,e,r,this.getAttribute(n));return i&&function(e){this.setAttribute(n,i(e))}})},Oa.style=function(e,t,n){var r=arguments.length;if(r<3){if("string"!=typeof e){for(n in r<2&&(t=""),e)this.style(n,e[n],t);return this}n=""}function i(){this.style.removeProperty(e)}function o(t){return null==t?i:(t+="",function(){var r,i=c(this).getComputedStyle(this,null).getPropertyValue(e);return i!==t&&(r=lo(i,t),function(t){this.style.setProperty(e,r(t),n)})})}return _a(this,"style."+e,t,o)},Oa.styleTween=function(e,t,n){function r(r,i){var o=t.call(this,r,i,c(this).getComputedStyle(this,null).getPropertyValue(e));return o&&function(t){this.style.setProperty(e,o(t),n)}}return arguments.length<3&&(n=""),this.tween("style."+e,r)},Oa.text=function(e){return _a(this,"text",e,Pa)},Oa.remove=function(){var e=this.namespace;return this.each("end.transition",(function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)}))},Oa.ease=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].ease:("function"!=typeof e&&(e=o.ease.apply(o,arguments)),ge(this,(function(r){r[n][t].ease=e})))},Oa.delay=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].delay:ge(this,"function"==typeof e?function(r,i,o){r[n][t].delay=+e.call(r,r.__data__,i,o)}:(e=+e,function(r){r[n][t].delay=e}))},Oa.duration=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].duration:ge(this,"function"==typeof e?function(r,i,o){r[n][t].duration=Math.max(1,e.call(r,r.__data__,i,o))}:(e=Math.max(1,e),function(r){r[n][t].duration=e}))},Oa.each=function(e,t){var n=this.id,r=this.namespace;if(arguments.length<2){var i=wa,s=Ra;try{Ra=n,ge(this,(function(t,i,o){wa=t[r][n],e.call(t,t.__data__,i,o)}))}finally{wa=i,Ra=s}}else ge(this,(function(i){var s=i[r][n];(s.event||(s.event=o.dispatch("start","end","interrupt"))).on(e,t)}));return this},Oa.transition=function(){for(var e,t,n,r=this.id,i=++Ma,o=this.namespace,s=[],a=0,l=this.length;a<l;a++){s.push(e=[]);for(var u,c=0,p=(u=this[a]).length;c<p;c++)(t=u[c])&&ka(t,c,o,i,{time:(n=t[o][r]).time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration}),e.push(t)}return ba(s,o,i)},o.svg.axis=function(){var e,t=o.scale.linear(),n=Fa,r=6,i=6,s=3,l=[10],u=null;function c(a){a.each((function(){var a,c=o.select(this),p=this.__chart__||t,d=this.__chart__=t.copy(),f=null==u?d.ticks?d.ticks.apply(d,l):d.domain():u,h=null==e?d.tickFormat?d.tickFormat.apply(d,l):k:e,g=c.selectAll(".tick").data(f,d),m=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Re),v=o.transition(g.exit()).style("opacity",Re).remove(),E=o.transition(g.order()).style("opacity",1),x=Math.max(r,0)+s,y=Is(d),T=c.selectAll(".domain").data([0]),N=(T.enter().append("path").attr("class","domain"),o.transition(T));m.append("line"),m.append("text");var C,S,I,L,A=m.select("line"),b=E.select("line"),R=g.select("text").text(h),w=m.select("text"),O=E.select("text"),M="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(a=Ua,C="x",I="y",S="x2",L="y2",R.attr("dy",M<0?"0em":".71em").style("text-anchor","middle"),N.attr("d","M"+y[0]+","+M*i+"V0H"+y[1]+"V"+M*i)):(a=Ba,C="y",I="x",S="y2",L="x2",R.attr("dy",".32em").style("text-anchor",M<0?"end":"start"),N.attr("d","M"+M*i+","+y[0]+"H0V"+y[1]+"H"+M*i)),A.attr(L,M*r),w.attr(I,M*x),b.attr(S,0).attr(L,M*r),O.attr(C,0).attr(I,M*x),d.rangeBand){var _=d,P=_.rangeBand()/2;p=d=function(e){return _(e)+P}}else p.rangeBand?p=d:v.call(a,d,p);m.call(a,p,d),E.call(a,d,d)}))}return c.scale=function(e){return arguments.length?(t=e,c):t},c.orient=function(e){return arguments.length?(n=e in Ga?e+"":Fa,c):n},c.ticks=function(){return arguments.length?(l=a(arguments),c):l},c.tickValues=function(e){return arguments.length?(u=e,c):u},c.tickFormat=function(t){return arguments.length?(e=t,c):e},c.tickSize=function(e){var t=arguments.length;return t?(r=+e,i=+arguments[t-1],c):r},c.innerTickSize=function(e){return arguments.length?(r=+e,c):r},c.outerTickSize=function(e){return arguments.length?(i=+e,c):i},c.tickPadding=function(e){return arguments.length?(s=+e,c):s},c.tickSubdivide=function(){return arguments.length&&c},c};var Fa="bottom",Ga={top:1,right:1,bottom:1,left:1};function Ua(e,t,n){e.attr("transform",(function(e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"}))}function Ba(e,t,n){e.attr("transform",(function(e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"}))}o.svg.brush=function(){var e,t,n=$(d,"brushstart","brush","brushend"),r=null,i=null,s=[0,0],a=[0,0],l=!0,u=!0,p=Va[0];function d(e){e.each((function(){var e=o.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",m).on("touchstart.brush",m),t=e.selectAll(".background").data([0]);t.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(p,k);n.exit().remove(),n.enter().append("g").attr("class",(function(e){return"resize "+e})).style("cursor",(function(e){return ja[e]})).append("rect").attr("x",(function(e){return/[ew]$/.test(e)?-3:null})).attr("y",(function(e){return/^[ns]/.test(e)?-3:null})).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",d.empty()?"none":null);var s,a=o.transition(e),l=o.transition(t);r&&(s=Is(r),l.attr("x",s[0]).attr("width",s[1]-s[0]),h(a)),i&&(s=Is(i),l.attr("y",s[0]).attr("height",s[1]-s[0]),g(a)),f(a)}))}function f(e){e.selectAll(".resize").attr("transform",(function(e){return"translate("+s[+/e$/.test(e)]+","+a[+/^s/.test(e)]+")"}))}function h(e){e.select(".extent").attr("x",s[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function g(e){e.select(".extent").attr("y",a[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",a[1]-a[0])}function m(){var p,m,v=this,E=o.select(o.event.target),x=n.of(v,arguments),y=o.select(v),T=E.datum(),N=!/^(n|s)$/.test(T)&&r,C=!/^(e|w)$/.test(T)&&i,S=E.classed("extent"),I=Ie(v),L=o.mouse(v),A=o.select(c(v)).on("keydown.brush",(function(){32==o.event.keyCode&&(S||(p=null,L[0]-=s[1],L[1]-=a[1],S=2),H())})).on("keyup.brush",(function(){32==o.event.keyCode&&2==S&&(L[0]+=s[1],L[1]+=a[1],S=0,H())}));if(o.event.changedTouches?A.on("touchmove.brush",w).on("touchend.brush",M):A.on("mousemove.brush",w).on("mouseup.brush",M),y.interrupt().selectAll("*").interrupt(),S)L[0]=s[0]-L[0],L[1]=a[0]-L[1];else if(T){var b=+/w$/.test(T),R=+/^n/.test(T);m=[s[1-b]-L[0],a[1-R]-L[1]],L[0]=s[b],L[1]=a[R]}else o.event.altKey&&(p=L.slice());function w(){var e=o.mouse(v),t=!1;m&&(e[0]+=m[0],e[1]+=m[1]),S||(o.event.altKey?(p||(p=[(s[0]+s[1])/2,(a[0]+a[1])/2]),L[0]=s[+(e[0]<p[0])],L[1]=a[+(e[1]<p[1])]):p=null),N&&O(e,r,0)&&(h(y),t=!0),C&&O(e,i,1)&&(g(y),t=!0),t&&(f(y),x({type:"brush",mode:S?"move":"resize"}))}function O(n,r,i){var o,c,d=Is(r),f=d[0],h=d[1],g=L[i],m=i?a:s,v=m[1]-m[0];if(S&&(f-=g,h-=v+g),o=(i?u:l)?Math.max(f,Math.min(h,n[i])):n[i],S?c=(o+=g)+v:(p&&(g=Math.max(f,Math.min(h,2*p[i]-o))),g<o?(c=o,o=g):c=g),m[0]!=o||m[1]!=c)return i?t=null:e=null,m[0]=o,m[1]=c,!0}function M(){w(),y.style("pointer-events","all").selectAll(".resize").style("display",d.empty()?"none":null),o.select("body").style("cursor",null),A.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),I(),x({type:"brushend"})}y.style("pointer-events","none").selectAll(".resize").style("display",null),o.select("body").style("cursor",E.style("cursor")),x({type:"brushstart"}),w()}return d.event=function(r){r.each((function(){var r=n.of(this,arguments),i={x:s,y:a,i:e,j:t},l=this.__chart__||i;this.__chart__=i,Ra?o.select(this).transition().each("start.brush",(function(){e=l.i,t=l.j,s=l.x,a=l.y,r({type:"brushstart"})})).tween("brush:brush",(function(){var n=uo(s,i.x),o=uo(a,i.y);return e=t=null,function(e){s=i.x=n(e),a=i.y=o(e),r({type:"brush",mode:"resize"})}})).each("end.brush",(function(){e=i.i,t=i.j,r({type:"brush",mode:"resize"}),r({type:"brushend"})})):(r({type:"brushstart"}),r({type:"brush",mode:"resize"}),r({type:"brushend"}))}))},d.x=function(e){return arguments.length?(p=Va[!(r=e)<<1|!i],d):r},d.y=function(e){return arguments.length?(p=Va[!r<<1|!(i=e)],d):i},d.clamp=function(e){return arguments.length?(r&&i?(l=!!e[0],u=!!e[1]):r?l=!!e:i&&(u=!!e),d):r&&i?[l,u]:r?l:i?u:null},d.extent=function(n){var o,l,u,c,p;return arguments.length?(r&&(o=n[0],l=n[1],i&&(o=o[0],l=l[0]),e=[o,l],r.invert&&(o=r(o),l=r(l)),l<o&&(p=o,o=l,l=p),o==s[0]&&l==s[1]||(s=[o,l])),i&&(u=n[0],c=n[1],r&&(u=u[1],c=c[1]),t=[u,c],i.invert&&(u=i(u),c=i(c)),c<u&&(p=u,u=c,c=p),u==a[0]&&c==a[1]||(a=[u,c])),d):(r&&(e?(o=e[0],l=e[1]):(o=s[0],l=s[1],r.invert&&(o=r.invert(o),l=r.invert(l)),l<o&&(p=o,o=l,l=p))),i&&(t?(u=t[0],c=t[1]):(u=a[0],c=a[1],i.invert&&(u=i.invert(u),c=i.invert(c)),c<u&&(p=u,u=c,c=p))),r&&i?[[o,u],[l,c]]:r?[o,l]:i&&[u,c])},d.clear=function(){return d.empty()||(s=[0,0],a=[0,0],e=t=null),d},d.empty=function(){return!!r&&s[0]==s[1]||!!i&&a[0]==a[1]},o.rebind(d,n,"on")};var ja={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Va=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Ha=Bt.format=mn.timeFormat,qa=Ha.utc,$a=qa("%Y-%m-%dT%H:%M:%S.%LZ");function za(e){return e.toISOString()}function Wa(e,t,n){function r(t){return e(t)}function i(e,n){var r=(e[1]-e[0])/n,i=o.bisect(Ya,r);return i==Ya.length?[t.year,_s(e.map((function(e){return e/31536e6})),n)[2]]:i?t[r/Ya[i-1]<Ya[i]/r?i-1:i]:[Za,_s(e,n)[2]]}return r.invert=function(t){return Qa(e.invert(t))},r.domain=function(t){return arguments.length?(e.domain(t),r):e.domain().map(Qa)},r.nice=function(e,t){var n=r.domain(),o=Ss(n),s=null==e?i(o,10):"number"==typeof e&&i(o,e);function a(n){return!isNaN(n)&&!e.range(n,Qa(+n+1),t).length}return s&&(e=s[0],t=s[1]),r.domain(As(n,t>1?{floor:function(t){for(;a(t=e.floor(t));)t=Qa(t-1);return t},ceil:function(t){for(;a(t=e.ceil(t));)t=Qa(+t+1);return t}}:e))},r.ticks=function(e,t){var n=Ss(r.domain()),o=null==e?i(n,10):"number"==typeof e?i(n,e):!e.range&&[{range:e},t];return o&&(e=o[0],t=o[1]),e.range(n[0],Qa(+n[1]+1),t<1?1:t)},r.tickFormat=function(){return n},r.copy=function(){return Wa(e.copy(),t,n)},Os(r,e)}function Qa(e){return new Date(e)}Ha.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?za:$a,za.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},za.toString=$a.toString,Bt.second=qt((function(e){return new jt(1e3*Math.floor(e/1e3))}),(function(e,t){e.setTime(e.getTime()+1e3*Math.floor(t))}),(function(e){return e.getSeconds()})),Bt.seconds=Bt.second.range,Bt.seconds.utc=Bt.second.utc.range,Bt.minute=qt((function(e){return new jt(6e4*Math.floor(e/6e4))}),(function(e,t){e.setTime(e.getTime()+6e4*Math.floor(t))}),(function(e){return e.getMinutes()})),Bt.minutes=Bt.minute.range,Bt.minutes.utc=Bt.minute.utc.range,Bt.hour=qt((function(e){var t=e.getTimezoneOffset()/60;return new jt(36e5*(Math.floor(e/36e5-t)+t))}),(function(e,t){e.setTime(e.getTime()+36e5*Math.floor(t))}),(function(e){return e.getHours()})),Bt.hours=Bt.hour.range,Bt.hours.utc=Bt.hour.utc.range,Bt.month=qt((function(e){return(e=Bt.day(e)).setDate(1),e}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e){return e.getMonth()})),Bt.months=Bt.month.range,Bt.months.utc=Bt.month.utc.range;var Ya=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Xa=[[Bt.second,1],[Bt.second,5],[Bt.second,15],[Bt.second,30],[Bt.minute,1],[Bt.minute,5],[Bt.minute,15],[Bt.minute,30],[Bt.hour,1],[Bt.hour,3],[Bt.hour,6],[Bt.hour,12],[Bt.day,1],[Bt.day,2],[Bt.week,1],[Bt.month,1],[Bt.month,3],[Bt.year,1]],Ka=Ha.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&1!=e.getDate()}],["%b %d",function(e){return 1!=e.getDate()}],["%B",function(e){return e.getMonth()}],["%Y",tr]]),Za={range:function(e,t,n){return o.range(Math.ceil(e/n)*n,+t,n).map(Qa)},floor:k,ceil:k};Xa.year=Bt.year,Bt.scale=function(){return Wa(o.scale.linear(),Xa,Ka)};var Ja=Xa.map((function(e){return[e[0].utc,e[1]]})),el=qa.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&1!=e.getUTCDate()}],["%b %d",function(e){return 1!=e.getUTCDate()}],["%B",function(e){return e.getUTCMonth()}],["%Y",tr]]);function tl(e){return JSON.parse(e.responseText)}function nl(e){var t=l.createRange();return t.selectNode(l.body),t.createContextualFragment(e.responseText)}Ja.year=Bt.year.utc,Bt.scale.utc=function(){return Wa(o.scale.linear(),Ja,el)},o.text=Ct((function(e){return e.responseText})),o.json=function(e,t){return St(e,"application/json",tl,t)},o.html=function(e,t){return St(e,"text/html",nl,t)},o.xml=Ct((function(e){return e.responseXML})),this.d3=o,void 0===(i="function"==typeof(r=o)?r.call(t,n,t,e):r)||(e.exports=i)}()},229:function(e,t,n){"use strict";var r=r||{};r.SingleChild={addPlaceholders:function e(t,n){if(t.children){for(var r=0;r<t.children.length;r++)e(t.children[r]);if(1===t.children.length){var i=1.2*t.size;n&&(i=.1*t.children[0].size),t.children.push({name:"placeholder",size:i})}}},removePlaceholders:function e(t){for(var n=t.length-1;n>=0;n--){var r=t[n];"placeholder"===r.name?t.splice(n,1):r.children&&e(r.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.children&&1===n.children.length){var r=n.x-n.children[0].x;n.children[0].x+=r,i(n.children[0],r)}}function i(e,t){if(e.children)for(var n=0;n<e.children.length;n++)e.children[n].x+=t,i(e.children[n],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,n=e[0].y,r=0;r<e.length;r++){var i=e[r];i.x-=t,i.y-=n}}},t.a=r},240:function(e,t){
27
27
  /*! Copyright (c) 2014 Hidenari Nozaki and contributors | Licensed under the MIT license */
28
- !function(e,t){"use strict";!function(e){e.module("angucomplete-alt",[]).directive("angucompleteAlt",["$q","$parse","$http","$sce","$timeout","$templateCache","$interpolate",function(e,t,n,r,i,o,s){var a=40,l=39,u=38,c=37,p=27,d=13,f=9,h=3,g=524288,m=500,v=200,E="autocomplete-required",x="Searching...",y="No results found";function T(t,o,s,T){var N,C,S,I,L,A,b=o.find("input"),R=h,w=null,O=E,M=null,_=null,P=o[0].querySelector(".angucomplete-dropdown"),D=!1,k=null;function F(e,n){e&&("object"==typeof e?(t.searchStr=j(e),B({originalObject:e})):"string"==typeof e&&e.length>0?t.searchStr=e:console&&console.error&&console.error("Tried to set "+(n?"initial":"")+" value of angucomplete to",e,"which is an invalid value"),q(!0))}function G(e){k=null,t.hideResults(e),document.body.removeEventListener("click",G)}function U(e){return e.which?e.which:e.keyCode}function B(e){"function"==typeof t.selectedObject?t.selectedObject(e,t.selectedObjectData):t.selectedObject=e,q(!!e)}function j(e){return t.titleField.split(",").map((function(t){return V(e,t)})).join(" ")}function V(e,t){var n,r;if(t){n=t.split("."),r=e;for(var i=0;i<n.length;i++)r=r[n[i]]}else r=e;return r}function H(e,n){var i,o,s;if(s=new RegExp(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),e)return e.match&&e.replace||(e=e.toString()),i=(o=e.match(s))?e.replace(s,'<span class="'+t.matchClass+'">'+o[0]+"</span>"):e,r.trustAsHtml(i)}function q(e){t.notEmpty=e,M=t.searchStr,t.fieldRequired&&T&&t.inputName&&T[t.inputName].$setValidity(O,e)}function $(e){!t.overrideSuggestions||t.selectedObject&&t.selectedObject.originalObject===t.searchStr||(e&&e.preventDefault(),i.cancel(w),K(),B({originalObject:t.searchStr}),t.clearSelected&&(t.searchStr=null),ee())}function z(){return o[0].querySelectorAll(".angucomplete-row")[t.currentIndex]}function W(e){P.scrollTop=P.scrollTop+e}function Q(){var e=t.results[t.currentIndex];t.matchClass?b.val(j(e.originalObject)):b.val(e.title)}function Y(e){return function(n,r,i,o){r||i||o||!n.data||(n=n.data),t.searching=!1,re(V(C(n),t.remoteUrlDataField),e)}}function X(e,n,r,i){t.searching=!1,0!==n&&-1!==n&&(n||r||i||(n=e.status),t.remoteUrlErrorCallback?t.remoteUrlErrorCallback(e,n,r,i):console&&console.error&&console.error("http error"))}function K(){_&&_.resolve()}function Z(r){var i={},o=t.remoteUrl+encodeURIComponent(r);t.remoteUrlRequestFormatter&&(i={params:t.remoteUrlRequestFormatter(r)},o=t.remoteUrl),t.remoteUrlRequestWithCredentials&&(i.withCredentials=!0),K(),_=e.defer(),i.timeout=_.promise,n.get(o,i).success(Y(r)).error(X)}function J(n){K(),_=e.defer(),t.remoteApiHandler(n,_.promise).then(Y(n)).catch(X)}function ee(){t.showDropdown=!1,t.results=[],P&&(P.scrollTop=0)}function te(){t.showDropdown=I,t.currentIndex=t.focusFirst?0:-1,t.results=[]}function ne(e){!e||e.length<R||(t.localData?t.$apply((function(){var n;n=void 0!==t.localSearch()?t.localSearch()(e,t.localData):function(e){var n,r,i,o,s=t.searchFields.split(","),a=[];for(void 0!==t.parseInput()&&(e=t.parseInput()(e)),n=0;n<t.localData.length;n++){for(r=!1,i=0;i<s.length;i++)o=V(t.localData[n],s[i])||"",r=r||o.toString().toLowerCase().indexOf(e.toString().toLowerCase())>=0;r&&(a[a.length]=t.localData[n])}return a}(e),t.searching=!1,re(n,e)})):t.remoteApiHandler?J(e):Z(e))}function re(e,n){var r,i,o,s,a,l;if(e&&e.length>0)for(t.results=[],r=0;r<e.length;r++)t.titleField&&""!==t.titleField&&(s=a=j(e[r])),i="",t.descriptionField&&(i=l=V(e[r],t.descriptionField)),o="",t.imageField&&(o=V(e[r],t.imageField)),t.matchClass&&(a=H(s,n),l=H(i,n)),t.results[t.results.length]={title:a,description:l,image:o,originalObject:e[r]};else t.results=[];t.autoMatch&&1===t.results.length&&function(e,n,r){if(!r)return!1;for(var i in n)if(n[i].toLowerCase()===r.toLowerCase())return t.selectResult(e),!0;return!1}(t.results[0],{title:s,desc:i||""},t.searchStr)?t.showDropdown=!1:0!==t.results.length||L?t.showDropdown=!0:t.showDropdown=!1}function ie(){t.localData?re(t.localData,""):t.remoteApiHandler?J(""):Z("")}o.on("mousedown",(function(e){e.target.id?(k=e.target.id)===t.id+"_dropdown"&&document.body.addEventListener("click",G):k=e.target.className})),t.currentIndex=t.focusFirst?0:null,t.searching=!1,S=t.$watch("initialValue",(function(e){e&&(S(),F(e,!0))})),t.$watch("fieldRequired",(function(e,n){e!==n&&(e?M&&-1!==t.currentIndex?q(!0):q(!1):T[t.inputName].$setValidity(O,!0))})),t.$on("angucomplete-alt:clearInput",(function(e,n){n&&n!==t.id||(t.searchStr=null,B(),q(!1),ee())})),t.$on("angucomplete-alt:changeInput",(function(e,n,r){n&&n===t.id&&F(r)})),t.onFocusHandler=function(){t.focusIn&&t.focusIn(),0!==R||t.searchStr&&0!==t.searchStr.length||(t.currentIndex=t.focusFirst?0:t.currentIndex,t.showDropdown=!0,ie())},t.hideResults=function(){k&&(k===t.id+"_dropdown"||k.indexOf("angucomplete")>=0)?k=null:(N=i((function(){ee(),t.$apply((function(){t.searchStr&&t.searchStr.length>0&&b.val(t.searchStr)}))}),v),K(),t.focusOut&&t.focusOut(),t.overrideSuggestions&&t.searchStr&&t.searchStr.length>0&&-1===t.currentIndex&&$())},t.resetHideResults=function(){N&&i.cancel(N)},t.hoverRow=function(e){t.currentIndex=e},t.selectResult=function(e){t.matchClass&&(e.title=j(e.originalObject),e.description=V(e.originalObject,t.descriptionField)),t.clearSelected?t.searchStr=null:t.searchStr=e.title,B(e),ee()},t.inputChangeHandler=function(e){return e.length<R?(K(),ee()):0===e.length&&0===R&&(t.searching=!1,ie()),t.inputChanged&&(e=t.inputChanged(e)),e},t.fieldRequiredClass&&""!==t.fieldRequiredClass&&(O=t.fieldRequiredClass),t.minlength&&""!==t.minlength&&(R=parseInt(t.minlength,10)),t.pause||(t.pause=m),t.clearSelected||(t.clearSelected=!1),t.overrideSuggestions||(t.overrideSuggestions=!1),t.fieldRequired&&T&&(t.initialValue?q(!0):q(!1)),t.inputType=s.type?s.type:"text",t.textSearching=s.textSearching?s.textSearching:x,t.textNoResults=s.textNoResults?s.textNoResults:y,I="false"!==t.textSearching,L="false"!==t.textNoResults,t.maxlength=s.maxlength?s.maxlength:g,b.on("keydown",(function(e){var n=U(e),r=null,i=null;n===d&&t.results?(t.currentIndex>=0&&t.currentIndex<t.results.length?(e.preventDefault(),t.selectResult(t.results[t.currentIndex])):($(e),ee()),t.$apply()):n===a&&t.results?(e.preventDefault(),t.currentIndex+1<t.results.length&&t.showDropdown&&(t.$apply((function(){t.currentIndex++,Q()})),D&&(r=z(),P.getBoundingClientRect().top+parseInt(getComputedStyle(P).maxHeight,10)<r.getBoundingClientRect().bottom&&W(function(e){var t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,10)+parseInt(t.marginBottom,10)}(r))))):n===u&&t.results?(e.preventDefault(),t.currentIndex>=1?(t.$apply((function(){t.currentIndex--,Q()})),D&&(i=z().getBoundingClientRect().top-(P.getBoundingClientRect().top+parseInt(getComputedStyle(P).paddingTop,10)))<0&&W(i-1)):0===t.currentIndex&&t.$apply((function(){t.currentIndex=-1,b.val(t.searchStr)}))):n===f?t.results&&t.results.length>0&&t.showDropdown?-1===t.currentIndex&&t.overrideSuggestions?$():(-1===t.currentIndex&&(t.currentIndex=0),t.selectResult(t.results[t.currentIndex]),t.$digest()):t.searchStr&&t.searchStr.length>0&&$():n===p&&e.preventDefault()})),b.on("keyup",(function(e){var n=U(e);if(n!==c&&n!==l)if(n===u||n===d)e.preventDefault();else if(n===a)e.preventDefault(),!t.showDropdown&&t.searchStr&&t.searchStr.length>=R&&(te(),t.searching=!0,ne(t.searchStr));else if(n===p)ee(),t.$apply((function(){b.val(t.searchStr)}));else{if(0===R&&!t.searchStr)return;t.searchStr&&""!==t.searchStr?t.searchStr.length>=R&&(te(),w&&i.cancel(w),t.searching=!0,w=i((function(){ne(t.searchStr)}),t.pause)):t.showDropdown=!1,M&&M!==t.searchStr&&!t.clearSelected&&t.$apply((function(){B()}))}})),A="remoteUrlResponseFormatter",C=function(e){return t[A]?t[A](e):e},i((function(){var e=getComputedStyle(P);D=e.maxHeight&&"auto"===e.overflowY}))}return(o.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=s.startSymbol(),n=s.endSymbol();if("{{"!==t||"}}"!==n){var r=e.html().replace(/\{\{/g,t).replace(/\}\}/g,n);e.html(r)}return T}})}])}(window.angular)}()},34:function(e,t){function n(e,t){return{showToastMessageWithDelay:function(n){return new Promise(r=>{e.success(t.instant(n)),setTimeout(r,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",n),n.$inject=["toastr","$translate"]},35:function(e,t){angular.module("graphdb.framework.rest.connectors.service",[]).factory("ConnectorsRestService",r),r.$inject=["$http"];const n="rest/connectors";function r(e){return{getConnectors:function(){return e.get(n)},initConnector:function(t){return e.get(`${n}/options?prefix=${t}`)},hasConnector:function(t){return e.get(`${n}/existing?prefix=${t}`)},checkConnector:function(t){return e.post(`${n}/check`,t,{headers:{"Content-Type":"text/plain"}})}}}},36:function(e,t,n){"use strict";n.r(t);n(13),n(35);function r(e){const t=[];return Object.keys(e).forEach((function(n){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]))})),t.join("&")}function i(e,t){return _.reduce(e,(function(e,n){if(""===n.key&&""===n.value);else{if(""===n.key)throw new Error(t.instant("externalsync.empty.value.key.error",{value:n.value}));if(e.hasOwnProperty(n.key))throw new Error(t.instant("externalsync.duplicate.key.error",{key:n.key}));e[n.key]=n.value}return e}),{})}function o(e,t){for(let r=0;r<t.length;r++){const i=t[r];if("StringArray"===i.__type)e[i.__name]||(e[i.__name]=[""]);else if("OptionArray"===i.__type)if(e[i.__name])for(let t=0;t<i.__childOptions.length;t++){const n=i.__childOptions[t];if("Boolean"===n.__type)for(let t=0;t<e[i.__name].length;t++){const r=e[i.__name][t];!r.hasOwnProperty([n.__name])&&angular.isDefined(n.__defaultValue)&&(r[n.__name]=n.__defaultValue)}}else{e[i.__name]=[];const t={};for(let e=0;e<i.__childOptions.length;e++){const n=i.__childOptions[e];"StringArray"===n.__type?t[n.__name]=[""]:t[n.__name]=angular.isUndefined(n.__defaultValue)?"":n.__defaultValue}e[i.__name].push(t)}else"Map"===i.__type?e[i.__name]?e[i.__name]=(n=e[i.__name],_.map(n,(function(e,t){return{key:t,value:e}}))):e[i.__name]=[]:"JsonString"===i.__type?!e[i.__name]||e[i.__name]instanceof String||"string"==typeof e[i.__name]||(e[i.__name]=angular.toJson(e[i.__name],2)):angular.isUndefined(e[i.__name])&&(e[i.__name]=angular.isUndefined(i.__defaultValue)?"":i.__defaultValue)}var n;return e}function s(e,t,n){return e.post("repositories/"+t,r({query:n}),{headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/sparql-results+json","X-GraphDB-Local-Consistency":"updating"}})}function a(e){return e.substring(0,e.length-1)+"/instance#"}function l(e,t,n,r,o){const s=function e(t,n){const r={};return _.each(n,(function(n){angular.isDefined(t[n.__name])&&("OptionArray"===n.__type?(r[n.__name]=[],_.each(t[n.__name],(function(t){r[n.__name].push(e(t,n.__childOptions))}))):r[n.__name]=angular.copy(t[n.__name]))})),r}(n,r);for(let e=0;e<r.length;e++)try{"Map"===r[e].__type?s[r[e].__name]=i(s[r[e].__name],$translate):"JsonString"===r[e].__type&&(s[r[e].__name]=angular.fromJson(s[r[e].__name]))}catch(t){return o(r[e].__label,t.message),null}!function e(t){Array.isArray(t)&&(t=_.filter(t,(function(e){return null!==e&&(!e.trim||""!==e.trim())})));return Object.keys(t).forEach((function(n){""!==t[n]&&null!=t[n]||!1===t[n]?"object"==typeof t[n]&&(t[n]=e(t[n])):delete t[n]})),t}(s);let l="";return l+="PREFIX :<"+t+">\n",l+="PREFIX inst:<"+a(t)+">\n",l+="INSERT DATA {\n",l+="\tinst:"+e+" :createConnector '''\n",l+=angular.toJson(s,2),l+="\n''' .\n}\n",l=l.replace(/\\/g,"\\\\\\"),l}function u(e,t,n,i,u,c,p,d,f,h){function g(t){e.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:t?h.instant("externalsync.repairing"):h.instant("externalsync.creating"),waitOnRepairStartOnce:!!t,eta:"-",inline:!1,iri:null}}function m(t,n,r){return g(r),$.extend(e.beingBuiltConnector,{iri:a(t)+n,name:n,inline:!1,doneCallback:function(){e.beingBuiltConnector.modalInstance.dismiss("cancel")}}),e.beingBuiltConnector.modalInstance=i.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:e}),e.beingBuiltConnector.modalInstance}function v(t,i,o){const s=m(t.value,i.name,!1);d.addStatements(n.getActiveRepository(),r({update:i.query})).then((function(){f.getConnectors().then((function(){f.hasConnector(encodeURIComponent(t.value)).then((function(n){e.existing[t.key]=n.data}))})),u.success(h.instant("created.connector",{name:i.name}))}),(function(e){u.error(getError(e)),o()})).finally((function(){s.dismiss("cancel")}))}e.loader=!1,e.controllers=[],e.existing={},e.definitions={},e.getLoaderMessage=function(){const t=(Date.now()-e.loaderStartTime)/1e3,n=e.getHumanReadableSeconds(t);let r="";return r=e.progressMessage?e.progressMessage+"... "+n:h.instant("common.running.operation",{timeHuman:n}),e.extraMessage&&t>10&&(r+="\n"+e.extraMessage),r},e.setLoader=function(t,n,r){t?(e.loader=!0,e.loaderStartTime=Date.now(),e.progressMessage=n,e.extraMessage=r):(e.loader=!1,e.progressMessage="",e.extraMessage="")},e.initConnector=function(t){return f.initConnector(encodeURIComponent(t.value)).then((function(n){return e.definitions[t.key]=n.data,f.hasConnector(encodeURIComponent(t.value)).then((function(n){e.existing[t.key]=n.data}))}))},e.getConnectors=function(){e.isLicenseValid()&&e.canWriteActiveRepo()&&(e.setLoader(!0,h.instant("externalsync.fetching.connectors"),h.instant("common.extra.message")),f.getConnectors().then((function(r){e.connectors=Object.keys(r.data).map((function(e){return{key:e,value:r.data[e]}})),p.all(_.map(e.connectors,(function(t){return e.initConnector(t)}))).finally((function(){g();const r=function(e){const t=_.map(e,(function(e){return"<"+e.value+"connectorStatus>"})).join("|");return t?"SELECT ?connector ?status { ?connector "+t+" ?status }":null}(e.connectors);r?function(e){return s(t,n.getActiveRepository(),e)}(r).then((function(t){const n=function(e){if(e.bindings)for(let t=0;t<e.bindings.length;t++)try{const n=JSON.parse(e.bindings[t].status.value);if("BUILDING"===n.status)return{connector:e.bindings[t].connector.value,status:n}}catch(e){console.error(e)}return{}}(t.data.results);if(n.connector){const t=n.connector.split(/#/);t[0]=t[0].replace(/\/instance$/,"#"),r=t[0],i=t[1],g(),$.extend(e.beingBuiltConnector,{iri:a(r)+i,name:i,inline:!0,doneCallback:function(){e.beingBuiltConnector.inline=!1}})}var r,i})).finally((function(){e.setLoader(!1)})):e.setLoader(!1)}))})).catch((function(t){e.setLoader(!1),u.error(getError(t),h.instant("externalsync.could.not.get.connectors.error"))})),e.existing={})},e.getOptions=function(t){return e.definitions[t.key]},e.isEmpty=function(e){return angular.isObject(e)&&0===Object.keys(e).length},e.toPrettyJson=function(e){return angular.toJson(e,2)},e.$watch((function(){return n.getActiveRepository()}),e.getConnectors),e.$watch((function(){return n.getActiveLocation()}),e.getConnectors),e.copyConnector=function(t,n){let r;angular.isUndefined(n)||(r=angular.copy(n),r.name=r.name+"-copy"),i.open({templateUrl:"pages/createConnector.html",controller:"CreateConnectorCtrl",size:"lg",backdrop:"static",resolve:{connector:function(){return t},values:function(){return angular.isUndefined(r)?{name:"",values:{}}:r},options:function(){return e.getOptions(t)}}}).result.then((function(n){v(t,n,(function(){n.skipConversion=!0,e.newConnector(t,n)}))}))},e.newConnector=function(t,n){i.open({templateUrl:"pages/createConnector.html",controller:"CreateConnectorCtrl",size:"lg",backdrop:"static",resolve:{connector:function(){return t},values:function(){return angular.isUndefined(n)?{name:"",values:{}}:n},options:function(){return e.getOptions(t)}}}).result.then((function(n){v(t,n,(function(){n.skipConversion=!0,e.newConnector(t,n)}))}))},e.repair=function(t,i){c.openSimpleModal({title:h.instant("externalsync.confirm.repair"),message:h.instant("externalsync.repair.warning.msg"),warning:!0}).result.then((function(){const o=m(i.value,t.name,!0),s=(l=t.name,"PREFIX prefix:<"+(c=i.value)+">\nINSERT DATA {\n\t<"+a(c)+l+'> prefix:repairConnector ""\n}');var l,c;d.addStatements(n.getActiveRepository(),r({update:s})).then((function(){f.getConnectors().then((function(){f.hasConnector(encodeURIComponent(i.value)).then((function(t){e.existing[i.key]=t.data}))})),u.success(h.instant("externalsync.repair.success.msg",{name:t.name}))}),(function(e){u.error(getError(e))})).finally((function(){o.dismiss("cancel")}))}))},e.delete=function(t,o){const s=o.key.indexOf("Elastic")>=0||o.key.indexOf("Solr")>=0;i.open({templateUrl:"js/angular/externalsync/templates/deleteConnector.html",controller:"DeleteConnectorCtrl",resolve:{popoverMsg:function(){return s?h.instant("delete.connector.conditional",{type:o.key}):""}}}).result.then((function(i){e.setLoader(!0,h.instant("externalsync.delete.progress.msg",{name:t.name}),h.instant("externalsync.extra.message.warning"));const a=function(e,t,n){const r=t.substring(0,t.length-1)+"/instance#";return"PREFIX prefix:<"+t+">\nINSERT DATA {\n\t<"+r+e+'> prefix:dropConnector "'+(n?"force":"")+'"\n}'}(t.name,o.value,i);d.addStatements(n.getActiveRepository(),r({update:a})).then((function(){f.getConnectors().then((function(){f.hasConnector(encodeURIComponent(o.value)).then((function(t){e.existing[o.key]=t.data}))})),i?(u.success(h.instant("externalsync.delete.force.success.msg",{name:t.name})),s&&u.warning(h.instant("externalsync.delete.remote.warning",{key:o.key}))):u.success(h.instant("externalsync.delete.success.msg",{name:t.name}))}),(function(e){u.error(getError(e))})).finally((function(){e.setLoader(!1)}))}))},e.viewQuery=function(t,n){i.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){const r=e.getOptions(t);return l(n.name,t.value,o(n.values,r),r)}}})}}function c(e,t,n){e.force=!1,e.popoverMsg=n,e.ok=function(){t.close(e.force)},e.cancel=function(){t.dismiss()}}function p(e,t,n,r,i){function o(){return l(e.name,n.value,e.values,e.options,(function(e,t){i.error(t,e)}))}e.connector=n,e.addField=function(t,n){const r=angular.copy(e.defaultValues[n][0]);e.values[n].splice(t+1,0,r)},e.addOption=function(e,t){t.splice(e+1,0,"")},e.deleteOption=function(e,t){t.splice(e,1)},e.addMapOption=function(e,t){t.splice(e+1,0,{key:"",value:""})},e.deleteMapOption=function(e,t){t.splice(e,1)},e.ok=function(){if(e.form.$valid){const n=o();n&&t.close({name:e.name,values:e.values,options:e.options,query:n})}},e.viewQuery=function(){const e=o();e&&r.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){return e}}})},e.cancel=function(){t.dismiss("cancel")}}function d(e,t,n,r,i,s,a,l){angular.extend(this,t("ExtendNewConnectorCtrl",{$scope:e,$modalInstance:r,connector:i,$modal:s})),e.values=a.values,e.options=l,e.name=a.name,a.skipConversion||(e.values=o(e.values,e.options)),e.defaultValues=angular.copy(e.values)}function f(e,t,n,r,i){function o(){const o=function(e){const t=e.replace(/\/instance#.+$/,"#connectorStatus");let n="";return n+="SELECT ?status {\n",n+="\t<"+e+"> <"+t+"> ?status",n+="\n}",n}(e.beingBuiltConnector.iri);e.beingBuiltConnector.iri=null,e.progressInterval=t((function(){(function(e){return s(n,r.getActiveRepository(),e)})(o).then((function(n){const r=function(e){if(e.bindings&&e.bindings.length>0)try{return JSON.parse(e.bindings[0].status.value)}catch(e){console.error(e)}return{}}(n.data.results);"BUILDING"===r.status?(e.beingBuiltConnector.status=r,e.beingBuiltConnector.percentDone=(100*r.processedEntities/r.estimatedEntities).toFixed(0),e.beingBuiltConnector.eta=e.getHumanReadableSeconds(r.etaSeconds),e.beingBuiltConnector.actionName=r.repair?i.instant("externalsync.repairing"):i.instant("externalsync.creating"),e.beingBuiltConnector.waitOnRepairStartOnce=!1):"BUILT"!==r.status||e.beingBuiltConnector.waitOnRepairStartOnce||(t.cancel(e.progressInterval),e.beingBuiltConnector.doneCallback&&e.beingBuiltConnector.doneCallback())}))}),1e3),e.$on("$destroy",(function(){t.cancel(e.progressInterval)}))}e.beingBuiltConnector=e.beingBuiltConnector||{},!e.beingBuiltConnector.inline&&e.beingBuiltConnector.iri&&o(),e.$watch("beingBuiltConnector.iri",(function(t){e.beingBuiltConnector.inline&&t&&o()}))}angular.module("graphdb.framework.externalsync.controllers",["graphdb.framework.rest.rdf4j.repositories.service","graphdb.framework.rest.connectors.service"]).controller("ConnectorsCtrl",u).controller("ExtendNewConnectorCtrl",p).controller("CreateConnectorCtrl",d).controller("CreateProgressCtrl",f).controller("DeleteConnectorCtrl",c).filter("ceil",(function(){return function(e){return Math.ceil(e)}})),u.$inject=["$scope","$http","$repositories","$modal","toastr","ModalService","$q","RDF4JRepositoriesRestService","ConnectorsRestService","$translate"],c.$inject=["$scope","$modalInstance","popoverMsg"],p.$inject=["$scope","$modalInstance","connector","$modal","toastr"],d.$inject=["$scope","$controller","$http","$modalInstance","connector","$modal","values","options"],f.$inject=["$scope","$interval","$http","$repositories","$translate"]},38:function(e,t,n){"use strict";n.r(t);n(4),n(15);var r=n(0);function i(e,t,n,i,o,s,a,l,u,c,p,d,f,h,g){const m={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:!0,sameAs:!0};let v,E;function x(t){!function(){if(i.isActiveRepoOntopType())return;const t=document.getElementById("sameAs");!t||e.currentQuery.inference||t.disabled?e.currentQuery.inference&&t.disabled&&(t.removeAttribute("disabled"),e.currentQuery.sameAs=v.appSettings.DEFAULT_SAMEAS):(t.disabled=!0,e.currentQuery.sameAs=!1)}(),e.tabs.forEach((function(n,r){n.id===t.id&&(e.tabs[r].query=t.query,i.isActiveRepoOntopType()||(e.tabs[r].inference=t.inference,e.tabs[r].sameAs=t.sameAs))})),f.set(h.TABS_STATE,e.tabs)}function y(t,n,r,i){const o=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=n,e.extraMessage=r,e.noLoaderTimer=i,o.addClass("hide")):(e.progressMessage="",e.extraMessage="",e.noLoaderTimer=!1,e.currentTrackAlias=null,e.abortRequested=!1,o.removeClass("hide")),null===e.$$phase&&e.$apply()}function T(n){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let r;r=t(n?function(){e.fixSizesOnHorizontalViewModeSwitch(n)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){t.cancel(r)}))}window.yasr&&window.yasr.container&&t((function(){window.yasr.container.resize()}),100)}function N(){T(!0)}function C(t,n){n.newRepo&&(e.tabsData=f.get(h.TABS_STATE),e.tabsData.forEach((function(e){e.yasrData=void 0,e.queryType=void 0,e.resultsCount=0,e.allResultsCount=0,e.sizeDelta=void 0})),f.set(h.TABS_STATE,e.tabsData),e.tabs=e.tabsData,e.currentQuery={},e.errorMessage=null,e.repositoryError=null)}function S(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function I(r,o){if(e.executedQueryTab=e.currentQuery,o){if("SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType())return void n.warning(g.instant("query.editor.warning.msg"));if(i.isActiveRepoOntopType())return void n.warning(g.instant("query.editor.virtual.repo.warning.msg"))}if(e.explainRequested=o,!e.queryIsRunning){if(r?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.lastRunQueryMode=window.editor.getQueryMode(),"update"===e.lastRunQueryMode&&i.isActiveRepoOntopType())return void n.warning(g.instant("query.editor.virtual.repo.update.warning.msg"));if(y(!0,"update"===e.lastRunQueryMode?g.instant("query.editor.executing.update"):g.instant("query.editor.evaluating.query")),"none"!==e.viewMode){e.viewMode="none",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch();const n=t(window.editor.query,500);e.$on("$destroy",(function(){t.cancel(n)}))}else window.editor.query()}}function L(){e.showSampleQueries=!e.showSampleQueries,e.showSampleQueries?a.getSavedQueries().success((function(t){e.sampleQueries=t,$("#sampleQueriesCollapse").collapse("show").width("300px")})).error((function(e){const t=getError(e);n.error(t,g.instant("query.editor.get.saved.queries.error"))})):$("#sampleQueriesCollapse").collapse("hide")}function A(t){let n=void 0;return e.tabsData.forEach((function(e){if(e.name===t.name&&e.query===t.body)return n=e.id,e})),n}function b(t){return function(n,r,i){e.savedQuery={name:n,query:r||window.editor.getValue(),shared:i},$(t).modal("show")}}function R(t){for(let n=0;n<e.tabsData.length;n++){if(e.tabsData[n].id===t)return n}}e.getPrincipal=function(){return c.getPrincipal().then(t=>{v=t,function(e,t){m.inference=t.appSettings.DEFAULT_INFERENCE,m.sameAs=t.appSettings.DEFAULT_SAMEAS,e.skipCountQuery=!t.appSettings.EXECUTE_COUNT,e.ignoreSharedQueries=t.appSettings.IGNORE_SHARED_QUERIES,e.tabsData=e.tabs=f.get(h.TABS_STATE)||[m],e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(e,t,n){x(n.currentQuery)})),e.$on("repositoryIsSet",C)}(e,v)})},e.getPrincipal(),this.hint=document.createElement("span"),this.hint.innerHTML=g.instant("query.editor.autocomplete.hint"),this.hint.style.fontSize="12px",this.hint.style.color="gray",this.hint.style.backgroundColor="white",this.hint.style.position="absolute",this.hint.style.zIndex="3",this.hint.style.paddingLeft="12px",e.$watch((function(){return angular.element(".CodeMirror-hints").length}),e=>{if(e){const e=angular.element(".CodeMirror-hints")[0].getBoundingClientRect();document.body.appendChild(this.hint),this.hint.style.top=e.top-20+"px",this.hint.style.left=e.right-this.hint.offsetWidth-12+"px"}else this.hint&&this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint)}),e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:1e3,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.saveTab=function(t){const n=R(t);if(void 0===n)return{};const r=e.tabsData[n];return e.saveQueryToLocal(r),r},e.loadTab=function(n){e.tabsData=f.get(h.TABS_STATE)||[m];const r=R(n),o=e.tabsData[r];o.yasrData&&y(!0,g.instant("query.editor.render.results.msg"),null,!0);t((function(){""===e.currentQuery.query&&(e.currentQuery.query=" "),t((function(){window.editor.setValue(e.currentQuery.query),e.yasr.updateDownloadDropdown(),e.$broadcast("tabLoaded",e.currentQuery.id),e.yasr.options.output=o.outputType,o.yasrData&&(o.yasrData.customError?(e.yasr.results={getException:function(){return o.yasrData.customError}},y(!1)):t((function(){e.setYasrResponse(o.yasrData,o.textStatus,o.jqXhrOrErrorString),y(!1),$(".yasr_btnGroup li:nth-child(2)").hasClass("active")&&t((function(){$(".yasr_btnGroup li:nth-child(2) a").get(0).click()}),0)}),0))}),0)}),0),f.set(h.TABS_STATE_CURRENT_ID,n),e.currentQuery=o,t((function(){e.currentTabConfig={},e.currentTabConfig.queryType=o.queryType,e.currentTabConfig.resultsCount=o.resultsCount,e.currentTabConfig.offset=o.offset,e.currentTabConfig.allResultsCount=o.allResultsCount,e.currentTabConfig.allResultsCountExact=o.allResultsCountExact,e.currentTabConfig.page=o.page,e.currentTabConfig.pageSize=o.pageSize,e.currentTabConfig.timeFinished=o.timeFinished,e.currentTabConfig.timeTook=o.timeTook,e.currentTabConfig.sizeDelta=o.sizeDelta,e.currentTabConfig.customUpdateMessage=o.customUpdateMessage,e.currentTabConfig.errorMessage=o.errorMessage,e.currentTabConfig.warningMessage=o.warningMessage,e.$apply()}),0),$("#yasr").css("padding","0"),E||(E=setInterval(M,200));!function(){const t=i.isActiveRepoOntopType(),n=i.isActiveRepoFedXType();(function(e){const t=document.getElementById("sameAs"),n=document.getElementById("inference");t&&(t.disabled=!!e);n&&(n.disabled=!!e)})(t),e.nocount=!(!t&&!n)||!v.appSettings.EXECUTE_COUNT,t&&(e.currentQuery.inference=!0,e.currentQuery.sameAs=!0)}()},e.addNewTab=function(n,r,i){if(!_(!0))return;let o;o=r||i?{id:"1",name:r,query:i,inference:v.appSettings.DEFAULT_INFERENCE,sameAs:v.appSettings.DEFAULT_SAMEAS}:{id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:v.appSettings.DEFAULT_INFERENCE,sameAs:v.appSettings.DEFAULT_SAMEAS};w++;const s=""+w;e.tabsData=e.tabs;const a=o;a.id=s,e.tabsData.push(a),f.set(h.TABS_STATE_MAXID,w),f.set(h.TABS_STATE,e.tabsData);const l=Array.prototype.slice.call(arguments,1);t((function(){e.$apply(),S(s),n&&n.apply(this,l)}),0),e.tabs=e.tabsData},e.isTabChangeOk=_,e.runQuery=I,e.abortCurrentQuery=function(){d.abortQueryByAlias(e.currentTrackAlias).success((function(){e.abortRequested=!0}))},e.editQuery=function(t){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:g.instant("query.editor.edit.saved.query",{name:t.name}),query:t,edit:!0,okButtonText:g.instant("common.save.btn")}}}}).result.then((function(r){const i={name:r.name,body:r.body,shared:r.shared};t.name!==r.name?a.addNewSavedQuery(i).success((function(){e.deleteQueryHttp(t.name,!0)})).error((function(e){const t=getError(e);n.error(t,g.instant("query.editor.edit.saved.query.error"))})):a.editSavedQuery(i).success((function(){$("#editQueryContainer").modal("hide"),e.toggleSampleQueries(),n.success(g.instant("query.editor.edit.saved.query.success.msg",{name:t.name}))})).error((function(e){const t=getError(e);n.error(t,g.instant("query.editor.edit.saved.query.error"))}))}))},e.getNamespaces=function(){y(!0,g.instant("common.refreshing.namespaces"),g.instant("common.extra.message")),e.namespacesLoading=!0,p.getRepositoryNamespaces().success((function(t){const n={};t.results.bindings.forEach((function(e){n[e.prefix.value]=e.namespace.value})),e.namespaces=n})).error((function(t){e.repositoryError=getError(t)})).finally((function(){y(!1),e.namespacesLoading=!1}))},e.changePagination=function(){I(!0,e.explainRequested)},e.toggleSampleQueries=L,e.addKnownPrefixes=function(){a.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){const t=getError(e);return n.error(t,g.instant("common.add.known.prefixes.error")),!0}))},e.getExistingTabId=A,e.querySelected=function(t){const n=A(t);e.toggleSampleQueries(),e.isTabChangeOk(!1)&&(e.highlightNextTabChange=!0,angular.isDefined(n)?S(n):e.addNewTab(null,t.name,t.body))},e.deleteQuery=function(t){s.openSimpleModal({title:g.instant("common.confirm"),message:g.instant("query.editor.delete.saved.query.warning.msg",{savedQueryName:t}),warning:!0}).result.then((function(){e.deleteQueryHttp(t)}))},e.deleteQueryHttp=function(t,r){a.deleteSavedQuery(t).success((function(){e.toggleSampleQueries(),r||n.success(g.instant("query.editor.delete.saved.query.success.msg",{savedQueryName:t}))})).error((function(e){const t=getError(e);n.error(t,g.instant("query.editor.delete.saved.query.error"))}))},e.saveQuery=function(t,n){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:g.instant("query.editor.create.saved.query.msg"),query:{name:t.name,body:t.query,shared:t.shared},edit:!1,okButtonText:g.instant("common.create.btn"),queryExists:n,existingQueryErrMsg:Object(r.decodeHTML)(g.instant("query.sample.existing.query.warning",{name:t.name}))}}}}).result.then((function(t){e.saveQueryHttp(t)}),(function(){}))},e.saveQueryHttp=function(t){a.addNewSavedQuery(t).success((function(){n.success(g.instant("query.editor.save.saved.query.success.msg",{name:t.name}))})).error((function(r){let i=getError(r);if(n.error(i,g.instant("query.editor.create.saved.query.error")),i="Query '"+t.name+"' already exists!"){t.query=t.body;const n=!0;e.saveQuery(t,n)}}))},e.saveQueryToLocal=x,e.setLoader=y,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3;let n="",r="";e.noLoaderTimer||(n=e.getHumanReadableSeconds(t));r=e.progressMessage?g.instant("query.editor.progress.msg",{progressMessage:e.progressMessage,timeHuman:n}):g.instant("common.running.operation",{timeHuman:n});e.extraMessage&&t>10&&(r+=g.instant("query.editor.extra.msg",{extraMessage:e.extraMessage}));return r},e.fixSizesOnHorizontalViewModeSwitch=T,e.changeViewMode=function(){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,f.set(h.VIEW_MODE,e.orientationViewMode),T()},e.showHideEditor=N,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!f.get(h.VIEW_MODE)||"true"===f.get(h.VIEW_MODE),e.viewMode="none",e.getActiveRepository=function(){return i.getActiveRepository()},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return i.getActiveRepository()},e.orientationViewMode||N(),window.onbeforeunload=function(){e.currentQuery&&e.saveTab(e.currentQuery.id),f.set(h.TABS_STATE,e.tabs)},e.$on("$destroy",(function(){e.currentQuery&&e.saveTab(e.currentQuery.id),f.set(h.TABS_STATE,e.tabs),clearInterval(E)})),e.$on("$destroy",(function(){clearInterval(E),window.editor=null,window.yasr=null})),$(document).mouseup((function(t){const n=$("#sampleQueriesCollapse");!n.is(t.target)&&0===n.has(t.target).length&&e.showSampleQueries&&L()}));let w=f.get(h.TABS_STATE_MAXID)||1;function O(e){return $(e).attr("data-id")}function M(){if(e.currentTabConfig.resultsCount>=0){const e=$(".saveAsDropDown");e.length>0&&!window.editor.queryValid?yasr.header.find(".saveAsDropDown").remove():0===e.length&&window.editor.queryValid&&yasr.updateDownloadDropdown()}}function _(t){return!(e.queryIsRunning&&!e.namespacesLoading)||(t?n.info(g.instant("query.editor.new.tab.running.query.warning.msg")):n.info(g.instant("query.editor.tab.switching.running.query.warning.msg")),!1)}e.highlightNextTabChange=!1,e.$on("tabAction",(function(n,r){r.relatedTarget&&(t.cancel(r.relatedTarget.timer),$(r.relatedTarget).css("color",""),e.saveTab(O(r.relatedTarget))),e.loadTab(O(r.target));const i=["var(--onto-orange)","","var(--onto-orange)"],o=[400,400,400];if(e.highlightNextTabChange){e.highlightNextTabChange=!1;let n=0;$(r.target).css("color",i[n]);const s=function(){n++,n<i.length?($(r.target).css("color",i[n]),r.target.timer=t(s,o[n])):$(r.target).css("color","")};t(s,o[n])}})),e.$on("deleteAllexeptSelected",(function(t,n){e.tabsData=n,e.tabs=n})),e.currentQuery={},e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.editQueryModal=b("#editQueryContainer"),e.deleteQueryModal=b("#confirmDeleteContainer"),e.saveQueryModal=b("#saveQueryContainer"),e.getResultsDescription=function(){let t;if(0===e.currentTabConfig.resultsCount)t="No results.";else{const n=(e.currentTabConfig.page-1)*e.currentTabConfig.pageSize+Math.min(e.currentTabConfig.resultsCount,e.currentTabConfig.pageSize);t=g.instant("query.editor.showing.results.from.msg")+l("currency")(e.currentTabConfig.offset,"",0)+g.instant("query.editor.to")+l("currency")(n,"",0),e.currentTabConfig.allResultsCount>0&&(t+=g.instant(e.currentTabConfig.allResultsCountExact?"query.editor.of":"query.editor.of.at.least"),t+=l("currency")(e.currentTabConfig.allResultsCount,"",0)),t+="."}return t},e.getUpdateDescription=function(){return e.currentTabConfig.customUpdateMessage?g.instant(e.currentTabConfig.customUpdateMessage.msg,{name:e.currentTabConfig.customUpdateMessage.name}):void 0===e.currentTabConfig.sizeDelta?"":e.currentTabConfig.sizeDelta<0?g.instant("yasr.removed.statements.result.msg",{sizeDelta:Math.abs(e.currentTabConfig.sizeDelta)}):e.currentTabConfig.sizeDelta>0?g.instant("yasr.added.statements.result.msg",{sizeDelta:e.currentTabConfig.sizeDelta}):g.instant("yasr.statements.no.change.msg")},e.getStaleWarningMessage=function(){const t=60*Math.round((Date.now()-e.currentTabConfig.timeFinished)/6e4);if(t>=3600)return g.instant("yasr.stale.result.msg",{secondsAgo:e.getHumanReadableSeconds(t)})};const P=function(){};angular.element(u).bind("resize",P),e.$on("$destroy",(function(){angular.element(u).unbind("resize",P)}))}function o(e,t,n,r){n.queryExists&&(e.queryExists=!0),e.query=angular.copy(n.query),e.title=n.title,e.edit=n.edit,e.okButtonText=n.okButtonText,e.existingQueryErrMsg=r.trustAsHtml(n.existingQueryErrMsg),e.ok=function(){e.form.$valid&&t.close(e.query)},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.core.directives.queryeditor.controllers",["graphdb.framework.utils.localstorageadapter","graphdb.framework.rest.sparql.service"]).controller("QueryEditorCtrl",i).controller("QuerySampleModalCtrl",o),i.$inject=["$scope","$timeout","toastr","$repositories","$modal","ModalService","SparqlRestService","$filter","$window","$jwtAuth","RDF4JRepositoriesRestService","MonitoringRestService","LocalStorageAdapter","LSKeys","$translate"],o.$inject=["$scope","$modalInstance","data","$sce"]},39:function(e,t,n){"use strict";n.r(t);n(35),n(4),n(36);var r=n(224),i=n.n(r),o=n(223),s=n.n(o),a=n(0);function l(e,t,n,r,o,l,u,c,p,d,f,h,g,m){let v;return{restrict:"AE",scope:!1,templateUrl:"js/angular/core/directives/queryeditor/templates/query-editor.html",link:function(E,x,y){E.nostorage=y.hasOwnProperty("nostorage"),E.notabs=y.hasOwnProperty("notabs"),E.notoolbar=y.hasOwnProperty("notoolbar"),E.notoolbarSaved=y.hasOwnProperty("notoolbarSaved"),E.notoolbarCopy=y.hasOwnProperty("notoolbarCopy"),E.notoolbarInference=y.hasOwnProperty("notoolbarInference"),E.notoolbarSameAs=y.hasOwnProperty("notoolbarSameAs"),E.nostatus=y.hasOwnProperty("nostatus"),E.norun=y.hasOwnProperty("norun"),E.runButtonName="query.editor.run.btn",y.runButtonName&&(E.runButtonName=y.runButtonName);if(E.nocount="true"===y.nocount,y.callbackOnChange){const e=E[y.callbackOnChange];"function"==typeof e&&(v=e)}e((function(){!function(E){function x(){angular.element("#wb-sparql-saveQuery")[0].click()}function y(){E.runQuery(!1,!1)}function T(){E.runQuery(!1,!0)}function N(){if(E.tabs.length<2||!E.currentQuery.id||!E.isTabChangeOk(!1))return;let e=D(E.currentQuery.id);e=(e+1)%E.tabs.length,S(E.tabs[e].id)}function C(){if(E.tabs.length<2||!E.currentQuery.id||!E.isTabChangeOk(!1))return;let e=D(E.currentQuery.id);e--,-1===e&&(e=E.tabs.length-1),S(E.tabs[e].id)}function S(t){e((function(){let e=$('a[data-id = "'+t+'"]');0===e.length&&(e=$("a[data-id]").first()),e.tab("show")}),0)}E.changePagination=function(){E.runQuery(!0,E.explainRequested)},window.editor=i.a.fromTextArea(document.getElementById("query"),{persistent:null,value:"",indentUnit:4,createShareLink:null,cursorHeight:1,sparql:{showQueryButton:!1,acceptHeaderGraph:"application/x-graphdb-table-results+json, application/rdf+json;q=0.9, */*;q=0.8",acceptHeaderSelect:"application/x-sparqlstar-results+json, application/sparql-results+json;q=0.9, */*;q=0.8"},extraKeys:{"Ctrl-Enter":y,"Cmd-Enter":y,"Shift-Ctrl-Enter":T,"Shift-Cmd-Enter":T,"Ctrl-Alt-T":E.addNewTab,"Cmd-Alt-T":E.addNewTab,"Ctrl-S":x,"Cmd-S":x,"Ctrl-Alt-Left":C,"Cmd-Alt-Left":C,"Ctrl-Alt-Right":N,"Cmd-Alt-Right":N},locale:m.getLanguage()}),window.editor.toastBuildIndex=function(){const e=Object(a.decodeHTML)(g.instant("explore.autocomplete.warning.msg"));n.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${e}</a></div>`,{allowHtml:!0})},window.editor.toastError=function(e){n.error("Cannot execute autocomplete query. "+getError(e))},window.editor.on("update",(function(){angular.element(".parseErrorIcon").parent().css("z-index","10")})),window.editor.on("changes",(function(){angular.element(".CodeMirror-linenumbers").css("width","1px"),angular.element(".CodeMirror-sizer").css("margin-left","0px"),clearTimeout(E.changesTimeout);const e=!window.editor.queryValid;E.changesTimeout=setTimeout(v?v():function(){const t=D(E.currentQuery.id)+1;$('a[data-id = "'+t+'"]').toggleClass("query-has-error",e).attr("title",e?g.instant("query.editor.query.syntax.error"):"")},200),E.currentQuery.query=window.editor.getValue(),E.currentQuery.queryType=window.editor.getQueryType()})),$(".fullscreenToggleBtns").hide();const I=function(e){$(e.target).removeClass("fa-link").addClass("fa-check").blur(),setTimeout((function(){$(e.target).removeClass("fa-check").addClass("fa-link")}),1e3)};window.onbeforeunload=function(){E.nostorage||f.set(h.TABS_STATE,E.tabs),E.saveTab(E.currentQuery.id)};const L=i.a.executeQuery,A=i.a.getUrlArguments;function b(e,t,n){return{status:e,statusText:t,responseText:n}}let R,w;E.$on("$destroy",(function(){E.nostorage||f.set(h.TABS_STATE,E.tabs),i.a.executeQuery=L,i.a.getUrlArguments=A,E.saveTab(E.currentQuery.id)})),i.a.drawButtons=function(e){e.buttons=$("#yasqe_buttons_mocked")},i.a.getActiveRepository=function(){return r.getActiveRepository()},i.a.getUrlArguments=function(e,t){const n=A(e,t),r=window.editor.getQueryType();return"SELECT"!==r&&"CONSTRUCT"!==r&&"DESCRIBE"!==r||(n.push({name:"limit",value:E.currentTabConfig.pageSize+1}),E.currentTabConfig.offset=(E.currentTabConfig.page-1)*E.currentTabConfig.pageSize+1,n.push({name:"offset",value:E.currentTabConfig.offset-1})),!E.explainRequested||"SELECT"!==r&&"CONSTRUCT"!==r||n.push({name:"explain",value:"true"}),n},i.a.executeQuery=function(e){if(w&&$(w.resultsContainer).length&&$(w.resultsContainer).empty(),e.options.sparql.headers["X-GraphDB-Catch"]=E.currentTabConfig.pageSize+"; throw",E.currentTrackAlias="query-editor-"+performance.now()+"-"+Date.now(),e.options.sparql.headers["X-GraphDB-Track-Alias"]=E.currentTrackAlias,e.options.sparql.headers["X-GraphDB-Repository-Location"]=r.getActiveRepositoryObject().location,E.countTimeouted=!1,"query"===e.getQueryMode()?e.options.sparql.endpoint="repositories/"+r.getActiveRepository():"update"===e.getQueryMode()&&(e.options.sparql.endpoint="repositories/"+r.getActiveRepository()+"/statements"),e.options.sparql.args=[{name:"infer",value:E.currentQuery.inference},{name:"sameAs",value:E.currentQuery.sameAs}],E.currentTabConfig.customUpdateMessage="","update"!==window.editor.getQueryMode()){const t=E.currentTabConfig,n=E.executedQueryTab.id;return window.editor.options.sparql.handlers.countCallback=function(e,r,i){if(200===e.status){const o=E.tabs[D(n)];o&&(w.setResultsCount(e,r,i),t.allResultsCount=w.allCount,o.allResultsCount=w.allCount,t.allResultsCountExact=!0,o.allResultsCountExact=!0,E.saveTab(o.id))}else t.countTimeouted=!0},null!=E.currentQuery.outputType?w.options.output=E.currentQuery.outputType:w.options.output="table",E.currentTabConfig.queryType=window.editor.getQueryType(),E.queryStartTime=(new Date).getTime(),L(e,{setQueryLimit:function(e){return"CONSTRUCT"===E.currentTabConfig.queryType&&r.isActiveRepoOntopType()?window.editor.getValueWithoutComments():e}})}{const t=function(){E.currentTabConfig.queryType="UPDATE",p.getRepositorySize().success((function(t){return E.repoSize=parseInt(t),E.queryStartTime=(new Date).getTime(),L(e,{})})).error((function(t){return n.warning(g.instant("query.editor.repo.size.error",{repo:r.getActiveRepository(),error:getError(t)})),E.queryStartTime=(new Date).getTime(),L(e,{})}))};d.checkConnector(window.editor.getValue()).then((function(e){if(e.data.command&&!e.data.hasSupport){E.currentTabConfig.queryType="ERROR",E.currentTabConfig.timeFinished=Date.now(),E.currentTabConfig.timeTook=(E.currentTabConfig.timeFinished-E.queryStartTime)/1e3;const t=b(-1,g.instant("query.editor.inactive.plugin.warning.msg",{connectorName:e.data.connectorName,pluginName:e.data.pluginName}));return w.results={getException:function(){return t}},E.setLoader(!1),void M({customError:t},"",null)}if("create"===e.data.command||"repair"===e.data.command){const t="repair"===e.data.command;t?(E.setLoader(!0,g.instant("query.editor.repairing.connector",{name:e.data.name})),E.currentTabConfig.customUpdateMessage={msg:"query.editor.repaired.connector",name:e.data.name}):(E.setLoader(!0,g.instant("query.editor.creating.connector",{name:e.data.name})),E.currentTabConfig.customUpdateMessage={msg:"created.connector",name:e.data.name});const n=E.$new(!0);n.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:t?g.instant("externalsync.repairing"):g.instant("externalsync.creating"),eta:"-",inline:!1,iri:e.data.iri,name:e.data.name,doneCallback:function(){R.dismiss("cancel")}},n.getHumanReadableSeconds=E.getHumanReadableSeconds,R=u.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:n})}else"drop"===e.data.command&&(E.setLoader(!0,g.instant("externalsync.delete.progress.msg",{name:e.data.name})),E.currentTabConfig.customUpdateMessage={msg:"externalsync.delete.success.msg",name:e.data.name});t()}),(function(){t()}))}};const O=i.a.getAjaxConfig;function M(e,t,n){e.getResponseHeader&&e.getResponseHeader("content-type")&&(e.contentType=e.getResponseHeader("content-type")),delete e.response;const r=D(E.executedQueryTab.id),i=E.tabs[r],o={queryType:E.currentTabConfig.queryType,yasrData:e,textStatus:t,jqXhrOrErrorString:n,page:E.currentTabConfig.page,pageSize:E.currentTabConfig.pageSize,allResultsCount:E.currentTabConfig.allResultsCount,allResultsCountExact:E.currentTabConfig.allResultsCountExact,resultsCount:E.currentTabConfig.resultsCount,offset:E.currentTabConfig.offset,timeTook:E.currentTabConfig.timeTook,timeFinished:E.currentTabConfig.timeFinished,sizeDelta:E.currentTabConfig.sizeDelta,customUpdateMessage:E.currentTabConfig.customUpdateMessage,errorMessage:E.currentTabConfig.errorMessage,warningMessage:E.currentTabConfig.warningMessage};"ERROR"!==E.currentTabConfig.queryType&&"UPDATE"!==E.currentTabConfig.queryType&&"ASK"!==E.currentTabConfig.queryType&&(o.outputType=E.yasr.options.output),angular.extend(E.currentQuery,o),angular.extend(i,o),E.nostorage||f.set(h.TABS_STATE,E.tabs),$('a[data-id = "'+E.executedQueryTab.id+'"]').tab("show")}function P(){var e=w.results.getBindings(),t=w.results.getVariables(),n=e[0],r=t[0];if(1===t.length&&1===e.length&&"plan"===r&&n[r].value.includes("# NOTE: Optimization groups")){var o=document.getElementsByClassName("nonUri")[0];o.classList.add("cm-s-default"),o.setAttribute("id","highlighted_output");var s=o.innerText.substring(1,o.innerText.length-1);o.innerHTML="",i.a.runMode(s,"sparql11",document.getElementById("highlighted_output"))}}function D(e){for(let t=0;t<E.tabs.length;t++){if(E.tabs[t].id===e)return t}}function k(e){return angular.isDefined(e)&&"false"!==e}function F(e,n,r){const i=E.getExistingTabId(e),o=E.$on("tabLoaded",(function(){angular.isDefined(n)&&(E.currentQuery.inference=k(n)),angular.isDefined(r)&&(E.currentQuery.sameAs=k(r)),k(t.search().execute)&&("update"===window.editor.getQueryMode()?l.openSimpleModal({title:g.instant("confirm.execute"),message:g.instant("query.editor.automatically.execute.update.warning"),warning:!0}).result.then((function(){E.runQuery(!1)})):E.runQuery(!1)),o()}));E.highlightNextTabChange=!0,angular.isDefined(i)?S(i):E.addNewTab(null,e.name,e.body)}function G(){if(t.search().savedQueryName)e=t.search().savedQueryName,r=t.search().owner,i=t.search().infer,s=t.search().sameAs,o.getSavedQuery(e,r).success((function(e){F(e,i,s)})).error((function(t){n.error(g.instant("query.editor.missing.saved.query.data.error",{savedQueryName:e,error:getError(t)}))}));else if(t.search().query){F({name:t.search().name,body:t.search().query},t.search().infer,t.search().sameAs)}else{S(f.get(h.TABS_STATE_CURRENT_ID))}var e,r,i,s}function U(){E.getNamespaces(),i.a.signal(window.editor,"repositoryOrAuthorizationChanged",r.getActiveRepository(),c.getAuthToken()),G()}i.a.getAjaxConfig=function(e,t){const n=O(e,t);return _.extend(n.headers,{Authorization:c.getAuthToken()}),n},E.copyToClipboardQuery=function(e,t){l.openCopyToClipboardModal(function(e,t){let n=[location.protocol,"//",location.host,location.pathname].join("");e?(n=n+"?savedQueryName="+encodeURIComponent(e),null!=t&&(n+="&owner="+encodeURIComponent(t))):n=n+"?"+$.param({name:E.currentQuery.name,infer:E.currentQuery.inference,sameAs:E.currentQuery.sameAs,query:window.editor.getValue()});return n}(e,t))},E.copyToClipboardResult=function(e){l.openCopyToClipboardModal(e)},E.goToVisual=function(){const e={query:window.editor.getValue(),sameAs:E.currentQuery.sameAs,inference:E.currentQuery.inference};t.path("graphs-visualizations").search(e)},$("textarea").on("paste",(function(){e((function(){E.addKnownPrefixes()}),0)})),E.$on("language-changed",(function(e,t){w&&w.options&&(w.options.locale=t.locale,w.changeLanguage(t.locale)),window.editor.options.locale=t.locale,i.a.signal(window.editor,"language-changed")})),w=s()(document.getElementById("yasr"),{getUsedPrefixes:{},persistency:!1,locale:m.getLanguage()}),window.yasr=w,w.afterCopy=I,w.getQueryResultsAsFormat=function(e){const t=$("#wb-download");t.attr("action","repositories/"+r.getActiveRepository()),$("#wb-download-query").val(E.currentQuery.query),window.editor.getValue()!==E.currentQuery.query&&n.warning(g.instant("query.editor.query.results.mismatch")),$("#wb-download-infer").val(E.currentQuery.inference),$("#wb-download-sameAs").val(E.currentQuery.sameAs);const i=localStorage.getItem("com.ontotext.graphdb.auth");i&&$("#wb-auth-token").val(i),$("#wb-download-accept").val(e),t.submit()},window.editor.options.sparql.handlers.complete=function(t,i,o){function s(){M(t,i,o)}if(R&&R.dismiss("cancel"),null===window.editor)return void E.setLoader(!1);if(E.currentTabConfig.errorMessage=t.getResponseHeader("X-GraphDB-Error"),E.currentTabConfig.warningMessage=t.getResponseHeader("X-GraphDB-Warning"),w.currentQuery=E.currentQuery,E.currentTabConfig.timeFinished=Date.now(),E.currentTabConfig.timeTook=(E.currentTabConfig.timeFinished-E.queryStartTime)/1e3,t.status>=400)return t.responseText=t.responseText.replace(/^([^: ]+: )+/,""),E.currentTabConfig.queryType="ERROR",s(),E.setYasrResponse(t,i,o),void E.setLoader(!1);if(0===t.status){E.currentTabConfig.queryType="ERROR";const e=b(-1,g.instant("aborted.request.msg"),g.instant("aborted.request.no.results.msg"));return w.results={getException:function(){return e}},E.setLoader(!1),void M({customError:e},"",null)}let a;if(E.setLoader(!1),"update"===window.editor.getQueryMode())a=function(){p.getRepositorySize().success((function(e){let t;void 0!==E.repoSize&&(t=Number(e)-E.repoSize),E.currentTabConfig.sizeDelta=t,s()})).error((function(e){n.warning(g.instant("query.editor.repo.size.error",{repo:r.getActiveRepository(),error:getError(e)})),E.currentTabConfig.sizeDelta=void 0,s()}))};else{if(200===t.status){const e=t.getResponseHeader("Content-Type");0!==e.indexOf("application/sparql-results+json")&&0!==e.indexOf("application/x-sparqlstar-results+json")&&0!==e.indexOf("application/x-graphdb-table-results+json")||t.responseJSON.results&&(E.currentTabConfig.resultsCount=t.responseJSON.results.bindings.length,t.responseJSON.results.bindings.length>E.currentTabConfig.pageSize&&(t.responseJSON.results.bindings.length=E.currentTabConfig.pageSize),E.currentTabConfig.allResultsCountExact||((E.nocount||E.countTimeouted||E.currentTabConfig.resultsCount<=E.currentTabConfig.pageSize)&&(t.status=204),E.currentTabConfig.allResultsCount=Math.max(E.currentTabConfig.allResultsCount,E.currentTabConfig.pageSize*(E.currentTabConfig.page-1)+E.currentTabConfig.resultsCount),E.currentTabConfig.resultsCount<=E.currentTabConfig.pageSize&&(E.currentTabConfig.allResultsCountExact=!0)))}E.setLoader(!0,g.instant("query.editor.render.results.msg"),null,!0),a=function(){E.setYasrResponse(t,i,o),s(),E.setLoader(!1)}}e((function(){a(),"CONSTRUCT"!==window.editor.getQueryType()?($(".yasr_btnGroup.nav.nav-tabs li a.disabled").removeClass("disabled").css("font-weight","400"),$(".yasr_btnGroup.nav.nav-tabs li.disabled a").addClass("disabled").css("font-weight","200"),"DESCRIBE"===window.editor.getQueryType()&&$(".yasr_btnGroup.nav.nav-tabs li a").removeClass("disabled").css("font-weight","400")):"CONSTRUCT"===window.editor.getQueryType()&&$(".yasr_btnGroup.nav.nav-tabs li a.disabled").removeClass("disabled").css("font-weight","400"),$("#yasr").css("padding","0"),$(".yasr_btnGroup li:nth-child(2)").hasClass("active")&&e((function(){$(".yasr_btnGroup li:nth-child(2) a").get(0).click()}),100),$("#wb-sparql-addNewTab").click((function(){$(".dataTables_filter").hide(),$(".resultsTable").hide()}))}),100)},window.editor.options.sparql.handlers.resetResults=function(){},E.yasr=w,E.setYasrResponse=function(e,t,n){e.responseJSON&&(e.response=e.responseJSON,e.responseText=void 0),window.yasr.plugins.table.options.highlightLiteralCellResult=P,w.setResponse(e,t,n)},E.$watch("yasr.options.output",(function(e){if(e&&"UPDATE"!==E.currentTabConfig.queryType&&"ASK"!==E.currentTabConfig.queryType){const t=E.tabs[D(E.currentQuery.id)];angular.isDefined(t)&&E.currentTabConfig.queryType&&t.outputType!==e&&(t.outputType=E.currentQuery.outputType=e,E.saveTab(t.id))}})),void E.$watch("namespaces",(function(){E.namespaces&&(w&&w.options&&E.namespaces&&(w.options.getUsedPrefixes=E.namespaces),i.a.signal(window.editor,"namespacesChanged",E.namespaces))})),$(document).mouseup((function(e){const t=$("#sampleQueriesCollapse");!t.is(e.target)&&0===t.has(e.target).length&&E.showSampleQueries&&E.toggleSampleQueries()})),r.getActiveRepository()&&U();E.$on("repositoryIsSet",(function(){r.getActiveRepository()&&U()})),e((function(){angular.element(document).find(".CodeMirror textarea:first-child").focus()}),50)}(E)}),150)}}}angular.module("graphdb.framework.core.directives.queryeditor.queryeditor",["ngCookies","graphdb.framework.externalsync.controllers","graphdb.framework.rest.connectors.service","graphdb.framework.utils.localstorageadapter"]).directive("queryEditor",l),l.$inject=["$timeout","$location","toastr","$repositories","SparqlRestService","ModalService","$modal","$jwtAuth","RDF4JRepositoriesRestService","ConnectorsRestService","LocalStorageAdapter","LSKeys","$translate","$languageService"]},42:function(e,t,n){"use strict";n.r(t),n.d(t,"STATIC_RULESETS",(function(){return r})),n.d(t,"REPOSITORY_TYPES",(function(){return i})),n.d(t,"FILENAME_PATTERN",(function(){return o})),n.d(t,"NUMBER_PATTERN",(function(){return s}));const r=[{id:"empty",name:"No inference"},{id:"rdfs-optimized",name:"RDFS (Optimized)"},{id:"rdfs",name:"RDFS"},{id:"rdfsplus-optimized",name:"RDFS-Plus (Optimized)"},{id:"owl-horst-optimized",name:"OWL-Horst (Optimized)"},{id:"owl-horst",name:"OWL-Horst"},{id:"owl2-ql-optimized",name:"OWL2-QL (Optimized)"},{id:"owl2-ql",name:"OWL2-QL"},{id:"owl-max-optimized",name:"OWL-Max (Optimized)"},{id:"owl-max",name:"OWL-Max"},{id:"owl2-rl-optimized",name:"OWL2-RL (Optimized)"},{id:"owl2-rl",name:"OWL2-RL"}],i={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},o=new RegExp("^[a-zA-Z0-9-_]+$"),s=new RegExp("^[0-9]+$")},43:function(e,t){angular.module("graphdb.framework.rest.graphexplore.data.service",[]).factory("GraphDataRestService",s),s.$inject=["$http"];const n="rest/class-hierarchy",r="rest/domain-range",i="rest/dependencies/",o="rest/explore-graph/";function s(e){return{getClassHierarchyData:function(t){return e.get(n,{params:{graphURI:t}})},reloadClassHierarchy:function(t){return e.get(n,{params:{doReload:!0,graphURI:t}})},getClassInstances:function(t){return e.get(`${n}/class-instances`,{params:{targetUri:t}})},getDomainRangeData:function(t,n){return e.get(r,{params:{targetUri:t,collapsed:n}})},checkDomainRangeData:function(t){return e.head(r,{params:{targetUri:t}})},getRelationshipsData:function(t,n,r){return e.get(`${i}matrix`,{params:{mode:n,classes:_.map(t,(function(e){return e.name})),graphURI:r}})},getRelationshipsClasses:function(t,n){return e.get(`${i}classes`,{params:{mode:t,graphURI:n}})},getRelationshipsStatus:function(t){return e.get(`${i}status`,{params:{graphURI:t}})},calculateRelationships:function(t){return e.get(`${i}update`,{params:{graphURI:t}})},getPredicates:function(t,n,r){return e.get(`${i}predicates`,{params:{from:t,to:n,mode:"all",graphURI:r}})},getInstanceNode:function(t){return e.get(`${o}node`,{params:{iri:t}})},getInstanceNodeLinks:function(t){return e.get(`${o}links`,{params:{iri:t}})},getRdfsLabelAndComment:function(t,n,r){const i=r||{};return e({url:"rest/explore/details",method:"GET",params:_.extend(i,{uri:t,languages:n}),headers:{Accept:"application/json"}})}}}},57:function(e,t){function n(e){return{initLazyList:function(t,n,r,i,o){return e((function(){const e=t+i-1,s=Math.max(0-i,e),a=Math.min(e+n-1,o.length);s>a?r([]):$.isArray(o)&&r(o.slice(s,a+1))}),100,!0)}}}angular.module("graphdb.framework.graphexplore.services.uiscroll",[]).factory("UiScrollService",n),n.$inject=["$timeout"]},58:function(e,t){angular.module("graphdb.framework.graphexplore.services.rdfsdetails",[]).factory("RdfsLabelCommentService",(function(){return{processAndFilterLabelAndComment:function(e){function t(e){const t={};for(let n in e)if(e.hasOwnProperty(n)){let r=n;n.indexOf(":")>-1&&(r=n,n=n.split(":")[1].toLowerCase()),t[n]=e[r]}return t}const n=e.results.bindings,r=[],i=[];_.each(n,(function(e){let n;angular.isUndefined(e.label)||(n=t(e.label),r.push(n)),angular.isUndefined(e.comment)||(n=t(e.comment),i.push(n))}));const o=function(e){return"en"===e.lang||"de"===e.lang},s=$.grep(r,o)[0],a=$.grep(i,o)[0],l=angular.isUndefined(s)?r.length>0?r[0].value:void 0:s.value,u=angular.isUndefined(a)?i.length>0?i[0].value:void 0:a.value;return{rdfsLabel:l,rdfsComment:u}}}}))},59:function(e,t){angular.module("graphdb.framework.rest.graphexplore.savedgraphs.service",[]).factory("SavedGraphsRestService",r),r.$inject=["$http"];const n="rest/explore-graph/saved";function r(e){return{getSavedGraphs:function(){return e.get(n)},getSavedGraph:function(t){return e.get(`${n}/${encodeURIComponent(t)}`)},editSavedGraph:function(t){return e.put(`${n}/${encodeURIComponent(t.id)}`,t)},deleteSavedGraph:function(t){return e.delete(`${n}/${encodeURIComponent(t.id)}`)},addNewSavedGraph:function(t){return e.post(n,t)}}}},60:function(e,t){angular.module("graphdb.framework.rest.graphconfig.service",[]).factory("GraphConfigRestService",i);const n="rest/explore-graph/",r=`${n}config`;function i(e){return{getGraphConfigs:function(){return e.get(r)},getGraphConfigSamples:function(){return e.get(`${n}samples`)},loadGraphForConfig:function(t,n,i,o){return e.get(`${r}/graph/${encodeURIComponent(t.id)}?includeInferred=${n}&linksLimit=${i}&sameAsState=${o}`)},getConfig:function(t){return e.get(`${r}/${encodeURIComponent(t)}`)},createGraphConfig:function(t){return e.post(r,t)},updateGraphConfig:function(t){return e.put(`${r}/${encodeURIComponent(t.id)}`,t)},deleteGraphConfig:function(t){return e.delete(`${r}/${encodeURIComponent(t.id)}`)},validateQuery:function(t,r,i,o,s){return e({method:"POST",url:`${n}validate`,data:{query:t,queryType:r,params:i,all:o,oneOf:s}})}}}i.$inject=["$http"]},61:function(e,t,n){"use strict";n.r(t);n(4);const r=400,i=50,o=1500,s=25;function a(e,t,n,a,l,u,c,p,d,f,h,g,m,v,E,x,y){e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=()=>angular.noop(),e.currentBrowserLimit=2e3,m.firefox?e.currentBrowserLimit=i:(m.safari||m.msie||m.msedge)&&(e.currentBrowserLimit=r);const T={};let N=0,C=0;t.key="",T.get=function(t,n,r){return d.initLazyList(t,n,r,N,e.instancesObj.items)};let S=allGraphs;const I=function(){if(e.getActiveRepository())return x.resolveGraphs().success((function(t){e.graphsInRepo=t.results.bindings,L()})).error((function(t){e.repositoryError=getError(t),c.error(getError(t),y.instant("graphexplore.error.getting.graphs"))}))},L=function(){const t=v.get(`classHierarchy-selectedGraph-${a.getActiveRepository()}`);null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?S=t:v.set(`classHierarchy-selectedGraph-${a.getActiveRepository()}`,S)};function A(t,n,r){e.classCountSlider.options&&e.classCountSlider.options.ceil!==n&&(e.classCountSlider={});var i;e.classCountSlider.value||(e.showExternalElements=!0,e.classCountSlider={value:n,options:{floor:1,ceil:n,vertical:!0,showSelectionBar:!0,onChange:function(){h(b,100,!0)}}},null===v.get(E.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&n>e.currentBrowserLimit&&(i=e.currentBrowserLimit,m.chrome?c.warning(y.instant("graphexplore.disabling.animations",{classLimit:i}),y.instant("graphexplore.reducing.visual.effects")):c.warning(y.instant("graphexplore.browser.performance",{browser:m.name,classLimit:i}),y.instant("graphexplore.reducing.visual.effects"))));const a=v.get(E.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=a&&"true"!==a&&(e.showExternalElements=!0),r?e.classCountSlider.value=r:n>=o&&(e.classCountSlider.value=o,c.warning(y.instant("graphexplore.class.count.slider",{count:o}),y.instant("graphexplore.reducing.class.count"))),n>=s&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=s,e.isWarningShowed=!0,c.warning(y.instant("graphexplore.class.count.browser",{count:s}),y.instant("graphexplore.reducing.class.count"))),h((function(){e.$broadcast("reCalcViewDimensions")}),200),b();let l=0;$("rzslider").on("wheel",(function(t){t.preventDefault(),t.stopPropagation();const n=(new Date).getTime();if(!(n-l>100))return;l=n,t=t.originalEvent;let r=e.classCountSlider.value;t.deltaY<=-1?r+=1:t.deltaY>=1&&(r-=1),r!==e.classCountSlider.value&&r>=e.classCountSlider.options.floor&&r<=e.classCountSlider.options.ceil&&e.$apply((function(){e.classCountSlider.value=r,h(b,100,!0)}))}))}function b(){e.currentSliderValue=e.classCountSlider.value}function R(e){const t=e.fullName,r=e.name;p.checkDomainRangeData(t).success((function(e,i){204===i?c.warning(y.instant("graphexplore.no.domain.range",{name:r})):(v.set(E.CLASS_HIERARCHY_LAST_SELECTED_CLASS,n.hash()),n.hash("").path("domain-range-graph").search("uri",t).search("name",r))})).error((function(){c.error(y.instant("graphexplore.error.request.failed",{name:r}))}))}function w(){n.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,v.clearClassHieararchyState(),e.hidePrefixes="true"===v.get(E.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},t.$broadcast("angucomplete-alt:clearInput")}function O(){e.hasClassHierarchy()&&h((function(){$("#toolbar").removeClass("ng-hide")}),0)}t.$watch((function(){return t.key}),(function(){N=0,_.each(e.instancesObj.items,(function(e){t.key>e&&N++})),C++})),T.revision=function(){return C},e.adapterContainer={adapter:{remain:!0}},e.$on("goToDomainRangeGraphView",(function(e,t){R(t)})),e.$on("classCount",A),e.$on("repositoryIsSet",(function(){if(!l.isLicenseValid())return;if(M===a.getActiveRepository())return;M=a.getActiveRepository();if(e.repositoryError=null,!M)return;S=allGraphs,I().then(P)})),e.datasource=T,e.goToDomainRangeGraphView=R,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,t.$broadcast("sidePanelClosed")},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return a.getActiveRepository()},e.isSystemRepository=function(){return a.isSystemRepository()},e.confirmReloadClassHierarchy=function(){g.openSimpleModal({title:y.instant("confirm.operation"),message:y.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){w(),e.loader=!0,e.hierarchyError=!1,p.reloadClassHierarchy(S.contextID.uri).success((function(t){e.loader=!1,e.classHierarchyData=t,O(),A()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),c.error(getError(t),y.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){g.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){const n={name:e.title};t.$broadcast("searchedClass",n)}},e.instancesQueryObj.query="",e.instancesFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.instancesQueryObj.query.toLowerCase())>=0},I(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&h((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(t){const n=t.fullName;let r=t.name;if(r===n){const e=r.lastIndexOf("#");r=r.substring(e+1)}e.encodedUri=encodeURIComponent(n);const i=encodeURIComponent("prefix onto:<http://www.ontotext.com/> select ?s from onto:disable-sameAs { ?s a <"+n+"> . }");e.viewInstancesUri="sparql?name="+r+"&infer=true&sameAs=false&query="+i+"&execute=true",p.getRdfsLabelAndComment(n).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment,e.expanded=!1})).error((function(){c.error("Error getting rdfs:label and rdfs:comment")})),e.instancesQueryObj.query="",e.instancesLoader=!0,p.getClassInstances(n).success((function(t){e.instancesObj.items=[],_.each(t,(function(t,n){const r={};r.type=t.startsWith("<<")&&t.endsWith(">>")?"triple":"uri",r.absUri=encodeURIComponent(t),r.absUriNonEncoded=t,r.resolvedUri=n,e.instancesObj.items.push(r)})),e.instancesLoader=!1,e.instancesSearchPlaceholder=e.instancesObj.items.length<1e3?"Search class instances":"Search first 1000 class instances",e.instancesNotFiltered=e.instancesObj.items})).error((function(){c.error(y.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));let M=a.getActiveRepository();function P(){w(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,p.getClassHierarchyData(S.contextID.uri).success((function(t,n){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=t,207===n&&c.warning(y.instant("graphexplore.update.diagram"),y.instant("graphexplore.repository.data.changed")),O()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),c.error(getError(t),y.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return l.isLicenseValid()},e.chosenGraph=function(e){S=e,P(),v.set(`classHierarchy-selectedGraph-${a.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",a),a.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]},62:function(e,t,n){"use strict";n.r(t);n(4);function r(e,t,n,r,i,o,s,a,l,u,c,p,d){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;n.key="",f.get=function(t,n,r){return u.initLazyList(t,n,r,h,e.predicatesObj.items)},n.$watch((function(){return n.key}),(function(){h=0,_.each(e.predicatesObj.items,(function(e){n.key>e&&h++})),g++})),f.revision=function(){return g},e.adapterContainer={adapter:{remain:!0}};const m=s.get(a.DOMAIN_RANGE_COLLAPSE_EDGES);function v(){const e=s.get(a.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,n){const r=n.objectPropClassUri,i=n.objectPropClassName;t.path("domain-range-graph").search("uri",r).search("name",i)})),e.$on("switchEdgeMode",(function(e,n){t.path("domain-range-graph").search("uri",n.uri).search("name",n.name).search("collapsed",n.collapsed)})),e.$on("repositoryIsSet",(function(){if(E===i.getActiveRepository())return;E=i.getActiveRepository();v()})),e.$on("changeCollapsedEdgesState",(function(t,n){e.collapseEdges=!n,s.set(a.DOMAIN_RANGE_COLLAPSE_EDGES,e.collapseEdges)})),e.goToClassHierarchyView=v,e.copyToClipboard=function(e){c.openCopyToClipboardModal(e)},e.toggleCollapseEdgesState=function(){e.collapseEdges=!e.collapseEdges,o.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&&r((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedPredicate",(function(){e.showPredicatesInfoPanel&&function(t){const n=t.target,r=t.source;e.encodedUri=encodeURIComponent(t.uri),e.sourceTargetObjectNodeUri=n.objectPropClassUri?n.objectPropClassUri:r.objectPropClassUri,e.encodedSourceTargetObjectNodeUri=encodeURIComponent(e.sourceTargetObjectNodeUri),e.sourceTargetObjectNodeName=n.objectPropClassName?n.objectPropClassName:r.objectPropClassName?r.objectPropClassName:"<i>Literal</i>",-1===e.sourceTargetObjectNodeName.indexOf("Literal")?l.getRdfsLabelAndComment(e.sourceTargetObjectNodeUri).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment})).error((function(){p.error(d.instant("domain.range.error.get.label.comment"))})):(e.rdfsComment=void 0,e.rdfsLabel=void 0);e.predicatesObj.items=[],e.predicatesQueryObj.query="";const i=n.allEdges?n.allEdges:r.allEdges;_.each(i,(function(t){const n={};n.absUri=encodeURIComponent(t.uri),n.absUriNonEncoded=t.uri,n.resolvedUri=t.name,n.isImplicit=t.implicit,e.predicatesObj.items.push(n)})),e.predicatesListNotFiltered=e.predicatesObj.items}(e.selectedPredicate)})),$(document).ready((function(){$(".compact-mode-toggle").click((function(){$(".tooltip").hide()}))}));let E=i.getActiveRepository()}angular.module("graphdb.framework.graphexplore.controllers.domainrange",["ui.scroll.jqlite","ui.scroll","ngSanitize","graphdb.framework.utils.localstorageadapter"]).controller("DomainRangeGraphCtlr",r),r.$inject=["$scope","$location","$rootScope","$timeout","$repositories","$window","LocalStorageAdapter","LSKeys","GraphDataRestService","UiScrollService","ModalService","toastr","$translate"]},63:function(e,t,n){(function(e){const t={WAIT:"WAIT",NO_REPO:"NO_REPO",READY:"READY",IN_PROGRESS:"IN_PROGRESS",ERROR:"ERROR"},n={contextID:{type:"all",value:"all.graphs.label",uri:""}};function r(e){if(e<1e3)return e;const t=Math.floor(Math.log(e)/Math.log(1e3));let n=e/Math.pow(1e3,t);return n=n%1>1/Math.pow(1e3,t-1)?n.toFixed(2):n.toFixed(0),n+["K","M","G","T","P","H"][t-1]}function i(e,r,i,o,s,a,l,u,c,p,d){let f=null;e.status=i.getActiveRepository()?t.WAIT:t.NO_REPO;let h=n;const g=function(){p.resolveGraphs().success((function(t){e.graphsInRepo=t.results.bindings,m(),e.isSystemRepository()?"READY"!==e.status&&E():(e.status="WAIT",E(!0))})).error((function(t){e.repositoryError=getError(t),o.error(getError(t),d.instant("graphexplore.error.getting.graph"))}))},m=function(){const t=c.get(`dependencies-selectedGraph-${i.getActiveRepository()}`);null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?h=t:c.set(`dependencies-selectedGraph-${i.getActiveRepository()}`,h)},v=function(n){d3.select("#dependencies-chord").html(""),e.status=t.WAIT,a.getRelationshipsData(n,e.direction,h.contextID.uri).success((function(n){e.dependenciesData={matrix:n.right,nodes:n.left,hasLinks:_.sum(_.map(n.right,(function(e){return _.sum(e)})))>0,direction:e.direction},e.status=t.READY})).error((function(n){e.status=t.READY,o.error(getError(n),d.instant("graphexplore.error.dependencies.count"))}))},E=function(n){(e.status!==t.READY||n)&&(e.status=t.WAIT,a.getRelationshipsStatus(h.contextID.uri).success((function(n){if(e.status=n,e.status===t.IN_PROGRESS){if(null!==f)return;f=s(E,2e3)}e.status===t.READY&&(null!==f&&(s.cancel(f),f=null),a.getRelationshipsClasses(e.direction,h.contextID.uri).success((function(t,n){e.allClasses.items=_.filter(t,N),e.allNotFilteredClasses=t,e.selectedClasses=void 0,angular.isUndefined(e.selectedClasses)&&(e.selectedClasses=t.slice(0,10)),v(e.selectedClasses),207===n&&o.warning(d.instant("graphexplore.update.diagram"),d.instant("graphexplore.repository.data.changed"))}))),0===e.status.indexOf("ERROR;")&&(e.status=t.ERROR,o.error(d.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})))})).error((function(n){e.status=t.ERROR,o.error(getError(n),d.instant("graphexplore.error.dependencies.count.status"))})))};e.allClasses={},e.allClasses.items=[],e.allNotFilteredClasses=[],e.direction="all";const x={};let y=0,T=0;function N(t){return-1!==t.name.toLowerCase().indexOf(e.classQuery.query.toLowerCase())}r.key="",x.get=function(t,n,r){return l.initLazyList(t,n,r,y,e.allClasses.items)},r.$watch((function(){return r.key}),(function(){y=0,_.each(e.allClasses.items,(function(e){r.key>e&&y++})),T++})),x.revision=function(){return T},e.datasource=x,e.adapterContainer={adapter:{remain:!0}},e.classQuery={},e.classQuery.query="",e.classFilterFunc=N,e.$watch("allClasses.items",(function(){e.allClasses.items.length>0&&s((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("direction",(function(){!i.getActiveRepository()||e.isSystemRepository()||i.isActiveRepoFedXType()||g()})),e.$on("$destroy",(function(){s.cancel(f)})),e.isLoading=function(){return e.status===t.IN_PROGRESS||e.status===t.WAIT},e.confirmCalculateDependencies=function(){u.openSimpleModal({title:d.instant("confirm.operation"),message:d.instant("graphexplore.calculating.relationships"),warning:!0}).result.then((function(){e.calculateDependencies()}))},e.calculateDependencies=function(){e.status=t.WAIT,e.selectedClasses=void 0,a.calculateRelationships(h.contextID.uri).success((function(t){0===t.indexOf("ERROR;")?o.error(d.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})):E()})).error((function(e){o.error(d.instant("graphexplore.error.could.not.force.count",{error:getError(e)}))}))},e.addClass=function(t){e.selectedClasses.push(t),v(e.selectedClasses)},e.removeClass=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t.name})),v(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})),v(e.selectedClasses)},e.removeClassByName=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t})),v(e.selectedClasses)},e.removeAllClasses=function(){e.selectedClasses=[],v(e.selectedClasses)},e.isSystemRepository=function(){return"SYSTEM"===i.getActiveRepository()};const C=e.$on("repositoryIsSet",(function(){e.classQuery={},e.classQuery.query="",e.repositoryError=null,h=n,i.getActiveRepository()&&!i.isActiveRepoFedXType()?g():e.status=t.NO_REPO}));window.addEventListener("beforeunload",(function e(){C(),window.removeEventListener("beforeunload",e)})),e.selectGraph=function(e){h=e,E(!0),c.set(`dependencies-selectedGraph-${i.getActiveRepository()}`,h)},e.getSelectedGraphValue=function(){return h.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelectedGraphValue()}}Object.defineProperty(e,"allGraphs",{get:()=>n}),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",i).config(["$tooltipProvider",function(e){e.options({appendToBody:!0})}]).filter("humanize",(function(){return r})),i.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","GraphDataRestService","UiScrollService","ModalService","LocalStorageAdapter","RDF4JRepositoriesRestService","$translate"]}).call(this,n(5))},64:function(e,t,n){"use strict";n.r(t);n(3);var r=n(221),i=n(220),o=n.n(i),s=(n(4),n(42));function a(e,t,n,i,a,l,u,c,p,d,f,h,g,m,v,E,x,y,T,N,C,S){e.languageChanged=!1,e.propertiesObj={},e.propertiesQueryObj={},e.propertiesObj.items=[],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=S.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=S.instant("sidepanel.invalid.limit.links.tooltip"),t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=S.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=S.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=S.instant("visual.search.instance.placeholder")})),e.onopen=e.onclose=()=>angular.noop(),e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);const I={};let L=0,A=0,b={},R=0;const w=16,O=d3.behavior.zoom().scaleExtent([.5,10]);let M;const P=1e3,D=1e3;let k,F;function G(e){m.openCopyToClipboardModal(e)}function U(){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}}))}t.key="",I.get=function(t,n,r){return g.initLazyList(t,n,r,L,e.propertiesObj.items)},t.$watch((function(){return t.key}),(function(){L=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&L++})),A++})),I.revision=function(){return A},e.datasource=I,e.adapterContainer={adapter:{remain:!0}},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=S.instant("visual.search.instance.placeholder"),e.propertiesFilterFunc=function(t){return t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0},e.resetState=function(){e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,b={},R=0},e.pushHistory=function(t,n){e.embedded&&(t.embedded=!0),f.search(t),f.state(n)},e.goToHome=function(){e.resetState(),f.url("graphs-visualizations")},e.shouldShowSettings=function(){return e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id},e.shouldDisableSameAs=function(){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.$watch("propertiesObj.items",(function(){angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&l((function(){e.adapterContainer.adapter.reload()}),500)})),e.toggleMoreInfo=function(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=G,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=angular.copy(e.defaultSettings),d.when(h.getPrincipal()).then(t=>(function(t){const n=t.appSettings;e.defaultSettings.includeInferred=n.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=n.DEFAULT_INFERENCE&&n.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=n.DEFAULT_VIS_GRAPH_SCHEMA;const r=x.get(y.GRAPHS_VIZ);if(r&&"object"==typeof r)try{e.saveSettings=r,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=angular.copy(e.defaultSettings),x.set(y.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=angular.copy(e.defaultSettings)})(t)),e.resetSettings=function(){e.settings=angular.copy(e.defaultSettings),e.validateLinksLimit(),U()},e.changeLimit=function(t){let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=function(){e.invalidLimit=!s.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=function(){e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=angular.copy(e.saveSettings):e.settings=angular.copy(e.defaultSettings),U()},e.reExpandNode=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)};const B=function(t,n,r){const i=void 0===n?e.saveSettings.sameAsState:!0===n,o=void 0===r?e.saveSettings.includeInferred:!0===r;e.loading=!0,u({url:"rest/explore-graph/graph",method:"POST",headers:{"Content-Type":"application/json"},data:{query:t,linksLimit:e.saveSettings.linksLimit,languages:e.shouldShowSettings()?e.saveSettings.languages:[],includeInferred:o,sameAsState:i}}).then((function(e){he(e)}),(function(t){e.loading=!1,a.error(getError(t.data),S.instant("graphexplore.error.cannot.load.graph"))}))};function j(e){return e.replace(/[()']/g,"")}function V(e,t){let n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")}function H(e){return[e.source.iri,e.target.iri].join(">")}function q(e){if(e.isTriple){let t=document.getElementById(j(V(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x}function z(e){if(e.isTriple){let t=document.getElementById(j(V(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y}function W(e){let t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`}function Q(e){return j(`${e.source.isTriple?V(e.source.iri,!0):e.source.iri}>${e.target.isTriple?V(e.target.iri,!0):e.target.iri}>marker`)}function Y(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,n){return e.x=t,e.y=n,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(n){const r=n.source.iri,i=n.target.iri,o=_.min([r,i])+"|"+_.max([r,i]);t[o]||(t[o]=1,e[r]=(e[r]||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 n,r;n=e.isTripleSource?Ne(e.source):_.find(t,(function(t){return t.iri===e.source})),r=e.isTripleTarget?Ne(e.target):_.find(t,(function(t){return t.iri===e.target}));let i={source:n,target:r,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${i.source.isTriple?V(i.source.iri):i.source.iri}>${i.target.isTriple?V(i.target.iri):i.target.iri}`;if(X.tripleLinksCopy.has(e)){let t=X.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),X.tripleLinksCopy.set(e,t),null}X.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of X.tripleLinksCopy.keys())1===X.tripleLinksCopy.get(e).length&&X.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return n(e,t).length};function n(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 r=n(e,t),i=_.map(r,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const r=n(e,t),i=_.map(r,(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(n){let r=e.split(">"),i=V(n.source.iri),o=V(n.target.iri);if(i===e&&X.tripleNodes.delete(o)){let e=o.split(">");t.push({source:e[0],target:e[1]})}let s=i===e||o===e||n.source.iri===r[0]&&n.target.iri===r[1];return s&&(X.tripleLinksCopy.delete(`${i}>${o}`),X.tripleLinksCopy.delete(`${o}>${i}`)),s})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(n){let r=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&r.push(V(e.target.iri)),e.source.isTriple||e.target.isTriple||r.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(r);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 r=[],i=this.links;this.links=_.reject(this.links,(function(o){let s=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!s){let r;if(o.source.iri!==e.iri||2!==t(o.target,i)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,i)||o.source.isTriple||(r=n(o.source,i)):r=n(o.target,i),!r)return!1;s=(r[0].source.iri===e.iri||r[0].target.iri)&&(r[1].source.iri===e.iri||r[1].target.iri)}return s&&(o.target.isTriple&&r.push(V(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),s})),this.removeTriples(r),i=this.links,this.nodes=_.reject(this.nodes,(function(n){return 0===t(n,i)&&n.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;let r=V(e.iri);if(this.tripleNodes.has(r)){let t=this.tripleNodes.get(r);t.push(e),this.tripleNodes.set(r,t)}else e.weight=10,this.tripleNodes.set(r,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:angular.copy(e.labels),types:angular.copy(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),n=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:n,colorIndex:R,type2color:b,scale:O.scale(),translate:O.translate()}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=angular.copy(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)&&(R=t.colorIndex,b=angular.copy(t.type2color)),angular.isDefined(t.translate)&&angular.isDefined(t.scale)&&(M="translate("+t.translate[0]+", "+t.translate[1]+") scale("+t.scale+")",O.translate(t.translate),O.scale(t.scale)),ce()}}e.updateSettings=function(){e.invalidLimit?a.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?e.reExpandNode(e.rootNodeIri):e.queryResultsMode&&f.search().query?B(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&e.loadGraphConfig(e.configLoaded),e.saveSettings.showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none"),e.showInfoPanel=!1,e.showFilter=!1,x.set(y.GRAPHS_VIZ,e.saveSettings))},e.showInfoPanel=!1;let X=new Y;e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},e.getGraphConfigs=function(t){N.getGraphConfigs().success((function(n){e.graphConfigs=n,t&&t()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.graph.configs.short.msg"))}))},e.loadConfigForId=function(t,n){t===e.defaultGraphConfig.id?e.loadGraphConfig(e.defaultGraphConfig):N.getConfig(t).success((function(t){e.loadGraphConfig(t),n()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.could.not.load.config",{configId:t}))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=function(t){e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.loadGraphConfig=function(t){e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?l((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,N.loadGraphForConfig(t,t.startQueryIncludeInferred,e.saveSettings.linksLimit,t.startQuerySameAs).then((function(e){he(e)}),(function(t){e.loading=!1,a.error(getError(t),S.instant("graphexplore.error.graph.load"))})))},e.deleteConfig=function(t){m.openSimpleModal({title:S.instant("common.confirm"),message:S.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){N.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=function(t){e.pushHistory({config:t.id},{config:t}),e.resetState(),e.loadGraphConfig(t)},E.onpopstate=function(t){e.resetState(),t.state&&(t.state.config?(e.loadGraphConfig(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))};const K=function(){f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,B(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0,angular.isDefined(n)&&(e.rootNodeIri=n,u({url:"rest/explore-graph/node",method:"GET",params:{iri:n,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?e.saveSettings.languages:[],includeInferred:e.saveSettings.includeInferred,sameAsState:e.saveSettings.sameAsState}}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),X=new Y;const n=X.addNode(t.data,P/2,D/2);M="translate(0, -70) scale(1)",O.translate([0,-70]),O.scale(1),me(n,!0)})).catch((function(t){e.loading=!1,a.error(getError(t),S.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri),f.search().saved&&T.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.could.not.open"))}))},Z=function(){f.search().config?e.loadConfigForId(f.search().config,K):f.search().query||f.search().uri?(e.loadGraphConfig(e.defaultGraphConfig),K()):K()};function J(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(Z),e.getNamespacesPromise=C.getNamespaces(e.getActiveRepository()).success((function(t){const n=_.map(t.results.bindings,(function(e){return{uri:e.namespace.value,prefix:e.prefix.value}}));e.namespaces=_.sortBy(n,(function(e){return e.uri.length})),ee()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.view.will.not.work"))})))}function ee(){i.isLicenseValid()&&(e.getAutocompletePromise=p.checkAutocompleteStatus())}e.replaceIRIWithPrefix=function(t){const n=e.namespaces,r=_.findLast(n,(function(e){return 0===t.indexOf(e.uri)}));return r?r.prefix+":"+t.substring(r.uri.length):t},e.addedTag=function(t){return t.text.indexOf(":")<0?(a.warning(S.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const n=e.split(":"),r=n[0],i=n[1];if(!angular.isUndefined(i)){const e=c.getNamespaceUriForPrefix(t,r);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?a.warning(S.instant("graphexplore.absolute.prefixed.iri.option"),t):a.warning(S.instant("graphexplore.absolute.prefixed.iri"),t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return a.warning(S.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return a.warning(S.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.hasInitedRepository=!1,e.$on("autocompleteStatus",(function(){ee()})),e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),J(n.newRepo),n.newRepo&&(e.resetState(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),K()))})),J();const te=500,ne=1.75,re=d3.scale.linear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),ie=d3.scale.linear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(b[e])&&(b[e]=R,R++);const t=b[e];return t>39?"#c2c2c2":t%2==0?re(t/2):ie(t/2)};const oe=d3.layout.force().gravity(.07).size([P,D]),se=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+P+" "+D).attr("preserveAspectRatio","xMidYMid meet");let ae=0,le=0;const ue=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.0.3-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 ce(t){d3.selectAll("svg g").remove(),d3.selectAll("svg rect").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),O.on("zoom",(function(){M="translate("+d3.event.translate+") scale("+d3.event.scale+")",n.attr("transform",M)})),se.append("rect").attr("width",10*P).attr("height",10*D).attr("x",-(10*P-P)/2).attr("y",-(10*D-D)/2).style("fill","none").style("pointer-events","all").call(O).on("click",(function(){d3.event.stopPropagation(),ve(),oe.stop()}));const n=se.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(M)&&!t?M:""})),i=o()().attr("class","d3-tip").customPosition((function(){const e=k.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let n="";return t.fixed&&(n+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?n+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):n+="<i>No types</i>",n})),s=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,n){if(0===n)return Se(t);if(n<10)return" · "+Se(t);if(10===n){const t=function(e){return e.predicates.length-10}(e),n=t>1?t+" predicates":t+" predicate";return" · "+S.instant("graphexplore.tip.text",{textToShow:n})}})),""),t};let u;const c=o()().attr("class","d3-tip").customPosition((function(e){const t=u.getBoundingClientRect(),n=function(e){const t=s(e),n=document.createElement("canvas").getContext("2d");return n.font="13px Arial",e.predicates.length<10?n.measureText(t).width:n.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:n+"px"}})).html((function(e){return s(e)}));const p=function(){l.cancel(void 0),l.cancel(ae),k=null,i.hide(),le=l((function(){ve()}),500)};se.call(i);se.call(c);let d=se.selectAll(".link"),f=se.selectAll(".node");oe.nodes(X.nodes).charge(-3e3),oe.links(X.links).linkDistance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),n=e.predicates[0].split("/"),r=n[n.length-1];t.addClass("predicate-text").text(r),$("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})),n.append("defs").selectAll("marker").data(oe.links()).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return Q(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"),d=n.selectAll(".link").data(X.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return j(H(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${Q(e)})`}));const h=n.selectAll(".link-wrapper").append("text").text((function(e){return Ce(e)})).attr("class",(function(e){return e.predicates.length>1||X.tripleNodes.has(H(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",e.saveSettings.showLinksText?"":"none").on("mouseover",(function(e){d3.event.stopPropagation(),function(e){l.cancel(void 0);const t=u=d3.event.target;l((function(){u===t&&e.predicates.length>1&&c.show(e,u)}),300)}(e)})).on("mouseout",(function(){l.cancel(void 0),u=null,c.hide()})).on("click",(function(t){d3.event.stopPropagation(),function(t){Te();let n=H(t);if(1===t.predicates.length&&X.tripleNodes.has(n)){F=null;let e=X.tripleNodes.get(n)[0];if(de(e,this,d3.event.button)){let t={};t.iri=e.iri,t.pred=Se(e.iri.split(" ")[1]),xe(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,F===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(F=null);F=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){let n=function(e,t){let n=H(t);return X.tripleNodes.has(n)?X.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),r=n>-1;return{value:Se(e),partOfTriple:r,linkId:r?H(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(t)}(t)}));let g,m=0,v=0,E=0;const x=function(){d3.event.button&&0!==d3.event.button||(p(),l.cancel(g),e.showPredicates=!1,d3.event.timeStamp-m<te?v++:v=1,m=d3.event.timeStamp,d3.event.preventDefault())},y=function(t){if(d3.event.button&&0!==d3.event.button)return;l.cancel(g);const n=d3.event,r=this;if(d3.event.timeStamp-m<te)if(1===v)g=l((function(){de(t,r,n)}),40+te-(d3.event.timeStamp-m));else if(2===v){X.countLinks(t,X.links)<=e.saveSettings.linksLimit?me(t,!1,r.parentNode):a.info(S.instant("graphexplore.increase.limit"),S.instant("graphexplore.node.at.max")),e.closeInfoPanel()}d3.event.preventDefault()};function T(e,t){let r,i,o,s,a=!0;if("down"===t)r=2*e.size,i=e.size/3,o=.8,s=.3;else if("down-fixed"===t)r=2*e.size,i=e.size,o=.8,s=.66;else if("up"===t)r=e.size/3,i=2*e.size,o=.3,s=.8;else{if("fixed"!==t)return;r=e.size,o=.66,a=!1}let l=n.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",o);"fixed"!==t&&"down-fixed"!==t||(e.pin=l),a&&(l=l.transition().duration(1e3).style("font-size",(function(){return i+"px"})).attr("opacity",s),"down-fixed"!==t&&l.remove())}const N=d3.behavior.drag().origin((function(e){return e})).on("dragstart",(function(e){0===d3.event.sourceEvent.button&&(e.fixedBeforeDrag=e.fixed,e.isBeingDragged=!0,e.beginDragging=!0,ve(),d3.event.sourceEvent.stopPropagation(),d3.select(this).classed("dragging",!0))})).on("drag",(function(t){t.isBeingDragged&&(v=0,t.px=d3.event.x,t.py=d3.event.y,t.fixed?t.beginDragging&&T(t,"fixed"):(e.numberOfPinnedNodes++,t.fixed=!0,T(t,"down-fixed")),t.pinWasFixed=!0,t.beginDragging=null,oe.resume())})).on("dragend",(function(e){e.isBeingDragged&&(e.pinWasFixed&&(e.pinWasFixed=null,d3.select(".pinned").remove()),e.isBeingDragged=!1,d3.select(this).classed("dragging",!1))}));f=n.selectAll(".node").data(X.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])})).call(N).on("mouseover",(function(t){if(!t.isBeingDragged){const n=d3.event;l.cancel(le),ae=l(()=>{(function(t,n){if(e.showInfoPanel)return!1;(pe.closeIcon||pe.expandIcon||pe.focusIcon||pe.copyURIIcon)&&pe.removeIcons();if(oe.alpha()<.05)return pe.initIcons(t,n.parentNode),oe.stop(),!0;return!1})(t,this)&&function(e,t){l.cancel(void 0);const n=k=t.target;l((function(){k===n&&i.show(e,k)}),300)}(t,n)},400)}})).on("mouseout",p).on("mousedown",x).on("touchstart",(function(e){x(),E=0,g=l((function(){E<5&&fe(e),g=null,v=0}),1e3)})).on("touchmove",(function(){E++})).on("mouseup",y).on("touchend",y).on("contextmenu",(function(t){d3.event.shiftKey||(d3.event.preventDefault(),ve(),e.closeInfoPanel(),t.fixed?(e.numberOfPinnedNodes--,t.fixed=!1,T(t,"up"),oe.resume()):(e.numberOfPinnedNodes++,t.fixed=!0,T(t,"down")),function(e){k&&i.show(e,k)}(t))}));const C=n.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*ne}));n.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=r.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,w,!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})),l((function(){$(".node-label-body div").each((function(e,t){let n=t.textContent.substring(0,t.textContent.length-1);let r=0;for(;r<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)n=n.substring(0,n.length-1),t.textContent=n+"…",r++}))}),50)}(C),oe.on("tick",(function(){d3.geom.quadtree(X.nodes);X.nodes.length;d.attr("x1",(function(e){return q(e.source)})).attr("y1",(function(e){return z(e.source)})).attr("x2",(function(e){return q(e.target)})).attr("y2",(function(e){return z(e.target)})),h.attr("x",(function(e){let t=q(e.source),n=q(e.target);return e.x=.5*(t+n)})).attr("y",(function(e){let t=z(e.source),n=z(e.target);return e.y=.5*(t+n)})).attr("transform",(function(e){return"rotate("+function(e,t){const n={x:q(e.source),y:z(e.source)},r={x:q(e.target),y:z(e.target)};if(t)return 180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;{const e=180*Math.atan2(r.y-n.y,r.x-n.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})),n.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),n.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),C.attr("x",(function(e){return e.x-e.size*ne})).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}))})),angular.isDefined(ue)&&ue.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(n){let r=j(n.source.iri),i=j(n.target.iri);if(r===t&&i===e){let e=r;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),n.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),oe.start()}ce();const pe=new function(){function e(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,r){const i=o()().attr("class","d3-tip d3-actions-tip").customPosition((function(){const e=d3.event.target.getBoundingClientRect();return{top:e.top-20+"px",left:e.right+10+"px"}})).html((function(e){return e}));se.call(i);n.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return e(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(--onto-orange)"),this.collapseIcon.on("click",(function(){var e;(e=n).isExpanded=!1,X.removeNodeLeafLinks(e),ce()})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(ae),l.cancel(le)})).on("mouseout",(function(){i.hide(),le=l((function(){ve()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return e(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(--onto-orange)"),this.expandIcon.on("click",(function(){me(n,!1,r)})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(le),l.cancel(ae)})).on("mouseout",(function(){i.hide(),le=l((function(){ve()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return e(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(--onto-orange)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",n.iri)})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(le),l.cancel(ae)})).on("mouseout",(function(){i.hide(),le=l((function(){ve()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return e(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(--onto-orange)"),this.copyURIIcon.on("click",(function(){G(n.iri),ve(),i.hide()})).on("mouseover",(function(){i.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>"),l.cancel(le),l.cancel(ae)})).on("mouseout",(function(){i.hide(),le=l((function(){ve()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return e(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(--onto-orange)"),this.closeIcon.on("click",(function(){fe(n)})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(le),l.cancel(ae)})).on("mouseout",(function(){i.hide(),le=l((function(){ve()}),500)})),this.animateMenu(n)},this.animateMenu=function(t){let n=0;let r=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.expandedState=!0}};function de(n,r,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",n.iri),!1):i.ctrlKey||i.metaKey?(fe(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(Ee(n),!0)}function fe(e){X.removeNode(e),ce()}function he(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),X=new Y,M="translate(0, -70) scale(1)",O.translate([0,-70]),O.scale(1)}(t),ge(t)}function ge(t,n,r){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(X.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));let o=[];const s=X.tripleLinksCopy.values();for(let e=0;e<X.tripleLinksCopy.size;e++){s.next().value.forEach(e=>{o.push(e)})}i=_.filter(i,(function(e){return-1===_.findIndex(o,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),i=_.filter(i,(function(e){return e.source!==e.target}));const l=function(e,t){let n=t.map((function(t){return t[e]}));return t.filter((function(t,r){return n.indexOf(t[e])===r}))}("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),c=_.map(X.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),p=X.tripleNodes.values();for(let e=0;e<X.tripleNodes.size;e++){p.next().value.forEach(e=>{c.push({iri:e.iri,isTriple:e.isTriple})})}const f=_.reject(l,(function(e){return _.some(c,e)}));if(0===f.length)r?a.info(S.instant("graphexplore.error.node.connections")):0===i.length&&a.info(S.instant("graphexplore.error.node.connections")),X.addAndMatchLinks(i),ce();else{const t=[],r=[];_.forEach(f,(function(n,i){t.push(u({url:"rest/explore-graph/node",method:"GET",params:{iri:n.isTriple?W(n.iri):n.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?e.saveSettings.languages:[],includeInferred:e.saveSettings.includeInferred,sameAsState:e.saveSettings.sameAsState}}).then((function(e){r[i]=e.data})))})),d.all(t).then((function(){_.forEach(r,(function(e,t){const i=2*Math.PI*t/r.length,o=(n?n.x:0)+Math.cos(i)*D/3,s=(n?n.y:0)+Math.sin(i)*D/3;e.isTriple?X.addTriple(e,o,s):X.addNode(e,o,s)})),X.addAndMatchLinks(i),n&&(n.isExpanded=!0),ce()}))}}function me(t,n,r){if(ue.getLoadingState())return;ue.init(t,r);const i=t.iri;u({url:"rest/explore-graph/links",method:"GET",params:{iri:i,linksLimit:e.saveSettings.linksLimit,includeInferred:e.saveSettings.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?e.saveSettings.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?e.saveSettings.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?e.saveSettings.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?e.saveSettings.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?e.saveSettings.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?e.saveSettings.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?e.saveSettings.languages:[],sameAsState:e.saveSettings.sameAsState,includeSchema:e.saveSettings.includeSchema}}).then((function(e){ge(e,t,n)}),(function(t){const n=getError(t.data);a.error(n,S.instant("graphexplore.error.exploring.node")),e.loading=!1,ue.setLoadingState(!1)}))}function ve(){angular.isDefined(pe)&&pe.expandedState&&pe.removeIcons()}function Ee(t){oe.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?encodeURI(W(t.iri)):encodeURI(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="",u.get("rest/explore-graph/properties",{params:{iri:t.isTriple?W(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?e.saveSettings.languages:[],includeInferred:e.saveSettings.includeInferred,sameAsState:e.saveSettings.sameAsState,rejectedPredicates:e.shouldShowSettings()?e.saveSettings.rejectedPredicates:[]}}).then((function(t){e.data=_.mapKeys(t.data,(function(t,n){return e.replaceIRIWithPrefix(n)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,n){e.propertiesObj.items.push({key:n,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const n=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));n&&(e.nodeImage=n.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){a.warning(getError(e.data),"Error")}))}function xe(e){ye("predicate","var(--onto-orange-dark)",e),ye("predicates","var(--onto-orange-dark)",e);let t=document.getElementsByClassName("link");t&&_.each(t,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--onto-orange-dark)",t.style.strokeWidth=4)}));let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--onto-orange-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function ye(e,t,n){let r=document.getElementsByClassName(e);r&&_.each(r,(function(e){let r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),V(n.iri)===H(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===H(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Ce(r))}))}function Te(){_.each(e.predicates,(function(e){let t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));let t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),ye("predicate",""),ye("predicates","");let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Ne(e){let t=V(e);if(X.tripleNodes.has(t))return X.tripleNodes.get(t).find(t=>t.iri===e)}function Ce(e){return e.predicates.length>1?e.predicates.length+" predicates":Se(e.predicates[0])}function Se(t){const n=e.replaceIRIWithPrefix(t);return n.length===t.length?t.split("/")[t.split("/").length-1]:n}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],F=null,l((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(X.tripleNodes.has(t.linkId)){Te();let n=X.tripleNodes.get(t.linkId)[t.nodeIndex];Ee(n),e.showPredicates=!0;let r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");let i={};const o=X.tripleLinksCopy.values();for(let e=0;e<X.tripleLinksCopy.size;e++){let e=o.next().value;e.length>1&&e.every(t=>t.source.iri===n.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=V(t.target.iri),i.oppTriplePred=Se(t.target.iri.split(" ")[1])),i.pred=Se(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==n.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=V(t.source.iri),i.oppTriplePred=Se(t.source.iri.split(" ")[1])),i.pred=Se(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=Se(n.iri.split(" ")[1])),xe(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLoadingLocation=function(){return n.isLoadingLocation()},e.hasActiveLocation=function(){return n.hasActiveLocation()},e.rotate=function(e){ve();const t=2*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t),i=P/2,o=D/2;d3.selectAll(".node-wrapper").each((function(e){e.x=i+(n*(e.x-i)+r*(e.y-o)),e.y=o+(-r*(e.x-i)+n*(e.y-o)),e.fixed&&(e.px=e.x,e.py=e.y)})),oe.resume()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,e.pushHistory(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(X.copyState()),n={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};n.id?e.saveGraphModal("update",n):e.saveGraphModal("new",n)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const Ie=function(t){T.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),a.success(S.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,n,r){v.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:n,graphExists:r,shared:n.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),T.addNewSavedGraph(t).success((function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),a.success(S.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{const e=getError(n);a.error(e,S.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Ie(t.graph)}}))},e.refreshSavedGraphs=function(){T.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,n){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),X.restoreState(JSON.parse(t.data)),n||e.pushHistory({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(e){G([location.protocol,"//",location.host,location.pathname,"?saved=",e.id].join(""))},e.deleteSavedGraph=function(t){m.openSimpleModal({title:S.instant("common.confirm"),message:S.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){T.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),a.success(S.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,n){return n.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){ve();const t=e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(n){n.fixed=t,t&&e.numberOfPinnedNodes++})),oe.resume()},$("body").on("keydown",(function(t){"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,n,r){switch(e.mode=n.mode,e.graph=angular.copy(n.graph),e.graphExists=n.graphExists,e.mode){case"new":e.title=r.instant("graphexplore.create.new.graph"),e.okButtonText=r.instant("common.create.btn");break;case"update":e.title=r.instant("graphexplore.update"),e.okButtonText=r.instant("common.save.btn");break;case"rename":e.title=r.instant("graphexplore.rename"),e.okButtonText=r.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"]).controller("GraphsVisualizationsCtrl",a).controller("SaveGraphModalCtrl",l).config(["$tooltipProvider",function(e){e.options({appendToBody:!0})}]),a.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","$http","ClassInstanceDetailsService","AutocompleteRestService","$q","$location","$jwtAuth","UiScrollService","ModalService","$modal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","RDF4JRepositoriesRestService","$translate"],l.$inject=["$scope","$modalInstance","data","$translate"]},65:function(e,t,n){"use strict";n.r(t);n(34),n(4);function r(e,t,n,r,i,o,s,a,l,u,c,p,d,f,h,g,m){var v;e.page=1,e.totalPages=5,e.helpHidden=1===h.get(g.HIDE_GRAPH_CONFIG_HELP),e.toggleHelp=function(t){void 0===t&&(t=h.get(g.HIDE_GRAPH_CONFIG_HELP)),1!==t?(h.set(g.HIDE_GRAPH_CONFIG_HELP,1),e.helpHidden=!0):(h.set(g.HIDE_GRAPH_CONFIG_HELP,0),e.helpHidden=!1)},e.fixedVisualCallback=function(t,n){e.newConfig.startIRI=t,e.newConfig.startIRILabel=n,v=!0},e.isDefaultGraph=function(e){return"Minimal"===e.name||"Advanced"===e.name},e.isUserGraph=function(t){return!e.isDefaultGraph(t)},e.getSampleName=function(e,t){const n=e[t+"Description"];return n||(e.id?"Copy of "+e.name:e.name)};const E=function(){u.getGraphConfigSamples().success((function(t){e.samples=_.filter(t,(function(t){return!t.id||e.newConfig.id!==t.id||(e.revertConfig=t,!1)}))})).error((function(e){r.error(getError(e),m.instant("graphexplore.error.graph.configs"))}))},x=p.configName;function y(e){r.warning(e)}function T(t){let n;return"query"===t.startMode&&1===e.page?n=t.startGraphQuery:2===e.page?n=t.expandQuery:3===e.page?n=t.resourceQuery:4===e.page?n=t.predicateLabelQuery:5===e.page&&(n=t.resourcePropertiesQuery),angular.isDefined(n)?n:""}function N(){function o(){e.getAutocompletePromise=c.checkAutocompleteStatus()}E(),e.createGraphConfig=function(){u.createGraphConfig(e.newConfig).success((async function(){await d.showToastMessageWithDelay("graphexplore.saved.new.config"),n.url("graphs-visualizations")})).error((function(e){r.error(getError(e),m.instant("graphexplore.error.could.not.create"))}))},e.updateGraphConfig=function(){u.updateGraphConfig(e.newConfig).success((async function(){await d.showToastMessageWithDelay("graphexplore.saved.config"),n.url("graphs-visualizations")})).error((function(e){r.error(getError(e),m.instant("graphexplore.error.could.not.save"))}))},e.$on("autocompleteStatus",(function(){o()})),o(),e.getNamespacesPromise=f.getNamespaces(e.getActiveRepository());const s=function(e,t,n,r,i,o){t?u.validateQuery(t,n,r,i,o).success((function(){e()})).error((function(e){y(getError(e))})):e()};function a(){l()&&e.$broadcast("addStartFixedNodeAutomatically",{startIRI:e.newConfig.startIRI})}function l(){return 1===e.page&&"node"===e.newConfig.startMode}e.validateCurrentPage=function(t){e.updateModel(),1===e.page?"node"!==e.newConfig.startMode||e.newConfig.startIRI?"query"!==e.newConfig.startMode||e.newConfig.startGraphQuery?"query"===e.newConfig.startMode?s(t,e.newConfig.startGraphQuery,"graph"):t():y(m.instant("graphexplore.provide.query")):y(m.instant("graphexplore.select.start.node")):2===e.page?s(t,e.newConfig.expandQuery,"construct",["node"]):3===e.page?s(t,e.newConfig.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===e.page?s(t,e.newConfig.predicateLabelQuery,"tuple",["edge"],["label"]):5===e.page&&s(t,e.newConfig.resourcePropertiesQuery,"tuple",["node"],["property","value"])},e.goToPage=function(t){e.page!==t&&e.validateCurrentPage((function(){e.showEditor(),e.page=t,e.notoolbar=1!==e.page}))},e.goToPreviousPage=function(){e.page>1&&e.goToPage(e.page-1),l()&&(v=!1)},e.goToNextPage=function(){a(),v&&e.goToPage(e.page+1)},e.saveGraphConfig=function(){a(),l()&&!v||(e.newConfig.startQueryIncludeInferred=e.currentQuery.inference,e.newConfig.startQuerySameAs=e.currentQuery.sameAs,e.validateCurrentPage((function(){e.newConfig.name?e.isUpdate?e.updateGraphConfig(e.newConfig):e.createGraphConfig(e.newConfig):y(m.instant("graphexplore.provide.config.name"))})))},e.updateModel=function(){const t=window.editor.getValue().trim();"query"===e.newConfig.startMode&&1===e.page?e.newConfig.startGraphQuery=t:2===e.page?e.newConfig.expandQuery=t:3===e.page?e.newConfig.resourceQuery=t:4===e.page?e.newConfig.predicateLabelQuery=t:5===e.page&&(e.newConfig.resourcePropertiesQuery=t)},e.setQuery=function(e){window.editor.setValue(e||" ")},e.updateDirty=function(){if(e.revertConfig){const t=T(e.revertConfig),n=window.editor.getValue().trim();e.queryEditorIsDirty=t!==n}},e.updateEditor=function(){t((function(){e.currentQuery.query=T(e.newConfig),i.isActiveRepoOntopType()&&(e.nocount=!0),e.currentQuery.inference=e.newConfig.startQueryIncludeInferred,e.currentQuery.sameAs=e.newConfig.startQuerySameAs,P(e.currentQuery.id),b(e.currentQuery.id)}),100)},e.showEditor=function(){window.editor&&window.editor.xhr&&window.editor.xhr.abort(),e.viewMode="yasr"},e.showPreview=function(){e.currentQuery.outputType="table",e.runQuery()},e.revertEditor=function(){e.setQuery(T(e.revertConfig))},e.$watch("newConfig.startMode",(function(n){"query"===n&&t((function(){e.updateEditor()}),0)})),e.$watch("page",(function(n){("query"===e.newConfig.startMode||n>1)&&t((function(){e.showEditor(),e.updateEditor()}),0)}))}e.newConfig={startQueryIncludeInferred:!0,startQuerySameAs:!0},e.newConfig.startMode="search",e.isUpdate=!1,e.shared=!1,e.encodeQuery=function(e){return encodeURIComponent(e)},x?(e.isUpdate=!0,u.getConfig(x).success((function(t){e.newConfig=t,N()})).error((function(e){r.error(getError(e),m.instant("created.connector",{name:x}))}))):(e.isUpdate=!1,N());const C={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs};e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:100,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.tabsData=e.tabs=[C],e.saveTab=function(t){const n=function(t){for(let n=0;n<e.tabsData.length;n++){if(e.tabsData[n].id===t)return n}}(t);if(void 0===n)return{};const r=e.tabsData[n];return e.saveQueryToLocal(r),r},e.loadTab=P,e.addNewTab=function(e,t,n){},e.runQuery=R,e.getNamespaces=w,e.changePagination=function(){R(!0,e.explainRequested)},e.toggleSampleQueries=function(){},e.addKnownPrefixes=O,e.getExistingTabId=M,e.querySelected=function(t){const n=M(t);e.toggleSampleQueries(),angular.isDefined(n)?b(n):e.addNewTab(null,t.name,t.body)},e.saveQueryToLocal=S,e.setLoader=I,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3,n=e.getHumanReadableSeconds(t);let r="";r=e.progressMessage?e.progressMessage+"... "+n:m.instant("common.running.operation",{timeHuman:n});e.extraMessage&&t>10&&(r+="\n"+e.extraMessage);return r},e.fixSizesOnHorizontalViewModeSwitch=L,e.changeViewMode=function(n){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,L(),$(".dataTables_filter").remove(),$(".resultsTable").remove(),t((function(){P(n),b(n)}),100)},e.showHideEditor=A,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!0;e.getActiveRepository();function S(e){}function I(t,n,r){const i=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=n,e.extraMessage=r,i.addClass("hide")):(e.progressMessage="",e.extraMessage="",i.removeClass("hide")),null===e.$$phase&&e.$apply()}function L(n){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}const i=n;if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let n;n=t(i?function(){e.fixSizesOnHorizontalViewModeSwitch(i)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){t.cancel(n)}))}window.yasr&&window.yasr.container&&t((function(){window.yasr.container.resize()}),100)}function A(){L(!0)}function b(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function R(t,n){e.executedQueryTab=e.currentQuery,n&&"SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType()?r.warning(m.instant("query.editor.warning.msg")):"update"!==window.editor.getQueryMode()?(e.explainRequested=n,e.queryIsRunning||(t?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.viewMode="editor",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch(),I(!0,m.instant("evaluating.query.msg")),window.editor.query())):r.warning(m.instant("cannot.execute.update.error"))}function w(){I(!0,m.instant("common.refreshing.namespaces"),m.instant("common.extra.message")),f.getRepositoryNamespaces().success((function(t){const n={};t.results.bindings.forEach((function(e){n[e.prefix.value]=e.namespace.value})),e.namespaces=n})).error((function(t){e.repositoryError=getError(t)})).finally((function(){I(!1)}))}function O(){a.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){let t=getError(e);return r.error(t,m.instant("common.add.known.prefixes.error")),!0}))}function M(t){let n=void 0;return angular.forEach(e.tabsData,(function(e){if(e.name===t.name&&e.query===t.body)return n=e.id,e})),n}e.orientationViewMode||A(),e.getActiveRepository()&&w(),e.$on("$destroy",(function(){window.editor=null,window.yasr=null})),$("textarea").on("paste",(function(){t((function(){O()}),0)})),e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(){e.currentQuery}));function P(n){e.tabsData=[e.currentQuery];let r=e.currentQuery;null==e.currentQuery.query||""===e.currentQuery.query?window.editor.setValue(" "):window.editor.setValue(e.currentQuery.query),t((function(){e.currentTabConfig={},e.currentTabConfig.queryType=r.queryType,e.currentTabConfig.resultsCount=r.resultsCount,e.currentTabConfig.offset=r.offset,e.currentTabConfig.allResultsCount=r.allResultsCount,e.currentTabConfig.page=r.page,e.currentTabConfig.pageSize=r.pageSize,e.currentTabConfig.timeFinished=r.timeFinished,e.currentTabConfig.timeTook=r.timeTook,e.currentTabConfig.sizeDelta=r.sizeDelta,e.$apply()}),0),$("#yasr").css("padding","0")}function D(e){return $(e).attr("data-id")}e.$on("tabAction",(function(t,n){n.relatedTarget&&e.saveTab(D(n.relatedTarget)),e.loadTab(D(n.target))})),e.$on("deleteAllexeptSelected",(function(t,n){e.tabsData=n,e.tabs=n})),e.currentQuery=angular.copy(C),e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.getResultsDescription=function(){},e.getUpdateDescription=function(){},e.getStaleWarningMessage=function(){}}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("GraphConfigCtrl",r),r.$inject=["$scope","$timeout","$location","toastr","$repositories","$modal","ModalService","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate"]},66:function(e,t,n){"use strict";n.r(t);var r=n(220),i=n.n(r),o=n(229),s=n(221),a=n(222);n(4);function l(e,t,n,r,l,u,c,p,d,f,h,g,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(c,v,E){!function(c,v){var E=800,x=800,y=x,T=20,N=d3.layout.pack().size([y-T,y-T]).value((function(e){return e.size})),C=d3.scale.linear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),S=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 "+E+" "+x).attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function I(){return S.append("svg:g").attr({id:"main-group",transform:"translate("+E/2+","+x/2+")"})}function L(){return"true"===h.get(g.CLASS_HIERARCHY_HIDE_PREFIXES)}function A(){var e=a.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.0.3-RC2");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=a.a.Export.generateBase64ImageSource();d3.select(this).attr({href:t,download:"class-hierarchy-"+u.getActiveRepository()+".svg"})}c.hidePrefixes=L();var b,R,w=I();if(!c.classHierarchyData.classCount&&u.getActiveRepository()&&!u.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=h.get(`classHierarchy-selectedGraph-${u.getActiveRepository()}`);n.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,n,r){e.loader=!1,207===n&&p.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),c.classHierarchyData=t,d3.select("#download-svg").on("mouseover",A)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),p.error(m.instant("graphexplore.error.request.failed",{name:f,error:getError(t)}))}))}var O,M,P,D,k,F,G,U,B={};function j(n,a,u,p){P&&P(),D&&D(),d3.selectAll("#main-group").remove(),w=I(),o.a.SingleChild.addPlaceholders(n,!0),M=u||n;var h,g=N.nodes(n);M.isInFocusTransitive=!0,o.a.SingleChild.removePlaceholders(g),o.a.SingleChild.centerNodes(g),o.a.SingleChild.makePositionsRelativeToZero(g);var m=i()().attr("class","d3-tip").customPosition((function(e){return{top:"inherit",bottom:r.innerHeight-d3.event.clientY+"px",right:r.innerWidth-d3.event.clientX+"px"}})).html((function(e){return e.name}));S.call(m);var v=w.selectAll("circle").data(g).enter().append("g");a.doFade&&v.each((function(e){s.a.Transition.fadeIn(d3.select(this),550)}));var E,x=[],L=v.append("circle").attr("class",(function(e){return e.role})).style("fill",(function(e){return e.children?C(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.name!==f){var t=e.name;x.push({name:t}),B[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(){a.noPrefixes?m.show(e):e.textHidden?m.show(e):m.hide(e)})),e.circle.on("mouseout",m.hide)}}));function A(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),E=e}function k(){c.showClassInfoPanel=!1}x&&(x=_.uniqBy(x,"name"),c.flattenedClassNames=x);var F=s.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(F);R=function(e){W(e),e.name===f?(k(),d3.selectAll(".selected").classed("selected",!1)):(A(e),c.selectedClass=E,c.showClassInfoPanel=!0,c.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},F.on("click",(function(e){e.id&&r.history.pushState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),m.hide(),R(e)})),F.on("dblclick",(function(t){t!==n&&(m.hide(),A(t),e.$broadcast("goToDomainRangeGraphView",E,M),d3.event.stopPropagation())}));var G=0;S.on("wheel",(function(){m.hide();var e=d3.event;e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-G>100){G=t;var n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");var i=e.target.__data__;if(i||(i=M),"in"===n){if(i!==M){for(;i.parent&&!i.parent.isInFocusTransitive;)i=i.parent;i.depth<M.depth&&(i=M)}if(i===M&&i.children){for(var o=i.children[0],s=1;s<i.children.length;s++)i.children[s].sortingRank>o.sortingRank&&(o=i.children[s]);i=o}W(i,!0)}else"out"===n&&(i=M.parent)&&W(i,!0);M.name===f&&r.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),V()}}));var U=w.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)}));a.noPrefixes?(O!==n&&(U.each((function(e){var t=e.name.indexOf(":");e.name.indexOf("http://")>-1?e.noPrefixName=e.name:t>-1&&(e.noPrefixName=e.name.substring(t+1))})),O=n),U.style("font-size",(function(e){return s.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return s.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):U.style("font-size",(function(e){return s.a.Text.calcFontSize(e.name,e.r)})).text((function(e){return s.a.Text.getTextWithElipsisIfNeeded(e.name,e.r/3)})),U.style("display",(function(e){return e.parent===n?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),a.doFade&&!a.keepPrevState&&U.each((function(e){s.a.Transition.fadeIn(d3.select(this),550)})),b=function(){function e(e){e&&L.each((function(t){e==t.id&&R(t)}))}var n=t.hash();r.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var j=w.selectAll("circle, text");function H(e,t){var n=y/e[2];h=e,j.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),L.attr("r",(function(e){return e.r*n})),t&&U.each((function(e){e.fullName!==M.topLevelParentUri&&M.topLevelParentUri!==f||(e.textSel.style("display","none"),M.children&&M.children.length?_.each(M.children,(function(e){e.textSel.style("display","inline")})):M.textSel.style("display","inline"),M.parent&&_.each(M.parent.children,(function(e){e.name!==M.name&&e.textSel.style("display","inline")})))})),U.style("font-size",(function(e){return a.noPrefixes?s.a.Text.calcFontSize(e.noPrefixName,e.r*n):s.a.Text.calcFontSize(e.name,e.r*n)})).text((function(e){return a.noPrefixes?s.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):s.a.Text.getTextWithElipsisIfNeeded(e.name,e.r*n/3)}))}function q(e){var t=2*e+T;return 2*e/t<.3&&(t=2*e+2),t}function $(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive||(e.textHidden=!0,this.style.display="none")}function z(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive&&(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display="")}function W(e,t){if(l((function(){c.showExternalElements=e.name===f})),e.id&&r.history.replaceState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),M!==e){if(t&&(k(),d3.selectAll(".selected").classed("selected",!1)),M.parent)for(var n=M;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=n.children,n=n.parent;if(2*(M=e).r/(2*M.r+T)<.3||c.currentSliderValue>c.currentBrowserLimit)H([M.x,M.y,q(M.r)]),U.each((function(e){$.call(this,e),z.call(this,e)}));else d3.transition().duration(d).tween("zoom",(function(e){var t=d3.interpolateZoom(h,[M.x,M.y,q(M.r)]);return function(e){H(t(e))}})).selectAll("text").each("start",$).each("end",z)}}H([M.x,M.y,q(M.r)],p),P=c.$on("rootFocus",(function(){r.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),R(n)})),D=c.$on("classSearch",(function(e){R(e)}))}function V(){var t=c.classHierarchyData.classCount;let n=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}window.addEventListener("resize",V),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",V),window.removeEventListener("beforeunload",e)})),c.$watch("classHierarchyData",(function(){k&&k(),F&&F(),G&&G(),U&&U();var e=L();if(c.classHierarchyData.classCount){V();var t=angular.copy(c.classHierarchyData);var n,r,i=function(e){return N.nodes(e).sort((function(e,t){return e.sortingRank>t.sortingRank?-1:e.sortingRank<t.sortingRank?1:e.depth>t.depth?1:e.depth<t.depth?-1:0}))}(t);function o(e,t){var i={keepPrevState:!0,noPrefixes:L()};r=i.noPrefixes,j(n||e,i,M,!0),l((function(){h.set(g.CLASS_HIERARCHY_SWITCH_PREFIXES,t),b()}),70)}function s(e,i,s){if(e){h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),n={name:f,children:[]};for(var a=new Set,l=1;l<=e;l++)a.add(i[l].id),i[l].parent===i[0]&&n.children.push(i[l]);if(function e(t){if(t.children){for(var n=[],r=0;r<t.children.length;r++)a.has(t.children[r].id)&&n.push($.extend({},t.children[r]));t.children=n;for(r=0;r<t.children.length;r++)e(t.children[r])}}(n),s)r=angular.isUndefined(r)?L():r,j(n,{noPrefixes:r});else o(t)}}var a,u=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(u)s(u,i);else{var p={doFade:!0,keepPrevState:!0,noPrefixes:L()};j(t,p),b()}k=c.$watch("hidePrefixes",(function(n){angular.isUndefined(n)||e?e=void 0:l((function(){!function(e){angular.isUndefined(e)||h.set(g.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),o(t,!0)}),50)}),!0),F=c.$watch("currentSliderValue",(function(e){s(e,i,!0)}),!0),U=c.$on("onEnterKeypressSearchAction",(function(e){a&&R(a)})),G=c.$on("searchedClass",(function(e,t){(a=B[t.name])&&R(a)}))}}),!0)}(c)}}}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",l),l.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},67:function(e,t,n){"use strict";n.r(t);var r=n(222),i=n(221);n(4);function o(e,t,n,o,s,a,l,u,c,p,d,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(p){const d=u((function(){!function(p){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)}))};var d=1200,g=d/18,m=d/110,v=m/2,E=d/90,x=d/1e3,y=d/600,T=d3.layout.force().size([d,600]).charge(-900),N=T.drag().on("dragstart",(function(e){d3.select(this).classed("selected",e.selected=!0)})),C=d3.select("#domain-range").append("svg").attr("viewBox","0 0 "+d+" 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),S=C.append("defs");S.append("marker").attr({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),S.append("marker").attr({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),S.append("marker").attr({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var e=r.a.Export.getCSSRules("css/domain-range-graph.css?v=2.0.3-RC2");$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>");var t=r.a.Export.generateBase64ImageSource();d3.select(this).attr({href:t,download:"domain-range-graph-"+n.getActiveRepository()+".svg"})}));var I=d/7,L=1.2*I,A=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+I+" "+L).attr("preserveAspectRatio","xMidYMid meet");A.append("rect").attr({width:I,height:L}).style("fill","rgba(235, 235, 235, 0.9)");var b=d/75,R=d/40,w=b+g/2.5,O=R,M=w+d/90,_=E/1.1,P=R,D=(A.append("circle").attr({class:"legend-class-node",cx:(b+w)/2,cy:P,r:g/4.5}),O+d/370);A.append("text").attr({x:M,y:D}).style("font-size",_+"px").text("main class node");var k=P+d/30;A.append("circle").attr({class:"legend-object-node",cx:(b+w)/2,cy:k,r:m/1.25});var F=D+d/30;A.append("text").attr({x:M,y:F}).style("font-size",_+"px").text("class node");var G=k+d/45;A.append("circle").attr({class:"legend-datatype-node",cx:(b+w)/2,cy:G,r:v});var U=F+d/45;A.append("text").attr({x:M,y:U}).style("font-size",_+"px").text("datatype node");var B=G+d/45;d3.select(".legend-class-node");A.append("line").attr({class:"property-arrow",x1:b,y1:B,x2:w,y2:B}).style("stroke-width",x).attr("marker-end","url("+s.absUrl()+"#arrow)"),A.append("text").attr({x:M,y:B+d/370}).style("font-size",_+"px").text("explicit property");var j=B+d/45;A.append("line").attr({class:"implicit-property-arrow",x1:b,y1:j,x2:w,y2:j}).style("stroke-width",x).attr("marker-end","url("+s.absUrl()+"#arrow)"),A.append("text").attr({x:M,y:j+d/370}).style("font-size",_+"px").text("implicit property");var V=j+d/45;A.append("line").attr({class:"collapsed-property-arrow",x1:b,y1:V,x2:w,y2:V}).style("stroke-width",y).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),A.append("text").attr({x:M,y:V+d/370}).style("font-size",_+"px").text("collapsed property");var H=C,q=s.search().uri,z=s.search().name,W=s.search().collapsed;o.getDomainRangeData(q,W).success((function(e,t,n){p.domainRangeGraphData=e})).error((function(e){c.error("Request for "+z+" failed!")})),$(window).on("popstate",(function(){a.set(l.DOMAIN_RANGE_WENT_BACK,!0)})),t.onpopstate=function(t){t.state&&e.$broadcast("changeCollapsedEdgesState",t.state.collapsed)},p.$watch("collapseEdges",(function(){angular.isUndefined(p.collapseEdges)||(a.set(l.DOMAIN_RANGE_COLLAPSE_EDGES,p.collapseEdges),"true"!==a.get(l.DOMAIN_RANGE_WENT_BACK)&&function(t){e.$broadcast("switchEdgeMode",{uri:q,name:z,collapsed:t})}(p.collapseEdges),a.remove(l.DOMAIN_RANGE_WENT_BACK))})),p.$watch("domainRangeGraphData",(function(){if(p.domainRangeGraphData){var n=angular.copy(p.domainRangeGraphData);T.nodes(n.nodes).links(n.links);var r=H.selectAll(".link").data(n.links).enter().append("g");function o(e){e.style("stroke",f),e.style("stroke-width",y),e.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var a,l,c=0;r.each((function(e){if(e.objectPropNodeClassUri!==q)a=r.append("line").attr({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",x).each((function(e){switch(e.propertyType){case"objectLeft":e.targetRadius=g;break;case"objectRight":e.targetRadius=m;break;case"datatype":e.targetRadius=v;break;default:e.targetRadius=0}var t=d3.select(this);e.targetNodeEdgeCount>1?o(t):e.implicit&&t.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(l)){var t=g/2;l=d3.select(this).append("path").attr({d:"M 0 0 A "+t+" "+t+" 0 1 1 0 "+t,class:"loop-link",fill:"none","marker-end":"url("+s.absUrl()+"#arrow-loop)"}).style("stroke-width",x)}(c+=e.targetNodeEdgeCount)>1&&o(d3.select(".loop-link"))}}));var C={};function S(){$.isEmptyObject(C)||(C.text.style("fill","black"),C.background.style("fill","#f0f0f0"))}function I(e){S(),C.text=d3.select(this),C.background=d3.select(this.previousSibling),C.text.style("fill","white"),C.background.style("fill",f),u((function(){p.showPredicatesInfoPanel=!0,p.selectedPredicate=e})),d3.event.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",S)}));var L=r.append("text").attr("class",(function(e){return e.objectPropNodeClassUri===q?"loop-link-property-name":"property-name"})).attr("dx",(function(e){return g/2*("objectLeft"===e.propertyType?1:-1)})).style("text-anchor",(function(e){return"objectLeft"===e.propertyType?"end":"start"})).style("font-size",E).text((function(e){return e.targetNodeEdgeCount>1?e.targetNodeEdgeCount+" predicates":e.name}));L.each((function(e){var n=d3.select(this);/\d\spredicates/.test(n.text())?n.style("font-weight","bold").on("click",I):n.on("click",(function(e){t.open("resource?uri="+encodeURIComponent(e.uri),"_blank")}))}));var A=d/600,b=r.append("rect").attr("class",(function(e){return e.objectPropNodeClassUri!==q?"link-background":"loop-link-background"})).attr("width",(function(e){return e.calculatedWidth=this.previousSibling.getBBox().width,e.calculatedWidth+2*A})).attr("height",(function(e){return e.calculatedHeight=this.previousSibling.getBBox().height,e.calculatedHeight+A})).attr("transform",(function(e){var t=A-g/2*("objectLeft"===e.propertyType?1:-1);return"objectLeft"===e.propertyType&&(t+=e.calculatedWidth),"translate(-"+t+",-"+(A+e.calculatedHeight/2)+")"})).on("click",(function(e){d3.event.stopPropagation()})),R=H.selectAll(".node").data(n.nodes).enter().append("g"),w=R.filter((function(e){return e.objectPropClassUri!==q})).append("circle").each((function(e){var t=d3.select(this);"main"===e.classPosition?t.attr({class:"class-node",r:g}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===e.objectPropClassName?t.attr({class:"datatype-node",r:v}):t.attr({class:"object-prop-node",r:m})})).call(N);d3.selectAll(".object-prop-node").on("dblclick",(function(t,n){p.$apply((function(){e.$broadcast("reloadDomainRangeGraphView",t,n)}))})),R.filter((function(e){return e.objectPropClassName&&e.objectPropClassUri!==q})).append("text").attr("class",(function(e){return e.classPosition+"-class-label"})).style("font-size",E).text((function(e){return e.objectPropClassName})).on("click",(function(e){t.open("resource?uri="+encodeURIComponent(e.objectPropClassUri),"_blank")}));var O=R.select("text");H.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(z,g)})).text(z).on("click",(function(e){t.open("resource?uri="+encodeURIComponent(q),"_blank")}))}));var M=H.select(".class-node + text"),_=d3.select(".class-node"),P=d3.selectAll(".loop-link-background"),D=d3.selectAll(".loop-link-property-name");if(L=d3.selectAll(".property-name"),!angular.isUndefined(l)){var k=[];P.each((function(e,t){d3.select(this);k.push({idx:t,width:e.calculatedWidth,height:e.calculatedHeight})}))}T.on("tick",(function(e){var t=8*e.alpha;function n(e){var t=e.x+2*g,n=e.y-g/1.9;var r=[];P.each((function(i,o){r.push(i),o<h?function(r,i){var o=$.grep(k,(function(e){return e.idx==i}));i>0&&(t+=parseFloat(i*(o[0].height/(i/1.4)))),r.attr({transform:"rotate(270, "+e.x+","+e.y+") translate("+t+","+n+")",width:o[0].height,height:o[0].width})}(d3.select(this),o):d3.select(this).remove()})),function(e){var t;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(n){n.target.allEdges=e,t=this.getComputedTextLength()})).on("click",I),d3.select(".view-more-preds-rect").attr("height",t+2*A)}(r)}a.filter((function(e){return e.objectPropNodeClassUri!==q})).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 n=Math.atan2(e.target.y-e.source.y,e.target.x-e.source.x);e.targetX=e.target.x-Math.cos(n)*e.targetRadius,e.targetY=e.target.y-Math.sin(n)*e.targetRadius})),w.each((function(e){"main"!==e.classPosition||angular.isUndefined(l)||(!function(e){var t=e.x+.96*g,n=e.y-g/5.7-5;l.attr("transform","rotate(270, "+e.x+","+e.y+") translate("+t+","+n+")")}(e),function(e){function t(t,n){var r=$.grep(k,(function(e){return e.idx==n})),i=0;n>0&&(i=parseFloat(2*n*(r[0].height/1.4)));var o=e.x,s=e.y-2.1*g-i;t.attr({x:o,y:s}).moveToFront()}D.each((function(e,n){var r=d3.select(this),i=D.size()-h;i<0?t(r,n):(0==n&&!p.collapseEdges&&i>1&&(!function(e,t,n){e.classed("view-more-preds-label",!0).text(n+" predicates more ..."),null!==this.nextSibling&&t.classed("view-more-preds-rect",!0)}(r,d3.select(this.nextSibling),i),t(r,n)),n<h?t(r,n):r.remove())}))}(e),n(e)),e.objectPropClassUri!==q&&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=_.attr("cx")-d/2,n=.5*Math.log10(Math.abs(t));return e.x+=t>0?-n:n,e.x}(e):e.x})).attr("cy",(function(e){return e.y}))})),M.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).moveToFront(),b.filter((function(e){return e.objectPropNodeClassUri!==q})).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(),L.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(),O.attr("x",(function(e){return"right"===e.classPosition?e.x+1.2*m:e.x-1.2*m})).attr("y",(function(e){return e.y})).moveToFront()})).linkDistance(d/3.5).start()}}))}(p)}),50);p.$on("$destroy",(function(){u.cancel(d)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--onto-orange)").constant("ONTO_GREEN","var(--onto-green)").constant("ONTO_BLUE","var(--onto-blue)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",o),o.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]},68:function(e,t){function n(e,t){return{restrict:"A",scope:{},templateUrl:"js/angular/graphexplore/templates/systemRepoWarningTemplate.html",link:function(n){n.isSystemRepository=function(){return"SYSTEM"===e.getActiveRepository()},n.hasPermission=function(){return t.hasPermission()}}}}angular.module("graphdb.framework.graphexplore.directives.sysrepo",["graphdb.framework.graphexplore.controllers.class"]).directive("systemRepoWarning",n),n.$inject=["$repositories","$rootScope"]},69:function(e,t){function n(e){return{restrict:"AE",scope:{rdfsLabel:"=",rdfsComment:"=",expanded:"=",alwaysExpanded:"="},templateUrl:"js/angular/graphexplore/templates/rdfsCommentLabelTemplate.html",link:function(t,n){t.stringLimit=e,t.scrollToTop=function(){n[0].getElementsByClassName("rdfs-comment")[0].scrollTop=0},t.checkCommentLength=function(){return n[0].getElementsByClassName("rdfs-comment-text")[0].innerText.length<e},t.equalHeights=function(){const e=n[0].getElementsByClassName("rdfs-comment-text")[0].innerHeight;e<250&&t.expanded&&(n[0].getElementsByClassName("rdfs-comment")[0].innerHeight=e)},t.toggleFullComment=function(){t.expanded=!t.expanded},t.$watch("expanded || alwaysExpanded",(function(n){t.stringLimit=n?t.rdfsComment.length:e}))}}}angular.module("graphdb.framework.graphexplore.directives.rdfsdetails",[]).directive("rdfsCommentLabel",n).constant("SHORT_COMMENT_LENGTH",100),n.$inject=["SHORT_COMMENT_LENGTH"]},70:function(e,t,n){"use strict";n.r(t);var r=n(222);n(43);function i(e,t){return{restrict:"A",template:'<div id="dependencies-chord"></div>',scope:{dependenciesData:"="},link:function(n){n.$watch("dependenciesData",(function(){if(n.dependenciesData){const i=n.dependenciesData;!function(i,o){if(function(){let e=!0;for(const t of i){if(t.some(e=>0!==e)){e=!1;break}}return e}())return;const s=d3.scale.category20(),a=d3.select("body").append("div").attr("class","tooltip").style("opacity",0);d3.select("body").on("click",(function(){a.style("opacity",0)}));const l=Math.min(800,800)/2.8,u=l-24,c=d3.svg.arc().innerRadius(u).outerRadius(l),p=d3.layout.chord().padding(.04).sortSubgroups(d3.descending).sortChords(d3.ascending),d=d3.svg.chord().radius(u),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",l).style("fill","none"),p.matrix(i);const h=f.selectAll(".group").data(p.groups).enter().append("g").attr("class","group").on("mouseover",(function(e,t){g.classed("fade",(function(e){return e.source.index!==t&&e.target.index!==t}))}));h.append("title").text((function(e,t){return o[t]})),h.append("path").attr("id",(function(e,t){return"group"+t})).attr("d",c).style("fill",(function(e,t){return s(t)})),h.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("+(u+26)+")"+(e.angle>Math.PI?"rotate(180)":"")})).style("text-anchor",(function(e){return e.angle>Math.PI?"end":null})).text((function(e){return o[e.index]}));const g=f.selectAll(".chord").data(p.chords).enter().append("path").attr("class","chord").style("fill",(function(e){return s(e.target.index)})).style("fill-opacity",".67").style("stroke","#000").style("stroke-width",".25px").style("cursor","pointer").attr("d",d);g.on("mouseover",(function(){d3.select(this).style({"fill-opacity":"1"})})),g.on("mouseout",(function(){d3.select(this).style({"fill-opacity":".67"})})),g.on("click",(function(e){const r=o[e.source.index],i=o[e.target.index],s=d3.event.pageX,l=d3.event.pageY;t.getPredicates(r,i,n.selectedGraph&&n.selectedGraph.contextID.uri).success((function(e){let t="<div class='dependencies-tooltip'>"+("<div class='row'>"+r+" <i class='fa fa-exchange'></i> "+i+"</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>",a.html(t).style("left",s+"px").style("top",l+"px")})),a.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=r.a.Export.generateBase64ImageSource();d3.select(this).attr({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"]},71:function(e,t){function n(){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,n,r,i;e.listItemsObj.items=(t=e.filterQueryObj.query,n=e.listItemsObj.items,r=e.listItemsNotFiltered,i=e.filterFunction,t.length>0?_.filter(r,i):n.length!==r.length?r:n)}))}}}angular.module("graphdb.framework.graphexplore.directives.searchfilter",[]).directive("listItemsSearchFilter",n),n.$inject=[]},72:function(e,t){function n(e,t){return{restrict:"AE",scope:{searchData:"=",searchFields:"@",titleField:"@",searchPlaceholder:"@",initialValue:"=",searchedObjCallback:"&"},templateUrl:"js/angular/graphexplore/templates/searchIconInputTemplate.html",link:function(n,r){n.searchedObjCallback=n.searchedObjCallback(),n.performSearchActionOnEnter=function(){e.$broadcast("onEnterKeypressSearchAction")},n.showInput=function(){$("#selectGraphDropdown").hide(),r.find("#search_input #search_input_value")[0].value="",r.find(".search-icon").addClass("animated bounceOut").css("z-index","-1"),r.find("#search_input .angucomplete-holder").css("display","block"),t((function(){r.find("#search_input .angucomplete-holder").css("width","250px").css("left","-215px"),t((function(){r.find(".close-icon").css("display","block").addClass("animated bounceIn").css("z-index","3"),r.find("#search_input #search_input_value").focus()}),200)}),1)},n.hideInput=function(){r.find("#search_input #search_input_value")[0].value="",r.find("#search_input .angucomplete-holder").css("width","0px").css("left","35px"),t((function(){r.find("#search_input .angucomplete-holder").css("display","none"),$("#selectGraphDropdown").show()}),250),r.find(".close-icon").addClass("animated bounceOut").removeClass("bounceOut").css("z-index","-1").css("display","none").click((function(){$(".tooltip").hide()})),t((function(){r.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",n),n.$inject=["$rootScope","$timeout"]}}]);
28
+ !function(e,t){"use strict";!function(e){e.module("angucomplete-alt",[]).directive("angucompleteAlt",["$q","$parse","$http","$sce","$timeout","$templateCache","$interpolate",function(e,t,n,r,i,o,s){var a=40,l=39,u=38,c=37,p=27,d=13,f=9,h=3,g=524288,m=500,v=200,E="autocomplete-required",x="Searching...",y="No results found";function T(t,o,s,T){var N,C,S,I,L,A,b=o.find("input"),R=h,w=null,O=E,M=null,_=null,P=o[0].querySelector(".angucomplete-dropdown"),D=!1,k=null;function F(e,n){e&&("object"==typeof e?(t.searchStr=j(e),B({originalObject:e})):"string"==typeof e&&e.length>0?t.searchStr=e:console&&console.error&&console.error("Tried to set "+(n?"initial":"")+" value of angucomplete to",e,"which is an invalid value"),q(!0))}function G(e){k=null,t.hideResults(e),document.body.removeEventListener("click",G)}function U(e){return e.which?e.which:e.keyCode}function B(e){"function"==typeof t.selectedObject?t.selectedObject(e,t.selectedObjectData):t.selectedObject=e,q(!!e)}function j(e){return t.titleField.split(",").map((function(t){return V(e,t)})).join(" ")}function V(e,t){var n,r;if(t){n=t.split("."),r=e;for(var i=0;i<n.length;i++)r=r[n[i]]}else r=e;return r}function H(e,n){var i,o,s;if(s=new RegExp(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),e)return e.match&&e.replace||(e=e.toString()),i=(o=e.match(s))?e.replace(s,'<span class="'+t.matchClass+'">'+o[0]+"</span>"):e,r.trustAsHtml(i)}function q(e){t.notEmpty=e,M=t.searchStr,t.fieldRequired&&T&&t.inputName&&T[t.inputName].$setValidity(O,e)}function $(e){!t.overrideSuggestions||t.selectedObject&&t.selectedObject.originalObject===t.searchStr||(e&&e.preventDefault(),i.cancel(w),K(),B({originalObject:t.searchStr}),t.clearSelected&&(t.searchStr=null),ee())}function z(){return o[0].querySelectorAll(".angucomplete-row")[t.currentIndex]}function W(e){P.scrollTop=P.scrollTop+e}function Q(){var e=t.results[t.currentIndex];t.matchClass?b.val(j(e.originalObject)):b.val(e.title)}function Y(e){return function(n,r,i,o){r||i||o||!n.data||(n=n.data),t.searching=!1,re(V(C(n),t.remoteUrlDataField),e)}}function X(e,n,r,i){t.searching=!1,0!==n&&-1!==n&&(n||r||i||(n=e.status),t.remoteUrlErrorCallback?t.remoteUrlErrorCallback(e,n,r,i):console&&console.error&&console.error("http error"))}function K(){_&&_.resolve()}function Z(r){var i={},o=t.remoteUrl+encodeURIComponent(r);t.remoteUrlRequestFormatter&&(i={params:t.remoteUrlRequestFormatter(r)},o=t.remoteUrl),t.remoteUrlRequestWithCredentials&&(i.withCredentials=!0),K(),_=e.defer(),i.timeout=_.promise,n.get(o,i).success(Y(r)).error(X)}function J(n){K(),_=e.defer(),t.remoteApiHandler(n,_.promise).then(Y(n)).catch(X)}function ee(){t.showDropdown=!1,t.results=[],P&&(P.scrollTop=0)}function te(){t.showDropdown=I,t.currentIndex=t.focusFirst?0:-1,t.results=[]}function ne(e){!e||e.length<R||(t.localData?t.$apply((function(){var n;n=void 0!==t.localSearch()?t.localSearch()(e,t.localData):function(e){var n,r,i,o,s=t.searchFields.split(","),a=[];for(void 0!==t.parseInput()&&(e=t.parseInput()(e)),n=0;n<t.localData.length;n++){for(r=!1,i=0;i<s.length;i++)o=V(t.localData[n],s[i])||"",r=r||o.toString().toLowerCase().indexOf(e.toString().toLowerCase())>=0;r&&(a[a.length]=t.localData[n])}return a}(e),t.searching=!1,re(n,e)})):t.remoteApiHandler?J(e):Z(e))}function re(e,n){var r,i,o,s,a,l;if(e&&e.length>0)for(t.results=[],r=0;r<e.length;r++)t.titleField&&""!==t.titleField&&(s=a=j(e[r])),i="",t.descriptionField&&(i=l=V(e[r],t.descriptionField)),o="",t.imageField&&(o=V(e[r],t.imageField)),t.matchClass&&(a=H(s,n),l=H(i,n)),t.results[t.results.length]={title:a,description:l,image:o,originalObject:e[r]};else t.results=[];t.autoMatch&&1===t.results.length&&function(e,n,r){if(!r)return!1;for(var i in n)if(n[i].toLowerCase()===r.toLowerCase())return t.selectResult(e),!0;return!1}(t.results[0],{title:s,desc:i||""},t.searchStr)?t.showDropdown=!1:0!==t.results.length||L?t.showDropdown=!0:t.showDropdown=!1}function ie(){t.localData?re(t.localData,""):t.remoteApiHandler?J(""):Z("")}o.on("mousedown",(function(e){e.target.id?(k=e.target.id)===t.id+"_dropdown"&&document.body.addEventListener("click",G):k=e.target.className})),t.currentIndex=t.focusFirst?0:null,t.searching=!1,S=t.$watch("initialValue",(function(e){e&&(S(),F(e,!0))})),t.$watch("fieldRequired",(function(e,n){e!==n&&(e?M&&-1!==t.currentIndex?q(!0):q(!1):T[t.inputName].$setValidity(O,!0))})),t.$on("angucomplete-alt:clearInput",(function(e,n){n&&n!==t.id||(t.searchStr=null,B(),q(!1),ee())})),t.$on("angucomplete-alt:changeInput",(function(e,n,r){n&&n===t.id&&F(r)})),t.onFocusHandler=function(){t.focusIn&&t.focusIn(),0!==R||t.searchStr&&0!==t.searchStr.length||(t.currentIndex=t.focusFirst?0:t.currentIndex,t.showDropdown=!0,ie())},t.hideResults=function(){k&&(k===t.id+"_dropdown"||k.indexOf("angucomplete")>=0)?k=null:(N=i((function(){ee(),t.$apply((function(){t.searchStr&&t.searchStr.length>0&&b.val(t.searchStr)}))}),v),K(),t.focusOut&&t.focusOut(),t.overrideSuggestions&&t.searchStr&&t.searchStr.length>0&&-1===t.currentIndex&&$())},t.resetHideResults=function(){N&&i.cancel(N)},t.hoverRow=function(e){t.currentIndex=e},t.selectResult=function(e){t.matchClass&&(e.title=j(e.originalObject),e.description=V(e.originalObject,t.descriptionField)),t.clearSelected?t.searchStr=null:t.searchStr=e.title,B(e),ee()},t.inputChangeHandler=function(e){return e.length<R?(K(),ee()):0===e.length&&0===R&&(t.searching=!1,ie()),t.inputChanged&&(e=t.inputChanged(e)),e},t.fieldRequiredClass&&""!==t.fieldRequiredClass&&(O=t.fieldRequiredClass),t.minlength&&""!==t.minlength&&(R=parseInt(t.minlength,10)),t.pause||(t.pause=m),t.clearSelected||(t.clearSelected=!1),t.overrideSuggestions||(t.overrideSuggestions=!1),t.fieldRequired&&T&&(t.initialValue?q(!0):q(!1)),t.inputType=s.type?s.type:"text",t.textSearching=s.textSearching?s.textSearching:x,t.textNoResults=s.textNoResults?s.textNoResults:y,I="false"!==t.textSearching,L="false"!==t.textNoResults,t.maxlength=s.maxlength?s.maxlength:g,b.on("keydown",(function(e){var n=U(e),r=null,i=null;n===d&&t.results?(t.currentIndex>=0&&t.currentIndex<t.results.length?(e.preventDefault(),t.selectResult(t.results[t.currentIndex])):($(e),ee()),t.$apply()):n===a&&t.results?(e.preventDefault(),t.currentIndex+1<t.results.length&&t.showDropdown&&(t.$apply((function(){t.currentIndex++,Q()})),D&&(r=z(),P.getBoundingClientRect().top+parseInt(getComputedStyle(P).maxHeight,10)<r.getBoundingClientRect().bottom&&W(function(e){var t=getComputedStyle(e);return e.offsetHeight+parseInt(t.marginTop,10)+parseInt(t.marginBottom,10)}(r))))):n===u&&t.results?(e.preventDefault(),t.currentIndex>=1?(t.$apply((function(){t.currentIndex--,Q()})),D&&(i=z().getBoundingClientRect().top-(P.getBoundingClientRect().top+parseInt(getComputedStyle(P).paddingTop,10)))<0&&W(i-1)):0===t.currentIndex&&t.$apply((function(){t.currentIndex=-1,b.val(t.searchStr)}))):n===f?t.results&&t.results.length>0&&t.showDropdown?-1===t.currentIndex&&t.overrideSuggestions?$():(-1===t.currentIndex&&(t.currentIndex=0),t.selectResult(t.results[t.currentIndex]),t.$digest()):t.searchStr&&t.searchStr.length>0&&$():n===p&&e.preventDefault()})),b.on("keyup",(function(e){var n=U(e);if(n!==c&&n!==l)if(n===u||n===d)e.preventDefault();else if(n===a)e.preventDefault(),!t.showDropdown&&t.searchStr&&t.searchStr.length>=R&&(te(),t.searching=!0,ne(t.searchStr));else if(n===p)ee(),t.$apply((function(){b.val(t.searchStr)}));else{if(0===R&&!t.searchStr)return;t.searchStr&&""!==t.searchStr?t.searchStr.length>=R&&(te(),w&&i.cancel(w),t.searching=!0,w=i((function(){ne(t.searchStr)}),t.pause)):t.showDropdown=!1,M&&M!==t.searchStr&&!t.clearSelected&&t.$apply((function(){B()}))}})),A="remoteUrlResponseFormatter",C=function(e){return t[A]?t[A](e):e},i((function(){var e=getComputedStyle(P);D=e.maxHeight&&"auto"===e.overflowY}))}return(o.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=s.startSymbol(),n=s.endSymbol();if("{{"!==t||"}}"!==n){var r=e.html().replace(/\{\{/g,t).replace(/\}\}/g,n);e.html(r)}return T}})}])}(window.angular)}()},34:function(e,t){function n(e,t){return{showToastMessageWithDelay:function(n){return new Promise(r=>{e.success(t.instant(n)),setTimeout(r,200)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",n),n.$inject=["toastr","$translate"]},35:function(e,t){angular.module("graphdb.framework.rest.connectors.service",[]).factory("ConnectorsRestService",r),r.$inject=["$http"];const n="rest/connectors";function r(e){return{getConnectors:function(){return e.get(n)},initConnector:function(t){return e.get(`${n}/options?prefix=${t}`)},hasConnector:function(t){return e.get(`${n}/existing?prefix=${t}`)},checkConnector:function(t){return e.post(`${n}/check`,t,{headers:{"Content-Type":"text/plain"}})}}}},36:function(e,t,n){"use strict";n.r(t);n(13),n(35);function r(e){const t=[];return Object.keys(e).forEach((function(n){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]))})),t.join("&")}function i(e,t){return _.reduce(e,(function(e,n){if(""===n.key&&""===n.value);else{if(""===n.key)throw new Error(t.instant("externalsync.empty.value.key.error",{value:n.value}));if(e.hasOwnProperty(n.key))throw new Error(t.instant("externalsync.duplicate.key.error",{key:n.key}));e[n.key]=n.value}return e}),{})}function o(e,t){for(let r=0;r<t.length;r++){const i=t[r];if("StringArray"===i.__type)e[i.__name]||(e[i.__name]=[""]);else if("OptionArray"===i.__type)if(e[i.__name])for(let t=0;t<i.__childOptions.length;t++){const n=i.__childOptions[t];if("Boolean"===n.__type)for(let t=0;t<e[i.__name].length;t++){const r=e[i.__name][t];!r.hasOwnProperty([n.__name])&&angular.isDefined(n.__defaultValue)&&(r[n.__name]=n.__defaultValue)}}else{e[i.__name]=[];const t={};for(let e=0;e<i.__childOptions.length;e++){const n=i.__childOptions[e];"StringArray"===n.__type?t[n.__name]=[""]:t[n.__name]=angular.isUndefined(n.__defaultValue)?"":n.__defaultValue}e[i.__name].push(t)}else"Map"===i.__type?e[i.__name]?e[i.__name]=(n=e[i.__name],_.map(n,(function(e,t){return{key:t,value:e}}))):e[i.__name]=[]:"JsonString"===i.__type?!e[i.__name]||e[i.__name]instanceof String||"string"==typeof e[i.__name]||(e[i.__name]=angular.toJson(e[i.__name],2)):angular.isUndefined(e[i.__name])&&(e[i.__name]=angular.isUndefined(i.__defaultValue)?"":i.__defaultValue)}var n;return e}function s(e,t,n){return e.post("repositories/"+t,r({query:n}),{headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/sparql-results+json","X-GraphDB-Local-Consistency":"updating"}})}function a(e){return e.substring(0,e.length-1)+"/instance#"}function l(e,t,n,r,o){const s=function e(t,n){const r={};return _.each(n,(function(n){angular.isDefined(t[n.__name])&&("OptionArray"===n.__type?(r[n.__name]=[],_.each(t[n.__name],(function(t){r[n.__name].push(e(t,n.__childOptions))}))):r[n.__name]=angular.copy(t[n.__name]))})),r}(n,r);for(let e=0;e<r.length;e++)try{"Map"===r[e].__type?s[r[e].__name]=i(s[r[e].__name],$translate):"JsonString"===r[e].__type&&(s[r[e].__name]=angular.fromJson(s[r[e].__name]))}catch(t){return o(r[e].__label,t.message),null}!function e(t){Array.isArray(t)&&(t=_.filter(t,(function(e){return null!==e&&(!e.trim||""!==e.trim())})));return Object.keys(t).forEach((function(n){""!==t[n]&&null!=t[n]||!1===t[n]?"object"==typeof t[n]&&(t[n]=e(t[n])):delete t[n]})),t}(s);let l="";return l+="PREFIX :<"+t+">\n",l+="PREFIX inst:<"+a(t)+">\n",l+="INSERT DATA {\n",l+="\tinst:"+e+" :createConnector '''\n",l+=angular.toJson(s,2),l+="\n''' .\n}\n",l=l.replace(/\\/g,"\\\\\\"),l}function u(e,t,n,i,u,c,p,d,f,h){function g(t){e.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:t?h.instant("externalsync.repairing"):h.instant("externalsync.creating"),waitOnRepairStartOnce:!!t,eta:"-",inline:!1,iri:null}}function m(t,n,r){return g(r),$.extend(e.beingBuiltConnector,{iri:a(t)+n,name:n,inline:!1,doneCallback:function(){e.beingBuiltConnector.modalInstance.dismiss("cancel")}}),e.beingBuiltConnector.modalInstance=i.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:e}),e.beingBuiltConnector.modalInstance}function v(t,i,o){const s=m(t.value,i.name,!1);d.addStatements(n.getActiveRepository(),r({update:i.query})).then((function(){f.getConnectors().then((function(){f.hasConnector(encodeURIComponent(t.value)).then((function(n){e.existing[t.key]=n.data}))})),u.success(h.instant("created.connector",{name:i.name}))}),(function(e){u.error(getError(e)),o()})).finally((function(){s.dismiss("cancel")}))}e.loader=!1,e.controllers=[],e.existing={},e.definitions={},e.getLoaderMessage=function(){const t=(Date.now()-e.loaderStartTime)/1e3,n=e.getHumanReadableSeconds(t);let r="";return r=e.progressMessage?e.progressMessage+"... "+n:h.instant("common.running.operation",{timeHuman:n}),e.extraMessage&&t>10&&(r+="\n"+e.extraMessage),r},e.setLoader=function(t,n,r){t?(e.loader=!0,e.loaderStartTime=Date.now(),e.progressMessage=n,e.extraMessage=r):(e.loader=!1,e.progressMessage="",e.extraMessage="")},e.initConnector=function(t){return f.initConnector(encodeURIComponent(t.value)).then((function(n){return e.definitions[t.key]=n.data,f.hasConnector(encodeURIComponent(t.value)).then((function(n){e.existing[t.key]=n.data}))}))},e.getConnectors=function(){e.isLicenseValid()&&e.canWriteActiveRepo()&&(e.setLoader(!0,h.instant("externalsync.fetching.connectors"),h.instant("common.extra.message")),f.getConnectors().then((function(r){e.connectors=Object.keys(r.data).map((function(e){return{key:e,value:r.data[e]}})),p.all(_.map(e.connectors,(function(t){return e.initConnector(t)}))).finally((function(){g();const r=function(e){const t=_.map(e,(function(e){return"<"+e.value+"connectorStatus>"})).join("|");return t?"SELECT ?connector ?status { ?connector "+t+" ?status }":null}(e.connectors);r?function(e){return s(t,n.getActiveRepository(),e)}(r).then((function(t){const n=function(e){if(e.bindings)for(let t=0;t<e.bindings.length;t++)try{const n=JSON.parse(e.bindings[t].status.value);if("BUILDING"===n.status)return{connector:e.bindings[t].connector.value,status:n}}catch(e){console.error(e)}return{}}(t.data.results);if(n.connector){const t=n.connector.split(/#/);t[0]=t[0].replace(/\/instance$/,"#"),r=t[0],i=t[1],g(),$.extend(e.beingBuiltConnector,{iri:a(r)+i,name:i,inline:!0,doneCallback:function(){e.beingBuiltConnector.inline=!1}})}var r,i})).finally((function(){e.setLoader(!1)})):e.setLoader(!1)}))})).catch((function(t){e.setLoader(!1),u.error(getError(t),h.instant("externalsync.could.not.get.connectors.error"))})),e.existing={})},e.getOptions=function(t){return e.definitions[t.key]},e.isEmpty=function(e){return angular.isObject(e)&&0===Object.keys(e).length},e.toPrettyJson=function(e){return angular.toJson(e,2)},e.$watch((function(){return n.getActiveRepository()}),e.getConnectors),e.$watch((function(){return n.getActiveLocation()}),e.getConnectors),e.copyConnector=function(t,n){let r;angular.isUndefined(n)||(r=angular.copy(n),r.name=r.name+"-copy"),i.open({templateUrl:"pages/createConnector.html",controller:"CreateConnectorCtrl",size:"lg",backdrop:"static",resolve:{connector:function(){return t},values:function(){return angular.isUndefined(r)?{name:"",values:{}}:r},options:function(){return e.getOptions(t)}}}).result.then((function(n){v(t,n,(function(){n.skipConversion=!0,e.newConnector(t,n)}))}))},e.newConnector=function(t,n){i.open({templateUrl:"pages/createConnector.html",controller:"CreateConnectorCtrl",size:"lg",backdrop:"static",resolve:{connector:function(){return t},values:function(){return angular.isUndefined(n)?{name:"",values:{}}:n},options:function(){return e.getOptions(t)}}}).result.then((function(n){v(t,n,(function(){n.skipConversion=!0,e.newConnector(t,n)}))}))},e.repair=function(t,i){c.openSimpleModal({title:h.instant("externalsync.confirm.repair"),message:h.instant("externalsync.repair.warning.msg"),warning:!0}).result.then((function(){const o=m(i.value,t.name,!0),s=(l=t.name,"PREFIX prefix:<"+(c=i.value)+">\nINSERT DATA {\n\t<"+a(c)+l+'> prefix:repairConnector ""\n}');var l,c;d.addStatements(n.getActiveRepository(),r({update:s})).then((function(){f.getConnectors().then((function(){f.hasConnector(encodeURIComponent(i.value)).then((function(t){e.existing[i.key]=t.data}))})),u.success(h.instant("externalsync.repair.success.msg",{name:t.name}))}),(function(e){u.error(getError(e))})).finally((function(){o.dismiss("cancel")}))}))},e.delete=function(t,o){const s=o.key.indexOf("Elastic")>=0||o.key.indexOf("Solr")>=0;i.open({templateUrl:"js/angular/externalsync/templates/deleteConnector.html",controller:"DeleteConnectorCtrl",resolve:{popoverMsg:function(){return s?h.instant("delete.connector.conditional",{type:o.key}):""}}}).result.then((function(i){e.setLoader(!0,h.instant("externalsync.delete.progress.msg",{name:t.name}),h.instant("externalsync.extra.message.warning"));const a=function(e,t,n){const r=t.substring(0,t.length-1)+"/instance#";return"PREFIX prefix:<"+t+">\nINSERT DATA {\n\t<"+r+e+'> prefix:dropConnector "'+(n?"force":"")+'"\n}'}(t.name,o.value,i);d.addStatements(n.getActiveRepository(),r({update:a})).then((function(){f.getConnectors().then((function(){f.hasConnector(encodeURIComponent(o.value)).then((function(t){e.existing[o.key]=t.data}))})),i?(u.success(h.instant("externalsync.delete.force.success.msg",{name:t.name})),s&&u.warning(h.instant("externalsync.delete.remote.warning",{key:o.key}))):u.success(h.instant("externalsync.delete.success.msg",{name:t.name}))}),(function(e){u.error(getError(e))})).finally((function(){e.setLoader(!1)}))}))},e.viewQuery=function(t,n){i.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){const r=e.getOptions(t);return l(n.name,t.value,o(n.values,r),r)}}})}}function c(e,t,n){e.force=!1,e.popoverMsg=n,e.ok=function(){t.close(e.force)},e.cancel=function(){t.dismiss()}}function p(e,t,n,r,i){function o(){return l(e.name,n.value,e.values,e.options,(function(e,t){i.error(t,e)}))}e.connector=n,e.addField=function(t,n){const r=angular.copy(e.defaultValues[n][0]);e.values[n].splice(t+1,0,r)},e.addOption=function(e,t){t.splice(e+1,0,"")},e.deleteOption=function(e,t){t.splice(e,1)},e.addMapOption=function(e,t){t.splice(e+1,0,{key:"",value:""})},e.deleteMapOption=function(e,t){t.splice(e,1)},e.ok=function(){if(e.form.$valid){const n=o();n&&t.close({name:e.name,values:e.values,options:e.options,query:n})}},e.viewQuery=function(){const e=o();e&&r.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){return e}}})},e.cancel=function(){t.dismiss("cancel")}}function d(e,t,n,r,i,s,a,l){angular.extend(this,t("ExtendNewConnectorCtrl",{$scope:e,$modalInstance:r,connector:i,$modal:s})),e.values=a.values,e.options=l,e.name=a.name,a.skipConversion||(e.values=o(e.values,e.options)),e.defaultValues=angular.copy(e.values)}function f(e,t,n,r,i){function o(){const o=function(e){const t=e.replace(/\/instance#.+$/,"#connectorStatus");let n="";return n+="SELECT ?status {\n",n+="\t<"+e+"> <"+t+"> ?status",n+="\n}",n}(e.beingBuiltConnector.iri);e.beingBuiltConnector.iri=null,e.progressInterval=t((function(){(function(e){return s(n,r.getActiveRepository(),e)})(o).then((function(n){const r=function(e){if(e.bindings&&e.bindings.length>0)try{return JSON.parse(e.bindings[0].status.value)}catch(e){console.error(e)}return{}}(n.data.results);"BUILDING"===r.status?(e.beingBuiltConnector.status=r,e.beingBuiltConnector.percentDone=(100*r.processedEntities/r.estimatedEntities).toFixed(0),e.beingBuiltConnector.eta=e.getHumanReadableSeconds(r.etaSeconds),e.beingBuiltConnector.actionName=r.repair?i.instant("externalsync.repairing"):i.instant("externalsync.creating"),e.beingBuiltConnector.waitOnRepairStartOnce=!1):"BUILT"!==r.status||e.beingBuiltConnector.waitOnRepairStartOnce||(t.cancel(e.progressInterval),e.beingBuiltConnector.doneCallback&&e.beingBuiltConnector.doneCallback())}))}),1e3),e.$on("$destroy",(function(){t.cancel(e.progressInterval)}))}e.beingBuiltConnector=e.beingBuiltConnector||{},!e.beingBuiltConnector.inline&&e.beingBuiltConnector.iri&&o(),e.$watch("beingBuiltConnector.iri",(function(t){e.beingBuiltConnector.inline&&t&&o()}))}angular.module("graphdb.framework.externalsync.controllers",["graphdb.framework.rest.rdf4j.repositories.service","graphdb.framework.rest.connectors.service"]).controller("ConnectorsCtrl",u).controller("ExtendNewConnectorCtrl",p).controller("CreateConnectorCtrl",d).controller("CreateProgressCtrl",f).controller("DeleteConnectorCtrl",c).filter("ceil",(function(){return function(e){return Math.ceil(e)}})),u.$inject=["$scope","$http","$repositories","$modal","toastr","ModalService","$q","RDF4JRepositoriesRestService","ConnectorsRestService","$translate"],c.$inject=["$scope","$modalInstance","popoverMsg"],p.$inject=["$scope","$modalInstance","connector","$modal","toastr"],d.$inject=["$scope","$controller","$http","$modalInstance","connector","$modal","values","options"],f.$inject=["$scope","$interval","$http","$repositories","$translate"]},38:function(e,t,n){"use strict";n.r(t);n(4),n(15);var r=n(0);function i(e,t,n,i,o,s,a,l,u,c,p,d,f,h,g){const m={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:!0,sameAs:!0};let v,E;function x(t){!function(){if(i.isActiveRepoOntopType())return;const t=document.getElementById("sameAs");!t||e.currentQuery.inference||t.disabled?e.currentQuery.inference&&t.disabled&&(t.removeAttribute("disabled"),e.currentQuery.sameAs=v.appSettings.DEFAULT_SAMEAS):(t.disabled=!0,e.currentQuery.sameAs=!1)}(),e.tabs.forEach((function(n,r){n.id===t.id&&(e.tabs[r].query=t.query,i.isActiveRepoOntopType()||(e.tabs[r].inference=t.inference,e.tabs[r].sameAs=t.sameAs))})),f.set(h.TABS_STATE,e.tabs)}function y(t,n,r,i){const o=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=n,e.extraMessage=r,e.noLoaderTimer=i,o.addClass("hide")):(e.progressMessage="",e.extraMessage="",e.noLoaderTimer=!1,e.currentTrackAlias=null,e.abortRequested=!1,o.removeClass("hide")),null===e.$$phase&&e.$apply()}function T(n){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let r;r=t(n?function(){e.fixSizesOnHorizontalViewModeSwitch(n)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){t.cancel(r)}))}window.yasr&&window.yasr.container&&t((function(){window.yasr.container.resize()}),100)}function N(){T(!0)}function C(t,n){n.newRepo&&(e.tabsData=f.get(h.TABS_STATE),e.tabsData.forEach((function(e){e.yasrData=void 0,e.queryType=void 0,e.resultsCount=0,e.allResultsCount=0,e.sizeDelta=void 0})),f.set(h.TABS_STATE,e.tabsData),e.tabs=e.tabsData,e.currentQuery={},e.errorMessage=null,e.repositoryError=null)}function S(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function I(r,o){if(e.executedQueryTab=e.currentQuery,o){if("SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType())return void n.warning(g.instant("query.editor.warning.msg"));if(i.isActiveRepoOntopType())return void n.warning(g.instant("query.editor.virtual.repo.warning.msg"))}if(e.explainRequested=o,!e.queryIsRunning){if(r?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.lastRunQueryMode=window.editor.getQueryMode(),"update"===e.lastRunQueryMode&&i.isActiveRepoOntopType())return void n.warning(g.instant("query.editor.virtual.repo.update.warning.msg"));if(y(!0,"update"===e.lastRunQueryMode?g.instant("query.editor.executing.update"):g.instant("query.editor.evaluating.query")),"none"!==e.viewMode){e.viewMode="none",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch();const n=t(window.editor.query,500);e.$on("$destroy",(function(){t.cancel(n)}))}else window.editor.query()}}function L(){e.showSampleQueries=!e.showSampleQueries,e.showSampleQueries?a.getSavedQueries().success((function(t){e.sampleQueries=t,$("#sampleQueriesCollapse").collapse("show").width("300px")})).error((function(e){const t=getError(e);n.error(t,g.instant("query.editor.get.saved.queries.error"))})):$("#sampleQueriesCollapse").collapse("hide")}function A(t){let n=void 0;return e.tabsData.forEach((function(e){if(e.name===t.name&&e.query===t.body)return n=e.id,e})),n}function b(t){return function(n,r,i){e.savedQuery={name:n,query:r||window.editor.getValue(),shared:i},$(t).modal("show")}}function R(t){for(let n=0;n<e.tabsData.length;n++){if(e.tabsData[n].id===t)return n}}e.getPrincipal=function(){return c.getPrincipal().then(t=>{v=t,function(e,t){m.inference=t.appSettings.DEFAULT_INFERENCE,m.sameAs=t.appSettings.DEFAULT_SAMEAS,e.skipCountQuery=!t.appSettings.EXECUTE_COUNT,e.ignoreSharedQueries=t.appSettings.IGNORE_SHARED_QUERIES,e.tabsData=e.tabs=f.get(h.TABS_STATE)||[m],e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(e,t,n){x(n.currentQuery)})),e.$on("repositoryIsSet",C)}(e,v)})},e.getPrincipal(),this.hint=document.createElement("span"),this.hint.innerHTML=g.instant("query.editor.autocomplete.hint"),this.hint.style.fontSize="12px",this.hint.style.color="gray",this.hint.style.backgroundColor="white",this.hint.style.position="absolute",this.hint.style.zIndex="3",this.hint.style.paddingLeft="12px",e.$watch((function(){return angular.element(".CodeMirror-hints").length}),e=>{if(e){const e=angular.element(".CodeMirror-hints")[0].getBoundingClientRect();document.body.appendChild(this.hint),this.hint.style.top=e.top-20+"px",this.hint.style.left=e.right-this.hint.offsetWidth-12+"px"}else this.hint&&this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint)}),e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:1e3,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.saveTab=function(t){const n=R(t);if(void 0===n)return{};const r=e.tabsData[n];return e.saveQueryToLocal(r),r},e.loadTab=function(n){e.tabsData=f.get(h.TABS_STATE)||[m];const r=R(n),o=e.tabsData[r];o.yasrData&&y(!0,g.instant("query.editor.render.results.msg"),null,!0);t((function(){""===e.currentQuery.query&&(e.currentQuery.query=" "),t((function(){window.editor.setValue(e.currentQuery.query),e.yasr.updateDownloadDropdown(),e.$broadcast("tabLoaded",e.currentQuery.id),e.yasr.options.output=o.outputType,o.yasrData&&(o.yasrData.customError?(e.yasr.results={getException:function(){return o.yasrData.customError}},y(!1)):t((function(){e.setYasrResponse(o.yasrData,o.textStatus,o.jqXhrOrErrorString),y(!1),$(".yasr_btnGroup li:nth-child(2)").hasClass("active")&&t((function(){$(".yasr_btnGroup li:nth-child(2) a").get(0).click()}),0)}),0))}),0)}),0),f.set(h.TABS_STATE_CURRENT_ID,n),e.currentQuery=o,t((function(){e.currentTabConfig={},e.currentTabConfig.queryType=o.queryType,e.currentTabConfig.resultsCount=o.resultsCount,e.currentTabConfig.offset=o.offset,e.currentTabConfig.allResultsCount=o.allResultsCount,e.currentTabConfig.allResultsCountExact=o.allResultsCountExact,e.currentTabConfig.page=o.page,e.currentTabConfig.pageSize=o.pageSize,e.currentTabConfig.timeFinished=o.timeFinished,e.currentTabConfig.timeTook=o.timeTook,e.currentTabConfig.sizeDelta=o.sizeDelta,e.currentTabConfig.customUpdateMessage=o.customUpdateMessage,e.currentTabConfig.errorMessage=o.errorMessage,e.currentTabConfig.warningMessage=o.warningMessage,e.$apply()}),0),$("#yasr").css("padding","0"),E||(E=setInterval(M,200));!function(){const t=i.isActiveRepoOntopType(),n=i.isActiveRepoFedXType();(function(e){const t=document.getElementById("sameAs"),n=document.getElementById("inference");t&&(t.disabled=!!e);n&&(n.disabled=!!e)})(t),e.nocount=!(!t&&!n)||!v.appSettings.EXECUTE_COUNT,t&&(e.currentQuery.inference=!0,e.currentQuery.sameAs=!0)}()},e.addNewTab=function(n,r,i){if(!_(!0))return;let o;o=r||i?{id:"1",name:r,query:i,inference:v.appSettings.DEFAULT_INFERENCE,sameAs:v.appSettings.DEFAULT_SAMEAS}:{id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:v.appSettings.DEFAULT_INFERENCE,sameAs:v.appSettings.DEFAULT_SAMEAS};w++;const s=""+w;e.tabsData=e.tabs;const a=o;a.id=s,e.tabsData.push(a),f.set(h.TABS_STATE_MAXID,w),f.set(h.TABS_STATE,e.tabsData);const l=Array.prototype.slice.call(arguments,1);t((function(){e.$apply(),S(s),n&&n.apply(this,l)}),0),e.tabs=e.tabsData},e.isTabChangeOk=_,e.runQuery=I,e.abortCurrentQuery=function(){d.abortQueryByAlias(e.currentTrackAlias).success((function(){e.abortRequested=!0}))},e.editQuery=function(t){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:g.instant("query.editor.edit.saved.query",{name:t.name}),query:t,edit:!0,okButtonText:g.instant("common.save.btn")}}}}).result.then((function(r){const i={name:r.name,body:r.body,shared:r.shared};t.name!==r.name?a.addNewSavedQuery(i).success((function(){e.deleteQueryHttp(t.name,!0)})).error((function(e){const t=getError(e);n.error(t,g.instant("query.editor.edit.saved.query.error"))})):a.editSavedQuery(i).success((function(){$("#editQueryContainer").modal("hide"),e.toggleSampleQueries(),n.success(g.instant("query.editor.edit.saved.query.success.msg",{name:t.name}))})).error((function(e){const t=getError(e);n.error(t,g.instant("query.editor.edit.saved.query.error"))}))}))},e.getNamespaces=function(){y(!0,g.instant("common.refreshing.namespaces"),g.instant("common.extra.message")),e.namespacesLoading=!0,p.getRepositoryNamespaces().success((function(t){const n={};t.results.bindings.forEach((function(e){n[e.prefix.value]=e.namespace.value})),e.namespaces=n})).error((function(t){e.repositoryError=getError(t)})).finally((function(){y(!1),e.namespacesLoading=!1}))},e.changePagination=function(){I(!0,e.explainRequested)},e.toggleSampleQueries=L,e.addKnownPrefixes=function(){a.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){const t=getError(e);return n.error(t,g.instant("common.add.known.prefixes.error")),!0}))},e.getExistingTabId=A,e.querySelected=function(t){const n=A(t);e.toggleSampleQueries(),e.isTabChangeOk(!1)&&(e.highlightNextTabChange=!0,angular.isDefined(n)?S(n):e.addNewTab(null,t.name,t.body))},e.deleteQuery=function(t){s.openSimpleModal({title:g.instant("common.confirm"),message:g.instant("query.editor.delete.saved.query.warning.msg",{savedQueryName:t}),warning:!0}).result.then((function(){e.deleteQueryHttp(t)}))},e.deleteQueryHttp=function(t,r){a.deleteSavedQuery(t).success((function(){e.toggleSampleQueries(),r||n.success(g.instant("query.editor.delete.saved.query.success.msg",{savedQueryName:t}))})).error((function(e){const t=getError(e);n.error(t,g.instant("query.editor.delete.saved.query.error"))}))},e.saveQuery=function(t,n){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:g.instant("query.editor.create.saved.query.msg"),query:{name:t.name,body:t.query,shared:t.shared},edit:!1,okButtonText:g.instant("common.create.btn"),queryExists:n,existingQueryErrMsg:Object(r.decodeHTML)(g.instant("query.sample.existing.query.warning",{name:t.name}))}}}}).result.then((function(t){e.saveQueryHttp(t)}),(function(){}))},e.saveQueryHttp=function(t){a.addNewSavedQuery(t).success((function(){n.success(g.instant("query.editor.save.saved.query.success.msg",{name:t.name}))})).error((function(r){let i=getError(r);if(n.error(i,g.instant("query.editor.create.saved.query.error")),i="Query '"+t.name+"' already exists!"){t.query=t.body;const n=!0;e.saveQuery(t,n)}}))},e.saveQueryToLocal=x,e.setLoader=y,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3;let n="",r="";e.noLoaderTimer||(n=e.getHumanReadableSeconds(t));r=e.progressMessage?g.instant("query.editor.progress.msg",{progressMessage:e.progressMessage,timeHuman:n}):g.instant("common.running.operation",{timeHuman:n});e.extraMessage&&t>10&&(r+=g.instant("query.editor.extra.msg",{extraMessage:e.extraMessage}));return r},e.fixSizesOnHorizontalViewModeSwitch=T,e.changeViewMode=function(){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,f.set(h.VIEW_MODE,e.orientationViewMode),T()},e.showHideEditor=N,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!f.get(h.VIEW_MODE)||"true"===f.get(h.VIEW_MODE),e.viewMode="none",e.getActiveRepository=function(){return i.getActiveRepository()},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return i.getActiveRepository()},e.orientationViewMode||N(),window.onbeforeunload=function(){e.currentQuery&&e.saveTab(e.currentQuery.id),f.set(h.TABS_STATE,e.tabs)},e.$on("$destroy",(function(){e.currentQuery&&e.saveTab(e.currentQuery.id),f.set(h.TABS_STATE,e.tabs),clearInterval(E)})),e.$on("$destroy",(function(){clearInterval(E),window.editor=null,window.yasr=null})),$(document).mouseup((function(t){const n=$("#sampleQueriesCollapse");!n.is(t.target)&&0===n.has(t.target).length&&e.showSampleQueries&&L()}));let w=f.get(h.TABS_STATE_MAXID)||1;function O(e){return $(e).attr("data-id")}function M(){if(e.currentTabConfig.resultsCount>=0){const e=$(".saveAsDropDown");e.length>0&&!window.editor.queryValid?yasr.header.find(".saveAsDropDown").remove():0===e.length&&window.editor.queryValid&&yasr.updateDownloadDropdown()}}function _(t){return!(e.queryIsRunning&&!e.namespacesLoading)||(t?n.info(g.instant("query.editor.new.tab.running.query.warning.msg")):n.info(g.instant("query.editor.tab.switching.running.query.warning.msg")),!1)}e.highlightNextTabChange=!1,e.$on("tabAction",(function(n,r){r.relatedTarget&&(t.cancel(r.relatedTarget.timer),$(r.relatedTarget).css("color",""),e.saveTab(O(r.relatedTarget))),e.loadTab(O(r.target));const i=["var(--onto-orange)","","var(--onto-orange)"],o=[400,400,400];if(e.highlightNextTabChange){e.highlightNextTabChange=!1;let n=0;$(r.target).css("color",i[n]);const s=function(){n++,n<i.length?($(r.target).css("color",i[n]),r.target.timer=t(s,o[n])):$(r.target).css("color","")};t(s,o[n])}})),e.$on("deleteAllexeptSelected",(function(t,n){e.tabsData=n,e.tabs=n})),e.currentQuery={},e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.editQueryModal=b("#editQueryContainer"),e.deleteQueryModal=b("#confirmDeleteContainer"),e.saveQueryModal=b("#saveQueryContainer"),e.getResultsDescription=function(){let t;if(0===e.currentTabConfig.resultsCount)t="No results.";else{const n=(e.currentTabConfig.page-1)*e.currentTabConfig.pageSize+Math.min(e.currentTabConfig.resultsCount,e.currentTabConfig.pageSize);t=g.instant("query.editor.showing.results.from.msg")+l("currency")(e.currentTabConfig.offset,"",0)+g.instant("query.editor.to")+l("currency")(n,"",0),e.currentTabConfig.allResultsCount>0&&(t+=g.instant(e.currentTabConfig.allResultsCountExact?"query.editor.of":"query.editor.of.at.least"),t+=l("currency")(e.currentTabConfig.allResultsCount,"",0)),t+="."}return t},e.getUpdateDescription=function(){return e.currentTabConfig.customUpdateMessage?g.instant(e.currentTabConfig.customUpdateMessage.msg,{name:e.currentTabConfig.customUpdateMessage.name}):void 0===e.currentTabConfig.sizeDelta?"":e.currentTabConfig.sizeDelta<0?g.instant("yasr.removed.statements.result.msg",{sizeDelta:Math.abs(e.currentTabConfig.sizeDelta)}):e.currentTabConfig.sizeDelta>0?g.instant("yasr.added.statements.result.msg",{sizeDelta:e.currentTabConfig.sizeDelta}):g.instant("yasr.statements.no.change.msg")},e.getStaleWarningMessage=function(){const t=60*Math.round((Date.now()-e.currentTabConfig.timeFinished)/6e4);if(t>=3600)return g.instant("yasr.stale.result.msg",{secondsAgo:e.getHumanReadableSeconds(t)})};const P=function(){};angular.element(u).bind("resize",P),e.$on("$destroy",(function(){angular.element(u).unbind("resize",P)}))}function o(e,t,n,r){n.queryExists&&(e.queryExists=!0),e.query=angular.copy(n.query),e.title=n.title,e.edit=n.edit,e.okButtonText=n.okButtonText,e.existingQueryErrMsg=r.trustAsHtml(n.existingQueryErrMsg),e.ok=function(){e.form.$valid&&t.close(e.query)},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.core.directives.queryeditor.controllers",["graphdb.framework.utils.localstorageadapter","graphdb.framework.rest.sparql.service"]).controller("QueryEditorCtrl",i).controller("QuerySampleModalCtrl",o),i.$inject=["$scope","$timeout","toastr","$repositories","$modal","ModalService","SparqlRestService","$filter","$window","$jwtAuth","RDF4JRepositoriesRestService","MonitoringRestService","LocalStorageAdapter","LSKeys","$translate"],o.$inject=["$scope","$modalInstance","data","$sce"]},39:function(e,t,n){"use strict";n.r(t);n(35),n(4),n(36);var r=n(224),i=n.n(r),o=n(223),s=n.n(o),a=n(0);function l(e,t,n,r,o,l,u,c,p,d,f,h,g,m){let v;return{restrict:"AE",scope:!1,templateUrl:"js/angular/core/directives/queryeditor/templates/query-editor.html",link:function(E,x,y){E.nostorage=y.hasOwnProperty("nostorage"),E.notabs=y.hasOwnProperty("notabs"),E.notoolbar=y.hasOwnProperty("notoolbar"),E.notoolbarSaved=y.hasOwnProperty("notoolbarSaved"),E.notoolbarCopy=y.hasOwnProperty("notoolbarCopy"),E.notoolbarInference=y.hasOwnProperty("notoolbarInference"),E.notoolbarSameAs=y.hasOwnProperty("notoolbarSameAs"),E.nostatus=y.hasOwnProperty("nostatus"),E.norun=y.hasOwnProperty("norun"),E.runButtonName="query.editor.run.btn",y.runButtonName&&(E.runButtonName=y.runButtonName);if(E.nocount="true"===y.nocount,y.callbackOnChange){const e=E[y.callbackOnChange];"function"==typeof e&&(v=e)}e((function(){!function(E){function x(){angular.element("#wb-sparql-saveQuery")[0].click()}function y(){E.runQuery(!1,!1)}function T(){E.runQuery(!1,!0)}function N(){if(E.tabs.length<2||!E.currentQuery.id||!E.isTabChangeOk(!1))return;let e=D(E.currentQuery.id);e=(e+1)%E.tabs.length,S(E.tabs[e].id)}function C(){if(E.tabs.length<2||!E.currentQuery.id||!E.isTabChangeOk(!1))return;let e=D(E.currentQuery.id);e--,-1===e&&(e=E.tabs.length-1),S(E.tabs[e].id)}function S(t){e((function(){let e=$('a[data-id = "'+t+'"]');0===e.length&&(e=$("a[data-id]").first()),e.tab("show")}),0)}E.changePagination=function(){E.runQuery(!0,E.explainRequested)},window.editor=i.a.fromTextArea(document.getElementById("query"),{persistent:null,value:"",indentUnit:4,createShareLink:null,cursorHeight:1,sparql:{showQueryButton:!1,acceptHeaderGraph:"application/x-graphdb-table-results+json, application/rdf+json;q=0.9, */*;q=0.8",acceptHeaderSelect:"application/x-sparqlstar-results+json, application/sparql-results+json;q=0.9, */*;q=0.8"},extraKeys:{"Ctrl-Enter":y,"Cmd-Enter":y,"Shift-Ctrl-Enter":T,"Shift-Cmd-Enter":T,"Ctrl-Alt-T":E.addNewTab,"Cmd-Alt-T":E.addNewTab,"Ctrl-S":x,"Cmd-S":x,"Ctrl-Alt-Left":C,"Cmd-Alt-Left":C,"Ctrl-Alt-Right":N,"Cmd-Alt-Right":N},locale:m.getLanguage()}),window.editor.toastBuildIndex=function(){const e=Object(a.decodeHTML)(g.instant("explore.autocomplete.warning.msg"));n.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${e}</a></div>`,{allowHtml:!0})},window.editor.toastError=function(e){n.error("Cannot execute autocomplete query. "+getError(e))},window.editor.on("update",(function(){angular.element(".parseErrorIcon").parent().css("z-index","10")})),window.editor.on("changes",(function(){angular.element(".CodeMirror-linenumbers").css("width","1px"),angular.element(".CodeMirror-sizer").css("margin-left","0px"),clearTimeout(E.changesTimeout);const e=!window.editor.queryValid;E.changesTimeout=setTimeout(v?v():function(){const t=D(E.currentQuery.id)+1;$('a[data-id = "'+t+'"]').toggleClass("query-has-error",e).attr("title",e?g.instant("query.editor.query.syntax.error"):"")},200),E.currentQuery.query=window.editor.getValue(),E.currentQuery.queryType=window.editor.getQueryType()})),$(".fullscreenToggleBtns").hide();const I=function(e){$(e.target).removeClass("fa-link").addClass("fa-check").blur(),setTimeout((function(){$(e.target).removeClass("fa-check").addClass("fa-link")}),1e3)};window.onbeforeunload=function(){E.nostorage||f.set(h.TABS_STATE,E.tabs),E.saveTab(E.currentQuery.id)};const L=i.a.executeQuery,A=i.a.getUrlArguments;function b(e,t,n){return{status:e,statusText:t,responseText:n}}let R,w;E.$on("$destroy",(function(){E.nostorage||f.set(h.TABS_STATE,E.tabs),i.a.executeQuery=L,i.a.getUrlArguments=A,E.saveTab(E.currentQuery.id)})),i.a.drawButtons=function(e){e.buttons=$("#yasqe_buttons_mocked")},i.a.getActiveRepository=function(){return r.getActiveRepository()},i.a.getUrlArguments=function(e,t){const n=A(e,t),r=window.editor.getQueryType();return"SELECT"!==r&&"CONSTRUCT"!==r&&"DESCRIBE"!==r||(n.push({name:"limit",value:E.currentTabConfig.pageSize+1}),E.currentTabConfig.offset=(E.currentTabConfig.page-1)*E.currentTabConfig.pageSize+1,n.push({name:"offset",value:E.currentTabConfig.offset-1})),!E.explainRequested||"SELECT"!==r&&"CONSTRUCT"!==r||n.push({name:"explain",value:"true"}),n},i.a.executeQuery=function(e){if(w&&$(w.resultsContainer).length&&$(w.resultsContainer).empty(),e.options.sparql.headers["X-GraphDB-Catch"]=E.currentTabConfig.pageSize+"; throw",E.currentTrackAlias="query-editor-"+performance.now()+"-"+Date.now(),e.options.sparql.headers["X-GraphDB-Track-Alias"]=E.currentTrackAlias,e.options.sparql.headers["X-GraphDB-Repository-Location"]=r.getActiveRepositoryObject().location,E.countTimeouted=!1,"query"===e.getQueryMode()?e.options.sparql.endpoint="repositories/"+r.getActiveRepository():"update"===e.getQueryMode()&&(e.options.sparql.endpoint="repositories/"+r.getActiveRepository()+"/statements"),e.options.sparql.args=[{name:"infer",value:E.currentQuery.inference},{name:"sameAs",value:E.currentQuery.sameAs}],E.currentTabConfig.customUpdateMessage="","update"!==window.editor.getQueryMode()){const t=E.currentTabConfig,n=E.executedQueryTab.id;return window.editor.options.sparql.handlers.countCallback=function(e,r,i){if(200===e.status){const o=E.tabs[D(n)];o&&(w.setResultsCount(e,r,i),t.allResultsCount=w.allCount,o.allResultsCount=w.allCount,t.allResultsCountExact=!0,o.allResultsCountExact=!0,E.saveTab(o.id))}else t.countTimeouted=!0},null!=E.currentQuery.outputType?w.options.output=E.currentQuery.outputType:w.options.output="table",E.currentTabConfig.queryType=window.editor.getQueryType(),E.queryStartTime=(new Date).getTime(),L(e,{setQueryLimit:function(e){return"CONSTRUCT"===E.currentTabConfig.queryType&&r.isActiveRepoOntopType()?window.editor.getValueWithoutComments():e}})}{const t=function(){E.currentTabConfig.queryType="UPDATE",p.getRepositorySize().success((function(t){return E.repoSize=parseInt(t),E.queryStartTime=(new Date).getTime(),L(e,{})})).error((function(t){return n.warning(g.instant("query.editor.repo.size.error",{repo:r.getActiveRepository(),error:getError(t)})),E.queryStartTime=(new Date).getTime(),L(e,{})}))};d.checkConnector(window.editor.getValue()).then((function(e){if(e.data.command&&!e.data.hasSupport){E.currentTabConfig.queryType="ERROR",E.currentTabConfig.timeFinished=Date.now(),E.currentTabConfig.timeTook=(E.currentTabConfig.timeFinished-E.queryStartTime)/1e3;const t=b(-1,g.instant("query.editor.inactive.plugin.warning.msg",{connectorName:e.data.connectorName,pluginName:e.data.pluginName}));return w.results={getException:function(){return t}},E.setLoader(!1),void M({customError:t},"",null)}if("create"===e.data.command||"repair"===e.data.command){const t="repair"===e.data.command;t?(E.setLoader(!0,g.instant("query.editor.repairing.connector",{name:e.data.name})),E.currentTabConfig.customUpdateMessage={msg:"query.editor.repaired.connector",name:e.data.name}):(E.setLoader(!0,g.instant("query.editor.creating.connector",{name:e.data.name})),E.currentTabConfig.customUpdateMessage={msg:"created.connector",name:e.data.name});const n=E.$new(!0);n.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:t?g.instant("externalsync.repairing"):g.instant("externalsync.creating"),eta:"-",inline:!1,iri:e.data.iri,name:e.data.name,doneCallback:function(){R.dismiss("cancel")}},n.getHumanReadableSeconds=E.getHumanReadableSeconds,R=u.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:n})}else"drop"===e.data.command&&(E.setLoader(!0,g.instant("externalsync.delete.progress.msg",{name:e.data.name})),E.currentTabConfig.customUpdateMessage={msg:"externalsync.delete.success.msg",name:e.data.name});t()}),(function(){t()}))}};const O=i.a.getAjaxConfig;function M(e,t,n){e.getResponseHeader&&e.getResponseHeader("content-type")&&(e.contentType=e.getResponseHeader("content-type")),delete e.response;const r=D(E.executedQueryTab.id),i=E.tabs[r],o={queryType:E.currentTabConfig.queryType,yasrData:e,textStatus:t,jqXhrOrErrorString:n,page:E.currentTabConfig.page,pageSize:E.currentTabConfig.pageSize,allResultsCount:E.currentTabConfig.allResultsCount,allResultsCountExact:E.currentTabConfig.allResultsCountExact,resultsCount:E.currentTabConfig.resultsCount,offset:E.currentTabConfig.offset,timeTook:E.currentTabConfig.timeTook,timeFinished:E.currentTabConfig.timeFinished,sizeDelta:E.currentTabConfig.sizeDelta,customUpdateMessage:E.currentTabConfig.customUpdateMessage,errorMessage:E.currentTabConfig.errorMessage,warningMessage:E.currentTabConfig.warningMessage};"ERROR"!==E.currentTabConfig.queryType&&"UPDATE"!==E.currentTabConfig.queryType&&"ASK"!==E.currentTabConfig.queryType&&(o.outputType=E.yasr.options.output),angular.extend(E.currentQuery,o),angular.extend(i,o),E.nostorage||f.set(h.TABS_STATE,E.tabs),$('a[data-id = "'+E.executedQueryTab.id+'"]').tab("show")}function P(){var e=w.results.getBindings(),t=w.results.getVariables(),n=e[0],r=t[0];if(1===t.length&&1===e.length&&"plan"===r&&n[r].value.includes("# NOTE: Optimization groups")){var o=document.getElementsByClassName("nonUri")[0];o.classList.add("cm-s-default"),o.setAttribute("id","highlighted_output");var s=o.innerText.substring(1,o.innerText.length-1);o.innerHTML="",i.a.runMode(s,"sparql11",document.getElementById("highlighted_output"))}}function D(e){for(let t=0;t<E.tabs.length;t++){if(E.tabs[t].id===e)return t}}function k(e){return angular.isDefined(e)&&"false"!==e}function F(e,n,r){const i=E.getExistingTabId(e),o=E.$on("tabLoaded",(function(){angular.isDefined(n)&&(E.currentQuery.inference=k(n)),angular.isDefined(r)&&(E.currentQuery.sameAs=k(r)),k(t.search().execute)&&("update"===window.editor.getQueryMode()?l.openSimpleModal({title:g.instant("confirm.execute"),message:g.instant("query.editor.automatically.execute.update.warning"),warning:!0}).result.then((function(){E.runQuery(!1)})):E.runQuery(!1)),o()}));E.highlightNextTabChange=!0,angular.isDefined(i)?S(i):E.addNewTab(null,e.name,e.body)}function G(){if(t.search().savedQueryName)e=t.search().savedQueryName,r=t.search().owner,i=t.search().infer,s=t.search().sameAs,o.getSavedQuery(e,r).success((function(e){F(e,i,s)})).error((function(t){n.error(g.instant("query.editor.missing.saved.query.data.error",{savedQueryName:e,error:getError(t)}))}));else if(t.search().query){F({name:t.search().name,body:t.search().query},t.search().infer,t.search().sameAs)}else{S(f.get(h.TABS_STATE_CURRENT_ID))}var e,r,i,s}function U(){E.getNamespaces(),i.a.signal(window.editor,"repositoryOrAuthorizationChanged",r.getActiveRepository(),c.getAuthToken()),G()}i.a.getAjaxConfig=function(e,t){const n=O(e,t);return _.extend(n.headers,{Authorization:c.getAuthToken()}),n},E.copyToClipboardQuery=function(e,t){l.openCopyToClipboardModal(function(e,t){let n=[location.protocol,"//",location.host,location.pathname].join("");e?(n=n+"?savedQueryName="+encodeURIComponent(e),null!=t&&(n+="&owner="+encodeURIComponent(t))):n=n+"?"+$.param({name:E.currentQuery.name,infer:E.currentQuery.inference,sameAs:E.currentQuery.sameAs,query:window.editor.getValue()});return n}(e,t))},E.copyToClipboardResult=function(e){l.openCopyToClipboardModal(e)},E.goToVisual=function(){const e={query:window.editor.getValue(),sameAs:E.currentQuery.sameAs,inference:E.currentQuery.inference};t.path("graphs-visualizations").search(e)},$("textarea").on("paste",(function(){e((function(){E.addKnownPrefixes()}),0)})),E.$on("language-changed",(function(e,t){w&&w.options&&(w.options.locale=t.locale,w.changeLanguage(t.locale)),window.editor.options.locale=t.locale,i.a.signal(window.editor,"language-changed")})),w=s()(document.getElementById("yasr"),{getUsedPrefixes:{},persistency:!1,locale:m.getLanguage()}),window.yasr=w,w.afterCopy=I,w.getQueryResultsAsFormat=function(e){const t=$("#wb-download");t.attr("action","repositories/"+r.getActiveRepository()),$("#wb-download-query").val(E.currentQuery.query),window.editor.getValue()!==E.currentQuery.query&&n.warning(g.instant("query.editor.query.results.mismatch")),$("#wb-download-infer").val(E.currentQuery.inference),$("#wb-download-sameAs").val(E.currentQuery.sameAs);const i=localStorage.getItem("com.ontotext.graphdb.auth");i&&$("#wb-auth-token").val(i),$("#wb-download-accept").val(e),t.submit()},window.editor.options.sparql.handlers.complete=function(t,i,o){function s(){M(t,i,o)}if(R&&R.dismiss("cancel"),null===window.editor)return void E.setLoader(!1);if(E.currentTabConfig.errorMessage=t.getResponseHeader("X-GraphDB-Error"),E.currentTabConfig.warningMessage=t.getResponseHeader("X-GraphDB-Warning"),w.currentQuery=E.currentQuery,E.currentTabConfig.timeFinished=Date.now(),E.currentTabConfig.timeTook=(E.currentTabConfig.timeFinished-E.queryStartTime)/1e3,t.status>=400)return t.responseText=t.responseText.replace(/^([^: ]+: )+/,""),E.currentTabConfig.queryType="ERROR",s(),E.setYasrResponse(t,i,o),void E.setLoader(!1);if(0===t.status){E.currentTabConfig.queryType="ERROR";const e=b(-1,g.instant("aborted.request.msg"),g.instant("aborted.request.no.results.msg"));return w.results={getException:function(){return e}},E.setLoader(!1),void M({customError:e},"",null)}let a;if(E.setLoader(!1),"update"===window.editor.getQueryMode())a=function(){p.getRepositorySize().success((function(e){let t;void 0!==E.repoSize&&(t=Number(e)-E.repoSize),E.currentTabConfig.sizeDelta=t,s()})).error((function(e){n.warning(g.instant("query.editor.repo.size.error",{repo:r.getActiveRepository(),error:getError(e)})),E.currentTabConfig.sizeDelta=void 0,s()}))};else{if(200===t.status){const e=t.getResponseHeader("Content-Type");0!==e.indexOf("application/sparql-results+json")&&0!==e.indexOf("application/x-sparqlstar-results+json")&&0!==e.indexOf("application/x-graphdb-table-results+json")||t.responseJSON.results&&(E.currentTabConfig.resultsCount=t.responseJSON.results.bindings.length,t.responseJSON.results.bindings.length>E.currentTabConfig.pageSize&&(t.responseJSON.results.bindings.length=E.currentTabConfig.pageSize),E.currentTabConfig.allResultsCountExact||((E.nocount||E.countTimeouted||E.currentTabConfig.resultsCount<=E.currentTabConfig.pageSize)&&(t.status=204),E.currentTabConfig.allResultsCount=Math.max(E.currentTabConfig.allResultsCount,E.currentTabConfig.pageSize*(E.currentTabConfig.page-1)+E.currentTabConfig.resultsCount),E.currentTabConfig.resultsCount<=E.currentTabConfig.pageSize&&(E.currentTabConfig.allResultsCountExact=!0)))}E.setLoader(!0,g.instant("query.editor.render.results.msg"),null,!0),a=function(){E.setYasrResponse(t,i,o),s(),E.setLoader(!1)}}e((function(){a(),"CONSTRUCT"!==window.editor.getQueryType()?($(".yasr_btnGroup.nav.nav-tabs li a.disabled").removeClass("disabled").css("font-weight","400"),$(".yasr_btnGroup.nav.nav-tabs li.disabled a").addClass("disabled").css("font-weight","200"),"DESCRIBE"===window.editor.getQueryType()&&$(".yasr_btnGroup.nav.nav-tabs li a").removeClass("disabled").css("font-weight","400")):"CONSTRUCT"===window.editor.getQueryType()&&$(".yasr_btnGroup.nav.nav-tabs li a.disabled").removeClass("disabled").css("font-weight","400"),$("#yasr").css("padding","0"),$(".yasr_btnGroup li:nth-child(2)").hasClass("active")&&e((function(){$(".yasr_btnGroup li:nth-child(2) a").get(0).click()}),100),$("#wb-sparql-addNewTab").click((function(){$(".dataTables_filter").hide(),$(".resultsTable").hide()}))}),100)},window.editor.options.sparql.handlers.resetResults=function(){},E.yasr=w,E.setYasrResponse=function(e,t,n){e.responseJSON&&(e.response=e.responseJSON,e.responseText=void 0),window.yasr.plugins.table.options.highlightLiteralCellResult=P,w.setResponse(e,t,n)},E.$watch("yasr.options.output",(function(e){if(e&&"UPDATE"!==E.currentTabConfig.queryType&&"ASK"!==E.currentTabConfig.queryType){const t=E.tabs[D(E.currentQuery.id)];angular.isDefined(t)&&E.currentTabConfig.queryType&&t.outputType!==e&&(t.outputType=E.currentQuery.outputType=e,E.saveTab(t.id))}})),void E.$watch("namespaces",(function(){E.namespaces&&(w&&w.options&&E.namespaces&&(w.options.getUsedPrefixes=E.namespaces),i.a.signal(window.editor,"namespacesChanged",E.namespaces))})),$(document).mouseup((function(e){const t=$("#sampleQueriesCollapse");!t.is(e.target)&&0===t.has(e.target).length&&E.showSampleQueries&&E.toggleSampleQueries()})),r.getActiveRepository()&&U();E.$on("repositoryIsSet",(function(){r.getActiveRepository()&&U()})),e((function(){angular.element(document).find(".CodeMirror textarea:first-child").focus()}),50)}(E)}),150)}}}angular.module("graphdb.framework.core.directives.queryeditor.queryeditor",["ngCookies","graphdb.framework.externalsync.controllers","graphdb.framework.rest.connectors.service","graphdb.framework.utils.localstorageadapter"]).directive("queryEditor",l),l.$inject=["$timeout","$location","toastr","$repositories","SparqlRestService","ModalService","$modal","$jwtAuth","RDF4JRepositoriesRestService","ConnectorsRestService","LocalStorageAdapter","LSKeys","$translate","$languageService"]},42:function(e,t,n){"use strict";n.r(t),n.d(t,"STATIC_RULESETS",(function(){return r})),n.d(t,"REPOSITORY_TYPES",(function(){return i})),n.d(t,"FILENAME_PATTERN",(function(){return o})),n.d(t,"NUMBER_PATTERN",(function(){return s}));const r=[{id:"empty",name:"No inference"},{id:"rdfs-optimized",name:"RDFS (Optimized)"},{id:"rdfs",name:"RDFS"},{id:"rdfsplus-optimized",name:"RDFS-Plus (Optimized)"},{id:"owl-horst-optimized",name:"OWL-Horst (Optimized)"},{id:"owl-horst",name:"OWL-Horst"},{id:"owl2-ql-optimized",name:"OWL2-QL (Optimized)"},{id:"owl2-ql",name:"OWL2-QL"},{id:"owl-max-optimized",name:"OWL-Max (Optimized)"},{id:"owl-max",name:"OWL-Max"},{id:"owl2-rl-optimized",name:"OWL2-RL (Optimized)"},{id:"owl2-rl",name:"OWL2-RL"}],i={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},o=new RegExp("^[a-zA-Z0-9-_]+$"),s=new RegExp("^[0-9]+$")},43:function(e,t){angular.module("graphdb.framework.rest.graphexplore.data.service",[]).factory("GraphDataRestService",s),s.$inject=["$http"];const n="rest/class-hierarchy",r="rest/domain-range",i="rest/dependencies/",o="rest/explore-graph/";function s(e){return{getClassHierarchyData:function(t){return e.get(n,{params:{graphURI:t}})},reloadClassHierarchy:function(t){return e.get(n,{params:{doReload:!0,graphURI:t}})},getClassInstances:function(t){return e.get(`${n}/class-instances`,{params:{targetUri:t}})},getDomainRangeData:function(t,n){return e.get(r,{params:{targetUri:t,collapsed:n}})},checkDomainRangeData:function(t){return e.head(r,{params:{targetUri:t}})},getRelationshipsData:function(t,n,r){return e.get(`${i}matrix`,{params:{mode:n,classes:_.map(t,(function(e){return e.name})),graphURI:r}})},getRelationshipsClasses:function(t,n){return e.get(`${i}classes`,{params:{mode:t,graphURI:n}})},getRelationshipsStatus:function(t){return e.get(`${i}status`,{params:{graphURI:t}})},calculateRelationships:function(t){return e.get(`${i}update`,{params:{graphURI:t}})},getPredicates:function(t,n,r){return e.get(`${i}predicates`,{params:{from:t,to:n,mode:"all",graphURI:r}})},getInstanceNode:function(t){return e.get(`${o}node`,{params:{iri:t}})},getInstanceNodeLinks:function(t){return e.get(`${o}links`,{params:{iri:t}})},getRdfsLabelAndComment:function(t,n,r){const i=r||{};return e({url:"rest/explore/details",method:"GET",params:_.extend(i,{uri:t,languages:n}),headers:{Accept:"application/json"}})}}}},57:function(e,t){function n(e){return{initLazyList:function(t,n,r,i,o){return e((function(){const e=t+i-1,s=Math.max(0-i,e),a=Math.min(e+n-1,o.length);s>a?r([]):$.isArray(o)&&r(o.slice(s,a+1))}),100,!0)}}}angular.module("graphdb.framework.graphexplore.services.uiscroll",[]).factory("UiScrollService",n),n.$inject=["$timeout"]},58:function(e,t){angular.module("graphdb.framework.graphexplore.services.rdfsdetails",[]).factory("RdfsLabelCommentService",(function(){return{processAndFilterLabelAndComment:function(e){function t(e){const t={};for(let n in e)if(e.hasOwnProperty(n)){let r=n;n.indexOf(":")>-1&&(r=n,n=n.split(":")[1].toLowerCase()),t[n]=e[r]}return t}const n=e.results.bindings,r=[],i=[];_.each(n,(function(e){let n;angular.isUndefined(e.label)||(n=t(e.label),r.push(n)),angular.isUndefined(e.comment)||(n=t(e.comment),i.push(n))}));const o=function(e){return"en"===e.lang||"de"===e.lang},s=$.grep(r,o)[0],a=$.grep(i,o)[0],l=angular.isUndefined(s)?r.length>0?r[0].value:void 0:s.value,u=angular.isUndefined(a)?i.length>0?i[0].value:void 0:a.value;return{rdfsLabel:l,rdfsComment:u}}}}))},59:function(e,t){angular.module("graphdb.framework.rest.graphexplore.savedgraphs.service",[]).factory("SavedGraphsRestService",r),r.$inject=["$http"];const n="rest/explore-graph/saved";function r(e){return{getSavedGraphs:function(){return e.get(n)},getSavedGraph:function(t){return e.get(`${n}/${encodeURIComponent(t)}`)},editSavedGraph:function(t){return e.put(`${n}/${encodeURIComponent(t.id)}`,t)},deleteSavedGraph:function(t){return e.delete(`${n}/${encodeURIComponent(t.id)}`)},addNewSavedGraph:function(t){return e.post(n,t)}}}},60:function(e,t){angular.module("graphdb.framework.rest.graphconfig.service",[]).factory("GraphConfigRestService",i);const n="rest/explore-graph/",r=`${n}config`;function i(e){return{getGraphConfigs:function(){return e.get(r)},getGraphConfigSamples:function(){return e.get(`${n}samples`)},loadGraphForConfig:function(t,n,i,o){return e.get(`${r}/graph/${encodeURIComponent(t.id)}?includeInferred=${n}&linksLimit=${i}&sameAsState=${o}`)},getConfig:function(t){return e.get(`${r}/${encodeURIComponent(t)}`)},createGraphConfig:function(t){return e.post(r,t)},updateGraphConfig:function(t){return e.put(`${r}/${encodeURIComponent(t.id)}`,t)},deleteGraphConfig:function(t){return e.delete(`${r}/${encodeURIComponent(t.id)}`)},validateQuery:function(t,r,i,o,s){return e({method:"POST",url:`${n}validate`,data:{query:t,queryType:r,params:i,all:o,oneOf:s}})}}}i.$inject=["$http"]},61:function(e,t,n){"use strict";n.r(t);n(4);const r=400,i=50,o=1500,s=25;function a(e,t,n,a,l,u,c,p,d,f,h,g,m,v,E,x,y){e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=()=>angular.noop(),e.currentBrowserLimit=2e3,m.firefox?e.currentBrowserLimit=i:(m.safari||m.msie||m.msedge)&&(e.currentBrowserLimit=r);const T={};let N=0,C=0;t.key="",T.get=function(t,n,r){return d.initLazyList(t,n,r,N,e.instancesObj.items)};let S=allGraphs;const I=function(){if(e.getActiveRepository())return x.resolveGraphs().success((function(t){e.graphsInRepo=t.results.bindings,L()})).error((function(t){e.repositoryError=getError(t),c.error(getError(t),y.instant("graphexplore.error.getting.graphs"))}))},L=function(){const t=v.get(`classHierarchy-selectedGraph-${a.getActiveRepository()}`);null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?S=t:v.set(`classHierarchy-selectedGraph-${a.getActiveRepository()}`,S)};function A(t,n,r){e.classCountSlider.options&&e.classCountSlider.options.ceil!==n&&(e.classCountSlider={});var i;e.classCountSlider.value||(e.showExternalElements=!0,e.classCountSlider={value:n,options:{floor:1,ceil:n,vertical:!0,showSelectionBar:!0,onChange:function(){h(b,100,!0)}}},null===v.get(E.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&n>e.currentBrowserLimit&&(i=e.currentBrowserLimit,m.chrome?c.warning(y.instant("graphexplore.disabling.animations",{classLimit:i}),y.instant("graphexplore.reducing.visual.effects")):c.warning(y.instant("graphexplore.browser.performance",{browser:m.name,classLimit:i}),y.instant("graphexplore.reducing.visual.effects"))));const a=v.get(E.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=a&&"true"!==a&&(e.showExternalElements=!0),r?e.classCountSlider.value=r:n>=o&&(e.classCountSlider.value=o,c.warning(y.instant("graphexplore.class.count.slider",{count:o}),y.instant("graphexplore.reducing.class.count"))),n>=s&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=s,e.isWarningShowed=!0,c.warning(y.instant("graphexplore.class.count.browser",{count:s}),y.instant("graphexplore.reducing.class.count"))),h((function(){e.$broadcast("reCalcViewDimensions")}),200),b();let l=0;$("rzslider").on("wheel",(function(t){t.preventDefault(),t.stopPropagation();const n=(new Date).getTime();if(!(n-l>100))return;l=n,t=t.originalEvent;let r=e.classCountSlider.value;t.deltaY<=-1?r+=1:t.deltaY>=1&&(r-=1),r!==e.classCountSlider.value&&r>=e.classCountSlider.options.floor&&r<=e.classCountSlider.options.ceil&&e.$apply((function(){e.classCountSlider.value=r,h(b,100,!0)}))}))}function b(){e.currentSliderValue=e.classCountSlider.value}function R(e){const t=e.fullName,r=e.name;p.checkDomainRangeData(t).success((function(e,i){204===i?c.warning(y.instant("graphexplore.no.domain.range",{name:r})):(v.set(E.CLASS_HIERARCHY_LAST_SELECTED_CLASS,n.hash()),n.hash("").path("domain-range-graph").search("uri",t).search("name",r))})).error((function(){c.error(y.instant("graphexplore.error.request.failed",{name:r}))}))}function w(){n.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,v.clearClassHieararchyState(),e.hidePrefixes="true"===v.get(E.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},t.$broadcast("angucomplete-alt:clearInput")}function O(){e.hasClassHierarchy()&&h((function(){$("#toolbar").removeClass("ng-hide")}),0)}t.$watch((function(){return t.key}),(function(){N=0,_.each(e.instancesObj.items,(function(e){t.key>e&&N++})),C++})),T.revision=function(){return C},e.adapterContainer={adapter:{remain:!0}},e.$on("goToDomainRangeGraphView",(function(e,t){R(t)})),e.$on("classCount",A),e.$on("repositoryIsSet",(function(){if(!l.isLicenseValid())return;if(M===a.getActiveRepository())return;M=a.getActiveRepository();if(e.repositoryError=null,!M)return;S=allGraphs,I().then(P)})),e.datasource=T,e.goToDomainRangeGraphView=R,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,t.$broadcast("sidePanelClosed")},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return a.getActiveRepository()},e.isSystemRepository=function(){return a.isSystemRepository()},e.confirmReloadClassHierarchy=function(){g.openSimpleModal({title:y.instant("confirm.operation"),message:y.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){w(),e.loader=!0,e.hierarchyError=!1,p.reloadClassHierarchy(S.contextID.uri).success((function(t){e.loader=!1,e.classHierarchyData=t,O(),A()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),c.error(getError(t),y.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){g.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){const n={name:e.title};t.$broadcast("searchedClass",n)}},e.instancesQueryObj.query="",e.instancesFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.instancesQueryObj.query.toLowerCase())>=0},I(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&h((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(t){const n=t.fullName;let r=t.name;if(r===n){const e=r.lastIndexOf("#");r=r.substring(e+1)}e.encodedUri=encodeURIComponent(n);const i=encodeURIComponent("prefix onto:<http://www.ontotext.com/> select ?s from onto:disable-sameAs { ?s a <"+n+"> . }");e.viewInstancesUri="sparql?name="+r+"&infer=true&sameAs=false&query="+i+"&execute=true",p.getRdfsLabelAndComment(n).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment,e.expanded=!1})).error((function(){c.error("Error getting rdfs:label and rdfs:comment")})),e.instancesQueryObj.query="",e.instancesLoader=!0,p.getClassInstances(n).success((function(t){e.instancesObj.items=[],_.each(t,(function(t,n){const r={};r.type=t.startsWith("<<")&&t.endsWith(">>")?"triple":"uri",r.absUri=encodeURIComponent(t),r.absUriNonEncoded=t,r.resolvedUri=n,e.instancesObj.items.push(r)})),e.instancesLoader=!1,e.instancesSearchPlaceholder=e.instancesObj.items.length<1e3?"Search class instances":"Search first 1000 class instances",e.instancesNotFiltered=e.instancesObj.items})).error((function(){c.error(y.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));let M=a.getActiveRepository();function P(){w(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,p.getClassHierarchyData(S.contextID.uri).success((function(t,n){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=t,207===n&&c.warning(y.instant("graphexplore.update.diagram"),y.instant("graphexplore.repository.data.changed")),O()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),c.error(getError(t),y.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return l.isLicenseValid()},e.chosenGraph=function(e){S=e,P(),v.set(`classHierarchy-selectedGraph-${a.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",a),a.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]},62:function(e,t,n){"use strict";n.r(t);n(4);function r(e,t,n,r,i,o,s,a,l,u,c,p,d){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;n.key="",f.get=function(t,n,r){return u.initLazyList(t,n,r,h,e.predicatesObj.items)},n.$watch((function(){return n.key}),(function(){h=0,_.each(e.predicatesObj.items,(function(e){n.key>e&&h++})),g++})),f.revision=function(){return g},e.adapterContainer={adapter:{remain:!0}};const m=s.get(a.DOMAIN_RANGE_COLLAPSE_EDGES);function v(){const e=s.get(a.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,n){const r=n.objectPropClassUri,i=n.objectPropClassName;t.path("domain-range-graph").search("uri",r).search("name",i)})),e.$on("switchEdgeMode",(function(e,n){t.path("domain-range-graph").search("uri",n.uri).search("name",n.name).search("collapsed",n.collapsed)})),e.$on("repositoryIsSet",(function(){if(E===i.getActiveRepository())return;E=i.getActiveRepository();v()})),e.$on("changeCollapsedEdgesState",(function(t,n){e.collapseEdges=!n,s.set(a.DOMAIN_RANGE_COLLAPSE_EDGES,e.collapseEdges)})),e.goToClassHierarchyView=v,e.copyToClipboard=function(e){c.openCopyToClipboardModal(e)},e.toggleCollapseEdgesState=function(){e.collapseEdges=!e.collapseEdges,o.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&&r((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedPredicate",(function(){e.showPredicatesInfoPanel&&function(t){const n=t.target,r=t.source;e.encodedUri=encodeURIComponent(t.uri),e.sourceTargetObjectNodeUri=n.objectPropClassUri?n.objectPropClassUri:r.objectPropClassUri,e.encodedSourceTargetObjectNodeUri=encodeURIComponent(e.sourceTargetObjectNodeUri),e.sourceTargetObjectNodeName=n.objectPropClassName?n.objectPropClassName:r.objectPropClassName?r.objectPropClassName:"<i>Literal</i>",-1===e.sourceTargetObjectNodeName.indexOf("Literal")?l.getRdfsLabelAndComment(e.sourceTargetObjectNodeUri).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment})).error((function(){p.error(d.instant("domain.range.error.get.label.comment"))})):(e.rdfsComment=void 0,e.rdfsLabel=void 0);e.predicatesObj.items=[],e.predicatesQueryObj.query="";const i=n.allEdges?n.allEdges:r.allEdges;_.each(i,(function(t){const n={};n.absUri=encodeURIComponent(t.uri),n.absUriNonEncoded=t.uri,n.resolvedUri=t.name,n.isImplicit=t.implicit,e.predicatesObj.items.push(n)})),e.predicatesListNotFiltered=e.predicatesObj.items}(e.selectedPredicate)})),$(document).ready((function(){$(".compact-mode-toggle").click((function(){$(".tooltip").hide()}))}));let E=i.getActiveRepository()}angular.module("graphdb.framework.graphexplore.controllers.domainrange",["ui.scroll.jqlite","ui.scroll","ngSanitize","graphdb.framework.utils.localstorageadapter"]).controller("DomainRangeGraphCtlr",r),r.$inject=["$scope","$location","$rootScope","$timeout","$repositories","$window","LocalStorageAdapter","LSKeys","GraphDataRestService","UiScrollService","ModalService","toastr","$translate"]},63:function(e,t,n){(function(e){const t={WAIT:"WAIT",NO_REPO:"NO_REPO",READY:"READY",IN_PROGRESS:"IN_PROGRESS",ERROR:"ERROR"},n={contextID:{type:"all",value:"all.graphs.label",uri:""}};function r(e){if(e<1e3)return e;const t=Math.floor(Math.log(e)/Math.log(1e3));let n=e/Math.pow(1e3,t);return n=n%1>1/Math.pow(1e3,t-1)?n.toFixed(2):n.toFixed(0),n+["K","M","G","T","P","H"][t-1]}function i(e,r,i,o,s,a,l,u,c,p,d){let f=null;e.status=i.getActiveRepository()?t.WAIT:t.NO_REPO;let h=n;const g=function(){p.resolveGraphs().success((function(t){e.graphsInRepo=t.results.bindings,m(),e.isSystemRepository()?"READY"!==e.status&&E():(e.status="WAIT",E(!0))})).error((function(t){e.repositoryError=getError(t),o.error(getError(t),d.instant("graphexplore.error.getting.graph"))}))},m=function(){const t=c.get(`dependencies-selectedGraph-${i.getActiveRepository()}`);null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?h=t:c.set(`dependencies-selectedGraph-${i.getActiveRepository()}`,h)},v=function(n){d3.select("#dependencies-chord").html(""),e.status=t.WAIT,a.getRelationshipsData(n,e.direction,h.contextID.uri).success((function(n){e.dependenciesData={matrix:n.right,nodes:n.left,hasLinks:_.sum(_.map(n.right,(function(e){return _.sum(e)})))>0,direction:e.direction},e.status=t.READY})).error((function(n){e.status=t.READY,o.error(getError(n),d.instant("graphexplore.error.dependencies.count"))}))},E=function(n){(e.status!==t.READY||n)&&(e.status=t.WAIT,a.getRelationshipsStatus(h.contextID.uri).success((function(n){if(e.status=n,e.status===t.IN_PROGRESS){if(null!==f)return;f=s(E,2e3)}e.status===t.READY&&(null!==f&&(s.cancel(f),f=null),a.getRelationshipsClasses(e.direction,h.contextID.uri).success((function(t,n){e.allClasses.items=_.filter(t,N),e.allNotFilteredClasses=t,e.selectedClasses=void 0,angular.isUndefined(e.selectedClasses)&&(e.selectedClasses=t.slice(0,10)),v(e.selectedClasses),207===n&&o.warning(d.instant("graphexplore.update.diagram"),d.instant("graphexplore.repository.data.changed"))}))),0===e.status.indexOf("ERROR;")&&(e.status=t.ERROR,o.error(d.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})))})).error((function(n){e.status=t.ERROR,o.error(getError(n),d.instant("graphexplore.error.dependencies.count.status"))})))};e.allClasses={},e.allClasses.items=[],e.allNotFilteredClasses=[],e.direction="all";const x={};let y=0,T=0;function N(t){return-1!==t.name.toLowerCase().indexOf(e.classQuery.query.toLowerCase())}r.key="",x.get=function(t,n,r){return l.initLazyList(t,n,r,y,e.allClasses.items)},r.$watch((function(){return r.key}),(function(){y=0,_.each(e.allClasses.items,(function(e){r.key>e&&y++})),T++})),x.revision=function(){return T},e.datasource=x,e.adapterContainer={adapter:{remain:!0}},e.classQuery={},e.classQuery.query="",e.classFilterFunc=N,e.$watch("allClasses.items",(function(){e.allClasses.items.length>0&&s((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("direction",(function(){!i.getActiveRepository()||e.isSystemRepository()||i.isActiveRepoFedXType()||g()})),e.$on("$destroy",(function(){s.cancel(f)})),e.isLoading=function(){return e.status===t.IN_PROGRESS||e.status===t.WAIT},e.confirmCalculateDependencies=function(){u.openSimpleModal({title:d.instant("confirm.operation"),message:d.instant("graphexplore.calculating.relationships"),warning:!0}).result.then((function(){e.calculateDependencies()}))},e.calculateDependencies=function(){e.status=t.WAIT,e.selectedClasses=void 0,a.calculateRelationships(h.contextID.uri).success((function(t){0===t.indexOf("ERROR;")?o.error(d.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})):E()})).error((function(e){o.error(d.instant("graphexplore.error.could.not.force.count",{error:getError(e)}))}))},e.addClass=function(t){e.selectedClasses.push(t),v(e.selectedClasses)},e.removeClass=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t.name})),v(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})),v(e.selectedClasses)},e.removeClassByName=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t})),v(e.selectedClasses)},e.removeAllClasses=function(){e.selectedClasses=[],v(e.selectedClasses)},e.isSystemRepository=function(){return"SYSTEM"===i.getActiveRepository()};const C=e.$on("repositoryIsSet",(function(){e.classQuery={},e.classQuery.query="",e.repositoryError=null,h=n,i.getActiveRepository()&&!i.isActiveRepoFedXType()?g():e.status=t.NO_REPO}));window.addEventListener("beforeunload",(function e(){C(),window.removeEventListener("beforeunload",e)})),e.selectGraph=function(e){h=e,E(!0),c.set(`dependencies-selectedGraph-${i.getActiveRepository()}`,h)},e.getSelectedGraphValue=function(){return h.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelectedGraphValue()}}Object.defineProperty(e,"allGraphs",{get:()=>n}),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",i).config(["$tooltipProvider",function(e){e.options({appendToBody:!0})}]).filter("humanize",(function(){return r})),i.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","GraphDataRestService","UiScrollService","ModalService","LocalStorageAdapter","RDF4JRepositoriesRestService","$translate"]}).call(this,n(5))},64:function(e,t,n){"use strict";n.r(t);n(3);var r=n(221),i=n(220),o=n.n(i),s=(n(4),n(42));function a(e,t,n,i,a,l,u,c,p,d,f,h,g,m,v,E,x,y,T,N,C,S){e.languageChanged=!1,e.propertiesObj={},e.propertiesQueryObj={},e.propertiesObj.items=[],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=S.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=S.instant("sidepanel.invalid.limit.links.tooltip"),t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=S.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=S.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=S.instant("visual.search.instance.placeholder")})),e.onopen=e.onclose=()=>angular.noop(),e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);const I={};let L=0,A=0,b={},R=0;const w=16,O=d3.behavior.zoom().scaleExtent([.5,10]);let M;const P=1e3,D=1e3;let k,F;function G(e){m.openCopyToClipboardModal(e)}function U(){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}}))}t.key="",I.get=function(t,n,r){return g.initLazyList(t,n,r,L,e.propertiesObj.items)},t.$watch((function(){return t.key}),(function(){L=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&L++})),A++})),I.revision=function(){return A},e.datasource=I,e.adapterContainer={adapter:{remain:!0}},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=S.instant("visual.search.instance.placeholder"),e.propertiesFilterFunc=function(t){return t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0},e.resetState=function(){e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,b={},R=0},e.pushHistory=function(t,n){e.embedded&&(t.embedded=!0),f.search(t),f.state(n)},e.goToHome=function(){e.resetState(),f.url("graphs-visualizations")},e.shouldShowSettings=function(){return e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id},e.shouldDisableSameAs=function(){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.$watch("propertiesObj.items",(function(){angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&l((function(){e.adapterContainer.adapter.reload()}),500)})),e.toggleMoreInfo=function(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=G,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=angular.copy(e.defaultSettings),d.when(h.getPrincipal()).then(t=>(function(t){const n=t.appSettings;e.defaultSettings.includeInferred=n.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=n.DEFAULT_INFERENCE&&n.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=n.DEFAULT_VIS_GRAPH_SCHEMA;const r=x.get(y.GRAPHS_VIZ);if(r&&"object"==typeof r)try{e.saveSettings=r,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=angular.copy(e.defaultSettings),x.set(y.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=angular.copy(e.defaultSettings)})(t)),e.resetSettings=function(){e.settings=angular.copy(e.defaultSettings),e.validateLinksLimit(),U()},e.changeLimit=function(t){let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=function(){e.invalidLimit=!s.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=function(){e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=angular.copy(e.saveSettings):e.settings=angular.copy(e.defaultSettings),U()},e.reExpandNode=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)};const B=function(t,n,r){const i=void 0===n?e.saveSettings.sameAsState:!0===n,o=void 0===r?e.saveSettings.includeInferred:!0===r;e.loading=!0,u({url:"rest/explore-graph/graph",method:"POST",headers:{"Content-Type":"application/json"},data:{query:t,linksLimit:e.saveSettings.linksLimit,languages:e.shouldShowSettings()?e.saveSettings.languages:[],includeInferred:o,sameAsState:i}}).then((function(e){he(e)}),(function(t){e.loading=!1,a.error(getError(t.data),S.instant("graphexplore.error.cannot.load.graph"))}))};function j(e){return e.replace(/[()']/g,"")}function V(e,t){let n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")}function H(e){return[e.source.iri,e.target.iri].join(">")}function q(e){if(e.isTriple){let t=document.getElementById(j(V(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x}function z(e){if(e.isTriple){let t=document.getElementById(j(V(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y}function W(e){let t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`}function Q(e){return j(`${e.source.isTriple?V(e.source.iri,!0):e.source.iri}>${e.target.isTriple?V(e.target.iri,!0):e.target.iri}>marker`)}function Y(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,n){return e.x=t,e.y=n,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(n){const r=n.source.iri,i=n.target.iri,o=_.min([r,i])+"|"+_.max([r,i]);t[o]||(t[o]=1,e[r]=(e[r]||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 n,r;n=e.isTripleSource?Ne(e.source):_.find(t,(function(t){return t.iri===e.source})),r=e.isTripleTarget?Ne(e.target):_.find(t,(function(t){return t.iri===e.target}));let i={source:n,target:r,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${i.source.isTriple?V(i.source.iri):i.source.iri}>${i.target.isTriple?V(i.target.iri):i.target.iri}`;if(X.tripleLinksCopy.has(e)){let t=X.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),X.tripleLinksCopy.set(e,t),null}X.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of X.tripleLinksCopy.keys())1===X.tripleLinksCopy.get(e).length&&X.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return n(e,t).length};function n(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 r=n(e,t),i=_.map(r,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const r=n(e,t),i=_.map(r,(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(n){let r=e.split(">"),i=V(n.source.iri),o=V(n.target.iri);if(i===e&&X.tripleNodes.delete(o)){let e=o.split(">");t.push({source:e[0],target:e[1]})}let s=i===e||o===e||n.source.iri===r[0]&&n.target.iri===r[1];return s&&(X.tripleLinksCopy.delete(`${i}>${o}`),X.tripleLinksCopy.delete(`${o}>${i}`)),s})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(n){let r=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&r.push(V(e.target.iri)),e.source.isTriple||e.target.isTriple||r.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(r);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 r=[],i=this.links;this.links=_.reject(this.links,(function(o){let s=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!s){let r;if(o.source.iri!==e.iri||2!==t(o.target,i)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,i)||o.source.isTriple||(r=n(o.source,i)):r=n(o.target,i),!r)return!1;s=(r[0].source.iri===e.iri||r[0].target.iri)&&(r[1].source.iri===e.iri||r[1].target.iri)}return s&&(o.target.isTriple&&r.push(V(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),s})),this.removeTriples(r),i=this.links,this.nodes=_.reject(this.nodes,(function(n){return 0===t(n,i)&&n.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;let r=V(e.iri);if(this.tripleNodes.has(r)){let t=this.tripleNodes.get(r);t.push(e),this.tripleNodes.set(r,t)}else e.weight=10,this.tripleNodes.set(r,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:angular.copy(e.labels),types:angular.copy(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),n=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:n,colorIndex:R,type2color:b,scale:O.scale(),translate:O.translate()}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=angular.copy(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)&&(R=t.colorIndex,b=angular.copy(t.type2color)),angular.isDefined(t.translate)&&angular.isDefined(t.scale)&&(M="translate("+t.translate[0]+", "+t.translate[1]+") scale("+t.scale+")",O.translate(t.translate),O.scale(t.scale)),ce()}}e.updateSettings=function(){e.invalidLimit?a.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?e.reExpandNode(e.rootNodeIri):e.queryResultsMode&&f.search().query?B(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&e.loadGraphConfig(e.configLoaded),e.saveSettings.showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none"),e.showInfoPanel=!1,e.showFilter=!1,x.set(y.GRAPHS_VIZ,e.saveSettings))},e.showInfoPanel=!1;let X=new Y;e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},e.getGraphConfigs=function(t){N.getGraphConfigs().success((function(n){e.graphConfigs=n,t&&t()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.graph.configs.short.msg"))}))},e.loadConfigForId=function(t,n){t===e.defaultGraphConfig.id?e.loadGraphConfig(e.defaultGraphConfig):N.getConfig(t).success((function(t){e.loadGraphConfig(t),n()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.could.not.load.config",{configId:t}))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=function(t){e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.loadGraphConfig=function(t){e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?l((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,N.loadGraphForConfig(t,t.startQueryIncludeInferred,e.saveSettings.linksLimit,t.startQuerySameAs).then((function(e){he(e)}),(function(t){e.loading=!1,a.error(getError(t),S.instant("graphexplore.error.graph.load"))})))},e.deleteConfig=function(t){m.openSimpleModal({title:S.instant("common.confirm"),message:S.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){N.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=function(t){e.pushHistory({config:t.id},{config:t}),e.resetState(),e.loadGraphConfig(t)},E.onpopstate=function(t){e.resetState(),t.state&&(t.state.config?(e.loadGraphConfig(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))};const K=function(){f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,B(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0,angular.isDefined(n)&&(e.rootNodeIri=n,u({url:"rest/explore-graph/node",method:"GET",params:{iri:n,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?e.saveSettings.languages:[],includeInferred:e.saveSettings.includeInferred,sameAsState:e.saveSettings.sameAsState}}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),X=new Y;const n=X.addNode(t.data,P/2,D/2);M="translate(0, -70) scale(1)",O.translate([0,-70]),O.scale(1),me(n,!0)})).catch((function(t){e.loading=!1,a.error(getError(t),S.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri),f.search().saved&&T.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.could.not.open"))}))},Z=function(){f.search().config?e.loadConfigForId(f.search().config,K):f.search().query||f.search().uri?(e.loadGraphConfig(e.defaultGraphConfig),K()):K()};function J(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(Z),e.getNamespacesPromise=C.getNamespaces(e.getActiveRepository()).success((function(t){const n=_.map(t.results.bindings,(function(e){return{uri:e.namespace.value,prefix:e.prefix.value}}));e.namespaces=_.sortBy(n,(function(e){return e.uri.length})),ee()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.view.will.not.work"))})))}function ee(){i.isLicenseValid()&&(e.getAutocompletePromise=p.checkAutocompleteStatus())}e.replaceIRIWithPrefix=function(t){const n=e.namespaces,r=_.findLast(n,(function(e){return 0===t.indexOf(e.uri)}));return r?r.prefix+":"+t.substring(r.uri.length):t},e.addedTag=function(t){return t.text.indexOf(":")<0?(a.warning(S.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const n=e.split(":"),r=n[0],i=n[1];if(!angular.isUndefined(i)){const e=c.getNamespaceUriForPrefix(t,r);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?a.warning(S.instant("graphexplore.absolute.prefixed.iri.option"),t):a.warning(S.instant("graphexplore.absolute.prefixed.iri"),t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return a.warning(S.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return a.warning(S.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.hasInitedRepository=!1,e.$on("autocompleteStatus",(function(){ee()})),e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),J(n.newRepo),n.newRepo&&(e.resetState(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),K()))})),J();const te=500,ne=1.75,re=d3.scale.linear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),ie=d3.scale.linear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(b[e])&&(b[e]=R,R++);const t=b[e];return t>39?"#c2c2c2":t%2==0?re(t/2):ie(t/2)};const oe=d3.layout.force().gravity(.07).size([P,D]),se=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+P+" "+D).attr("preserveAspectRatio","xMidYMid meet");let ae=0,le=0;const ue=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.0.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 ce(t){d3.selectAll("svg g").remove(),d3.selectAll("svg rect").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),O.on("zoom",(function(){M="translate("+d3.event.translate+") scale("+d3.event.scale+")",n.attr("transform",M)})),se.append("rect").attr("width",10*P).attr("height",10*D).attr("x",-(10*P-P)/2).attr("y",-(10*D-D)/2).style("fill","none").style("pointer-events","all").call(O).on("click",(function(){d3.event.stopPropagation(),ve(),oe.stop()}));const n=se.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(M)&&!t?M:""})),i=o()().attr("class","d3-tip").customPosition((function(){const e=k.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let n="";return t.fixed&&(n+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?n+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):n+="<i>No types</i>",n})),s=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,n){if(0===n)return Se(t);if(n<10)return" · "+Se(t);if(10===n){const t=function(e){return e.predicates.length-10}(e),n=t>1?t+" predicates":t+" predicate";return" · "+S.instant("graphexplore.tip.text",{textToShow:n})}})),""),t};let u;const c=o()().attr("class","d3-tip").customPosition((function(e){const t=u.getBoundingClientRect(),n=function(e){const t=s(e),n=document.createElement("canvas").getContext("2d");return n.font="13px Arial",e.predicates.length<10?n.measureText(t).width:n.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:n+"px"}})).html((function(e){return s(e)}));const p=function(){l.cancel(void 0),l.cancel(ae),k=null,i.hide(),le=l((function(){ve()}),500)};se.call(i);se.call(c);let d=se.selectAll(".link"),f=se.selectAll(".node");oe.nodes(X.nodes).charge(-3e3),oe.links(X.links).linkDistance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),n=e.predicates[0].split("/"),r=n[n.length-1];t.addClass("predicate-text").text(r),$("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})),n.append("defs").selectAll("marker").data(oe.links()).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return Q(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"),d=n.selectAll(".link").data(X.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return j(H(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${Q(e)})`}));const h=n.selectAll(".link-wrapper").append("text").text((function(e){return Ce(e)})).attr("class",(function(e){return e.predicates.length>1||X.tripleNodes.has(H(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",e.saveSettings.showLinksText?"":"none").on("mouseover",(function(e){d3.event.stopPropagation(),function(e){l.cancel(void 0);const t=u=d3.event.target;l((function(){u===t&&e.predicates.length>1&&c.show(e,u)}),300)}(e)})).on("mouseout",(function(){l.cancel(void 0),u=null,c.hide()})).on("click",(function(t){d3.event.stopPropagation(),function(t){Te();let n=H(t);if(1===t.predicates.length&&X.tripleNodes.has(n)){F=null;let e=X.tripleNodes.get(n)[0];if(de(e,this,d3.event.button)){let t={};t.iri=e.iri,t.pred=Se(e.iri.split(" ")[1]),xe(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,F===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(F=null);F=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){let n=function(e,t){let n=H(t);return X.tripleNodes.has(n)?X.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),r=n>-1;return{value:Se(e),partOfTriple:r,linkId:r?H(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(t)}(t)}));let g,m=0,v=0,E=0;const x=function(){d3.event.button&&0!==d3.event.button||(p(),l.cancel(g),e.showPredicates=!1,d3.event.timeStamp-m<te?v++:v=1,m=d3.event.timeStamp,d3.event.preventDefault())},y=function(t){if(d3.event.button&&0!==d3.event.button)return;l.cancel(g);const n=d3.event,r=this;if(d3.event.timeStamp-m<te)if(1===v)g=l((function(){de(t,r,n)}),40+te-(d3.event.timeStamp-m));else if(2===v){X.countLinks(t,X.links)<=e.saveSettings.linksLimit?me(t,!1,r.parentNode):a.info(S.instant("graphexplore.increase.limit"),S.instant("graphexplore.node.at.max")),e.closeInfoPanel()}d3.event.preventDefault()};function T(e,t){let r,i,o,s,a=!0;if("down"===t)r=2*e.size,i=e.size/3,o=.8,s=.3;else if("down-fixed"===t)r=2*e.size,i=e.size,o=.8,s=.66;else if("up"===t)r=e.size/3,i=2*e.size,o=.3,s=.8;else{if("fixed"!==t)return;r=e.size,o=.66,a=!1}let l=n.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",o);"fixed"!==t&&"down-fixed"!==t||(e.pin=l),a&&(l=l.transition().duration(1e3).style("font-size",(function(){return i+"px"})).attr("opacity",s),"down-fixed"!==t&&l.remove())}const N=d3.behavior.drag().origin((function(e){return e})).on("dragstart",(function(e){0===d3.event.sourceEvent.button&&(e.fixedBeforeDrag=e.fixed,e.isBeingDragged=!0,e.beginDragging=!0,ve(),d3.event.sourceEvent.stopPropagation(),d3.select(this).classed("dragging",!0))})).on("drag",(function(t){t.isBeingDragged&&(v=0,t.px=d3.event.x,t.py=d3.event.y,t.fixed?t.beginDragging&&T(t,"fixed"):(e.numberOfPinnedNodes++,t.fixed=!0,T(t,"down-fixed")),t.pinWasFixed=!0,t.beginDragging=null,oe.resume())})).on("dragend",(function(e){e.isBeingDragged&&(e.pinWasFixed&&(e.pinWasFixed=null,d3.select(".pinned").remove()),e.isBeingDragged=!1,d3.select(this).classed("dragging",!1))}));f=n.selectAll(".node").data(X.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])})).call(N).on("mouseover",(function(t){if(!t.isBeingDragged){const n=d3.event;l.cancel(le),ae=l(()=>{(function(t,n){if(e.showInfoPanel)return!1;(pe.closeIcon||pe.expandIcon||pe.focusIcon||pe.copyURIIcon)&&pe.removeIcons();if(oe.alpha()<.05)return pe.initIcons(t,n.parentNode),oe.stop(),!0;return!1})(t,this)&&function(e,t){l.cancel(void 0);const n=k=t.target;l((function(){k===n&&i.show(e,k)}),300)}(t,n)},400)}})).on("mouseout",p).on("mousedown",x).on("touchstart",(function(e){x(),E=0,g=l((function(){E<5&&fe(e),g=null,v=0}),1e3)})).on("touchmove",(function(){E++})).on("mouseup",y).on("touchend",y).on("contextmenu",(function(t){d3.event.shiftKey||(d3.event.preventDefault(),ve(),e.closeInfoPanel(),t.fixed?(e.numberOfPinnedNodes--,t.fixed=!1,T(t,"up"),oe.resume()):(e.numberOfPinnedNodes++,t.fixed=!0,T(t,"down")),function(e){k&&i.show(e,k)}(t))}));const C=n.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*ne}));n.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=r.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,w,!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})),l((function(){$(".node-label-body div").each((function(e,t){let n=t.textContent.substring(0,t.textContent.length-1);let r=0;for(;r<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)n=n.substring(0,n.length-1),t.textContent=n+"…",r++}))}),50)}(C),oe.on("tick",(function(){d3.geom.quadtree(X.nodes);X.nodes.length;d.attr("x1",(function(e){return q(e.source)})).attr("y1",(function(e){return z(e.source)})).attr("x2",(function(e){return q(e.target)})).attr("y2",(function(e){return z(e.target)})),h.attr("x",(function(e){let t=q(e.source),n=q(e.target);return e.x=.5*(t+n)})).attr("y",(function(e){let t=z(e.source),n=z(e.target);return e.y=.5*(t+n)})).attr("transform",(function(e){return"rotate("+function(e,t){const n={x:q(e.source),y:z(e.source)},r={x:q(e.target),y:z(e.target)};if(t)return 180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;{const e=180*Math.atan2(r.y-n.y,r.x-n.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})),n.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),n.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),C.attr("x",(function(e){return e.x-e.size*ne})).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}))})),angular.isDefined(ue)&&ue.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(n){let r=j(n.source.iri),i=j(n.target.iri);if(r===t&&i===e){let e=r;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),n.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),oe.start()}ce();const pe=new function(){function e(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,r){const i=o()().attr("class","d3-tip d3-actions-tip").customPosition((function(){const e=d3.event.target.getBoundingClientRect();return{top:e.top-20+"px",left:e.right+10+"px"}})).html((function(e){return e}));se.call(i);n.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return e(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(--onto-orange)"),this.collapseIcon.on("click",(function(){var e;(e=n).isExpanded=!1,X.removeNodeLeafLinks(e),ce()})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(ae),l.cancel(le)})).on("mouseout",(function(){i.hide(),le=l((function(){ve()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return e(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(--onto-orange)"),this.expandIcon.on("click",(function(){me(n,!1,r)})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(le),l.cancel(ae)})).on("mouseout",(function(){i.hide(),le=l((function(){ve()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return e(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(--onto-orange)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",n.iri)})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(le),l.cancel(ae)})).on("mouseout",(function(){i.hide(),le=l((function(){ve()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return e(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(--onto-orange)"),this.copyURIIcon.on("click",(function(){G(n.iri),ve(),i.hide()})).on("mouseover",(function(){i.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>"),l.cancel(le),l.cancel(ae)})).on("mouseout",(function(){i.hide(),le=l((function(){ve()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return e(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(--onto-orange)"),this.closeIcon.on("click",(function(){fe(n)})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(le),l.cancel(ae)})).on("mouseout",(function(){i.hide(),le=l((function(){ve()}),500)})),this.animateMenu(n)},this.animateMenu=function(t){let n=0;let r=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.expandedState=!0}};function de(n,r,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",n.iri),!1):i.ctrlKey||i.metaKey?(fe(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(Ee(n),!0)}function fe(e){X.removeNode(e),ce()}function he(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),X=new Y,M="translate(0, -70) scale(1)",O.translate([0,-70]),O.scale(1)}(t),ge(t)}function ge(t,n,r){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(X.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));let o=[];const s=X.tripleLinksCopy.values();for(let e=0;e<X.tripleLinksCopy.size;e++){s.next().value.forEach(e=>{o.push(e)})}i=_.filter(i,(function(e){return-1===_.findIndex(o,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),i=_.filter(i,(function(e){return e.source!==e.target}));const l=function(e,t){let n=t.map((function(t){return t[e]}));return t.filter((function(t,r){return n.indexOf(t[e])===r}))}("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),c=_.map(X.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),p=X.tripleNodes.values();for(let e=0;e<X.tripleNodes.size;e++){p.next().value.forEach(e=>{c.push({iri:e.iri,isTriple:e.isTriple})})}const f=_.reject(l,(function(e){return _.some(c,e)}));if(0===f.length)r?a.info(S.instant("graphexplore.error.node.connections")):0===i.length&&a.info(S.instant("graphexplore.error.node.connections")),X.addAndMatchLinks(i),ce();else{const t=[],r=[];_.forEach(f,(function(n,i){t.push(u({url:"rest/explore-graph/node",method:"GET",params:{iri:n.isTriple?W(n.iri):n.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?e.saveSettings.languages:[],includeInferred:e.saveSettings.includeInferred,sameAsState:e.saveSettings.sameAsState}}).then((function(e){r[i]=e.data})))})),d.all(t).then((function(){_.forEach(r,(function(e,t){const i=2*Math.PI*t/r.length,o=(n?n.x:0)+Math.cos(i)*D/3,s=(n?n.y:0)+Math.sin(i)*D/3;e.isTriple?X.addTriple(e,o,s):X.addNode(e,o,s)})),X.addAndMatchLinks(i),n&&(n.isExpanded=!0),ce()}))}}function me(t,n,r){if(ue.getLoadingState())return;ue.init(t,r);const i=t.iri;u({url:"rest/explore-graph/links",method:"GET",params:{iri:i,linksLimit:e.saveSettings.linksLimit,includeInferred:e.saveSettings.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?e.saveSettings.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?e.saveSettings.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?e.saveSettings.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?e.saveSettings.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?e.saveSettings.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?e.saveSettings.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?e.saveSettings.languages:[],sameAsState:e.saveSettings.sameAsState,includeSchema:e.saveSettings.includeSchema}}).then((function(e){ge(e,t,n)}),(function(t){const n=getError(t.data);a.error(n,S.instant("graphexplore.error.exploring.node")),e.loading=!1,ue.setLoadingState(!1)}))}function ve(){angular.isDefined(pe)&&pe.expandedState&&pe.removeIcons()}function Ee(t){oe.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?encodeURI(W(t.iri)):encodeURI(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="",u.get("rest/explore-graph/properties",{params:{iri:t.isTriple?W(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?e.saveSettings.languages:[],includeInferred:e.saveSettings.includeInferred,sameAsState:e.saveSettings.sameAsState,rejectedPredicates:e.shouldShowSettings()?e.saveSettings.rejectedPredicates:[]}}).then((function(t){e.data=_.mapKeys(t.data,(function(t,n){return e.replaceIRIWithPrefix(n)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,n){e.propertiesObj.items.push({key:n,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const n=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));n&&(e.nodeImage=n.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){a.warning(getError(e.data),"Error")}))}function xe(e){ye("predicate","var(--onto-orange-dark)",e),ye("predicates","var(--onto-orange-dark)",e);let t=document.getElementsByClassName("link");t&&_.each(t,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--onto-orange-dark)",t.style.strokeWidth=4)}));let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--onto-orange-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function ye(e,t,n){let r=document.getElementsByClassName(e);r&&_.each(r,(function(e){let r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),V(n.iri)===H(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===H(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Ce(r))}))}function Te(){_.each(e.predicates,(function(e){let t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));let t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),ye("predicate",""),ye("predicates","");let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function Ne(e){let t=V(e);if(X.tripleNodes.has(t))return X.tripleNodes.get(t).find(t=>t.iri===e)}function Ce(e){return e.predicates.length>1?e.predicates.length+" predicates":Se(e.predicates[0])}function Se(t){const n=e.replaceIRIWithPrefix(t);return n.length===t.length?t.split("/")[t.split("/").length-1]:n}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],F=null,l((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(X.tripleNodes.has(t.linkId)){Te();let n=X.tripleNodes.get(t.linkId)[t.nodeIndex];Ee(n),e.showPredicates=!0;let r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");let i={};const o=X.tripleLinksCopy.values();for(let e=0;e<X.tripleLinksCopy.size;e++){let e=o.next().value;e.length>1&&e.every(t=>t.source.iri===n.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=V(t.target.iri),i.oppTriplePred=Se(t.target.iri.split(" ")[1])),i.pred=Se(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==n.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=V(t.source.iri),i.oppTriplePred=Se(t.source.iri.split(" ")[1])),i.pred=Se(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=Se(n.iri.split(" ")[1])),xe(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLoadingLocation=function(){return n.isLoadingLocation()},e.hasActiveLocation=function(){return n.hasActiveLocation()},e.rotate=function(e){ve();const t=2*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t),i=P/2,o=D/2;d3.selectAll(".node-wrapper").each((function(e){e.x=i+(n*(e.x-i)+r*(e.y-o)),e.y=o+(-r*(e.x-i)+n*(e.y-o)),e.fixed&&(e.px=e.x,e.py=e.y)})),oe.resume()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,e.pushHistory(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(X.copyState()),n={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};n.id?e.saveGraphModal("update",n):e.saveGraphModal("new",n)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const Ie=function(t){T.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),a.success(S.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,n,r){v.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:n,graphExists:r,shared:n.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),T.addNewSavedGraph(t).success((function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),a.success(S.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{const e=getError(n);a.error(e,S.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Ie(t.graph)}}))},e.refreshSavedGraphs=function(){T.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,n){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),X.restoreState(JSON.parse(t.data)),n||e.pushHistory({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(e){G([location.protocol,"//",location.host,location.pathname,"?saved=",e.id].join(""))},e.deleteSavedGraph=function(t){m.openSimpleModal({title:S.instant("common.confirm"),message:S.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){T.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),a.success(S.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,n){return n.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){ve();const t=e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(n){n.fixed=t,t&&e.numberOfPinnedNodes++})),oe.resume()},$("body").on("keydown",(function(t){"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,n,r){switch(e.mode=n.mode,e.graph=angular.copy(n.graph),e.graphExists=n.graphExists,e.mode){case"new":e.title=r.instant("graphexplore.create.new.graph"),e.okButtonText=r.instant("common.create.btn");break;case"update":e.title=r.instant("graphexplore.update"),e.okButtonText=r.instant("common.save.btn");break;case"rename":e.title=r.instant("graphexplore.rename"),e.okButtonText=r.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"]).controller("GraphsVisualizationsCtrl",a).controller("SaveGraphModalCtrl",l).config(["$tooltipProvider",function(e){e.options({appendToBody:!0})}]),a.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","$http","ClassInstanceDetailsService","AutocompleteRestService","$q","$location","$jwtAuth","UiScrollService","ModalService","$modal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","RDF4JRepositoriesRestService","$translate"],l.$inject=["$scope","$modalInstance","data","$translate"]},65:function(e,t,n){"use strict";n.r(t);n(34),n(4);function r(e,t,n,r,i,o,s,a,l,u,c,p,d,f,h,g,m){var v;e.page=1,e.totalPages=5,e.helpHidden=1===h.get(g.HIDE_GRAPH_CONFIG_HELP),e.toggleHelp=function(t){void 0===t&&(t=h.get(g.HIDE_GRAPH_CONFIG_HELP)),1!==t?(h.set(g.HIDE_GRAPH_CONFIG_HELP,1),e.helpHidden=!0):(h.set(g.HIDE_GRAPH_CONFIG_HELP,0),e.helpHidden=!1)},e.fixedVisualCallback=function(t,n){e.newConfig.startIRI=t,e.newConfig.startIRILabel=n,v=!0},e.isDefaultGraph=function(e){return"Minimal"===e.name||"Advanced"===e.name},e.isUserGraph=function(t){return!e.isDefaultGraph(t)},e.getSampleName=function(e,t){const n=e[t+"Description"];return n||(e.id?"Copy of "+e.name:e.name)};const E=function(){u.getGraphConfigSamples().success((function(t){e.samples=_.filter(t,(function(t){return!t.id||e.newConfig.id!==t.id||(e.revertConfig=t,!1)}))})).error((function(e){r.error(getError(e),m.instant("graphexplore.error.graph.configs"))}))},x=p.configName;function y(e){r.warning(e)}function T(t){let n;return"query"===t.startMode&&1===e.page?n=t.startGraphQuery:2===e.page?n=t.expandQuery:3===e.page?n=t.resourceQuery:4===e.page?n=t.predicateLabelQuery:5===e.page&&(n=t.resourcePropertiesQuery),angular.isDefined(n)?n:""}function N(){function o(){e.getAutocompletePromise=c.checkAutocompleteStatus()}E(),e.createGraphConfig=function(){u.createGraphConfig(e.newConfig).success((async function(){await d.showToastMessageWithDelay("graphexplore.saved.new.config"),n.url("graphs-visualizations")})).error((function(e){r.error(getError(e),m.instant("graphexplore.error.could.not.create"))}))},e.updateGraphConfig=function(){u.updateGraphConfig(e.newConfig).success((async function(){await d.showToastMessageWithDelay("graphexplore.saved.config"),n.url("graphs-visualizations")})).error((function(e){r.error(getError(e),m.instant("graphexplore.error.could.not.save"))}))},e.$on("autocompleteStatus",(function(){o()})),o(),e.getNamespacesPromise=f.getNamespaces(e.getActiveRepository());const s=function(e,t,n,r,i,o){t?u.validateQuery(t,n,r,i,o).success((function(){e()})).error((function(e){y(getError(e))})):e()};function a(){l()&&e.$broadcast("addStartFixedNodeAutomatically",{startIRI:e.newConfig.startIRI})}function l(){return 1===e.page&&"node"===e.newConfig.startMode}e.validateCurrentPage=function(t){e.updateModel(),1===e.page?"node"!==e.newConfig.startMode||e.newConfig.startIRI?"query"!==e.newConfig.startMode||e.newConfig.startGraphQuery?"query"===e.newConfig.startMode?s(t,e.newConfig.startGraphQuery,"graph"):t():y(m.instant("graphexplore.provide.query")):y(m.instant("graphexplore.select.start.node")):2===e.page?s(t,e.newConfig.expandQuery,"construct",["node"]):3===e.page?s(t,e.newConfig.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===e.page?s(t,e.newConfig.predicateLabelQuery,"tuple",["edge"],["label"]):5===e.page&&s(t,e.newConfig.resourcePropertiesQuery,"tuple",["node"],["property","value"])},e.goToPage=function(t){e.page!==t&&e.validateCurrentPage((function(){e.showEditor(),e.page=t,e.notoolbar=1!==e.page}))},e.goToPreviousPage=function(){e.page>1&&e.goToPage(e.page-1),l()&&(v=!1)},e.goToNextPage=function(){a(),v&&e.goToPage(e.page+1)},e.saveGraphConfig=function(){a(),l()&&!v||(e.newConfig.startQueryIncludeInferred=e.currentQuery.inference,e.newConfig.startQuerySameAs=e.currentQuery.sameAs,e.validateCurrentPage((function(){e.newConfig.name?e.isUpdate?e.updateGraphConfig(e.newConfig):e.createGraphConfig(e.newConfig):y(m.instant("graphexplore.provide.config.name"))})))},e.updateModel=function(){const t=window.editor.getValue().trim();"query"===e.newConfig.startMode&&1===e.page?e.newConfig.startGraphQuery=t:2===e.page?e.newConfig.expandQuery=t:3===e.page?e.newConfig.resourceQuery=t:4===e.page?e.newConfig.predicateLabelQuery=t:5===e.page&&(e.newConfig.resourcePropertiesQuery=t)},e.setQuery=function(e){window.editor.setValue(e||" ")},e.updateDirty=function(){if(e.revertConfig){const t=T(e.revertConfig),n=window.editor.getValue().trim();e.queryEditorIsDirty=t!==n}},e.updateEditor=function(){t((function(){e.currentQuery.query=T(e.newConfig),i.isActiveRepoOntopType()&&(e.nocount=!0),e.currentQuery.inference=e.newConfig.startQueryIncludeInferred,e.currentQuery.sameAs=e.newConfig.startQuerySameAs,P(e.currentQuery.id),b(e.currentQuery.id)}),100)},e.showEditor=function(){window.editor&&window.editor.xhr&&window.editor.xhr.abort(),e.viewMode="yasr"},e.showPreview=function(){e.currentQuery.outputType="table",e.runQuery()},e.revertEditor=function(){e.setQuery(T(e.revertConfig))},e.$watch("newConfig.startMode",(function(n){"query"===n&&t((function(){e.updateEditor()}),0)})),e.$watch("page",(function(n){("query"===e.newConfig.startMode||n>1)&&t((function(){e.showEditor(),e.updateEditor()}),0)}))}e.newConfig={startQueryIncludeInferred:!0,startQuerySameAs:!0},e.newConfig.startMode="search",e.isUpdate=!1,e.shared=!1,e.encodeQuery=function(e){return encodeURIComponent(e)},x?(e.isUpdate=!0,u.getConfig(x).success((function(t){e.newConfig=t,N()})).error((function(e){r.error(getError(e),m.instant("created.connector",{name:x}))}))):(e.isUpdate=!1,N());const C={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs};e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:100,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.tabsData=e.tabs=[C],e.saveTab=function(t){const n=function(t){for(let n=0;n<e.tabsData.length;n++){if(e.tabsData[n].id===t)return n}}(t);if(void 0===n)return{};const r=e.tabsData[n];return e.saveQueryToLocal(r),r},e.loadTab=P,e.addNewTab=function(e,t,n){},e.runQuery=R,e.getNamespaces=w,e.changePagination=function(){R(!0,e.explainRequested)},e.toggleSampleQueries=function(){},e.addKnownPrefixes=O,e.getExistingTabId=M,e.querySelected=function(t){const n=M(t);e.toggleSampleQueries(),angular.isDefined(n)?b(n):e.addNewTab(null,t.name,t.body)},e.saveQueryToLocal=S,e.setLoader=I,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3,n=e.getHumanReadableSeconds(t);let r="";r=e.progressMessage?e.progressMessage+"... "+n:m.instant("common.running.operation",{timeHuman:n});e.extraMessage&&t>10&&(r+="\n"+e.extraMessage);return r},e.fixSizesOnHorizontalViewModeSwitch=L,e.changeViewMode=function(n){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,L(),$(".dataTables_filter").remove(),$(".resultsTable").remove(),t((function(){P(n),b(n)}),100)},e.showHideEditor=A,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!0;e.getActiveRepository();function S(e){}function I(t,n,r){const i=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=n,e.extraMessage=r,i.addClass("hide")):(e.progressMessage="",e.extraMessage="",i.removeClass("hide")),null===e.$$phase&&e.$apply()}function L(n){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}const i=n;if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let n;n=t(i?function(){e.fixSizesOnHorizontalViewModeSwitch(i)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){t.cancel(n)}))}window.yasr&&window.yasr.container&&t((function(){window.yasr.container.resize()}),100)}function A(){L(!0)}function b(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function R(t,n){e.executedQueryTab=e.currentQuery,n&&"SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType()?r.warning(m.instant("query.editor.warning.msg")):"update"!==window.editor.getQueryMode()?(e.explainRequested=n,e.queryIsRunning||(t?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.viewMode="editor",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch(),I(!0,m.instant("evaluating.query.msg")),window.editor.query())):r.warning(m.instant("cannot.execute.update.error"))}function w(){I(!0,m.instant("common.refreshing.namespaces"),m.instant("common.extra.message")),f.getRepositoryNamespaces().success((function(t){const n={};t.results.bindings.forEach((function(e){n[e.prefix.value]=e.namespace.value})),e.namespaces=n})).error((function(t){e.repositoryError=getError(t)})).finally((function(){I(!1)}))}function O(){a.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){let t=getError(e);return r.error(t,m.instant("common.add.known.prefixes.error")),!0}))}function M(t){let n=void 0;return angular.forEach(e.tabsData,(function(e){if(e.name===t.name&&e.query===t.body)return n=e.id,e})),n}e.orientationViewMode||A(),e.getActiveRepository()&&w(),e.$on("$destroy",(function(){window.editor=null,window.yasr=null})),$("textarea").on("paste",(function(){t((function(){O()}),0)})),e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(){e.currentQuery}));function P(n){e.tabsData=[e.currentQuery];let r=e.currentQuery;null==e.currentQuery.query||""===e.currentQuery.query?window.editor.setValue(" "):window.editor.setValue(e.currentQuery.query),t((function(){e.currentTabConfig={},e.currentTabConfig.queryType=r.queryType,e.currentTabConfig.resultsCount=r.resultsCount,e.currentTabConfig.offset=r.offset,e.currentTabConfig.allResultsCount=r.allResultsCount,e.currentTabConfig.page=r.page,e.currentTabConfig.pageSize=r.pageSize,e.currentTabConfig.timeFinished=r.timeFinished,e.currentTabConfig.timeTook=r.timeTook,e.currentTabConfig.sizeDelta=r.sizeDelta,e.$apply()}),0),$("#yasr").css("padding","0")}function D(e){return $(e).attr("data-id")}e.$on("tabAction",(function(t,n){n.relatedTarget&&e.saveTab(D(n.relatedTarget)),e.loadTab(D(n.target))})),e.$on("deleteAllexeptSelected",(function(t,n){e.tabsData=n,e.tabs=n})),e.currentQuery=angular.copy(C),e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.getResultsDescription=function(){},e.getUpdateDescription=function(){},e.getStaleWarningMessage=function(){}}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("GraphConfigCtrl",r),r.$inject=["$scope","$timeout","$location","toastr","$repositories","$modal","ModalService","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate"]},66:function(e,t,n){"use strict";n.r(t);var r=n(220),i=n.n(r),o=n(229),s=n(221),a=n(222);n(4);function l(e,t,n,r,l,u,c,p,d,f,h,g,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(c,v,E){!function(c,v){var E=800,x=800,y=x,T=20,N=d3.layout.pack().size([y-T,y-T]).value((function(e){return e.size})),C=d3.scale.linear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),S=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 "+E+" "+x).attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function I(){return S.append("svg:g").attr({id:"main-group",transform:"translate("+E/2+","+x/2+")"})}function L(){return"true"===h.get(g.CLASS_HIERARCHY_HIDE_PREFIXES)}function A(){var e=a.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.0.3");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=a.a.Export.generateBase64ImageSource();d3.select(this).attr({href:t,download:"class-hierarchy-"+u.getActiveRepository()+".svg"})}c.hidePrefixes=L();var b,R,w=I();if(!c.classHierarchyData.classCount&&u.getActiveRepository()&&!u.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=h.get(`classHierarchy-selectedGraph-${u.getActiveRepository()}`);n.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,n,r){e.loader=!1,207===n&&p.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),c.classHierarchyData=t,d3.select("#download-svg").on("mouseover",A)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),p.error(m.instant("graphexplore.error.request.failed",{name:f,error:getError(t)}))}))}var O,M,P,D,k,F,G,U,B={};function j(n,a,u,p){P&&P(),D&&D(),d3.selectAll("#main-group").remove(),w=I(),o.a.SingleChild.addPlaceholders(n,!0),M=u||n;var h,g=N.nodes(n);M.isInFocusTransitive=!0,o.a.SingleChild.removePlaceholders(g),o.a.SingleChild.centerNodes(g),o.a.SingleChild.makePositionsRelativeToZero(g);var m=i()().attr("class","d3-tip").customPosition((function(e){return{top:"inherit",bottom:r.innerHeight-d3.event.clientY+"px",right:r.innerWidth-d3.event.clientX+"px"}})).html((function(e){return e.name}));S.call(m);var v=w.selectAll("circle").data(g).enter().append("g");a.doFade&&v.each((function(e){s.a.Transition.fadeIn(d3.select(this),550)}));var E,x=[],L=v.append("circle").attr("class",(function(e){return e.role})).style("fill",(function(e){return e.children?C(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.name!==f){var t=e.name;x.push({name:t}),B[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(){a.noPrefixes?m.show(e):e.textHidden?m.show(e):m.hide(e)})),e.circle.on("mouseout",m.hide)}}));function A(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),E=e}function k(){c.showClassInfoPanel=!1}x&&(x=_.uniqBy(x,"name"),c.flattenedClassNames=x);var F=s.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(F);R=function(e){W(e),e.name===f?(k(),d3.selectAll(".selected").classed("selected",!1)):(A(e),c.selectedClass=E,c.showClassInfoPanel=!0,c.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},F.on("click",(function(e){e.id&&r.history.pushState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),m.hide(),R(e)})),F.on("dblclick",(function(t){t!==n&&(m.hide(),A(t),e.$broadcast("goToDomainRangeGraphView",E,M),d3.event.stopPropagation())}));var G=0;S.on("wheel",(function(){m.hide();var e=d3.event;e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-G>100){G=t;var n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");var i=e.target.__data__;if(i||(i=M),"in"===n){if(i!==M){for(;i.parent&&!i.parent.isInFocusTransitive;)i=i.parent;i.depth<M.depth&&(i=M)}if(i===M&&i.children){for(var o=i.children[0],s=1;s<i.children.length;s++)i.children[s].sortingRank>o.sortingRank&&(o=i.children[s]);i=o}W(i,!0)}else"out"===n&&(i=M.parent)&&W(i,!0);M.name===f&&r.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),V()}}));var U=w.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)}));a.noPrefixes?(O!==n&&(U.each((function(e){var t=e.name.indexOf(":");e.name.indexOf("http://")>-1?e.noPrefixName=e.name:t>-1&&(e.noPrefixName=e.name.substring(t+1))})),O=n),U.style("font-size",(function(e){return s.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return s.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):U.style("font-size",(function(e){return s.a.Text.calcFontSize(e.name,e.r)})).text((function(e){return s.a.Text.getTextWithElipsisIfNeeded(e.name,e.r/3)})),U.style("display",(function(e){return e.parent===n?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),a.doFade&&!a.keepPrevState&&U.each((function(e){s.a.Transition.fadeIn(d3.select(this),550)})),b=function(){function e(e){e&&L.each((function(t){e==t.id&&R(t)}))}var n=t.hash();r.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var j=w.selectAll("circle, text");function H(e,t){var n=y/e[2];h=e,j.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),L.attr("r",(function(e){return e.r*n})),t&&U.each((function(e){e.fullName!==M.topLevelParentUri&&M.topLevelParentUri!==f||(e.textSel.style("display","none"),M.children&&M.children.length?_.each(M.children,(function(e){e.textSel.style("display","inline")})):M.textSel.style("display","inline"),M.parent&&_.each(M.parent.children,(function(e){e.name!==M.name&&e.textSel.style("display","inline")})))})),U.style("font-size",(function(e){return a.noPrefixes?s.a.Text.calcFontSize(e.noPrefixName,e.r*n):s.a.Text.calcFontSize(e.name,e.r*n)})).text((function(e){return a.noPrefixes?s.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):s.a.Text.getTextWithElipsisIfNeeded(e.name,e.r*n/3)}))}function q(e){var t=2*e+T;return 2*e/t<.3&&(t=2*e+2),t}function $(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive||(e.textHidden=!0,this.style.display="none")}function z(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive&&(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display="")}function W(e,t){if(l((function(){c.showExternalElements=e.name===f})),e.id&&r.history.replaceState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),M!==e){if(t&&(k(),d3.selectAll(".selected").classed("selected",!1)),M.parent)for(var n=M;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=n.children,n=n.parent;if(2*(M=e).r/(2*M.r+T)<.3||c.currentSliderValue>c.currentBrowserLimit)H([M.x,M.y,q(M.r)]),U.each((function(e){$.call(this,e),z.call(this,e)}));else d3.transition().duration(d).tween("zoom",(function(e){var t=d3.interpolateZoom(h,[M.x,M.y,q(M.r)]);return function(e){H(t(e))}})).selectAll("text").each("start",$).each("end",z)}}H([M.x,M.y,q(M.r)],p),P=c.$on("rootFocus",(function(){r.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),R(n)})),D=c.$on("classSearch",(function(e){R(e)}))}function V(){var t=c.classHierarchyData.classCount;let n=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}window.addEventListener("resize",V),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",V),window.removeEventListener("beforeunload",e)})),c.$watch("classHierarchyData",(function(){k&&k(),F&&F(),G&&G(),U&&U();var e=L();if(c.classHierarchyData.classCount){V();var t=angular.copy(c.classHierarchyData);var n,r,i=function(e){return N.nodes(e).sort((function(e,t){return e.sortingRank>t.sortingRank?-1:e.sortingRank<t.sortingRank?1:e.depth>t.depth?1:e.depth<t.depth?-1:0}))}(t);function o(e,t){var i={keepPrevState:!0,noPrefixes:L()};r=i.noPrefixes,j(n||e,i,M,!0),l((function(){h.set(g.CLASS_HIERARCHY_SWITCH_PREFIXES,t),b()}),70)}function s(e,i,s){if(e){h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),n={name:f,children:[]};for(var a=new Set,l=1;l<=e;l++)a.add(i[l].id),i[l].parent===i[0]&&n.children.push(i[l]);if(function e(t){if(t.children){for(var n=[],r=0;r<t.children.length;r++)a.has(t.children[r].id)&&n.push($.extend({},t.children[r]));t.children=n;for(r=0;r<t.children.length;r++)e(t.children[r])}}(n),s)r=angular.isUndefined(r)?L():r,j(n,{noPrefixes:r});else o(t)}}var a,u=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(u)s(u,i);else{var p={doFade:!0,keepPrevState:!0,noPrefixes:L()};j(t,p),b()}k=c.$watch("hidePrefixes",(function(n){angular.isUndefined(n)||e?e=void 0:l((function(){!function(e){angular.isUndefined(e)||h.set(g.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),o(t,!0)}),50)}),!0),F=c.$watch("currentSliderValue",(function(e){s(e,i,!0)}),!0),U=c.$on("onEnterKeypressSearchAction",(function(e){a&&R(a)})),G=c.$on("searchedClass",(function(e,t){(a=B[t.name])&&R(a)}))}}),!0)}(c)}}}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",l),l.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},67:function(e,t,n){"use strict";n.r(t);var r=n(222),i=n(221);n(4);function o(e,t,n,o,s,a,l,u,c,p,d,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(p){const d=u((function(){!function(p){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)}))};var d=1200,g=d/18,m=d/110,v=m/2,E=d/90,x=d/1e3,y=d/600,T=d3.layout.force().size([d,600]).charge(-900),N=T.drag().on("dragstart",(function(e){d3.select(this).classed("selected",e.selected=!0)})),C=d3.select("#domain-range").append("svg").attr("viewBox","0 0 "+d+" 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),S=C.append("defs");S.append("marker").attr({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),S.append("marker").attr({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),S.append("marker").attr({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var e=r.a.Export.getCSSRules("css/domain-range-graph.css?v=2.0.3");$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>");var t=r.a.Export.generateBase64ImageSource();d3.select(this).attr({href:t,download:"domain-range-graph-"+n.getActiveRepository()+".svg"})}));var I=d/7,L=1.2*I,A=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+I+" "+L).attr("preserveAspectRatio","xMidYMid meet");A.append("rect").attr({width:I,height:L}).style("fill","rgba(235, 235, 235, 0.9)");var b=d/75,R=d/40,w=b+g/2.5,O=R,M=w+d/90,_=E/1.1,P=R,D=(A.append("circle").attr({class:"legend-class-node",cx:(b+w)/2,cy:P,r:g/4.5}),O+d/370);A.append("text").attr({x:M,y:D}).style("font-size",_+"px").text("main class node");var k=P+d/30;A.append("circle").attr({class:"legend-object-node",cx:(b+w)/2,cy:k,r:m/1.25});var F=D+d/30;A.append("text").attr({x:M,y:F}).style("font-size",_+"px").text("class node");var G=k+d/45;A.append("circle").attr({class:"legend-datatype-node",cx:(b+w)/2,cy:G,r:v});var U=F+d/45;A.append("text").attr({x:M,y:U}).style("font-size",_+"px").text("datatype node");var B=G+d/45;d3.select(".legend-class-node");A.append("line").attr({class:"property-arrow",x1:b,y1:B,x2:w,y2:B}).style("stroke-width",x).attr("marker-end","url("+s.absUrl()+"#arrow)"),A.append("text").attr({x:M,y:B+d/370}).style("font-size",_+"px").text("explicit property");var j=B+d/45;A.append("line").attr({class:"implicit-property-arrow",x1:b,y1:j,x2:w,y2:j}).style("stroke-width",x).attr("marker-end","url("+s.absUrl()+"#arrow)"),A.append("text").attr({x:M,y:j+d/370}).style("font-size",_+"px").text("implicit property");var V=j+d/45;A.append("line").attr({class:"collapsed-property-arrow",x1:b,y1:V,x2:w,y2:V}).style("stroke-width",y).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),A.append("text").attr({x:M,y:V+d/370}).style("font-size",_+"px").text("collapsed property");var H=C,q=s.search().uri,z=s.search().name,W=s.search().collapsed;o.getDomainRangeData(q,W).success((function(e,t,n){p.domainRangeGraphData=e})).error((function(e){c.error("Request for "+z+" failed!")})),$(window).on("popstate",(function(){a.set(l.DOMAIN_RANGE_WENT_BACK,!0)})),t.onpopstate=function(t){t.state&&e.$broadcast("changeCollapsedEdgesState",t.state.collapsed)},p.$watch("collapseEdges",(function(){angular.isUndefined(p.collapseEdges)||(a.set(l.DOMAIN_RANGE_COLLAPSE_EDGES,p.collapseEdges),"true"!==a.get(l.DOMAIN_RANGE_WENT_BACK)&&function(t){e.$broadcast("switchEdgeMode",{uri:q,name:z,collapsed:t})}(p.collapseEdges),a.remove(l.DOMAIN_RANGE_WENT_BACK))})),p.$watch("domainRangeGraphData",(function(){if(p.domainRangeGraphData){var n=angular.copy(p.domainRangeGraphData);T.nodes(n.nodes).links(n.links);var r=H.selectAll(".link").data(n.links).enter().append("g");function o(e){e.style("stroke",f),e.style("stroke-width",y),e.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var a,l,c=0;r.each((function(e){if(e.objectPropNodeClassUri!==q)a=r.append("line").attr({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",x).each((function(e){switch(e.propertyType){case"objectLeft":e.targetRadius=g;break;case"objectRight":e.targetRadius=m;break;case"datatype":e.targetRadius=v;break;default:e.targetRadius=0}var t=d3.select(this);e.targetNodeEdgeCount>1?o(t):e.implicit&&t.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(l)){var t=g/2;l=d3.select(this).append("path").attr({d:"M 0 0 A "+t+" "+t+" 0 1 1 0 "+t,class:"loop-link",fill:"none","marker-end":"url("+s.absUrl()+"#arrow-loop)"}).style("stroke-width",x)}(c+=e.targetNodeEdgeCount)>1&&o(d3.select(".loop-link"))}}));var C={};function S(){$.isEmptyObject(C)||(C.text.style("fill","black"),C.background.style("fill","#f0f0f0"))}function I(e){S(),C.text=d3.select(this),C.background=d3.select(this.previousSibling),C.text.style("fill","white"),C.background.style("fill",f),u((function(){p.showPredicatesInfoPanel=!0,p.selectedPredicate=e})),d3.event.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",S)}));var L=r.append("text").attr("class",(function(e){return e.objectPropNodeClassUri===q?"loop-link-property-name":"property-name"})).attr("dx",(function(e){return g/2*("objectLeft"===e.propertyType?1:-1)})).style("text-anchor",(function(e){return"objectLeft"===e.propertyType?"end":"start"})).style("font-size",E).text((function(e){return e.targetNodeEdgeCount>1?e.targetNodeEdgeCount+" predicates":e.name}));L.each((function(e){var n=d3.select(this);/\d\spredicates/.test(n.text())?n.style("font-weight","bold").on("click",I):n.on("click",(function(e){t.open("resource?uri="+encodeURIComponent(e.uri),"_blank")}))}));var A=d/600,b=r.append("rect").attr("class",(function(e){return e.objectPropNodeClassUri!==q?"link-background":"loop-link-background"})).attr("width",(function(e){return e.calculatedWidth=this.previousSibling.getBBox().width,e.calculatedWidth+2*A})).attr("height",(function(e){return e.calculatedHeight=this.previousSibling.getBBox().height,e.calculatedHeight+A})).attr("transform",(function(e){var t=A-g/2*("objectLeft"===e.propertyType?1:-1);return"objectLeft"===e.propertyType&&(t+=e.calculatedWidth),"translate(-"+t+",-"+(A+e.calculatedHeight/2)+")"})).on("click",(function(e){d3.event.stopPropagation()})),R=H.selectAll(".node").data(n.nodes).enter().append("g"),w=R.filter((function(e){return e.objectPropClassUri!==q})).append("circle").each((function(e){var t=d3.select(this);"main"===e.classPosition?t.attr({class:"class-node",r:g}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===e.objectPropClassName?t.attr({class:"datatype-node",r:v}):t.attr({class:"object-prop-node",r:m})})).call(N);d3.selectAll(".object-prop-node").on("dblclick",(function(t,n){p.$apply((function(){e.$broadcast("reloadDomainRangeGraphView",t,n)}))})),R.filter((function(e){return e.objectPropClassName&&e.objectPropClassUri!==q})).append("text").attr("class",(function(e){return e.classPosition+"-class-label"})).style("font-size",E).text((function(e){return e.objectPropClassName})).on("click",(function(e){t.open("resource?uri="+encodeURIComponent(e.objectPropClassUri),"_blank")}));var O=R.select("text");H.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(z,g)})).text(z).on("click",(function(e){t.open("resource?uri="+encodeURIComponent(q),"_blank")}))}));var M=H.select(".class-node + text"),_=d3.select(".class-node"),P=d3.selectAll(".loop-link-background"),D=d3.selectAll(".loop-link-property-name");if(L=d3.selectAll(".property-name"),!angular.isUndefined(l)){var k=[];P.each((function(e,t){d3.select(this);k.push({idx:t,width:e.calculatedWidth,height:e.calculatedHeight})}))}T.on("tick",(function(e){var t=8*e.alpha;function n(e){var t=e.x+2*g,n=e.y-g/1.9;var r=[];P.each((function(i,o){r.push(i),o<h?function(r,i){var o=$.grep(k,(function(e){return e.idx==i}));i>0&&(t+=parseFloat(i*(o[0].height/(i/1.4)))),r.attr({transform:"rotate(270, "+e.x+","+e.y+") translate("+t+","+n+")",width:o[0].height,height:o[0].width})}(d3.select(this),o):d3.select(this).remove()})),function(e){var t;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(n){n.target.allEdges=e,t=this.getComputedTextLength()})).on("click",I),d3.select(".view-more-preds-rect").attr("height",t+2*A)}(r)}a.filter((function(e){return e.objectPropNodeClassUri!==q})).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 n=Math.atan2(e.target.y-e.source.y,e.target.x-e.source.x);e.targetX=e.target.x-Math.cos(n)*e.targetRadius,e.targetY=e.target.y-Math.sin(n)*e.targetRadius})),w.each((function(e){"main"!==e.classPosition||angular.isUndefined(l)||(!function(e){var t=e.x+.96*g,n=e.y-g/5.7-5;l.attr("transform","rotate(270, "+e.x+","+e.y+") translate("+t+","+n+")")}(e),function(e){function t(t,n){var r=$.grep(k,(function(e){return e.idx==n})),i=0;n>0&&(i=parseFloat(2*n*(r[0].height/1.4)));var o=e.x,s=e.y-2.1*g-i;t.attr({x:o,y:s}).moveToFront()}D.each((function(e,n){var r=d3.select(this),i=D.size()-h;i<0?t(r,n):(0==n&&!p.collapseEdges&&i>1&&(!function(e,t,n){e.classed("view-more-preds-label",!0).text(n+" predicates more ..."),null!==this.nextSibling&&t.classed("view-more-preds-rect",!0)}(r,d3.select(this.nextSibling),i),t(r,n)),n<h?t(r,n):r.remove())}))}(e),n(e)),e.objectPropClassUri!==q&&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=_.attr("cx")-d/2,n=.5*Math.log10(Math.abs(t));return e.x+=t>0?-n:n,e.x}(e):e.x})).attr("cy",(function(e){return e.y}))})),M.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).moveToFront(),b.filter((function(e){return e.objectPropNodeClassUri!==q})).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(),L.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(),O.attr("x",(function(e){return"right"===e.classPosition?e.x+1.2*m:e.x-1.2*m})).attr("y",(function(e){return e.y})).moveToFront()})).linkDistance(d/3.5).start()}}))}(p)}),50);p.$on("$destroy",(function(){u.cancel(d)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--onto-orange)").constant("ONTO_GREEN","var(--onto-green)").constant("ONTO_BLUE","var(--onto-blue)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",o),o.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]},68:function(e,t){function n(e,t){return{restrict:"A",scope:{},templateUrl:"js/angular/graphexplore/templates/systemRepoWarningTemplate.html",link:function(n){n.isSystemRepository=function(){return"SYSTEM"===e.getActiveRepository()},n.hasPermission=function(){return t.hasPermission()}}}}angular.module("graphdb.framework.graphexplore.directives.sysrepo",["graphdb.framework.graphexplore.controllers.class"]).directive("systemRepoWarning",n),n.$inject=["$repositories","$rootScope"]},69:function(e,t){function n(e){return{restrict:"AE",scope:{rdfsLabel:"=",rdfsComment:"=",expanded:"=",alwaysExpanded:"="},templateUrl:"js/angular/graphexplore/templates/rdfsCommentLabelTemplate.html",link:function(t,n){t.stringLimit=e,t.scrollToTop=function(){n[0].getElementsByClassName("rdfs-comment")[0].scrollTop=0},t.checkCommentLength=function(){return n[0].getElementsByClassName("rdfs-comment-text")[0].innerText.length<e},t.equalHeights=function(){const e=n[0].getElementsByClassName("rdfs-comment-text")[0].innerHeight;e<250&&t.expanded&&(n[0].getElementsByClassName("rdfs-comment")[0].innerHeight=e)},t.toggleFullComment=function(){t.expanded=!t.expanded},t.$watch("expanded || alwaysExpanded",(function(n){t.stringLimit=n?t.rdfsComment.length:e}))}}}angular.module("graphdb.framework.graphexplore.directives.rdfsdetails",[]).directive("rdfsCommentLabel",n).constant("SHORT_COMMENT_LENGTH",100),n.$inject=["SHORT_COMMENT_LENGTH"]},70:function(e,t,n){"use strict";n.r(t);var r=n(222);n(43);function i(e,t){return{restrict:"A",template:'<div id="dependencies-chord"></div>',scope:{dependenciesData:"="},link:function(n){n.$watch("dependenciesData",(function(){if(n.dependenciesData){const i=n.dependenciesData;!function(i,o){if(function(){let e=!0;for(const t of i){if(t.some(e=>0!==e)){e=!1;break}}return e}())return;const s=d3.scale.category20(),a=d3.select("body").append("div").attr("class","tooltip").style("opacity",0);d3.select("body").on("click",(function(){a.style("opacity",0)}));const l=Math.min(800,800)/2.8,u=l-24,c=d3.svg.arc().innerRadius(u).outerRadius(l),p=d3.layout.chord().padding(.04).sortSubgroups(d3.descending).sortChords(d3.ascending),d=d3.svg.chord().radius(u),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",l).style("fill","none"),p.matrix(i);const h=f.selectAll(".group").data(p.groups).enter().append("g").attr("class","group").on("mouseover",(function(e,t){g.classed("fade",(function(e){return e.source.index!==t&&e.target.index!==t}))}));h.append("title").text((function(e,t){return o[t]})),h.append("path").attr("id",(function(e,t){return"group"+t})).attr("d",c).style("fill",(function(e,t){return s(t)})),h.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("+(u+26)+")"+(e.angle>Math.PI?"rotate(180)":"")})).style("text-anchor",(function(e){return e.angle>Math.PI?"end":null})).text((function(e){return o[e.index]}));const g=f.selectAll(".chord").data(p.chords).enter().append("path").attr("class","chord").style("fill",(function(e){return s(e.target.index)})).style("fill-opacity",".67").style("stroke","#000").style("stroke-width",".25px").style("cursor","pointer").attr("d",d);g.on("mouseover",(function(){d3.select(this).style({"fill-opacity":"1"})})),g.on("mouseout",(function(){d3.select(this).style({"fill-opacity":".67"})})),g.on("click",(function(e){const r=o[e.source.index],i=o[e.target.index],s=d3.event.pageX,l=d3.event.pageY;t.getPredicates(r,i,n.selectedGraph&&n.selectedGraph.contextID.uri).success((function(e){let t="<div class='dependencies-tooltip'>"+("<div class='row'>"+r+" <i class='fa fa-exchange'></i> "+i+"</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>",a.html(t).style("left",s+"px").style("top",l+"px")})),a.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=r.a.Export.generateBase64ImageSource();d3.select(this).attr({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"]},71:function(e,t){function n(){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,n,r,i;e.listItemsObj.items=(t=e.filterQueryObj.query,n=e.listItemsObj.items,r=e.listItemsNotFiltered,i=e.filterFunction,t.length>0?_.filter(r,i):n.length!==r.length?r:n)}))}}}angular.module("graphdb.framework.graphexplore.directives.searchfilter",[]).directive("listItemsSearchFilter",n),n.$inject=[]},72:function(e,t){function n(e,t){return{restrict:"AE",scope:{searchData:"=",searchFields:"@",titleField:"@",searchPlaceholder:"@",initialValue:"=",searchedObjCallback:"&"},templateUrl:"js/angular/graphexplore/templates/searchIconInputTemplate.html",link:function(n,r){n.searchedObjCallback=n.searchedObjCallback(),n.performSearchActionOnEnter=function(){e.$broadcast("onEnterKeypressSearchAction")},n.showInput=function(){$("#selectGraphDropdown").hide(),r.find("#search_input #search_input_value")[0].value="",r.find(".search-icon").addClass("animated bounceOut").css("z-index","-1"),r.find("#search_input .angucomplete-holder").css("display","block"),t((function(){r.find("#search_input .angucomplete-holder").css("width","250px").css("left","-215px"),t((function(){r.find(".close-icon").css("display","block").addClass("animated bounceIn").css("z-index","3"),r.find("#search_input #search_input_value").focus()}),200)}),1)},n.hideInput=function(){r.find("#search_input #search_input_value")[0].value="",r.find("#search_input .angucomplete-holder").css("width","0px").css("left","35px"),t((function(){r.find("#search_input .angucomplete-holder").css("display","none"),$("#selectGraphDropdown").show()}),250),r.find(".close-icon").addClass("animated bounceOut").removeClass("bounceOut").css("z-index","-1").css("display","none").click((function(){$(".tooltip").hide()})),t((function(){r.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",n),n.$inject=["$rootScope","$timeout"]}}]);
29
29
  //# sourceMappingURL=11.3957302d7a301df30dd1.bundle.js.map