index.js 84 KB

123
  1. !function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(require("platform"),require("dagreD3")):"function"==typeof define&&define.amd?define(["platform","dagreD3"],b):"object"==typeof exports?exports.LineageHelper=b(require("platform"),require("dagreD3")):a.LineageHelper=b(a.platform,a.dagreD3)}(window,function(a,b){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,c){if(1&c&&(a=b(a)),8&c)return a;if(4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a.default}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=10)}([,function(b,c){b.exports=a},function(a,c){a.exports=b},,,,,,,function(a,b,c){},function(a,b,c){"use strict";function d(){}function e(){return[]}function f(a,b){this.ownerDocument=a.ownerDocument,this.namespaceURI=a.namespaceURI,this._next=null,this._parent=a,this.__data__=b}function g(a,b,c,d,e,g){for(var h,i=0,j=b.length,k=g.length;i<k;++i)(h=b[i])?(h.__data__=g[i],d[i]=h):c[i]=new f(a,g[i]);for(;i<j;++i)(h=b[i])&&(e[i]=h)}function h(a,b,c,d,e,g,h){var i,j,k,l={},m=b.length,n=g.length,o=new Array(m);for(i=0;i<m;++i)(j=b[i])&&(o[i]=k="$"+h.call(j,j.__data__,i,b),k in l?e[i]=j:l[k]=j);for(i=0;i<n;++i)(j=l[k="$"+h.call(a,g[i],i,g)])?(d[i]=j,j.__data__=g[i],l[k]=null):c[i]=new f(a,g[i]);for(i=0;i<m;++i)(j=b[i])&&l[o[i]]===j&&(e[i]=j)}function i(a,b){return a<b?-1:a>b?1:a>=b?0:NaN}function j(a){return function(){this.removeAttribute(a)}}function k(a){return function(){this.removeAttributeNS(a.space,a.local)}}function l(a,b){return function(){this.setAttribute(a,b)}}function m(a,b){return function(){this.setAttributeNS(a.space,a.local,b)}}function n(a,b){return function(){var c=b.apply(this,arguments);null==c?this.removeAttribute(a):this.setAttribute(a,c)}}function o(a,b){return function(){var c=b.apply(this,arguments);null==c?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}}function p(a){return function(){this.style.removeProperty(a)}}function q(a,b,c){return function(){this.style.setProperty(a,b,c)}}function r(a,b,c){return function(){var d=b.apply(this,arguments);null==d?this.style.removeProperty(a):this.style.setProperty(a,d,c)}}function s(a,b){return a.style.getPropertyValue(b)||ec(a).getComputedStyle(a,null).getPropertyValue(b)}function t(a){return function(){delete this[a]}}function u(a,b){return function(){this[a]=b}}function v(a,b){return function(){var c=b.apply(this,arguments);null==c?delete this[a]:this[a]=c}}function w(a){return a.trim().split(/^|\s+/)}function x(a){return a.classList||new y(a)}function y(a){this._node=a,this._names=w(a.getAttribute("class")||"")}function z(a,b){for(var c=x(a),d=-1,e=b.length;++d<e;)c.add(b[d])}function A(a,b){for(var c=x(a),d=-1,e=b.length;++d<e;)c.remove(b[d])}function B(a){return function(){z(this,a)}}function C(a){return function(){A(this,a)}}function D(a,b){return function(){(b.apply(this,arguments)?z:A)(this,a)}}function E(){this.textContent=""}function F(a){return function(){this.textContent=a}}function G(a){return function(){var b=a.apply(this,arguments);this.textContent=null==b?"":b}}function H(){this.innerHTML=""}function I(a){return function(){this.innerHTML=a}}function J(a){return function(){var b=a.apply(this,arguments);this.innerHTML=null==b?"":b}}function K(){this.nextSibling&&this.parentNode.appendChild(this)}function L(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function M(a){return function(){var b=this.ownerDocument,c=this.namespaceURI;return c===bc&&b.documentElement.namespaceURI===bc?b.createElement(a):b.createElementNS(c,a)}}function N(a){return function(){return this.ownerDocument.createElementNS(a.space,a.local)}}function O(){return null}function P(){var a=this.parentNode;a&&a.removeChild(this)}function Q(){var a=this.cloneNode(!1),b=this.parentNode;return b?b.insertBefore(a,this.nextSibling):a}function R(){var a=this.cloneNode(!0),b=this.parentNode;return b?b.insertBefore(a,this.nextSibling):a}function S(a,b,c){return a=T(a,b,c),function(b){var c=b.relatedTarget;c&&(c===this||8&c.compareDocumentPosition(this))||a.call(this,b)}}function T(a,b,c){return function(d){var e=hc;hc=d;try{a.call(this,this.__data__,b,c)}finally{hc=e}}}function U(a){return a.trim().split(/^|\s+/).map(function(a){var b="",c=a.indexOf(".");return c>=0&&(b=a.slice(c+1),a=a.slice(0,c)),{type:a,name:b}})}function V(a){return function(){var b=this.__on;if(b){for(var c,d=0,e=-1,f=b.length;d<f;++d)c=b[d],a.type&&c.type!==a.type||c.name!==a.name?b[++e]=c:this.removeEventListener(c.type,c.listener,c.capture);++e?b.length=e:delete this.__on}}}function W(a,b,c){var d=gc.hasOwnProperty(a.type)?S:T;return function(e,f,g){var h,i=this.__on,j=d(b,f,g);if(i)for(var k=0,l=i.length;k<l;++k)if((h=i[k]).type===a.type&&h.name===a.name)return this.removeEventListener(h.type,h.listener,h.capture),this.addEventListener(h.type,h.listener=j,h.capture=c),void(h.value=b);this.addEventListener(a.type,j,c),h={type:a.type,name:a.name,value:b,listener:j,capture:c},i?i.push(h):this.__on=[h]}}function X(a,b,c,d){var e=hc;a.sourceEvent=hc,hc=a;try{return b.apply(c,d)}finally{hc=e}}function Y(a,b,c){var d=ec(a),e=d.CustomEvent;"function"==typeof e?e=new e(b,c):(e=d.document.createEvent("Event"),c?(e.initEvent(b,c.bubbles,c.cancelable),e.detail=c.detail):e.initEvent(b,!1,!1)),a.dispatchEvent(e)}function Z(a,b){return function(){return Y(this,a,b)}}function _(a,b){return function(){return Y(this,a,b.apply(this,arguments))}}function aa(a,b){this._groups=a,this._parents=b}function ba(){return new aa([[document.documentElement]],ic)}function ca(a,b,c){a._context.bezierCurveTo((2*a._x0+a._x1)/3,(2*a._y0+a._y1)/3,(a._x0+2*a._x1)/3,(a._y0+2*a._y1)/3,(a._x0+4*a._x1+b)/6,(a._y0+4*a._y1+c)/6)}function da(a){this._context=a}function ea(){for(var a,b=0,c=arguments.length,d={};b<c;++b){if(!(a=arguments[b]+"")||a in d||/[\s.]/.test(a))throw new Error("illegal type: "+a);d[a]=[]}return new fa(d)}function fa(a){this._=a}function ga(a,b){return a.trim().split(/^|\s+/).map(function(a){var c="",d=a.indexOf(".");if(d>=0&&(c=a.slice(d+1),a=a.slice(0,d)),a&&!b.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:c}})}function ha(a,b){for(var c,d=0,e=a.length;d<e;++d)if((c=a[d]).name===b)return c.value}function ia(a,b,c){for(var d=0,e=a.length;d<e;++d)if(a[d].name===b){a[d]=mc,a=a.slice(0,d).concat(a.slice(d+1));break}return null!=c&&a.push({name:b,value:c}),a}function ja(){hc.stopImmediatePropagation()}function ka(a,b){var c=a.document.documentElement,d=kc(a).on("dragstart.drag",null);b&&(d.on("click.drag",qc,!0),setTimeout(function(){d.on("click.drag",null)},0)),"onselectstart"in c?d.on("selectstart.drag",null):(c.style.MozUserSelect=c.__noselect,delete c.__noselect)}function la(a){return((a=Math.exp(a))+1/a)/2}function ma(){return Cc||(Fc(na),Cc=Ec.now()+Dc)}function na(){Cc=0}function oa(){this._call=this._time=this._next=null}function pa(a,b,c){var d=new oa;return d.restart(a,b,c),d}function qa(){Cc=(Bc=Ec.now())+Dc,yc=zc=0;try{!function(){ma(),++yc;for(var a,b=nc;b;)(a=Cc-b._time)>=0&&b._call.call(null,a),b=b._next;--yc}()}finally{yc=0,function(){for(var a,b,c=nc,d=1/0;c;)c._call?(d>c._time&&(d=c._time),a=c,c=c._next):(b=c._next,c._next=null,c=a?a._next=b:nc=b);oc=a,sa(d)}(),Cc=0}}function ra(){var a=Ec.now(),b=a-Bc;b>1e3&&(Dc-=b,Bc=a)}function sa(a){yc||(zc&&(zc=clearTimeout(zc)),a-Cc>24?(a<1/0&&(zc=setTimeout(qa,a-Ec.now()-Dc)),Ac&&(Ac=clearInterval(Ac))):(Ac||(Bc=Ec.now(),Ac=setInterval(ra,1e3)),yc=1,Fc(qa)))}function ta(a,b){var c=va(a,b);if(c.state>0)throw new Error("too late; already scheduled");return c}function ua(a,b){var c=va(a,b);if(c.state>3)throw new Error("too late; already running");return c}function va(a,b){var c=a.__transition;if(!c||!(c=c[b]))throw new Error("transition not found");return c}function wa(a,b,c,d){function e(a){return a.length?a.pop()+" ":""}return function(f,g){var h=[],i=[];return f=a(f),g=a(g),function(a,d,e,f,g,h){if(a!==e||d!==f){var i=g.push("translate(",null,b,null,c);h.push({i:i-4,x:Pc(a,e)},{i:i-2,x:Pc(d,f)})}else(e||f)&&g.push("translate("+e+b+f+c)}(f.translateX,f.translateY,g.translateX,g.translateY,h,i),function(a,b,c,f){a!==b?(a-b>180?b+=360:b-a>180&&(a+=360),f.push({i:c.push(e(c)+"rotate(",null,d)-2,x:Pc(a,b)})):b&&c.push(e(c)+"rotate("+b+d)}(f.rotate,g.rotate,h,i),function(a,b,c,f){a!==b?f.push({i:c.push(e(c)+"skewX(",null,d)-2,x:Pc(a,b)}):b&&c.push(e(c)+"skewX("+b+d)}(f.skewX,g.skewX,h,i),function(a,b,c,d,f,g){if(a!==c||b!==d){var h=f.push(e(f)+"scale(",null,",",null,")");g.push({i:h-4,x:Pc(a,c)},{i:h-2,x:Pc(b,d)})}else 1===c&&1===d||f.push(e(f)+"scale("+c+","+d+")")}(f.scaleX,f.scaleY,g.scaleX,g.scaleY,h,i),f=g=null,function(a){for(var b,c=-1,d=i.length;++c<d;)h[(b=i[c]).i]=b.x(a);return h.join("")}}}function xa(a,b){var c,d;return function(){var e=ua(this,a),f=e.tween;if(f!==c)for(var g=0,h=(d=c=f).length;g<h;++g)if(d[g].name===b){(d=d.slice()).splice(g,1);break}e.tween=d}}function ya(a,b,c){var d,e;if("function"!=typeof c)throw new Error;return function(){var f=ua(this,a),g=f.tween;if(g!==d){e=(d=g).slice();for(var h={name:b,value:c},i=0,j=e.length;i<j;++i)if(e[i].name===b){e[i]=h;break}i===j&&e.push(h)}f.tween=e}}function za(a,b,c){var d=a._id;return a.each(function(){var a=ua(this,d);(a.value||(a.value={}))[b]=c.apply(this,arguments)}),function(a){return va(a,d).value[b]}}function Aa(a,b){var c=Object.create(a.prototype);for(var d in b)c[d]=b[d];return c}function Ba(){}function Ca(){return this.rgb().formatHex()}function Da(){return this.rgb().formatRgb()}function Ea(a){var b,c;return a=(a+"").trim().toLowerCase(),(b=Zc.exec(a))?(c=b[1].length,b=parseInt(b[1],16),6===c?Fa(b):3===c?new Ja(b>>8&15|b>>4&240,b>>4&15|240&b,(15&b)<<4|15&b,1):8===c?Ga(b>>24&255,b>>16&255,b>>8&255,(255&b)/255):4===c?Ga(b>>12&15|b>>8&240,b>>8&15|b>>4&240,b>>4&15|240&b,((15&b)<<4|15&b)/255):null):(b=$c.exec(a))?new Ja(b[1],b[2],b[3],1):(b=_c.exec(a))?new Ja(255*b[1]/100,255*b[2]/100,255*b[3]/100,1):(b=ad.exec(a))?Ga(b[1],b[2],b[3],b[4]):(b=bd.exec(a))?Ga(255*b[1]/100,255*b[2]/100,255*b[3]/100,b[4]):(b=cd.exec(a))?Na(b[1],b[2]/100,b[3]/100,1):(b=dd.exec(a))?Na(b[1],b[2]/100,b[3]/100,b[4]):ed.hasOwnProperty(a)?Fa(ed[a]):"transparent"===a?new Ja(NaN,NaN,NaN,0):null}function Fa(a){return new Ja(a>>16&255,a>>8&255,255&a,1)}function Ga(a,b,c,d){return d<=0&&(a=b=c=NaN),new Ja(a,b,c,d)}function Ha(a){return a instanceof Ba||(a=Ea(a)),a?new Ja((a=a.rgb()).r,a.g,a.b,a.opacity):new Ja}function Ia(a,b,c,d){return 1===arguments.length?Ha(a):new Ja(a,b,c,null==d?1:d)}function Ja(a,b,c,d){this.r=+a,this.g=+b,this.b=+c,this.opacity=+d}function Ka(){return"#"+Ma(this.r)+Ma(this.g)+Ma(this.b)}function La(){var a=this.opacity;return(1===(a=isNaN(a)?1:Math.max(0,Math.min(1,a)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===a?")":", "+a+")")}function Ma(a){return((a=Math.max(0,Math.min(255,Math.round(a)||0)))<16?"0":"")+a.toString(16)}function Na(a,b,c,d){return d<=0?a=b=c=NaN:c<=0||c>=1?a=b=NaN:b<=0&&(a=NaN),new Pa(a,b,c,d)}function Oa(a){if(a instanceof Pa)return new Pa(a.h,a.s,a.l,a.opacity);if(a instanceof Ba||(a=Ea(a)),!a)return new Pa;if(a instanceof Pa)return a;var b=(a=a.rgb()).r/255,c=a.g/255,d=a.b/255,e=Math.min(b,c,d),f=Math.max(b,c,d),g=NaN,h=f-e,i=(f+e)/2;return h?(g=b===f?(c-d)/h+6*(c<d):c===f?(d-b)/h+2:(b-c)/h+4,h/=i<.5?f+e:2-f-e,g*=60):h=i>0&&i<1?0:g,new Pa(g,h,i,a.opacity)}function Pa(a,b,c,d){this.h=+a,this.s=+b,this.l=+c,this.opacity=+d}function Qa(a,b,c){return 255*(a<60?b+(c-b)*a/60:a<180?c:a<240?b+(c-b)*(240-a)/60:b)}function Ra(a,b,c,d,e){var f=a*a,g=f*a;return((1-3*a+3*f-g)*b+(4-6*f+3*g)*c+(1+3*a+3*f-3*g)*d+g*e)/6}function Sa(a,b){return function(c){return a+c*b}}function Ta(a){return 1==(a=+a)?Ua:function(b,c){return c-b?function(a,b,c){return a=Math.pow(a,c),b=Math.pow(b,c)-a,c=1/c,function(d){return Math.pow(a+d*b,c)}}(b,c,a):fd(isNaN(b)?c:b)}}function Ua(a,b){var c=b-a;return c?Sa(a,c):fd(isNaN(a)?b:a)}function Va(a){return function(b){var c,d,e=b.length,f=new Array(e),g=new Array(e),h=new Array(e);for(c=0;c<e;++c)d=Ia(b[c]),f[c]=d.r||0,g[c]=d.g||0,h[c]=d.b||0;return f=a(f),g=a(g),h=a(h),d.opacity=1,function(a){return d.r=f(a),d.g=g(a),d.b=h(a),d+""}}}function Wa(a){return function(){this.removeAttribute(a)}}function Xa(a){return function(){this.removeAttributeNS(a.space,a.local)}}function Ya(a,b,c){var d,e,f=c+"";return function(){var g=this.getAttribute(a);return g===f?null:g===d?e:e=b(d=g,c)}}function Za(a,b,c){var d,e,f=c+"";return function(){var g=this.getAttributeNS(a.space,a.local);return g===f?null:g===d?e:e=b(d=g,c)}}function $a(a,b,c){var d,e,f;return function(){var g,h,i=c(this);return null!=i?(g=this.getAttribute(a))===(h=i+"")?null:g===d&&h===e?f:(e=h,f=b(d=g,i)):void this.removeAttribute(a)}}function _a(a,b,c){var d,e,f;return function(){var g,h,i=c(this);return null!=i?(g=this.getAttributeNS(a.space,a.local))===(h=i+"")?null:g===d&&h===e?f:(e=h,f=b(d=g,i)):void this.removeAttributeNS(a.space,a.local)}}function ab(a,b){return function(c){this.setAttribute(a,b.call(this,c))}}function bb(a,b){return function(c){this.setAttributeNS(a.space,a.local,b.call(this,c))}}function cb(a,b){function c(){var c=b.apply(this,arguments);return c!==e&&(d=(e=c)&&bb(a,c)),d}var d,e;return c._value=b,c}function db(a,b){function c(){var c=b.apply(this,arguments);return c!==e&&(d=(e=c)&&ab(a,c)),d}var d,e;return c._value=b,c}function eb(a,b){return function(){ta(this,a).delay=+b.apply(this,arguments)}}function fb(a,b){return b=+b,function(){ta(this,a).delay=b}}function gb(a,b){return function(){ua(this,a).duration=+b.apply(this,arguments)}}function hb(a,b){return b=+b,function(){ua(this,a).duration=b}}function ib(a,b){if("function"!=typeof b)throw new Error;return function(){ua(this,a).ease=b}}function jb(a,b,c){var d,e,f=function(a){return(a+"").trim().split(/^|\s+/).every(function(a){var b=a.indexOf(".");return b>=0&&(a=a.slice(0,b)),!a||"start"===a})}(b)?ta:ua;return function(){var g=f(this,a),h=g.on;h!==d&&(e=(d=h).copy()).on(b,c),g.on=e}}function kb(a){return function(){this.style.removeProperty(a)}}function lb(a,b,c){return function(d){this.style.setProperty(a,b.call(this,d),c)}}function mb(a,b,c){function d(){var d=b.apply(this,arguments);return d!==f&&(e=(f=d)&&lb(a,d,c)),e}var e,f;return d._value=b,d}function nb(a){return function(b){this.textContent=a.call(this,b)}}function ob(a){function b(){var b=a.apply(this,arguments);return b!==d&&(c=(d=b)&&nb(b)),c}var c,d;return b._value=a,b}function pb(a,b,c,d){this._groups=a,this._parents=b,this._name=c,this._id=d}function qb(){return++md}function rb(a,b){for(var c;!(c=a.__transition)||!(c=c[b]);)if(!(a=a.parentNode))return od.time=ma(),od;return c}function sb(a,b,c){this.target=a,this.type=b,this.transform=c}function tb(a,b,c){this.k=a,this.x=b,this.y=c}function ub(){hc.stopImmediatePropagation()}function vb(){return!hc.ctrlKey&&!hc.button}function wb(){var a=this;return a instanceof SVGElement?(a=a.ownerSVGElement||a).hasAttribute("viewBox")?[[(a=a.viewBox.baseVal).x,a.y],[a.x+a.width,a.y+a.height]]:[[0,0],[a.width.baseVal.value,a.height.baseVal.value]]:[[0,0],[a.clientWidth,a.clientHeight]]}function xb(){return this.__zoom||qd}function yb(){return-hc.deltaY*(1===hc.deltaMode?.05:hc.deltaMode?1:.002)}function zb(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ab(a,b,c){var d=a.invertX(b[0][0])-c[0][0],e=a.invertX(b[1][0])-c[1][0],f=a.invertY(b[0][1])-c[0][1],g=a.invertY(b[1][1])-c[1][1];return a.translate(e>d?(d+e)/2:Math.min(0,d)||Math.max(0,e),g>f?(f+g)/2:Math.min(0,f)||Math.max(0,g))}function Bb(a,b,c,d,e,f,g,h,i,j){this.target=a,this.type=b,this.subject=c,this.identifier=d,this.active=e,this.x=f,this.y=g,this.dx=h,this.dy=i,this._=j}function Cb(){return!hc.ctrlKey&&!hc.button}function Db(){return this.parentNode}function Eb(a){return null==a?{x:hc.x,y:hc.y}:a}function Fb(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gb(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Hb(){return new Gb}function Ib(a){this._context=a}function Jb(a){return a[0]}function Kb(a){return a[1]}function Lb(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function Mb(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?Lb(Object(c),!0).forEach(function(b){Nb(a,b,c[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):Lb(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}function Nb(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function Ob(){}function Pb(a,b){var c=new Ob;if(a instanceof Ob)a.each(function(a,b){c.set(b,a)});else if(Array.isArray(a)){var d,e=-1,f=a.length;if(null==b)for(;++e<f;)c.set(e,a[e]);else for(;++e<f;)c.set(b(d=a[e],e,a),d)}else if(a)for(var g in a)c.set(g,a[g]);return c}function Qb(){}function Rb(a,b){var c=new Qb;if(a instanceof Qb)a.each(function(a){c.add(a)});else if(a){var d=-1,e=a.length;if(null==b)for(;++d<e;)c.add(a[d]);else for(;++d<e;)c.add(b(a[d],d,a))}return c}function Sb(a){return(Sb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a})(a)}function Tb(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function Ub(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?Tb(Object(c),!0).forEach(function(b){Vb(a,b,c[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):Tb(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}function Vb(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function Wb(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}c.r(b),c.d(b,"default",function(){return Hd});var Xb=c(2),Yb=c.n(Xb),Zb=function(a){return null==a?d:function(){return this.querySelector(a)}},$b=function(a){return null==a?e:function(){return this.querySelectorAll(a)}},_b=function(a){return function(){return this.matches(a)}},ac=function(a){return new Array(a.length)};f.prototype={constructor:f,appendChild:function(a){return this._parent.insertBefore(a,this._next)},insertBefore:function(a,b){return this._parent.insertBefore(a,b)},querySelector:function(a){return this._parent.querySelector(a)},querySelectorAll:function(a){return this._parent.querySelectorAll(a)}};var bc="http://www.w3.org/1999/xhtml",cc={svg:"http://www.w3.org/2000/svg",xhtml:bc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},dc=function(a){var b=a+="",c=b.indexOf(":");return c>=0&&"xmlns"!==(b=a.slice(0,c))&&(a=a.slice(c+1)),cc.hasOwnProperty(b)?{space:cc[b],local:a}:a},ec=function(a){return a.ownerDocument&&a.ownerDocument.defaultView||a.document&&a||a.defaultView};y.prototype={add:function(a){this._names.indexOf(a)<0&&(this._names.push(a),this._node.setAttribute("class",this._names.join(" ")))},remove:function(a){var b=this._names.indexOf(a);b>=0&&(this._names.splice(b,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(a){return this._names.indexOf(a)>=0}};var fc=function(a){var b=dc(a);return(b.local?N:M)(b)},gc={},hc=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(gc={mouseenter:"mouseover",mouseleave:"mouseout"}));var ic=[null];aa.prototype=ba.prototype={constructor:aa,select:function(a){"function"!=typeof a&&(a=Zb(a));for(var b=this._groups,c=b.length,d=new Array(c),e=0;e<c;++e)for(var f,g,h=b[e],i=h.length,j=d[e]=new Array(i),k=0;k<i;++k)(f=h[k])&&(g=a.call(f,f.__data__,k,h))&&("__data__"in f&&(g.__data__=f.__data__),j[k]=g);return new aa(d,this._parents)},selectAll:function(a){"function"!=typeof a&&(a=$b(a));for(var b=this._groups,c=b.length,d=[],e=[],f=0;f<c;++f)for(var g,h=b[f],i=h.length,j=0;j<i;++j)(g=h[j])&&(d.push(a.call(g,g.__data__,j,h)),e.push(g));return new aa(d,e)},filter:function(a){"function"!=typeof a&&(a=_b(a));for(var b=this._groups,c=b.length,d=new Array(c),e=0;e<c;++e)for(var f,g=b[e],h=g.length,i=d[e]=[],j=0;j<h;++j)(f=g[j])&&a.call(f,f.__data__,j,g)&&i.push(f);return new aa(d,this._parents)},data:function(a,b){if(!a)return q=new Array(this.size()),m=-1,this.each(function(a){q[++m]=a}),q;var c,d=b?h:g,e=this._parents,f=this._groups;"function"!=typeof a&&(c=a,a=function(){return c});for(var i=f.length,j=new Array(i),k=new Array(i),l=new Array(i),m=0;m<i;++m){var n=e[m],o=f[m],p=o.length,q=a.call(n,n&&n.__data__,m,e),r=q.length,s=k[m]=new Array(r),t=j[m]=new Array(r);d(n,o,s,t,l[m]=new Array(p),q,b);for(var u,v,w=0,x=0;w<r;++w)if(u=s[w]){for(w>=x&&(x=w+1);!(v=t[x])&&++x<r;);u._next=v||null}}return(j=new aa(j,e))._enter=k,j._exit=l,j},enter:function(){return new aa(this._enter||this._groups.map(ac),this._parents)},exit:function(){return new aa(this._exit||this._groups.map(ac),this._parents)},join:function(a,b,c){var d=this.enter(),e=this,f=this.exit();return d="function"==typeof a?a(d):d.append(a+""),null!=b&&(e=b(e)),null==c?f.remove():c(f),d&&e?d.merge(e).order():e},merge:function(a){for(var b=this._groups,c=a._groups,d=b.length,e=c.length,f=Math.min(d,e),g=new Array(d),h=0;h<f;++h)for(var i,j=b[h],k=c[h],l=j.length,m=g[h]=new Array(l),n=0;n<l;++n)(i=j[n]||k[n])&&(m[n]=i);for(;h<d;++h)g[h]=b[h];return new aa(g,this._parents)},order:function(){for(var a=this._groups,b=-1,c=a.length;++b<c;)for(var d,e=a[b],f=e.length-1,g=e[f];--f>=0;)(d=e[f])&&(g&&4^d.compareDocumentPosition(g)&&g.parentNode.insertBefore(d,g),g=d);return this},sort:function(a){function b(b,c){return b&&c?a(b.__data__,c.__data__):!b-!c}a||(a=i);for(var c=this._groups,d=c.length,e=new Array(d),f=0;f<d;++f){for(var g,h=c[f],j=h.length,k=e[f]=new Array(j),l=0;l<j;++l)(g=h[l])&&(k[l]=g);k.sort(b)}return new aa(e,this._parents).order()},call:function(){var a=arguments[0];return arguments[0]=this,a.apply(null,arguments),this},nodes:function(){var a=new Array(this.size()),b=-1;return this.each(function(){a[++b]=this}),a},node:function(){for(var a=this._groups,b=0,c=a.length;b<c;++b)for(var d=a[b],e=0,f=d.length;e<f;++e){var g=d[e];if(g)return g}return null},size:function(){var a=0;return this.each(function(){++a}),a},empty:function(){return!this.node()},each:function(a){for(var b=this._groups,c=0,d=b.length;c<d;++c)for(var e,f=b[c],g=0,h=f.length;g<h;++g)(e=f[g])&&a.call(e,e.__data__,g,f);return this},attr:function(a,b){var c=dc(a);if(arguments.length<2){var d=this.node();return c.local?d.getAttributeNS(c.space,c.local):d.getAttribute(c)}return this.each((null==b?c.local?k:j:"function"==typeof b?c.local?o:n:c.local?m:l)(c,b))},style:function(a,b,c){return arguments.length>1?this.each((null==b?p:"function"==typeof b?r:q)(a,b,null==c?"":c)):s(this.node(),a)},property:function(a,b){return arguments.length>1?this.each((null==b?t:"function"==typeof b?v:u)(a,b)):this.node()[a]},classed:function(a,b){var c=w(a+"");if(arguments.length<2){for(var d=x(this.node()),e=-1,f=c.length;++e<f;)if(!d.contains(c[e]))return!1;return!0}return this.each(("function"==typeof b?D:b?B:C)(c,b))},text:function(a){return arguments.length?this.each(null==a?E:("function"==typeof a?G:F)(a)):this.node().textContent},html:function(a){return arguments.length?this.each(null==a?H:("function"==typeof a?J:I)(a)):this.node().innerHTML},raise:function(){return this.each(K)},lower:function(){return this.each(L)},append:function(a){var b="function"==typeof a?a:fc(a);return this.select(function(){return this.appendChild(b.apply(this,arguments))})},insert:function(a,b){var c="function"==typeof a?a:fc(a),d=null==b?O:"function"==typeof b?b:Zb(b);return this.select(function(){return this.insertBefore(c.apply(this,arguments),d.apply(this,arguments)||null)})},remove:function(){return this.each(P)},clone:function(a){return this.select(a?R:Q)},datum:function(a){return arguments.length?this.property("__data__",a):this.node().__data__},on:function(a,b,c){var d,e,f=U(a+""),g=f.length;if(!(arguments.length<2)){for(h=b?W:V,null==c&&(c=!1),d=0;d<g;++d)this.each(h(f[d],b,c));return this}var h=this.node().__on;if(h)for(var i,j=0,k=h.length;j<k;++j)for(d=0,i=h[j];d<g;++d)if((e=f[d]).type===i.type&&e.name===i.name)return i.value},dispatch:function(a,b){return this.each(("function"==typeof b?_:Z)(a,b))}};var jc=ba,kc=function(a){return"string"==typeof a?new aa([[document.querySelector(a)]],[document.documentElement]):new aa([[a]],ic)};da.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ca(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(a,b){switch(a=+a,b=+b,this._point){case 0:this._point=1,this._line?this._context.lineTo(a,b):this._context.moveTo(a,b);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ca(this,a,b)}this._x0=this._x1,this._x1=a,this._y0=this._y1,this._y1=b}};var lc=function(a){return new da(a)},mc={value:function(){}};fa.prototype=ea.prototype={constructor:fa,on:function(a,b){var c,d=this._,e=ga(a+"",d),f=-1,g=e.length;if(!(arguments.length<2)){if(null!=b&&"function"!=typeof b)throw new Error("invalid callback: "+b);for(;++f<g;)if(c=(a=e[f]).type)d[c]=ia(d[c],a.name,b);else if(null==b)for(c in d)d[c]=ia(d[c],a.name,null);return this}for(;++f<g;)if((c=(a=e[f]).type)&&(c=ha(d[c],a.name)))return c},copy:function(){var a={},b=this._;for(var c in b)a[c]=b[c].slice();return new fa(a)},call:function(a,b){if((c=arguments.length-2)>0)for(var c,d,e=new Array(c),f=0;f<c;++f)e[f]=arguments[f+2];if(!this._.hasOwnProperty(a))throw new Error("unknown type: "+a);for(f=0,c=(d=this._[a]).length;f<c;++f)d[f].value.apply(b,e)},apply:function(a,b,c){if(!this._.hasOwnProperty(a))throw new Error("unknown type: "+a);for(var d=this._[a],e=0,f=d.length;e<f;++e)d[e].value.apply(b,c)}};var nc,oc,pc=ea,qc=function(){hc.preventDefault(),hc.stopImmediatePropagation()},rc=function(a){var b=a.document.documentElement,c=kc(a).on("dragstart.drag",qc,!0);"onselectstart"in b?c.on("selectstart.drag",qc,!0):(b.__noselect=b.style.MozUserSelect,b.style.MozUserSelect="none")},sc=Math.SQRT2,tc=function(a,b){var c,d,e=a[0],f=a[1],g=a[2],h=b[0],i=b[1],j=b[2],k=h-e,l=i-f,m=k*k+l*l;if(m<1e-12)d=Math.log(j/g)/sc,c=function(a){return[e+a*k,f+a*l,g*Math.exp(sc*a*d)]};else{var n=Math.sqrt(m),o=(j*j-g*g+4*m)/(2*g*2*n),p=(j*j-g*g-4*m)/(2*j*2*n),q=Math.log(Math.sqrt(o*o+1)-o),r=Math.log(Math.sqrt(p*p+1)-p);d=(r-q)/sc,c=function(a){var b,c=a*d,h=la(q),i=g/(2*n)*(h*(b=sc*c+q,((b=Math.exp(2*b))-1)/(b+1))-function(a){return((a=Math.exp(a))-1/a)/2}(q));return[e+i*k,f+i*l,g*h/la(sc*c+q)]}}return c.duration=1e3*d,c},uc=function(){for(var a,b=hc;a=b.sourceEvent;)b=a;return b},vc=function(a,b){var c=a.ownerSVGElement||a;if(c.createSVGPoint){var d=c.createSVGPoint();return d.x=b.clientX,d.y=b.clientY,[(d=d.matrixTransform(a.getScreenCTM().inverse())).x,d.y]}var e=a.getBoundingClientRect();return[b.clientX-e.left-a.clientLeft,b.clientY-e.top-a.clientTop]},wc=function(a){var b=uc();return b.changedTouches&&(b=b.changedTouches[0]),vc(a,b)},xc=function(a,b,c){arguments.length<3&&(c=b,b=uc().changedTouches);for(var d,e=0,f=b?b.length:0;e<f;++e)if((d=b[e]).identifier===c)return vc(a,d);return null},yc=0,zc=0,Ac=0,Bc=0,Cc=0,Dc=0,Ec="object"==typeof performance&&performance.now?performance:Date,Fc="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(a){setTimeout(a,17)};oa.prototype=pa.prototype={constructor:oa,restart:function(a,b,c){if("function"!=typeof a)throw new TypeError("callback is not a function");c=(null==c?ma():+c)+(null==b?0:+b),this._next||oc===this||(oc?oc._next=this:nc=this,oc=this),this._call=a,this._time=c,sa()},stop:function(){this._call&&(this._call=null,this._time=1/0,sa())}};var Gc,Hc,Ic,Jc,Kc=function(a,b,c){var d=new oa;return b=null==b?0:+b,d.restart(function(c){d.stop(),a(c+b)},b,c),d},Lc=pc("start","end","cancel","interrupt"),Mc=[],Nc=function(a,b,c,d,e,f){var g=a.__transition;if(g){if(c in g)return}else a.__transition={};!function(a,b,c){function d(i){var j,k,l,m;if(1!==c.state)return f();for(j in h)if((m=h[j]).name===c.name){if(3===m.state)return Kc(d);4===m.state?(m.state=6,m.timer.stop(),m.on.call("interrupt",a,a.__data__,m.index,m.group),delete h[j]):+j<b&&(m.state=6,m.timer.stop(),m.on.call("cancel",a,a.__data__,m.index,m.group),delete h[j])}if(Kc(function(){3===c.state&&(c.state=4,c.timer.restart(e,c.delay,c.time),e(i))}),c.state=2,c.on.call("start",a,a.__data__,c.index,c.group),2===c.state){for(c.state=3,g=new Array(l=c.tween.length),j=0,k=-1;j<l;++j)(m=c.tween[j].value.call(a,a.__data__,c.index,c.group))&&(g[++k]=m);g.length=k+1}}function e(b){for(var d=b<c.duration?c.ease.call(null,b/c.duration):(c.timer.restart(f),c.state=5,1),e=-1,h=g.length;++e<h;)g[e].call(a,d);5===c.state&&(c.on.call("end",a,a.__data__,c.index,c.group),f())}function f(){for(var d in c.state=6,c.timer.stop(),delete h[b],h)return;delete a.__transition}var g,h=a.__transition;h[b]=c,c.timer=pa(function(a){c.state=1,c.timer.restart(d,c.delay,c.time),c.delay<=a&&d(a-c.delay)},0,c.time)}(a,c,{name:b,index:d,group:e,on:Lc,tween:Mc,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:0})},Oc=function(a,b){var c,d,e,f=a.__transition,g=!0;if(f){for(e in b=null==b?null:b+"",f)(c=f[e]).name===b?(d=c.state>2&&c.state<5,c.state=6,c.timer.stop(),c.on.call(d?"interrupt":"cancel",a,a.__data__,c.index,c.group),delete f[e]):g=!1;g&&delete a.__transition}},Pc=function(a,b){return a=+a,b=+b,function(c){return a*(1-c)+b*c}},Qc=180/Math.PI,Rc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},Sc=function(a,b,c,d,e,f){var g,h,i;return(g=Math.sqrt(a*a+b*b))&&(a/=g,b/=g),(i=a*c+b*d)&&(c-=a*i,d-=b*i),(h=Math.sqrt(c*c+d*d))&&(c/=h,d/=h,i/=h),a*d<b*c&&(a=-a,b=-b,i=-i,g=-g),{translateX:e,translateY:f,rotate:Math.atan2(b,a)*Qc,skewX:Math.atan(i)*Qc,scaleX:g,scaleY:h}},Tc=wa(function(a){return"none"===a?Rc:(Gc||(Gc=document.createElement("DIV"),Hc=document.documentElement,Ic=document.defaultView),Gc.style.transform=a,a=Ic.getComputedStyle(Hc.appendChild(Gc),null).getPropertyValue("transform"),Hc.removeChild(Gc),a=a.slice(7,-1).split(","),Sc(+a[0],+a[1],+a[2],+a[3],+a[4],+a[5]))},"px, ","px)","deg)"),Uc=wa(function(a){return null==a?Rc:(Jc||(Jc=document.createElementNS("http://www.w3.org/2000/svg","g")),Jc.setAttribute("transform",a),(a=Jc.transform.baseVal.consolidate())?(a=a.matrix,
  2. Sc(a.a,a.b,a.c,a.d,a.e,a.f)):Rc)},", ",")",")"),Vc=function(a,b,c){a.prototype=b.prototype=c,c.constructor=a},Wc="\\s*([+-]?\\d+)\\s*",Xc="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Yc="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zc=/^#([0-9a-f]{3,8})$/,$c=new RegExp("^rgb\\("+[Wc,Wc,Wc]+"\\)$"),_c=new RegExp("^rgb\\("+[Yc,Yc,Yc]+"\\)$"),ad=new RegExp("^rgba\\("+[Wc,Wc,Wc,Xc]+"\\)$"),bd=new RegExp("^rgba\\("+[Yc,Yc,Yc,Xc]+"\\)$"),cd=new RegExp("^hsl\\("+[Xc,Yc,Yc]+"\\)$"),dd=new RegExp("^hsla\\("+[Xc,Yc,Yc,Xc]+"\\)$"),ed={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};Vc(Ba,Ea,{copy:function(a){return Object.assign(new this.constructor,this,a)},displayable:function(){return this.rgb().displayable()},hex:Ca,formatHex:Ca,formatHsl:function(){return Oa(this).formatHsl()},formatRgb:Da,toString:Da}),Vc(Ja,Ia,Aa(Ba,{brighter:function(a){return a=null==a?1/.7:Math.pow(1/.7,a),new Ja(this.r*a,this.g*a,this.b*a,this.opacity)},darker:function(a){return a=null==a?.7:Math.pow(.7,a),new Ja(this.r*a,this.g*a,this.b*a,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ka,formatHex:Ka,formatRgb:La,toString:La})),Vc(Pa,function(a,b,c,d){return 1===arguments.length?Oa(a):new Pa(a,b,c,null==d?1:d)},Aa(Ba,{brighter:function(a){return a=null==a?1/.7:Math.pow(1/.7,a),new Pa(this.h,this.s,this.l*a,this.opacity)},darker:function(a){return a=null==a?.7:Math.pow(.7,a),new Pa(this.h,this.s,this.l*a,this.opacity)},rgb:function(){var a=this.h%360+360*(this.h<0),b=isNaN(a)||isNaN(this.s)?0:this.s,c=this.l,d=c+(c<.5?c:1-c)*b,e=2*c-d;return new Ja(Qa(a>=240?a-240:a+120,e,d),Qa(a,e,d),Qa(a<120?a+240:a-120,e,d),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var a=this.opacity;return(1===(a=isNaN(a)?1:Math.max(0,Math.min(1,a)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===a?")":", "+a+")")}}));var fd=function(a){return function(){return a}},gd=function a(b){function c(a,b){var c=d((a=Ia(a)).r,(b=Ia(b)).r),e=d(a.g,b.g),f=d(a.b,b.b),g=Ua(a.opacity,b.opacity);return function(b){return a.r=c(b),a.g=e(b),a.b=f(b),a.opacity=g(b),a+""}}var d=Ta(b);return c.gamma=a,c}(1);Va(function(a){var b=a.length-1;return function(c){var d=c<=0?c=0:c>=1?(c=1,b-1):Math.floor(c*b),e=a[d],f=a[d+1],g=d>0?a[d-1]:2*e-f,h=d<b-1?a[d+2]:2*f-e;return Ra((c-d/b)*b,g,e,f,h)}}),Va(function(a){var b=a.length;return function(c){var d=Math.floor(((c%=1)<0?++c:c)*b),e=a[(d+b-1)%b],f=a[d%b],g=a[(d+1)%b],h=a[(d+2)%b];return Ra((c-d/b)*b,e,f,g,h)}});var hd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,id=new RegExp(hd.source,"g"),jd=function(a,b){var c,d,e,f=hd.lastIndex=id.lastIndex=0,g=-1,h=[],i=[];for(a+="",b+="";(c=hd.exec(a))&&(d=id.exec(b));)(e=d.index)>f&&(e=b.slice(f,e),h[g]?h[g]+=e:h[++g]=e),(c=c[0])===(d=d[0])?h[g]?h[g]+=d:h[++g]=d:(h[++g]=null,i.push({i:g,x:Pc(c,d)})),f=id.lastIndex;return f<b.length&&(e=b.slice(f),h[g]?h[g]+=e:h[++g]=e),h.length<2?i[0]?function(a){return function(b){return a(b)+""}}(i[0].x):function(a){return function(){return a}}(b):(b=i.length,function(a){for(var c,d=0;d<b;++d)h[(c=i[d]).i]=c.x(a);return h.join("")})},kd=function(a,b){var c;return("number"==typeof b?Pc:b instanceof Ea?gd:(c=Ea(b))?(b=c,gd):jd)(a,b)},ld=jc.prototype.constructor,md=0,nd=jc.prototype;pb.prototype=function(a){return jc().transition(a)}.prototype={constructor:pb,select:function(a){var b=this._name,c=this._id;"function"!=typeof a&&(a=Zb(a));for(var d=this._groups,e=d.length,f=new Array(e),g=0;g<e;++g)for(var h,i,j=d[g],k=j.length,l=f[g]=new Array(k),m=0;m<k;++m)(h=j[m])&&(i=a.call(h,h.__data__,m,j))&&("__data__"in h&&(i.__data__=h.__data__),l[m]=i,Nc(l[m],b,c,m,l,va(h,c)));return new pb(f,this._parents,b,c)},selectAll:function(a){var b=this._name,c=this._id;"function"!=typeof a&&(a=$b(a));for(var d=this._groups,e=d.length,f=[],g=[],h=0;h<e;++h)for(var i,j=d[h],k=j.length,l=0;l<k;++l)if(i=j[l]){for(var m,n=a.call(i,i.__data__,l,j),o=va(i,c),p=0,q=n.length;p<q;++p)(m=n[p])&&Nc(m,b,c,p,n,o);f.push(n),g.push(i)}return new pb(f,g,b,c)},filter:function(a){"function"!=typeof a&&(a=_b(a));for(var b=this._groups,c=b.length,d=new Array(c),e=0;e<c;++e)for(var f,g=b[e],h=g.length,i=d[e]=[],j=0;j<h;++j)(f=g[j])&&a.call(f,f.__data__,j,g)&&i.push(f);return new pb(d,this._parents,this._name,this._id)},merge:function(a){if(a._id!==this._id)throw new Error;for(var b=this._groups,c=a._groups,d=b.length,e=c.length,f=Math.min(d,e),g=new Array(d),h=0;h<f;++h)for(var i,j=b[h],k=c[h],l=j.length,m=g[h]=new Array(l),n=0;n<l;++n)(i=j[n]||k[n])&&(m[n]=i);for(;h<d;++h)g[h]=b[h];return new pb(g,this._parents,this._name,this._id)},selection:function(){return new ld(this._groups,this._parents)},transition:function(){for(var a=this._name,b=this._id,c=qb(),d=this._groups,e=d.length,f=0;f<e;++f)for(var g,h=d[f],i=h.length,j=0;j<i;++j)if(g=h[j]){var k=va(g,b);Nc(g,a,c,j,h,{time:k.time+k.delay+k.duration,delay:0,duration:k.duration,ease:k.ease})}return new pb(d,this._parents,a,c)},call:nd.call,nodes:nd.nodes,node:nd.node,size:nd.size,empty:nd.empty,each:nd.each,on:function(a,b){var c=this._id;return arguments.length<2?va(this.node(),c).on.on(a):this.each(jb(c,a,b))},attr:function(a,b){var c=dc(a),d="transform"===c?Uc:kd;return this.attrTween(a,"function"==typeof b?(c.local?_a:$a)(c,d,za(this,"attr."+a,b)):null==b?(c.local?Xa:Wa)(c):(c.local?Za:Ya)(c,d,b))},attrTween:function(a,b){var c="attr."+a;if(arguments.length<2)return(c=this.tween(c))&&c._value;if(null==b)return this.tween(c,null);if("function"!=typeof b)throw new Error;var d=dc(a);return this.tween(c,(d.local?cb:db)(d,b))},style:function(a,b,c){var d="transform"==(a+="")?Tc:kd;return null==b?this.styleTween(a,function(a,b){var c,d,e;return function(){var f=s(this,a),g=(this.style.removeProperty(a),s(this,a));return f===g?null:f===c&&g===d?e:e=b(c=f,d=g)}}(a,d)).on("end.style."+a,kb(a)):"function"==typeof b?this.styleTween(a,function(a,b,c){var d,e,f;return function(){var g=s(this,a),h=c(this),i=h+"";return null==h&&(this.style.removeProperty(a),i=h=s(this,a)),g===i?null:g===d&&i===e?f:(e=i,f=b(d=g,h))}}(a,d,za(this,"style."+a,b))).each(function(a,b){var c,d,e,f,g="style."+b,h="end."+g;return function(){var i=ua(this,a),j=i.on,k=null==i.value[g]?f||(f=kb(b)):void 0;j===c&&e===k||(d=(c=j).copy()).on(h,e=k),i.on=d}}(this._id,a)):this.styleTween(a,function(a,b,c){var d,e,f=c+"";return function(){var g=s(this,a);return g===f?null:g===d?e:e=b(d=g,c)}}(a,d,b),c).on("end.style."+a,null)},styleTween:function(a,b,c){var d="style."+(a+="");if(arguments.length<2)return(d=this.tween(d))&&d._value;if(null==b)return this.tween(d,null);if("function"!=typeof b)throw new Error;return this.tween(d,mb(a,b,null==c?"":c))},text:function(a){return this.tween("text","function"==typeof a?function(a){return function(){var b=a(this);this.textContent=null==b?"":b}}(za(this,"text",a)):function(a){return function(){this.textContent=a}}(null==a?"":a+""))},textTween:function(a){var b="text";if(arguments.length<1)return(b=this.tween(b))&&b._value;if(null==a)return this.tween(b,null);if("function"!=typeof a)throw new Error;return this.tween(b,ob(a))},remove:function(){return this.on("end.remove",(a=this._id,function(){var b=this.parentNode;for(var c in this.__transition)if(+c!==a)return;b&&b.removeChild(this)}));var a},tween:function(a,b){var c=this._id;if(a+="",arguments.length<2){for(var d,e=va(this.node(),c).tween,f=0,g=e.length;f<g;++f)if((d=e[f]).name===a)return d.value;return null}return this.each((null==b?xa:ya)(c,a,b))},delay:function(a){var b=this._id;return arguments.length?this.each(("function"==typeof a?eb:fb)(b,a)):va(this.node(),b).delay},duration:function(a){var b=this._id;return arguments.length?this.each(("function"==typeof a?gb:hb)(b,a)):va(this.node(),b).duration},ease:function(a){var b=this._id;return arguments.length?this.each(ib(b,a)):va(this.node(),b).ease},end:function(){var a,b,c=this,d=c._id,e=c.size();return new Promise(function(f,g){var h={value:g},i={value:function(){0==--e&&f()}};c.each(function(){var c=ua(this,d),e=c.on;e!==a&&((b=(a=e).copy())._.cancel.push(h),b._.interrupt.push(h),b._.end.push(i)),c.on=b})})}};var od={time:null,delay:0,duration:250,ease:function(a){return((a*=2)<=1?a*a*a:(a-=2)*a*a+2)/2}};jc.prototype.interrupt=function(a){return this.each(function(){Oc(this,a)})},jc.prototype.transition=function(a){var b,c;a instanceof pb?(b=a._id,a=a._name):(b=qb(),(c=od).time=ma(),a=null==a?null:a+"");for(var d=this._groups,e=d.length,f=0;f<e;++f)for(var g,h=d[f],i=h.length,j=0;j<i;++j)(g=h[j])&&Nc(g,a,b,j,h,c||rb(g,b));return new pb(d,this._parents,a,b)};var pd=function(a){return function(){return a}};tb.prototype={constructor:tb,scale:function(a){return 1===a?this:new tb(this.k*a,this.x,this.y)},translate:function(a,b){return 0===a&0===b?this:new tb(this.k,this.x+this.k*a,this.y+this.k*b)},apply:function(a){return[a[0]*this.k+this.x,a[1]*this.k+this.y]},applyX:function(a){return a*this.k+this.x},applyY:function(a){return a*this.k+this.y},invert:function(a){return[(a[0]-this.x)/this.k,(a[1]-this.y)/this.k]},invertX:function(a){return(a-this.x)/this.k},invertY:function(a){return(a-this.y)/this.k},rescaleX:function(a){return a.copy().domain(a.range().map(this.invertX,this).map(a.invert,a))},rescaleY:function(a){return a.copy().domain(a.range().map(this.invertY,this).map(a.invert,a))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var qd=new tb(1,0,0);tb.prototype;var rd=function(){hc.preventDefault(),hc.stopImmediatePropagation()},sd=function(a){return function(){return a}};Bb.prototype.on=function(){var a=this._.on.apply(this._,arguments);return a===this._?this:a};var td=function(){function a(a){a.on("mousedown.drag",b).filter(p).on("touchstart.drag",e).on("touchmove.drag",f).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(){if(!l&&m.apply(this,arguments)){var a=h("mouse",n.apply(this,arguments),wc,this,arguments);a&&(kc(hc.view).on("mousemove.drag",c,!0).on("mouseup.drag",d,!0),rc(hc.view),ja(),k=!1,i=hc.clientX,j=hc.clientY,a("start"))}}function c(){if(qc(),!k){var a=hc.clientX-i,b=hc.clientY-j;k=a*a+b*b>t}q.mouse("drag")}function d(){kc(hc.view).on("mousemove.drag mouseup.drag",null),ka(hc.view,k),qc(),q.mouse("end")}function e(){if(m.apply(this,arguments)){var a,b,c=hc.changedTouches,d=n.apply(this,arguments),e=c.length;for(a=0;a<e;++a)(b=h(c[a].identifier,d,xc,this,arguments))&&(ja(),b("start"))}}function f(){var a,b,c=hc.changedTouches,d=c.length;for(a=0;a<d;++a)(b=q[c[a].identifier])&&(qc(),b("drag"))}function g(){var a,b,c=hc.changedTouches,d=c.length;for(l&&clearTimeout(l),l=setTimeout(function(){l=null},500),a=0;a<d;++a)(b=q[c[a].identifier])&&(ja(),b("end"))}function h(b,c,d,e,f){var g,h,i,j=d(c,b),k=r.copy();if(X(new Bb(a,"beforestart",g,b,s,j[0],j[1],0,0,k),function(){return null!=(hc.subject=g=o.apply(e,f))&&(h=g.x-j[0]||0,i=g.y-j[1]||0,!0)}))return function l(m){var n,o=j;switch(m){case"start":q[b]=l,n=s++;break;case"end":delete q[b],--s;case"drag":j=d(c,b),n=s}X(new Bb(a,m,g,b,n,j[0]+h,j[1]+i,j[0]-o[0],j[1]-o[1],k),k.apply,k,[m,e,f])}}var i,j,k,l,m=Cb,n=Db,o=Eb,p=Fb,q={},r=pc("start","drag","end"),s=0,t=0;return a.filter=function(b){return arguments.length?(m="function"==typeof b?b:sd(!!b),a):m},a.container=function(b){return arguments.length?(n="function"==typeof b?b:sd(b),a):n},a.subject=function(b){return arguments.length?(o="function"==typeof b?b:sd(b),a):o},a.touchable=function(b){return arguments.length?(p="function"==typeof b?b:sd(!!b),a):p},a.on=function(){var b=r.on.apply(r,arguments);return b===r?a:b},a.clickDistance=function(b){return arguments.length?(t=(b=+b)*b,a):Math.sqrt(t)},a},ud=Math.PI,vd=2*ud,wd=vd-1e-6;Gb.prototype=Hb.prototype={constructor:Gb,moveTo:function(a,b){this._+="M"+(this._x0=this._x1=+a)+","+(this._y0=this._y1=+b)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(a,b){this._+="L"+(this._x1=+a)+","+(this._y1=+b)},quadraticCurveTo:function(a,b,c,d){this._+="Q"+ +a+","+ +b+","+(this._x1=+c)+","+(this._y1=+d)},bezierCurveTo:function(a,b,c,d,e,f){this._+="C"+ +a+","+ +b+","+ +c+","+ +d+","+(this._x1=+e)+","+(this._y1=+f)},arcTo:function(a,b,c,d,e){a=+a,b=+b,c=+c,d=+d,e=+e;var f=this._x1,g=this._y1,h=c-a,i=d-b,j=f-a,k=g-b,l=j*j+k*k;if(e<0)throw new Error("negative radius: "+e);if(null===this._x1)this._+="M"+(this._x1=a)+","+(this._y1=b);else if(l>1e-6)if(Math.abs(k*h-i*j)>1e-6&&e){var m=c-f,n=d-g,o=h*h+i*i,p=m*m+n*n,q=Math.sqrt(o),r=Math.sqrt(l),s=e*Math.tan((ud-Math.acos((o+l-p)/(2*q*r)))/2),t=s/r,u=s/q;Math.abs(t-1)>1e-6&&(this._+="L"+(a+t*j)+","+(b+t*k)),this._+="A"+e+","+e+",0,0,"+ +(k*m>j*n)+","+(this._x1=a+u*h)+","+(this._y1=b+u*i)}else this._+="L"+(this._x1=a)+","+(this._y1=b)},arc:function(a,b,c,d,e,f){a=+a,b=+b,f=!!f;var g=(c=+c)*Math.cos(d),h=c*Math.sin(d),i=a+g,j=b+h,k=1^f,l=f?d-e:e-d;if(c<0)throw new Error("negative radius: "+c);null===this._x1?this._+="M"+i+","+j:(Math.abs(this._x1-i)>1e-6||Math.abs(this._y1-j)>1e-6)&&(this._+="L"+i+","+j),c&&(l<0&&(l=l%vd+vd),l>wd?this._+="A"+c+","+c+",0,1,"+k+","+(a-g)+","+(b-h)+"A"+c+","+c+",0,1,"+k+","+(this._x1=i)+","+(this._y1=j):l>1e-6&&(this._+="A"+c+","+c+",0,"+ +(l>=ud)+","+k+","+(this._x1=a+c*Math.cos(e))+","+(this._y1=b+c*Math.sin(e))))},rect:function(a,b,c,d){this._+="M"+(this._x0=this._x1=+a)+","+(this._y0=this._y1=+b)+"h"+ +c+"v"+ +d+"h"+-c+"Z"},toString:function(){return this._}};var xd=Hb,yd=function(a){return function(){return a}};Ib.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(a,b){switch(a=+a,b=+b,this._point){case 0:this._point=1,this._line?this._context.lineTo(a,b):this._context.moveTo(a,b);break;case 1:this._point=2;default:this._context.lineTo(a,b)}}};var zd=function(a){return new Ib(a)},Ad=c(1),Bd=c.n(Ad),Cd={entityStateReadOnly:{ACTIVE:!1,DELETED:!0,STATUS_ACTIVE:!1,STATUS_DELETED:!0}},Dd={nodeArrowDistance:24,refreshGraphForSafari:function(a){a.edgeEl.each(function(a){var b=this,c=$(this).find("pattern");setTimeout(function(a){$(b).find("defs").append(c)},500)})},refreshGraphForIE:function(a){var b=a.edgePathEl,c=0;b.each(function(a){var b=$(this).find("marker");$(this).find("marker").remove();var d=this;++c,setTimeout(function(a){$(d).find("defs").append(b),0===--c&&(this.$(".fontLoader").hide(),this.$("svg").fadeTo(1e3,1))},1e3)})},dragNode:function(a){var b=this,c=a.g,d=a.svg,e=a.guid,f=(a.edgePathEl,{dragmove:function(a,b){var d=this,e=kc(a),f=c.node(b),g=f.x,h=f.y;f.x+=hc.dx,f.y+=hc.dy,e.attr("transform","translate("+f.x+","+f.y+")");var i=f.x-g,j=f.y-h;c.edges().forEach(function(a){if(a.v==b||a.w==b){var e=c.edge(a.v,a.w);d.translateEdge(e,i,j),kc(e.elem).select("path").attr("d",d.calcPoints(a))}})},translateEdge:function(a,b,c){a.points.forEach(function(a){a.x=a.x+b,a.y=a.y+c})},calcPoints:function(a){var b=c.edge(a.v,a.w),d=c.node(a.v),e=c.node(a.w),f=b.points.slice(1,b.points.length-1);return b.points.slice(1,b.points.length-1),f.unshift(this.intersectRect(d,f[0])),f.push(this.intersectRect(e,f[f.length-1])),function(){function a(a){var h,i,j,k=a.length,l=!1;for(null==e&&(g=f(j=xd())),h=0;h<=k;++h)!(h<k&&d(i=a[h],h,a))===l&&((l=!l)?g.lineStart():g.lineEnd()),l&&g.point(+b(i,h,a),+c(i,h,a));if(j)return g=null,j+""||null}var b=Jb,c=Kb,d=yd(!0),e=null,f=zd,g=null;return a.x=function(c){return arguments.length?(b="function"==typeof c?c:yd(+c),a):b},a.y=function(b){return arguments.length?(c="function"==typeof b?b:yd(+b),a):c},a.defined=function(b){return arguments.length?(d="function"==typeof b?b:yd(!!b),a):d},a.curve=function(b){return arguments.length?(f=b,null!=e&&(g=f(e)),a):f},a.context=function(b){return arguments.length?(null==b?e=g=null:g=f(e=b),a):e},a}().x(function(a){return a.x}).y(function(a){return a.y}).curve(lc)(f)},intersectRect:function(a,c){var d=a.x,f=a.y,g=c.x-d,h=c.y-f,i=e?b.nodeArrowDistance+3:b.nodeArrowDistance,j=i,k=i,l=0,m=0;return Math.abs(h)*j>Math.abs(g)*k?(h<0&&(k=-k),l=0===h?0:k*g/h,m=k):(g<0&&(j=-j),l=j,m=0===g?0:j*h/g),{x:d+l,y:f+m}}}),g=td().on("drag",function(a){f.dragmove.call(f,this,a)}),h=td().on("drag",function(a){f.translateEdge(c.edge(a.v,a.w),hc.dx,hc.dy);var b=c.edge(a.v,a.w);kc(b.elem).select("path").attr("d",f.calcPoints(a))});g(d.selectAll("g.node")),h(d.selectAll("g.edgePath"))},zoomIn:function(a){var b=a.svg,c=a.scaleFactor,d=void 0===c?1.3:c;this.d3Zoom.scaleBy(b.transition().duration(750),d)},zoomOut:function(a){var b=a.svg,c=a.scaleFactor,d=void 0===c?.8:c;this.d3Zoom.scaleBy(b.transition().duration(750),d)},zoom:function(a){var b=a.svg,c=a.xa,d=a.ya,e=a.scale;b.transition().duration(750).call(this.d3Zoom.transform,qd.translate(c,d).scale(e))},fitToScreen:function(a){var b=a.svg,c=b.node(),d=c.getBBox(),e=c.parentElement,f=e.clientWidth,g=e.clientHeight,h=d.width,i=d.height,j=d.x+h/2,k=d.y+i/2,l=(l||.95)/Math.max(h/f,i/g),m=f/2-l*j,n=g/2-l*k;this.zoom({svg:b,xa:m,ya:n,scale:l})},centerNode:function(a){var b=a.guid,c=a.g,d=a.svg,e=a.svgGroupEl,f=(a.edgePathEl,a.width),g=a.height,h=a.fitToScreen,i=a.onCenterZoomed,j=a.isSelected;this.d3Zoom=function(){function a(a){a.property("__zoom",xb).on("wheel.zoom",h).on("mousedown.zoom",i).on("dblclick.zoom",j).filter(t).on("touchstart.zoom",k).on("touchmove.zoom",l).on("touchend.zoom touchcancel.zoom",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(a,b){return(b=Math.max(u[0],Math.min(u[1],b)))===a.k?a:new tb(b,a.x,a.y)}function c(a,b,c){var d=b[0]-c[0]*a.k,e=b[1]-c[1]*a.k;return d===a.x&&e===a.y?a:new tb(a.k,d,e)}function d(a){return[(+a[0][0]+ +a[1][0])/2,(+a[0][1]+ +a[1][1])/2]}function e(a,b,c){a.on("start.zoom",function(){f(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){f(this,arguments).end()}).tween("zoom",function(){var a=this,e=arguments,g=f(a,e),h=q.apply(a,e),i=null==c?d(h):"function"==typeof c?c.apply(a,e):c,j=Math.max(h[1][0]-h[0][0],h[1][1]-h[0][1]),k=a.__zoom,l="function"==typeof b?b.apply(a,e):b,m=x(k.invert(i).concat(j/k.k),l.invert(i).concat(j/l.k));return function(a){if(1===a)a=l;else{var b=m(a),c=j/b[2];a=new tb(c,i[0]-b[0]*c,i[1]-b[1]*c)}g.zoom(null,a)}})}function f(a,b,c){return!c&&a.__zooming||new g(a,b)}function g(a,b){this.that=a,this.args=b,this.active=0,this.extent=q.apply(a,b),this.taps=0}function h(){function a(){d.wheel=null,d.end()}if(p.apply(this,arguments)){var d=f(this,arguments),e=this.__zoom,g=Math.max(u[0],Math.min(u[1],e.k*Math.pow(2,s.apply(this,arguments)))),h=wc(this);if(d.wheel)d.mouse[0][0]===h[0]&&d.mouse[0][1]===h[1]||(d.mouse[1]=e.invert(d.mouse[0]=h)),clearTimeout(d.wheel);else{if(e.k===g)return;d.mouse=[h,e.invert(h)],Oc(this),d.start()}rd(),d.wheel=setTimeout(a,150),d.zoom("mouse",r(c(b(e,g),d.mouse[0],d.mouse[1]),d.extent,v))}}function i(){function a(){if(rd(),!d.moved){var a=hc.clientX-h,b=hc.clientY-i;d.moved=a*a+b*b>z}d.zoom("mouse",r(c(d.that.__zoom,d.mouse[0]=wc(d.that),d.mouse[1]),d.extent,v))}function b(){e.on("mousemove.zoom mouseup.zoom",null),ka(hc.view,d.moved),rd(),d.end()}if(!o&&p.apply(this,arguments)){var d=f(this,arguments,!0),e=kc(hc.view).on("mousemove.zoom",a,!0).on("mouseup.zoom",b,!0),g=wc(this),h=hc.clientX,i=hc.clientY;rc(hc.view),ub(),d.mouse=[g,this.__zoom.invert(g)],Oc(this),d.start()}}function j(){if(p.apply(this,arguments)){var d=this.__zoom,f=wc(this),g=d.invert(f),h=d.k*(hc.shiftKey?.5:2),i=r(c(b(d,h),f,g),q.apply(this,arguments),v);rd(),w>0?kc(this).transition().duration(w).call(e,i,f):kc(this).call(a.transform,i)}}function k(){if(p.apply(this,arguments)){var a,b,c,d,e=hc.touches,g=e.length,h=f(this,arguments,hc.changedTouches.length===g);for(ub(),b=0;b<g;++b)c=e[b],d=[d=xc(this,e,c.identifier),this.__zoom.invert(d),c.identifier],h.touch0?h.touch1||h.touch0[2]===d[2]||(h.touch1=d,h.taps=0):(h.touch0=d,a=!0,h.taps=1+!!n);n&&(n=clearTimeout(n)),a&&(h.taps<2&&(n=setTimeout(function(){n=null},500)),Oc(this),h.start())}}function l(){if(this.__zooming){var a,d,e,g,h=f(this,arguments),i=hc.changedTouches,j=i.length;for(rd(),n&&(n=clearTimeout(n)),h.taps=0,a=0;a<j;++a)d=i[a],e=xc(this,i,d.identifier),h.touch0&&h.touch0[2]===d.identifier?h.touch0[0]=e:h.touch1&&h.touch1[2]===d.identifier&&(h.touch1[0]=e);if(d=h.that.__zoom,h.touch1){var k=h.touch0[0],l=h.touch0[1],m=h.touch1[0],o=h.touch1[1],p=(p=m[0]-k[0])*p+(p=m[1]-k[1])*p,q=(q=o[0]-l[0])*q+(q=o[1]-l[1])*q;d=b(d,Math.sqrt(p/q)),e=[(k[0]+m[0])/2,(k[1]+m[1])/2],g=[(l[0]+o[0])/2,(l[1]+o[1])/2]}else{if(!h.touch0)return;e=h.touch0[0],g=h.touch0[1]}h.zoom("touch",r(c(d,e,g),h.extent,v))}}function m(){if(this.__zooming){var a,b,c=f(this,arguments),d=hc.changedTouches,e=d.length;for(ub(),o&&clearTimeout(o),o=setTimeout(function(){o=null},500),a=0;a<e;++a)b=d[a],c.touch0&&c.touch0[2]===b.identifier?delete c.touch0:c.touch1&&c.touch1[2]===b.identifier&&delete c.touch1;if(c.touch1&&!c.touch0&&(c.touch0=c.touch1,delete c.touch1),c.touch0)c.touch0[1]=this.__zoom.invert(c.touch0[0]);else if(c.end(),2===c.taps){var g=kc(this).on("dblclick.zoom");g&&g.apply(this,arguments)}}}var n,o,p=vb,q=wb,r=Ab,s=yb,t=zb,u=[0,1/0],v=[[-1/0,-1/0],[1/0,1/0]],w=250,x=tc,y=pc("start","zoom","end"),z=0;return a.transform=function(a,b,c){var d=a.selection?a.selection():a;d.property("__zoom",xb),a!==d?e(a,b,c):d.interrupt().each(function(){f(this,arguments).start().zoom(null,"function"==typeof b?b.apply(this,arguments):b).end()})},a.scaleBy=function(b,c,d){a.scaleTo(b,function(){var a=this.__zoom.k,b="function"==typeof c?c.apply(this,arguments):c;return a*b},d)},a.scaleTo=function(e,f,g){a.transform(e,function(){var a=q.apply(this,arguments),e=this.__zoom,h=null==g?d(a):"function"==typeof g?g.apply(this,arguments):g,i=e.invert(h),j="function"==typeof f?f.apply(this,arguments):f;return r(c(b(e,j),h,i),a,v)},g)},a.translateBy=function(b,c,d){a.transform(b,function(){return r(this.__zoom.translate("function"==typeof c?c.apply(this,arguments):c,"function"==typeof d?d.apply(this,arguments):d),q.apply(this,arguments),v)})},a.translateTo=function(b,c,e,f){a.transform(b,function(){var a=q.apply(this,arguments),b=this.__zoom,g=null==f?d(a):"function"==typeof f?f.apply(this,arguments):f;return r(qd.translate(g[0],g[1]).scale(b.k).translate("function"==typeof c?-c.apply(this,arguments):-c,"function"==typeof e?-e.apply(this,arguments):-e),a,v)},f)},g.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(a,b){return this.mouse&&"mouse"!==a&&(this.mouse[1]=b.invert(this.mouse[0])),this.touch0&&"touch"!==a&&(this.touch0[1]=b.invert(this.touch0[0])),this.touch1&&"touch"!==a&&(this.touch1[1]=b.invert(this.touch1[0])),this.that.__zoom=b,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){X(new sb(a,b,this.that.__zoom),y.apply,y,[b,this.that,this.args])}},a.wheelDelta=function(b){return arguments.length?(s="function"==typeof b?b:pd(+b),a):s},a.filter=function(b){return arguments.length?(p="function"==typeof b?b:pd(!!b),a):p},a.touchable=function(b){return arguments.length?(t="function"==typeof b?b:pd(!!b),a):t},a.extent=function(b){return arguments.length?(q="function"==typeof b?b:pd([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),a):q},a.scaleExtent=function(b){return arguments.length?(u[0]=+b[0],u[1]=+b[1],a):[u[0],u[1]]},a.translateExtent=function(b){return arguments.length?(v[0][0]=+b[0][0],v[1][0]=+b[1][0],v[0][1]=+b[0][1],v[1][1]=+b[1][1],a):[[v[0][0],v[0][1]],[v[1][0],v[1][1]]]},a.constrain=function(b){return arguments.length?(r=b,a):r},a.duration=function(b){return arguments.length?(w=+b,a):w},a.interpolate=function(b){return arguments.length?(x=b,a):x},a.on=function(){var b=y.on.apply(y,arguments);return b===y?a:b},a.clickDistance=function(b){return arguments.length?(z=(b=+b)*b,a):Math.sqrt(z)},a}(),d.call(this.d3Zoom).on("dblclick.zoom",null);var k=d.selectAll("g.nodes>g[id='"+b+"']"),l=(this.d3Zoom.scaleExtent([.01,50]).on("zoom",function(){e.attr("transform",hc.transform)}),null),m=null;if(k.empty()){if(h)return void this.fitToScreen({svg:d});l=c.graph().width/2,m=c.graph().height/2}else{var n=k.attr("transform").replace(/[^0-9\-.,]/g,"").split(",");l=n[0],m=n[1]}var o=-(1.2*l-f/2),p=-(1.2*m-g/2);this.zoom({svg:d,xa:o,ya:p,scale:1.2}),j?d.transition().duration(750).call(this.d3Zoom.transform,qd.translate(o,p).scale(1.2)):d.call(this.d3Zoom.transform,qd.translate(o,p).scale(1.2)),i&&i({newScale:1.2,newTranslate:[o,p],d3Zoom:this.d3Zoom,selectedNodeEl:k})},getToolTipDirection:function(a){var b=a.el,c=kc("body").node().getBoundingClientRect().width,d=kc(b).node().getBoundingClientRect(),e="e";return c-d.left<330?(e=c-d.left<330&&d.top<400?"sw":"w",c-d.left<330&&d.top>600&&(e="nw")):d.top>600?(e=c-d.left<330&&d.top>600?"nw":"n",d.left<50&&(e="ne")):d.top<400&&(e=d.left<50?"se":"s"),e},onHoverFade:function(a){var b=a.svg,c=a.g,d=a.mouseenter,e=a.nodesToHighlight,f=a.hoveredNode;return function(a){var e=b.selectAll(".node"),g=b.selectAll(".edgePath");if(d){b.classed("hover",!0);var h=c.successors(f),i=c.predecessors(f);a=h.concat(i),e.classed("hover-active-node",function(b,c,d){return!!function(a,b,c){if(a===c||b&&b.length&&-1!=b.indexOf(c))return!0}(f,a,b)}),g.classed("hover-active-path",function(a){return!!(a.v===f||a.w===f?1:0)})}else b.classed("hover",!1),e.classed("hover-active-node",!1),g.classed("hover-active-path",!1)}(e)},getBaseUrl:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.pathname;return a.replace(/\/[\w-]+.(jsp|html)|\/+$/gi,"")},getEntityIconPath:function(a){var b=a.entityData,c=a.errorUrl,d=a.imgBasePath,e=this.getBaseUrl()+(d||"/img/entity-icon/");if(b){var f=function(a){return e+(Cd.entityStateReadOnly[j]?"disabled/"+a:a)},g=function(){return k?Cd.entityStateReadOnly[j]?e+"disabled/process.png":e+"process.png":Cd.entityStateReadOnly[j]?e+"disabled/table.png":e+"table.png"},h=b.typeName,i=b.serviceType,j=b.status,k=b.isProcess;if(c){if(c.indexOf("table.png")>-1||c.indexOf("process.png")>-1)return null;var l=!(!c||!c.match("entity-icon/"+h+".png|disabled/"+h+".png"));return i&&l?f(i+".png"):g()}return h?f(h+".png"):i?f(i+".png"):g()}},base64Encode:function(a,b){var c=new FileReader;c.addEventListener("load",function(){return b(c.result)}),c.readAsDataURL(a)},imgShapeRender:function(a,b,c,d){function e(a){g.select('pattern[id="img_'+a.imgName+'"]').empty()&&g.append("pattern").attr("x","0%").attr("y","0%").attr("patternUnits","objectBoundingBox").attr("id","img_"+a.imgName).attr("width","100%").attr("height","100%").append("image").attr("href",function(b){var d=this;c&&!function b(e){var f=e.imagePath,g={url:f,method:"GET",cache:!0};p.attr("data-iconpath",f);var h=new XMLHttpRequest;h.onreadystatechange=function(){if(4===h.readyState)if(200===h.status)"IE"!==Bd.a.name?k.base64Encode(this.response,function(b){k.imageObject[a.imageIconPath]=b,kc(d).attr("xlink:href",b)}):k.imageObject[a.imageIconPath]=f,a.imageIconPath!==p.attr("data-iconpath")&&p.attr("data-iconpathorigin",a.imageIconPath);else if(404===h.status){var e=k.getEntityIconPath({entityData:c,errorUrl:f});if(null===e){var g=kc(d.parentElement);g.select("image").remove(),g.attr("patternContentUnits","objectBoundingBox").append("circle").attr("r","24px").attr("fill","#e8e8e8")}else b({imagePath:e})}},h.responseType="blob",h.open(g.method,g.url,!0),h.send(null)}({imagePath:a.imageIconPath})}).attr("x",a.leftPosition).attr("y",a.topPosition).attr("width",a.width).attr("height",a.height)}var f=d.dagreD3,g=d.defsEl,h=d.imgBasePath,i=d.guid,j=d.isRankdirToBottom,k=this,l=i,m=this.getEntityIconPath({entityData:c,imgBasePath:h}),n=m.split("/").pop();if(void 0===this.imageObject&&(this.imageObject={}),c.isDeleted&&(n="deleted_"+n),c.id==l)var o=!0;var p=a.append("circle").attr("fill","url(#img_"+n+")").attr("r",j?"30px":"24px").attr("data-stroke",c.id).attr("stroke-width","2px").attr("class","nodeImage "+(o?"currentNode":c.isProcess?"process":"node"));return o&&p.attr("stroke","#fb4200"),!0===c.isIncomplete&&(a.attr("class","node isIncomplete show"),a.insert("rect").attr("x","-5").attr("y","-23").attr("width","14").attr("height","16").attr("fill","url(#img_hourglass.svg)").attr("data-stroke",c.id).attr("stroke-width","2px"),e({imgName:"hourglass.svg",imageIconPath:"/img/entity-icon/hourglass.svg",leftPosition:"0",topPosition:"0",width:"12",height:"14"})),e({imgName:n,imageIconPath:m,leftPosition:j?"11":"4",topPosition:j?"20":o?"3":"4",width:"40",height:"40"}),c.intersect=function(a){return f.intersect.circle(c,o?k.nodeArrowDistance+3:k.nodeArrowDistance,a)},p},arrowPointRender:function(a,b,c,d,e){var f=e.dagreD3,g=a.node(),h=g?g.parentNode:a;kc(h).select("path.path").attr("marker-end","url(#"+b+")");var i=a.append("marker").attr("id",b).attr("viewBox","0 0 10 10").attr("refX",8).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",4).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",c.styleObj.stroke);f.util.applyStyle(i,c[d+"Style"]);
  3. },saveSvg:function(a){var b=a.svg,c=a.width,d=a.height,e=a.downloadFileName,f=a.onExportLineage,g=this,h=b.clone(!0).node();setTimeout(function(){"Firefox"===Bd.a.name&&(h.setAttribute("width",c),h.setAttribute("height",d));var a=kc("body").append("div");a.classed("hidden-svg",!0),a.node().appendChild(h);var b=kc(".hidden-svg svg");b.select("g").attr("transform","scale(1)"),b.select("foreignObject").remove();var i=150,j=150,k=h.getBBox().width+i,l=h.getBBox().height+j,m=h.getBBox().x,n=h.getBBox().y;h.attributes.viewBox.value=m+","+n+","+k+","+l;var o=document.createElement("canvas");o.id="canvas",o.style.display="none",o.width=1*h.getBBox().width+i,o.height=1*h.getBBox().height+j,kc("body").node().appendChild(o);var p=o.getContext("2d"),q=(new XMLSerializer).serializeToString(h),r=window.URL||window.webkitURL||window;p.fillStyle="#FFFFFF",p.fillRect(0,0,o.width,o.height),p.strokeRect(0,0,o.width,o.height),p.restore();var s=new Image(o.width,o.height),t=new Blob([q],{type:"image/svg+xml;base64"});"Safari"===Bd.a.name&&(t=new Blob([q],{type:"image/svg+xml"})),p.drawImage(s,50,50,o.width,o.height);var u=r.createObjectURL(t);s.onload=function(){try{var b=document.createElement("a");b.download=e,document.body.appendChild(b),p.drawImage(s,50,50,o.width,o.height),o.toBlob(function(a){a?(b.href=r.createObjectURL(a),a.size>1e7&&f({status:"failed",message:"The Image size is huge, please open the image in a browser!"}),b.click(),f({status:"Success",message:"Successful"}),"Safari"===Bd.a.name&&g.refreshGraphForSafari({edgeEl:g.$("svg g.node")})):f({status:"failed",message:"There was an error in downloading Lineage!"})},"image/png"),a.remove(),o.remove()}catch(a){f({status:"failed",message:"There was an error in downloading Lineage!"})}},s.src=u},0)}},Ed={getBaseUrl:function(a){return a.replace(/\/[\w-]+.(jsp|html)|\/+$/gi,"")},getEntityIconPath:function(){function a(a){return i+(Cd.entityStateReadOnly[d]?"disabled/"+a:a)}function b(){return g.isProcess?Cd.entityStateReadOnly[d]?i+"disabled/process.png":i+"process.png":Cd.entityStateReadOnly[d]?i+"disabled/table.png":i+"table.png"}var c,d,e,f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},g=f.entityData,h=f.errorUrl,i=this.getBaseUrl(window.location.pathname)+Globals.entityImgPath;if(g&&(e=g.typeName,c=g&&g.serviceType,d=g&&g.status),g){if(h){var j=!(!h||!h.match("entity-icon/"+e+".png|disabled/"+e+".png"));return c&&j?a(c+".png"):b()}return g.typeName?a(g.typeName+".png"):b()}},isProcess:function(a){var b=a.typeName,c=a.superTypes;return a.entityDef,"Process"==b||c.indexOf("Process")>-1},isDeleted:function(a){if(void 0!==a)return Cd.entityStateReadOnly[a.status]},isNodeToBeUpdated:function(a,b){var c=b.isProcessHideCheck,d=b.isDeletedEntityHideCheck,e={isProcess:c&&a.isProcess,isDeleted:d&&a.isDeleted};return e.update=e.isProcess||e.isDeleted,e},getServiceType:function(a){var b=a.typeName,c=a.entityDef,d=null;return b&&c&&(d=c.serviceType||null),d},getEntityDef:function(a){var b=a.typeName,c=a.entityDefCollection,d=null;return b&&(d=c.find(function(a){return a.name==b})),d},getNestedSuperTypes:function(a){var b=a.entityDef,c=a.entityDefCollection,d=new Set;return function a(b,c){b&&b.superTypes&&b.superTypes.length&&b.superTypes.forEach(function(b){d.add(b);var e=c.find(function(a){a.name});e&&a(e,c)})}(b,c),Array.from(d)},generateData:function(a){var b=this,c=a.data,d=void 0===c?{}:c,e=a.filterObj,f=a.entityDefCollection,g=a.g,h=a.guid,i=a.setGraphEdge,j=a.setGraphNode;return new Promise(function(a,c){try{var k=d.relations||{},l=d.guidEntityMap||{},m=e.isProcessHideCheck||e.isDeletedEntityHideCheck,n={fill:"none",stroke:"#ffb203",width:3},o=function(a){if(a){if(a.updatedValues)return a;var c=a.displayText?a.displayText:" ",d=Object.assign(a,{shape:"img",updatedValues:!0,label:c.trunc(18),toolTipLabel:c,id:a.guid,isLineage:!0,isIncomplete:a.isIncomplete,entityDef:b.getEntityDef({typeName:a.typeName,entityDefCollection:f})});return d.serviceType=b.getServiceType(d),d.superTypes=b.getNestedSuperTypes(Mb(Mb({},d),{},{entityDefCollection:f})),d.isProcess=b.isProcess(d),d.isDeleted=b.isDeleted(d),d}},p=function(a){return"fill:"+a.fill+";stroke:"+a.stroke+";stroke-width:"+a.width},q=function(a,c,d){var e=[];return a.forEach(function(a){if(b.isNodeToBeUpdated(o(l[a]),d).update)if(u[a])e=e.concat(u[a]);else{var c=function a(c,d){if(c&&v[c]){var e=[];return v[c].forEach(function(c){if(b.isNodeToBeUpdated(o(l[c]),d).update){var f=a(c,d);f&&(e=e.concat(f))}else e.push(c)}),e}return null}(a,d);c&&(e=e.concat(c))}else e.push(a)}),e},r=function(a){if(g._nodes[a])return g._nodes[a];var b=o(l[a]);return j(a,b),b},s=function(a,b){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i(a,b,Mb({arrowhead:"arrowPoint",curve:lc,style:p(n),styleObj:n},c))},t=function(a,b){r(a),r(b),s(a,b)},u={};if(m){var v=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=a.relations,c={};return b.forEach(function(a){c[a.fromEntityId]?c[a.fromEntityId].push(a.toEntityId):c[a.fromEntityId]=[a.toEntityId]}),c}(d);Object.keys(v).forEach(function(a){var c=v[a],d=b.isNodeToBeUpdated(o(l[a]),e),f=q(c,0,e);d.update?u[a]?u[a]=u[a].concat(f):u[a]=f:f.forEach(function(b){t(a,b)})})}else k.forEach(function(a){t(a.fromEntityId,a.toEntityId)});g._nodes[h]&&(g._nodes[h]&&(g._nodes[h].isLineage=!1),b.findImpactNodeAndUpdateData({guid:h,g:g,setEdge:s,getStyleObjStr:p})),a(g)}catch(a){c(a)}})},findImpactNodeAndUpdateData:function(a){var b=a.guid,c=a.getStyleObjStr,d=a.g,e=a.setEdge,f={},g={fill:"none",stroke:"#fb4200",width:3};!function a(){var b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},h=arguments.length>1?arguments[1]:void 0,i=Object.keys(b);i.length&&(f[h]||(f[h]=!0,i.forEach(function(b){d._nodes[b]&&(d._nodes[b].isLineage=!1),e(h,b,{style:c(g),styleObj:g}),a(d._sucs[b],b)})))}(d._sucs[b],b)}};String.prototype.trunc=String.prototype.trunc||function(a){return this.length>a?this.substr(0,a-1)+"...":this},Ob.prototype=Pb.prototype={constructor:Ob,has:function(a){return"$"+a in this},get:function(a){return this["$"+a]},set:function(a,b){return this["$"+a]=b,this},remove:function(a){var b="$"+a;return b in this&&delete this[b]},clear:function(){for(var a in this)"$"===a[0]&&delete this[a]},keys:function(){var a=[];for(var b in this)"$"===b[0]&&a.push(b.slice(1));return a},values:function(){var a=[];for(var b in this)"$"===b[0]&&a.push(this[b]);return a},entries:function(){var a=[];for(var b in this)"$"===b[0]&&a.push({key:b.slice(1),value:this[b]});return a},size:function(){var a=0;for(var b in this)"$"===b[0]&&++a;return a},empty:function(){for(var a in this)if("$"===a[0])return!1;return!0},each:function(a){for(var b in this)"$"===b[0]&&a(this[b],b.slice(1),this)}};var Fd=Pb,Gd=Fd.prototype;Qb.prototype=Rb.prototype={constructor:Qb,has:Gd.has,add:function(a){return this["$"+(a+="")]=a,this},remove:Gd.remove,clear:Gd.clear,values:Gd.keys,size:Gd.size,empty:Gd.empty,each:Gd.each},c(9);var Hd=function(){function a(b){var c=this;!function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}(this,a),this._setGraphNode=function(a,b){c.actualData[a]=Object.assign({},b),c.g.setNode(a,b)},this._setGraphEdge=function(a,b,d){c.g.setEdge(a,b,Ub({curve:lc},d))},this.options={},this._updateOptions(b);var d=this.options,e=d.el,f=d.manualTrigger,g=void 0!==f&&f;if(void 0===e)throw new Error("LineageHelper requires el propety to render the graph");return this.initReturnObj={init:function(a){return c.init(a)},updateOptions:function(a){return c._updateAllOptions(a)},createGraph:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return c._createGraph(c.options,c.graphOptions,a)},clear:function(a){return c.clear(a)},refresh:function(a){return c.refresh(a)},centerAlign:function(a){return c.centerAlign(a)},exportLineage:function(a){return c.exportLineage(a)},zoomIn:function(a){return c.zoomIn(a)},zoomOut:function(a){return c.zoomOut(a)},zoom:function(a){return c.zoom(a)},fullScreen:function(a){return c.fullScreen(a)},searchNode:function(a){return c.searchNode(a)},displayFullName:function(a){return c.displayFullName(a)},removeNodeSelection:function(a){return c.removeNodeSelection(a)},getGraphOptions:function(){return c.graphOptions},getNode:function(a,b){var d=null;return(d=b?c.actualData[a]:c.g._nodes[a])&&(d=Object.assign({},d)),d},getNodes:function(a,b){var d=null;return(d=b?c.actualData:c.g._nodes)&&(d=Object.assign({},d)),d},setNode:this._setGraphNode,setEdge:this._setGraphEdge},!1===g&&this.init(),this.initReturnObj}var b,c,d;return b=a,(c=[{key:"_updateAllOptions",value:function(a){Object.assign(this.options,a);var b=this.svg.node().getBoundingClientRect();this.graphOptions.width=this.options.width||b.width,this.graphOptions.height=this.options.height||b.height;var c=this.graphOptions,d=c.svg,e=c.width,f=c.height,g=c.guid,h=this.options.fitToScreen;d.select("g").node().removeAttribute("transform"),d.attr("viewBox","0 0 "+e+" "+f).attr("enable-background","new 0 0 "+e+" "+f),this.centerAlign({fitToScreen:h,guid:g})}},{key:"_updateOptions",value:function(a){Object.assign(this.options,{filterObj:{isProcessHideCheck:!1,isDeletedEntityHideCheck:!1}},a)}},{key:"init",value:function(){var a=this.options.data,b=void 0===a?{}:a;b.baseEntityGuid&&(this.guid=b.baseEntityGuid),this._initializeGraph(),this._initGraph()}},{key:"clear",value:function(){this.options.el||(this.svg.remove(),this.svg=null),this.g=null,this.graphOptions={}}},{key:"centerAlign",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=this.svg.select("g"),c=b.selectAll("g.edgePath");Dd.centerNode(Ub(Ub({},this.graphOptions),{},{svgGroupEl:b,edgePathEl:c},a))}},{key:"zoomIn",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Dd.zoomIn(Ub(Ub({},this.graphOptions),a))}},{key:"zoomOut",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Dd.zoomOut(Ub(Ub({},this.graphOptions),a))}},{key:"zoom",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Dd.zoom(Ub(Ub({},this.graphOptions),a))}},{key:"displayFullName",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=this;this.g.nodes().forEach(function(c){var d=b.svg.selectAll("g.nodes>g[id='"+c+"']"),e=b.g.node(c).toolTipLabel;1==a.bLabelFullText?d.select("tspan").text(e):d.select("tspan").text(e.trunc(18))}),this.selectedNode&&this.searchNode({guid:this.selectedNode})}},{key:"refresh",value:function(){this.clear(),this._initializeGraph(),this._initGraph({refresh:!0}),this.selectedNode=""}},{key:"removeNodeSelection",value:function(){this.svg.selectAll("g.node>circle").classed("node-detail-highlight",!1)}},{key:"searchNode",value:function(a){var b=a.guid,c=a.onSearchNode;this.svg.selectAll(".serach-rect").remove(),this.svg.selectAll(".label").attr("stroke","none"),this.selectedNode=b,this.centerAlign({guid:b,onCenterZoomed:function(a){var b=a.selectedNodeEl,d=b.node().getBBox(),e=d.width+10,f=d.x-5;b.select(".label").attr("stroke","#316132"),b.select("circle").classed("wobble",!0),b.insert("rect","circle").attr("class","serach-rect").attr("stroke","#37bb9b").attr("stroke-width","2.5px").attr("fill","none").attr("x",f).attr("y",-27.5).attr("width",e).attr("height",60),c&&"function"==typeof c&&c(a)},isSelected:!0})}},{key:"exportLineage",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=a.downloadFileName;if(void 0===b){var c=this.g._nodes[this.guid];b=c&&c.attributes?"".concat(c.attributes.qualifiedName||c.attributes.name||"lineage_export",".png"):"export.png"}Dd.saveSvg(Ub(Ub({},this.graphOptions),{},{downloadFileName:b,onExportLineage:function(a){function b(b){return a.apply(this,arguments)}return b.toString=function(){return a.toString()},b}(function(b){a.onExportLineage&&onExportLineage(b)})}))}},{key:"fullScreen",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=a.el;if(void 0===b)throw new Error("LineageHelper requires el propety to apply fullScreen class");var c=kc(b);return c.classed("fullscreen-mode")?(c.classed("fullscreen-mode",!1),!1):(c.classed("fullscreen-mode",!0),!0)}},{key:"_getValueFromUser",value:function(a){if(void 0!==a)return"function"==typeof a?a():a}},{key:"_initializeGraph",value:function(){var a=this.options,b=a.width,c=void 0===b?"100%":b,d=a.height,e=void 0===d?"100%":d,f=a.el;this.svg=kc(f),f instanceof SVGElement||(this.svg.selectAll("*").remove(),this.svg=this.svg.append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr(" xmlns:xlink","http://www.w3.org/1999/xlink").attr("version","1.1").attr("width",c).attr("height",e)),this.g=(new Yb.a.graphlib.Graph).setGraph(Object.assign({nodesep:50,ranksep:90,rankdir:"LR",marginx:20,marginy:20,transition:function(a){return a.transition().duration(500)}},this.options.dagreOptions)).setDefaultEdgeLabel(function(){return{}});var g=this.svg.node().getBoundingClientRect();this.actualData={},this.graphOptions={svg:this.svg,g:this.g,dagreD3:Yb.a,guid:this.guid,width:this.options.width||g.width,height:this.options.height||g.height}}},{key:"_initGraph",value:function(){var a=this,b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=b.refresh;this.svg&&this.svg.select("g").remove();var d=this.options.filterObj;if(this.options.getFilterObj){var e=this.options.getFilterObj();if(void 0!==e||null!==e){if("object"!==Sb(e))throw new Error("getFilterObj expect return type `object`,`null` or `Undefined`");d=e}}if(!0!==this.options.setDataManually)return void 0===this.options.data||this.options.data&&0===this.options.data.relations.length?(this.options.beforeRender&&this.options.beforeRender(),this.svg.append("text").attr("x","50%").attr("y","50%").attr("alignment-baseline","middle").attr("text-anchor","middle").text("No lineage data found"),void(this.options.afterRender&&this.options.afterRender())):Ed.generateData(Ub(Ub(Ub({},this.options),{},{filterObj:d},this.graphOptions),{},{setGraphNode:this._setGraphNode,setGraphEdge:this._setGraphEdge})).then(function(b){a._createGraph(a.options,a.graphOptions,{refresh:c})})}},{key:"_createGraph",value:function(a,b,c){var d=this,e=a.data,f=void 0===e?{}:e,g=a.imgBasePath,h=a.isShowTooltip,i=a.isShowHoverPath,j=a.onLabelClick,k=a.onPathClick,l=a.onNodeClick,m=a.zoom,n=a.fitToScreen,o=a.getToolTipContent,p=a.toolTipTitle,q=c.refresh;this.options.beforeRender&&this.options.beforeRender(),this.selectedNode="";var r=this,s=b.svg,t=b.g,u=b.width,v=b.height,w=this.options.dagreOptions&&"tb"===this.options.dagreOptions.rankdir;if(s instanceof jc==0)throw new Error("svg is not initialized or something went wrong while creatig graph instance");if(void 0!==t._nodes&&0!==t._nodes.length){t.nodes().forEach(function(a){var b=t.node(a);b&&(b.rx=b.ry=5)}),s.attr("viewBox","0 0 "+u+" "+v).attr("enable-background","new 0 0 "+u+" "+v);var x=s.append("g"),y=s.append("defs"),z=new Yb.a.render;z.arrows().arrowPoint=function(){return Dd.arrowPointRender.apply(Dd,Array.prototype.slice.call(arguments).concat([Ub({},b)]))},z.shapes().img=function(){return Dd.imgShapeRender.apply(Dd,Array.prototype.slice.call(arguments).concat([Ub(Ub({},b),{},{isRankdirToBottom:w,imgBasePath:r._getValueFromUser(g),defsEl:y})]))};var A=function(){function a(a){(k=function(a){var b=a.node();return b?"svg"===b.tagName.toLowerCase()?b:b.ownerSVGElement:null}(a))&&(l=k.createSVGPoint(),i.appendChild(j))}function b(){var a=kc(document.createElement("div"));return a.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),a.node()}function c(){return null==j&&(j=b(),i.appendChild(j)),kc(j)}function d(a){for(var b=m||a;null==b.getScreenCTM&&null!=b.parentNode;)b=b.parentNode;var c={},d=b.getScreenCTM(),e=b.getBBox(),f=e.width,g=e.height,h=e.x,i=e.y;return l.x=h,l.y=i,c.nw=l.matrixTransform(d),l.x+=f,c.ne=l.matrixTransform(d),l.y+=g,c.se=l.matrixTransform(d),l.x-=f,c.sw=l.matrixTransform(d),l.y-=g/2,c.w=l.matrixTransform(d),l.x+=f,c.e=l.matrixTransform(d),l.x-=f/2,l.y-=g/2,c.n=l.matrixTransform(d),l.y+=g,c.s=l.matrixTransform(d),c}function e(a){return"function"==typeof a?a:function(){return a}}var f=function(){return"n"},g=function(){return[0,0]},h=function(){return" "},i=document.body,j=b(),k=null,l=null,m=null;a.show=function(){var b=Array.prototype.slice.call(arguments);b[b.length-1]instanceof SVGElement&&(m=b.pop());var d,e=h.apply(this,b),j=g.apply(this,b),k=f.apply(this,b),l=c(),p=o.length,q=document.documentElement.scrollTop||i.scrollTop,r=document.documentElement.scrollLeft||i.scrollLeft;for(l.html(e).style("opacity",1).style("pointer-events","all");p--;)l.classed(o[p],!1);return d=n.get(k).apply(this),l.classed(k,!0).style("top",d.top+j[0]+q+"px").style("left",d.left+j[1]+r+"px"),a},a.hide=function(){return c().style("opacity",0).style("pointer-events","none"),a},a.attr=function(b,d){if(arguments.length<2&&"string"==typeof b)return c().attr(b);var e=Array.prototype.slice.call(arguments);return jc.prototype.attr.apply(c(),e),a},a.style=function(b,d){if(arguments.length<2&&"string"==typeof b)return c().style(b);var e=Array.prototype.slice.call(arguments);return jc.prototype.style.apply(c(),e),a},a.direction=function(b){return arguments.length?(f=null==b?b:e(b),a):f},a.offset=function(b){return arguments.length?(g=null==b?b:e(b),a):g},a.html=function(b){return arguments.length?(h=null==b?b:e(b),a):h},a.rootElement=function(b){return arguments.length?(i=null==b?b:e(b),a):i},a.destroy=function(){return j&&(c().remove(),j=null),a};var n=Fd({n:function(){var a=d(this);return{top:a.n.y-j.offsetHeight,left:a.n.x-j.offsetWidth/2}},s:function(){var a=d(this);return{top:a.s.y,left:a.s.x-j.offsetWidth/2}},e:function(){var a=d(this);return{top:a.e.y-j.offsetHeight/2,left:a.e.x}},w:function(){var a=d(this);return{top:a.w.y-j.offsetHeight/2,left:a.w.x-j.offsetWidth}},nw:function(){var a=d(this);return{top:a.nw.y-j.offsetHeight,left:a.nw.x-j.offsetWidth}},ne:function(){var a=d(this);return{top:a.ne.y-j.offsetHeight,left:a.ne.x}},sw:function(){var a=d(this);return{top:a.sw.y,left:a.sw.x-j.offsetWidth}},se:function(){var a=d(this);return{top:a.se.y,left:a.se.x}}}),o=n.keys();return a}().attr("class","d3-tip").offset([10,0]).html(function(a){if(o&&"function"==typeof o)return o(a,t.node(a));var b=t.node(a),c="";return p?c="<h5 style='text-align: center;'>"+p+"</h5>":b.id!==d.guid&&(c="<h5 style='text-align: center;'>"+(b.isLineage?"Lineage":"Impact")+"</h5>"),c+="<h5 class='text-center'><span style='color:#359f89'>"+b.toolTipLabel+"</span></h5> ",b.typeName&&(c+="<h5 class='text-center'><span>("+b.typeName+")</span></h5> "),b.queryText&&(c+="<h5>Query: <span style='color:#359f89'>"+b.queryText+"</span></h5> "),"<div class='tip-inner-scroll'>"+c+"</div>"});s.call(A),z(x,t),x.selectAll("g.nodes g.label").attr("transform",function(){return w?"translate(2,-20)":"translate(2,-38)"}).attr("font-size","10px").on("mouseenter",function(a){hc.preventDefault(),kc(this).classed("highlight",!0)}).on("mouseleave",function(a){hc.preventDefault(),kc(this).classed("highlight",!1)}).on("click",function(a){hc.preventDefault(),j&&"function"==typeof j&&j({clickedData:a}),A.hide(a)}),x.selectAll("g.nodes g.node circle").on("mouseenter",function(a,c,d){if(r.activeNode=!0,this.getScreenCTM().translate(+this.getAttribute("cx"),+this.getAttribute("cy")),r.svg.selectAll(".node").classed("active",!1),kc(this).classed("active",!0),r._getValueFromUser(h)){var e=Dd.getToolTipDirection({el:this});A.direction(e).show(a,this)}!1!==r._getValueFromUser(i)&&Dd.onHoverFade(Ub({opacity:.3,mouseenter:!0,hoveredNode:a},b))}).on("mouseleave",function(a){r.activeNode=!1;var c=this;setTimeout(function(b){r.activeTip||r.activeNode||(kc(c).classed("active",!1),r._getValueFromUser(h)&&A.hide(a))},150),!1!==r._getValueFromUser(i)&&Dd.onHoverFade(Ub({mouseenter:!1,hoveredNode:a},b))}).on("click",function(a){hc.defaultPrevented||(hc.preventDefault(),A.hide(a),s.selectAll("g.node>circle").classed("node-detail-highlight",!1),kc(this).classed("node-detail-highlight",!0),l&&"function"==typeof l&&l({clickedData:a,el:this}))});var B=x.selectAll("g.edgePath");B.selectAll("path.path").on("click",function(a){if(k&&"function"==typeof k){var b=f.relations.find(function(b){if(b.fromEntityId===a.v&&b.toEntityId===a.w)return!0});k({pathRelationObj:b,clickedData:a})}}),!1!==m&&Dd.centerNode(Ub(Ub({},b),{},{fitToScreen:n,svgGroupEl:x,edgePathEl:B})),Dd.dragNode(Ub(Ub({},b),{},{edgePathEl:B})),!0!==q&&this._addLegend(),this.options.afterRender&&this.options.afterRender()}else s.html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relations to display</text>')}},{key:"_addLegend",value:function(){if(!1!==this.options.legends){var a=kc(this.options.legendsEl||this.options.el).insert("div",":first-child").classed("legends",!0),b=a.append("span").style("color","#fb4200");b.append("i").classed("fa fa-circle-o fa-fw",!0),b.append("span").html("Current Entity"),(b=a.append("span").style("color","#686868")).append("i").classed("fa fa-hourglass-half fa-fw",!0),b.append("span").html("In Progress"),(b=a.append("span").style("color","#df9b00")).append("i").classed("fa fa-long-arrow-right fa-fw",!0),b.append("span").html("Lineage"),(b=a.append("span").style("color","#fb4200")).append("i").classed("fa fa-long-arrow-right fa-fw",!0),b.append("span").html("Impact")}}}])&&Wb(b.prototype,c),d&&Wb(b,d),a}()}])});