@nebula.js/sn-org-chart 0.13.0 → 0.16.0

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.
@@ -1,7 +1,7 @@
1
1
  /*
2
- * @nebula.js/sn-org-chart v0.13.0
3
- * Copyright (c) 2020 QlikTech International AB
2
+ * @nebula.js/sn-org-chart v0.16.0
3
+ * Copyright (c) 2022 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],n):(t=t||self)["sn-org-chart"]=n(t.stardust)}(this,(function(t){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function e(t,n,e,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void e(t)}s.done?n(u):Promise.resolve(u).then(r,o)}function r(t){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function s(t){e(a,o,i,s,u,"next",t)}function u(t){e(a,o,i,s,u,"throw",t)}s(void 0)}))}}function o(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function i(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function a(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?i(Object(e),!0).forEach((function(n){o(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):i(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function s(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var e=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(e.push(a.value),!n||e.length!==n);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return e}(t,n)||c(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||c(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,n){if(t){if("string"==typeof t)return l(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?l(t,n):void 0}}function l(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}var h={qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:5,qHeight:500}],qSuppressZero:!1,qSuppressMissing:!0},showTitles:!0,title:"",subtitle:"",footnote:"",navigationMode:"free",resizeOnExpand:!1,style:{fontColor:{colorType:"auto",color:{index:-1,color:"#484848"},colorExpression:""},backgroundColor:{colorType:"colorPicker",color:{index:-1,color:"#ffffff"},colorExpression:""},border:{top:!0,fullBorder:!0,colorType:"auto",color:{index:-1,color:"#737373"},colorExpression:""}}},f={targets:[{path:"/qHyperCubeDef",dimensions:{min:2,max:2},measures:{min:0,max:1}}]};var d={getValue:function(t,n,e){var r,o=n.split(".");if(void 0===t)return e;var i=t;for(r=0;r<o.length;++r){if(void 0===i[o[r]])return e;i=i[o[r]]}return i}},p=[{value:"auto",translation:"Common.Auto"},{value:"colorPicker",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],g=function(t){return d.getValue(t,"style.border.top")||d.getValue(t,"style.border.fullBorder")},m={definition:{type:"items",component:"accordion",items:{data:{uses:"data",items:{measures:{disabledRef:""},dimensions:{disabledRef:"",items:{dimensionLimits:{show:!1},attributes:{component:"attribute-expression-reference",defaultValue:[],show:function(t,n){return n.getDimensions()[0]===t},ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",translation:"Object.OrgChart.LabelExpression",defaultValue:"",id:"labelExpression",tid:"labelExpression"},{component:"expression",ref:"qExpression",translation:"Object.OrgChart.SubLabelExpression",defaultValue:"",id:"subLabelExpression",tid:"subLabelExpression"},{component:"expression",ref:"qExpression",translation:"Object.OrgChart.ExtraLabelExpression",defaultValue:"",id:"extraLabelExpression",tid:"extraLabelExpression"},{component:"expression",ref:"qExpression",translation:"Object.OrgChart.ColorLabelExpression",defaultValue:"",id:"colorByExpression",tid:"nodeColorByExpression"}]},desc:{show:function(t,n){return n.getDimensions()[0]===t},component:"text",translation:"Object.OrgChart.ExtraLabelDesc",style:"hint"}}}}},sorting:{uses:"sorting"},addOns:{type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"},rowLimit:{type:"integer",translation:"$RowLimit",ref:"rowLimit",defaultValue:3e4,min:5e3,max:1e5,show:!1}}}}},settings:{uses:"settings",items:{styling:{grouped:!0,translation:"properties.presentation",type:"items",items:{navigation:{type:"items",items:{navigationMode:{ref:"navigationMode",type:"string",translation:"Object.OrgChart.NavigationMode",component:"dropdown",options:[{value:"free",translation:"Object.OrgChart.FreeMode"},{value:"expandAll",translation:"Object.OrgChart.ExpandAll"}]},resizeOnExpand:{ref:"resizeOnExpand",type:"boolean",translation:"Object.OrgChart.resizeOnExpand",show:function(t){return"expandAll"!==d.getValue(t,"navigationMode")}}}},backgroundColor:{type:"items",items:{useColorExpression:{ref:"style.backgroundColor.colorType",type:"string",translation:"Object.OrgChart.BackgroundColor",component:"dropdown",options:p},colorPicker:{component:"color-picker",type:"object",ref:"style.backgroundColor.color",translation:"properties.color",dualOutput:!0,show:function(t){return"colorPicker"===d.getValue(t,"style.backgroundColor.colorType")}},colorExpression:{component:"string",type:"string",ref:"style.backgroundColor.colorExpression",translation:"Common.Expression",expression:"optional",show:function(t){return"byExpression"===d.getValue(t,"style.backgroundColor.colorType")}}}},fontColor:{type:"items",items:{useColorExpression:{ref:"style.fontColor.colorType",type:"string",translation:"Object.OrgChart.FontColor",component:"dropdown",options:p},colorPicker:{component:"color-picker",type:"object",ref:"style.fontColor.color",translation:"properties.color",dualOutput:!0,show:function(t){return"colorPicker"===d.getValue(t,"style.fontColor.colorType")}},colorExpression:{component:"string",type:"string",ref:"style.fontColor.colorExpression",translation:"Common.Expression",expression:"optional",show:function(t){return"byExpression"===d.getValue(t,"style.fontColor.colorType")}}}},border:{type:"items",items:{appearanceHeader:{component:"text",translation:"Object.OrgChart.CardAppearance",style:"pp-nm-hcd__list-header"},topBar:{type:"boolean",ref:"style.border.top",translation:"Object.OrgChart.TopBar",defaultValue:!0},fullBorder:{type:"boolean",ref:"style.border.fullBorder",translation:"properties.border",defaultValue:!1},colorType:{component:"dropdown",type:"string",ref:"style.border.colorType",translation:"properties.border.color",defaultValue:"auto",options:p,show:function(t){return g(t)}},colorPicker:{component:"color-picker",type:"object",ref:"style.border.color",translation:"properties.color",dualOutput:!0,show:function(t){return g(t)&&"colorPicker"===d.getValue(t,"style.border.colorType")}},colorExpression:{component:"string",type:"string",ref:"style.border.colorExpression",translation:"Common.Expression",expression:"optional",show:function(t){return g(t)&&"byExpression"===d.getValue(t,"style.border.colorType")}}}}}}}}}},support:{export:!0,exportData:!0,snapshot:!0,viewData:!0}};function y(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}1===(v=y).length&&(b=v,v=function(t,n){return y(b(t),n)});var v,b,x={value:function(){}};function w(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new _(r)}function _(t){this._=t}function k(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function C(t,n){for(var e,r=0,o=t.length;r<o;++r)if((e=t[r]).name===n)return e.value}function E(t,n,e){for(var r=0,o=t.length;r<o;++r)if(t[r].name===n){t[r]=x,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}_.prototype=w.prototype={constructor:_,on:function(t,n){var e,r=this._,o=k(t+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++i<a;)if(e=(t=o[i]).type)r[e]=E(r[e],t.name,n);else if(null==n)for(e in r)r[e]=E(r[e],t.name,null);return this}for(;++i<a;)if((e=(t=o[i]).type)&&(e=C(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new _(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,o=new Array(e),i=0;i<e;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,e=(r=this._[t]).length;i<e;++i)r[i].value.apply(n,o)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(n,e)}};var M="http://www.w3.org/1999/xhtml",L={svg:"http://www.w3.org/2000/svg",xhtml:M,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function O(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),L.hasOwnProperty(n)?{space:L[n],local:t}:t}function S(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===M&&n.documentElement.namespaceURI===M?n.createElement(t):n.createElementNS(e,t)}}function A(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function z(t){var n=O(t);return(n.local?A:S)(n)}function q(){}function T(t){return null==t?q:function(){return this.querySelector(t)}}function N(){return[]}function j(t){return null==t?N:function(){return this.querySelectorAll(t)}}function D(t){return function(){return this.matches(t)}}function P(t){return new Array(t.length)}function I(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}I.prototype={constructor:I,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function H(t,n,e,r,o,i){for(var a,s=0,u=n.length,c=i.length;s<c;++s)(a=n[s])?(a.__data__=i[s],r[s]=a):e[s]=new I(t,i[s]);for(;s<u;++s)(a=n[s])&&(o[s]=a)}function B(t,n,e,r,o,i,a){var s,u,c,l={},h=n.length,f=i.length,d=new Array(h);for(s=0;s<h;++s)(u=n[s])&&(d[s]=c="$"+a.call(u,u.__data__,s,n),c in l?o[s]=u:l[c]=u);for(s=0;s<f;++s)(u=l[c="$"+a.call(t,i[s],s,i)])?(r[s]=u,u.__data__=i[s],l[c]=null):e[s]=new I(t,i[s]);for(s=0;s<h;++s)(u=n[s])&&l[d[s]]===u&&(o[s]=u)}function V(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function R(t){return function(){this.removeAttribute(t)}}function Z(t){return function(){this.removeAttributeNS(t.space,t.local)}}function $(t,n){return function(){this.setAttribute(t,n)}}function X(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function W(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function Y(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function U(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function F(t){return function(){this.style.removeProperty(t)}}function G(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Q(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function K(t,n){return t.style.getPropertyValue(n)||U(t).getComputedStyle(t,null).getPropertyValue(n)}function J(t){return function(){delete this[t]}}function tt(t,n){return function(){this[t]=n}}function nt(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function et(t){return t.trim().split(/^|\s+/)}function rt(t){return t.classList||new ot(t)}function ot(t){this._node=t,this._names=et(t.getAttribute("class")||"")}function it(t,n){for(var e=rt(t),r=-1,o=n.length;++r<o;)e.add(n[r])}function at(t,n){for(var e=rt(t),r=-1,o=n.length;++r<o;)e.remove(n[r])}function st(t){return function(){it(this,t)}}function ut(t){return function(){at(this,t)}}function ct(t,n){return function(){(n.apply(this,arguments)?it:at)(this,t)}}function lt(){this.textContent=""}function ht(t){return function(){this.textContent=t}}function ft(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function dt(){this.innerHTML=""}function pt(t){return function(){this.innerHTML=t}}function gt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function mt(){this.nextSibling&&this.parentNode.appendChild(this)}function yt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vt(){return null}function bt(){var t=this.parentNode;t&&t.removeChild(this)}function xt(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function wt(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}ot.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var _t={},kt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(_t={mouseenter:"mouseover",mouseleave:"mouseout"}));function Ct(t,n,e){return t=Et(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function Et(t,n,e){return function(r){var o=kt;kt=r;try{t.call(this,this.__data__,n,e)}finally{kt=o}}}function Mt(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function Lt(t){return function(){var n=this.__on;if(n){for(var e,r=0,o=-1,i=n.length;r<i;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++o]=e:this.removeEventListener(e.type,e.listener,e.capture);++o?n.length=o:delete this.__on}}}function Ot(t,n,e){var r=_t.hasOwnProperty(t.type)?Ct:Et;return function(o,i,a){var s,u=this.__on,c=r(n,i,a);if(u)for(var l=0,h=u.length;l<h;++l)if((s=u[l]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=c,s.capture=e),void(s.value=n);this.addEventListener(t.type,c,e),s={type:t.type,name:t.name,value:n,listener:c,capture:e},u?u.push(s):this.__on=[s]}}function St(t,n,e){var r=U(t),o=r.CustomEvent;"function"==typeof o?o=new o(n,e):(o=r.document.createEvent("Event"),e?(o.initEvent(n,e.bubbles,e.cancelable),o.detail=e.detail):o.initEvent(n,!1,!1)),t.dispatchEvent(o)}function At(t,n){return function(){return St(this,t,n)}}function zt(t,n){return function(){return St(this,t,n.apply(this,arguments))}}var qt=[null];function Tt(t,n){this._groups=t,this._parents=n}function Nt(){return new Tt([[document.documentElement]],qt)}function jt(t){return"string"==typeof t?new Tt([[document.querySelector(t)]],[document.documentElement]):new Tt([[t]],qt)}function Dt(){for(var t,n=kt;t=n.sourceEvent;)n=t;return n}function Pt(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var o=t.getBoundingClientRect();return[n.clientX-o.left-t.clientLeft,n.clientY-o.top-t.clientTop]}function It(t){var n=Dt();return n.changedTouches&&(n=n.changedTouches[0]),Pt(t,n)}function Ht(t,n,e){arguments.length<3&&(e=n,n=Dt().changedTouches);for(var r,o=0,i=n?n.length:0;o<i;++o)if((r=n[o]).identifier===e)return Pt(t,r);return null}function Bt(){kt.preventDefault(),kt.stopImmediatePropagation()}function Vt(t){var n=t.document.documentElement,e=jt(t).on("dragstart.drag",Bt,!0);"onselectstart"in n?e.on("selectstart.drag",Bt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Rt(t,n){var e=t.document.documentElement,r=jt(t).on("dragstart.drag",null);n&&(r.on("click.drag",Bt,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}function Zt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function $t(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Xt(){}Tt.prototype=Nt.prototype={constructor:Tt,select:function(t){"function"!=typeof t&&(t=T(t));for(var n=this._groups,e=n.length,r=new Array(e),o=0;o<e;++o)for(var i,a,s=n[o],u=s.length,c=r[o]=new Array(u),l=0;l<u;++l)(i=s[l])&&(a=t.call(i,i.__data__,l,s))&&("__data__"in i&&(a.__data__=i.__data__),c[l]=a);return new Tt(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=j(t));for(var n=this._groups,e=n.length,r=[],o=[],i=0;i<e;++i)for(var a,s=n[i],u=s.length,c=0;c<u;++c)(a=s[c])&&(r.push(t.call(a,a.__data__,c,s)),o.push(a));return new Tt(r,o)},filter:function(t){"function"!=typeof t&&(t=D(t));for(var n=this._groups,e=n.length,r=new Array(e),o=0;o<e;++o)for(var i,a=n[o],s=a.length,u=r[o]=[],c=0;c<s;++c)(i=a[c])&&t.call(i,i.__data__,c,a)&&u.push(i);return new Tt(r,this._parents)},data:function(t,n){if(!t)return p=new Array(this.size()),l=-1,this.each((function(t){p[++l]=t})),p;var e,r=n?B:H,o=this._parents,i=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var a=i.length,s=new Array(a),u=new Array(a),c=new Array(a),l=0;l<a;++l){var h=o[l],f=i[l],d=f.length,p=t.call(h,h&&h.__data__,l,o),g=p.length,m=u[l]=new Array(g),y=s[l]=new Array(g);r(h,f,m,y,c[l]=new Array(d),p,n);for(var v,b,x=0,w=0;x<g;++x)if(v=m[x]){for(x>=w&&(w=x+1);!(b=y[w])&&++w<g;);v._next=b||null}}return(s=new Tt(s,o))._enter=u,s._exit=c,s},enter:function(){return new Tt(this._enter||this._groups.map(P),this._parents)},exit:function(){return new Tt(this._exit||this._groups.map(P),this._parents)},join:function(t,n,e){var r=this.enter(),o=this,i=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(o=n(o)),null==e?i.remove():e(i),r&&o?r.merge(o).order():o},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,o=e.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var u,c=n[s],l=e[s],h=c.length,f=a[s]=new Array(h),d=0;d<h;++d)(u=c[d]||l[d])&&(f[d]=u);for(;s<r;++s)a[s]=n[s];return new Tt(a,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,o=t[n],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=V);for(var e=this._groups,r=e.length,o=new Array(r),i=0;i<r;++i){for(var a,s=e[i],u=s.length,c=o[i]=new Array(u),l=0;l<u;++l)(a=s[l])&&(c[l]=a);c.sort(n)}return new Tt(o,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each((function(){t[++n]=this})),t},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var o,i=n[e],a=0,s=i.length;a<s;++a)(o=i[a])&&t.call(o,o.__data__,a,i);return this},attr:function(t,n){var e=O(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?Z:R:"function"==typeof n?e.local?Y:W:e.local?X:$)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?F:"function"==typeof n?Q:G)(t,n,null==e?"":e)):K(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?J:"function"==typeof n?nt:tt)(t,n)):this.node()[t]},classed:function(t,n){var e=et(t+"");if(arguments.length<2){for(var r=rt(this.node()),o=-1,i=e.length;++o<i;)if(!r.contains(e[o]))return!1;return!0}return this.each(("function"==typeof n?ct:n?st:ut)(e,n))},text:function(t){return arguments.length?this.each(null==t?lt:("function"==typeof t?ft:ht)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?dt:("function"==typeof t?gt:pt)(t)):this.node().innerHTML},raise:function(){return this.each(mt)},lower:function(){return this.each(yt)},append:function(t){var n="function"==typeof t?t:z(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:z(t),r=null==n?vt:"function"==typeof n?n:T(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(bt)},clone:function(t){return this.select(t?wt:xt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,o,i=Mt(t+""),a=i.length;if(!(arguments.length<2)){for(s=n?Ot:Lt,null==e&&(e=!1),r=0;r<a;++r)this.each(s(i[r],n,e));return this}var s=this.node().__on;if(s)for(var u,c=0,l=s.length;c<l;++c)for(r=0,u=s[c];r<a;++r)if((o=i[r]).type===u.type&&o.name===u.name)return u.value},dispatch:function(t,n){return this.each(("function"==typeof n?zt:At)(t,n))}};var Wt="\\s*([+-]?\\d+)\\s*",Yt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ut="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ft=/^#([0-9a-f]{3,8})$/,Gt=new RegExp("^rgb\\("+[Wt,Wt,Wt]+"\\)$"),Qt=new RegExp("^rgb\\("+[Ut,Ut,Ut]+"\\)$"),Kt=new RegExp("^rgba\\("+[Wt,Wt,Wt,Yt]+"\\)$"),Jt=new RegExp("^rgba\\("+[Ut,Ut,Ut,Yt]+"\\)$"),tn=new RegExp("^hsl\\("+[Yt,Ut,Ut]+"\\)$"),nn=new RegExp("^hsla\\("+[Yt,Ut,Ut,Yt]+"\\)$"),en={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 rn(){return this.rgb().formatHex()}function on(){return this.rgb().formatRgb()}function an(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=Ft.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?sn(n):3===e?new hn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?un(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?un(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=Gt.exec(t))?new hn(n[1],n[2],n[3],1):(n=Qt.exec(t))?new hn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Kt.exec(t))?un(n[1],n[2],n[3],n[4]):(n=Jt.exec(t))?un(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=tn.exec(t))?gn(n[1],n[2]/100,n[3]/100,1):(n=nn.exec(t))?gn(n[1],n[2]/100,n[3]/100,n[4]):en.hasOwnProperty(t)?sn(en[t]):"transparent"===t?new hn(NaN,NaN,NaN,0):null}function sn(t){return new hn(t>>16&255,t>>8&255,255&t,1)}function un(t,n,e,r){return r<=0&&(t=n=e=NaN),new hn(t,n,e,r)}function cn(t){return t instanceof Xt||(t=an(t)),t?new hn((t=t.rgb()).r,t.g,t.b,t.opacity):new hn}function ln(t,n,e,r){return 1===arguments.length?cn(t):new hn(t,n,e,null==r?1:r)}function hn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function fn(){return"#"+pn(this.r)+pn(this.g)+pn(this.b)}function dn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"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===t?")":", "+t+")")}function pn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function gn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new yn(t,n,e,r)}function mn(t){if(t instanceof yn)return new yn(t.h,t.s,t.l,t.opacity);if(t instanceof Xt||(t=an(t)),!t)return new yn;if(t instanceof yn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,o=Math.min(n,e,r),i=Math.max(n,e,r),a=NaN,s=i-o,u=(i+o)/2;return s?(a=n===i?(e-r)/s+6*(e<r):e===i?(r-n)/s+2:(n-e)/s+4,s/=u<.5?i+o:2-i-o,a*=60):s=u>0&&u<1?0:a,new yn(a,s,u,t.opacity)}function yn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function vn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function bn(t){return function(){return t}}function xn(t){return 1==(t=+t)?wn:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):bn(isNaN(n)?e:n)}}function wn(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):bn(isNaN(t)?n:t)}Zt(Xt,an,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:rn,formatHex:rn,formatHsl:function(){return mn(this).formatHsl()},formatRgb:on,toString:on}),Zt(hn,ln,$t(Xt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new hn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new hn(this.r*t,this.g*t,this.b*t,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:fn,formatHex:fn,formatRgb:dn,toString:dn})),Zt(yn,(function(t,n,e,r){return 1===arguments.length?mn(t):new yn(t,n,e,null==r?1:r)}),$t(Xt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new yn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new yn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,o=2*e-r;return new hn(vn(t>=240?t-240:t+120,o,r),vn(t,o,r),vn(t<120?t+240:t-120,o,r),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 t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var _n=function t(n){var e=xn(n);function r(t,n){var r=e((t=ln(t)).r,(n=ln(n)).r),o=e(t.g,n.g),i=e(t.b,n.b),a=wn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=o(n),t.b=i(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function kn(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var Cn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,En=new RegExp(Cn.source,"g");function Mn(t,n){var e,r,o,i=Cn.lastIndex=En.lastIndex=0,a=-1,s=[],u=[];for(t+="",n+="";(e=Cn.exec(t))&&(r=En.exec(n));)(o=r.index)>i&&(o=n.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(e=e[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:kn(e,r)})),i=En.lastIndex;return i<n.length&&(o=n.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?function(t){return function(n){return t(n)+""}}(u[0].x):function(t){return function(){return t}}(n):(n=u.length,function(t){for(var e,r=0;r<n;++r)s[(e=u[r]).i]=e.x(t);return s.join("")})}var Ln,On,Sn,An,zn=180/Math.PI,qn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Tn(t,n,e,r,o,i){var a,s,u;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(u=t*e+n*r)&&(e-=t*u,r-=n*u),(s=Math.sqrt(e*e+r*r))&&(e/=s,r/=s,u/=s),t*r<n*e&&(t=-t,n=-n,u=-u,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(n,t)*zn,skewX:Math.atan(u)*zn,scaleX:a,scaleY:s}}function Nn(t,n,e,r){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var s=[],u=[];return i=t(i),a=t(a),function(t,r,o,i,a,s){if(t!==o||r!==i){var u=a.push("translate(",null,n,null,e);s.push({i:u-4,x:kn(t,o)},{i:u-2,x:kn(r,i)})}else(o||i)&&a.push("translate("+o+n+i+e)}(i.translateX,i.translateY,a.translateX,a.translateY,s,u),function(t,n,e,i){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),i.push({i:e.push(o(e)+"rotate(",null,r)-2,x:kn(t,n)})):n&&e.push(o(e)+"rotate("+n+r)}(i.rotate,a.rotate,s,u),function(t,n,e,i){t!==n?i.push({i:e.push(o(e)+"skewX(",null,r)-2,x:kn(t,n)}):n&&e.push(o(e)+"skewX("+n+r)}(i.skewX,a.skewX,s,u),function(t,n,e,r,i,a){if(t!==e||n!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:kn(t,e)},{i:s-2,x:kn(n,r)})}else 1===e&&1===r||i.push(o(i)+"scale("+e+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,u),i=a=null,function(t){for(var n,e=-1,r=u.length;++e<r;)s[(n=u[e]).i]=n.x(t);return s.join("")}}}var jn=Nn((function(t){return"none"===t?qn:(Ln||(Ln=document.createElement("DIV"),On=document.documentElement,Sn=document.defaultView),Ln.style.transform=t,t=Sn.getComputedStyle(On.appendChild(Ln),null).getPropertyValue("transform"),On.removeChild(Ln),Tn(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),Dn=Nn((function(t){return null==t?qn:(An||(An=document.createElementNS("http://www.w3.org/2000/svg","g")),An.setAttribute("transform",t),(t=An.transform.baseVal.consolidate())?Tn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):qn)}),", ",")",")"),Pn=Math.SQRT2;function In(t){return((t=Math.exp(t))+1/t)/2}function Hn(t,n){var e,r,o=t[0],i=t[1],a=t[2],s=n[0],u=n[1],c=n[2],l=s-o,h=u-i,f=l*l+h*h;if(f<1e-12)r=Math.log(c/a)/Pn,e=function(t){return[o+t*l,i+t*h,a*Math.exp(Pn*t*r)]};else{var d=Math.sqrt(f),p=(c*c-a*a+4*f)/(2*a*2*d),g=(c*c-a*a-4*f)/(2*c*2*d),m=Math.log(Math.sqrt(p*p+1)-p),y=Math.log(Math.sqrt(g*g+1)-g);r=(y-m)/Pn,e=function(t){var n,e=t*r,s=In(m),u=a/(2*d)*(s*(n=Pn*e+m,((n=Math.exp(2*n))-1)/(n+1))-function(t){return((t=Math.exp(t))-1/t)/2}(m));return[o+u*l,i+u*h,a*s/In(Pn*e+m)]}}return e.duration=1e3*r,e}var Bn,Vn,Rn=0,Zn=0,$n=0,Xn=0,Wn=0,Yn=0,Un="object"===("undefined"==typeof performance?"undefined":n(performance))&&performance.now?performance:Date,Fn="object"===("undefined"==typeof window?"undefined":n(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Gn(){return Wn||(Fn(Qn),Wn=Un.now()+Yn)}function Qn(){Wn=0}function Kn(){this._call=this._time=this._next=null}function Jn(t,n,e){var r=new Kn;return r.restart(t,n,e),r}function te(){Wn=(Xn=Un.now())+Yn,Rn=Zn=0;try{!function(){Gn(),++Rn;for(var t,n=Bn;n;)(t=Wn-n._time)>=0&&n._call.call(null,t),n=n._next;--Rn}()}finally{Rn=0,function(){var t,n,e=Bn,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Bn=n);Vn=t,ee(r)}(),Wn=0}}function ne(){var t=Un.now(),n=t-Xn;n>1e3&&(Yn-=n,Xn=t)}function ee(t){Rn||(Zn&&(Zn=clearTimeout(Zn)),t-Wn>24?(t<1/0&&(Zn=setTimeout(te,t-Un.now()-Yn)),$n&&($n=clearInterval($n))):($n||(Xn=Un.now(),$n=setInterval(ne,1e3)),Rn=1,Fn(te)))}function re(t,n,e){var r=new Kn;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r}Kn.prototype=Jn.prototype={constructor:Kn,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Gn():+e)+(null==n?0:+n),this._next||Vn===this||(Vn?Vn._next=this:Bn=this,Vn=this),this._call=t,this._time=e,ee()},stop:function(){this._call&&(this._call=null,this._time=1/0,ee())}};var oe=w("start","end","cancel","interrupt"),ie=[];function ae(t,n,e,r,o,i){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,o=t.__transition;function i(u){var c,l,h,f;if(1!==e.state)return s();for(c in o)if((f=o[c]).name===e.name){if(3===f.state)return re(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete o[c]):+c<n&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete o[c])}if(re((function(){3===e.state&&(e.state=4,e.timer.restart(a,e.delay,e.time),a(u))})),e.state=2,e.on.call("start",t,t.__data__,e.index,e.group),2===e.state){for(e.state=3,r=new Array(h=e.tween.length),c=0,l=-1;c<h;++c)(f=e.tween[c].value.call(t,t.__data__,e.index,e.group))&&(r[++l]=f);r.length=l+1}}function a(n){for(var o=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(s),e.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(t,o);5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),s())}function s(){for(var r in e.state=6,e.timer.stop(),delete o[n],o)return;delete t.__transition}o[n]=e,e.timer=Jn((function(t){e.state=1,e.timer.restart(i,e.delay,e.time),e.delay<=t&&i(t-e.delay)}),0,e.time)}(t,e,{name:n,index:r,group:o,on:oe,tween:ie,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function se(t,n){var e=ce(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function ue(t,n){var e=ce(t,n);if(e.state>3)throw new Error("too late; already running");return e}function ce(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function le(t,n){var e,r,o,i=t.__transition,a=!0;if(i){for(o in n=null==n?null:n+"",i)(e=i[o]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete i[o]):a=!1;a&&delete t.__transition}}function he(t,n){var e,r;return function(){var o=ue(this,t),i=o.tween;if(i!==e)for(var a=0,s=(r=e=i).length;a<s;++a)if(r[a].name===n){(r=r.slice()).splice(a,1);break}o.tween=r}}function fe(t,n,e){var r,o;if("function"!=typeof e)throw new Error;return function(){var i=ue(this,t),a=i.tween;if(a!==r){o=(r=a).slice();for(var s={name:n,value:e},u=0,c=o.length;u<c;++u)if(o[u].name===n){o[u]=s;break}u===c&&o.push(s)}i.tween=o}}function de(t,n,e){var r=t._id;return t.each((function(){var t=ue(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return ce(t,r).value[n]}}function pe(t,n){var e;return("number"==typeof n?kn:n instanceof an?_n:(e=an(n))?(n=e,_n):Mn)(t,n)}function ge(t){return function(){this.removeAttribute(t)}}function me(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ye(t,n,e){var r,o,i=e+"";return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=n(r=a,e)}}function ve(t,n,e){var r,o,i=e+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=n(r=a,e)}}function be(t,n,e){var r,o,i;return function(){var a,s,u=e(this);if(null!=u)return(a=this.getAttribute(t))===(s=u+"")?null:a===r&&s===o?i:(o=s,i=n(r=a,u));this.removeAttribute(t)}}function xe(t,n,e){var r,o,i;return function(){var a,s,u=e(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===(s=u+"")?null:a===r&&s===o?i:(o=s,i=n(r=a,u));this.removeAttributeNS(t.space,t.local)}}function we(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function _e(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function ke(t,n){var e,r;function o(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&_e(t,o)),e}return o._value=n,o}function Ce(t,n){var e,r;function o(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&we(t,o)),e}return o._value=n,o}function Ee(t,n){return function(){se(this,t).delay=+n.apply(this,arguments)}}function Me(t,n){return n=+n,function(){se(this,t).delay=n}}function Le(t,n){return function(){ue(this,t).duration=+n.apply(this,arguments)}}function Oe(t,n){return n=+n,function(){ue(this,t).duration=n}}function Se(t,n){if("function"!=typeof n)throw new Error;return function(){ue(this,t).ease=n}}function Ae(t,n,e){var r,o,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?se:ue;return function(){var a=i(this,t),s=a.on;s!==r&&(o=(r=s).copy()).on(n,e),a.on=o}}var ze=Nt.prototype.constructor;function qe(t){return function(){this.style.removeProperty(t)}}function Te(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function Ne(t,n,e){var r,o;function i(){var i=n.apply(this,arguments);return i!==o&&(r=(o=i)&&Te(t,i,e)),r}return i._value=n,i}function je(t){return function(n){this.textContent=t.call(this,n)}}function De(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&je(r)),n}return r._value=t,r}var Pe=0;function Ie(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function He(){return++Pe}var Be=Nt.prototype;Ie.prototype=function(t){return Nt().transition(t)}.prototype={constructor:Ie,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=T(t));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var s,u,c=r[a],l=c.length,h=i[a]=new Array(l),f=0;f<l;++f)(s=c[f])&&(u=t.call(s,s.__data__,f,c))&&("__data__"in s&&(u.__data__=s.__data__),h[f]=u,ae(h[f],n,e,f,h,ce(s,e)));return new Ie(i,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=j(t));for(var r=this._groups,o=r.length,i=[],a=[],s=0;s<o;++s)for(var u,c=r[s],l=c.length,h=0;h<l;++h)if(u=c[h]){for(var f,d=t.call(u,u.__data__,h,c),p=ce(u,e),g=0,m=d.length;g<m;++g)(f=d[g])&&ae(f,n,e,g,d,p);i.push(d),a.push(u)}return new Ie(i,a,n,e)},filter:function(t){"function"!=typeof t&&(t=D(t));for(var n=this._groups,e=n.length,r=new Array(e),o=0;o<e;++o)for(var i,a=n[o],s=a.length,u=r[o]=[],c=0;c<s;++c)(i=a[c])&&t.call(i,i.__data__,c,a)&&u.push(i);return new Ie(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,o=e.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var u,c=n[s],l=e[s],h=c.length,f=a[s]=new Array(h),d=0;d<h;++d)(u=c[d]||l[d])&&(f[d]=u);for(;s<r;++s)a[s]=n[s];return new Ie(a,this._parents,this._name,this._id)},selection:function(){return new ze(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=He(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],u=s.length,c=0;c<u;++c)if(a=s[c]){var l=ce(a,n);ae(a,t,e,c,s,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new Ie(r,this._parents,t,e)},call:Be.call,nodes:Be.nodes,node:Be.node,size:Be.size,empty:Be.empty,each:Be.each,on:function(t,n){var e=this._id;return arguments.length<2?ce(this.node(),e).on.on(t):this.each(Ae(e,t,n))},attr:function(t,n){var e=O(t),r="transform"===e?Dn:pe;return this.attrTween(t,"function"==typeof n?(e.local?xe:be)(e,r,de(this,"attr."+t,n)):null==n?(e.local?me:ge)(e):(e.local?ve:ye)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=O(t);return this.tween(e,(r.local?ke:Ce)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?jn:pe;return null==n?this.styleTween(t,function(t,n){var e,r,o;return function(){var i=K(this,t),a=(this.style.removeProperty(t),K(this,t));return i===a?null:i===e&&a===r?o:o=n(e=i,r=a)}}(t,r)).on("end.style."+t,qe(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,o,i;return function(){var a=K(this,t),s=e(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=K(this,t)),a===u?null:a===r&&u===o?i:(o=u,i=n(r=a,s))}}(t,r,de(this,"style."+t,n))).each(function(t,n){var e,r,o,i,a="style."+n,s="end."+a;return function(){var u=ue(this,t),c=u.on,l=null==u.value[a]?i||(i=qe(n)):void 0;c===e&&o===l||(r=(e=c).copy()).on(s,o=l),u.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,o,i=e+"";return function(){var a=K(this,t);return a===i?null:a===r?o:o=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,Ne(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(de(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,De(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,o=ce(this.node(),e).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===t)return r.value;return null}return this.each((null==n?he:fe)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?Ee:Me)(n,t)):ce(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?Le:Oe)(n,t)):ce(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(Se(n,t)):ce(this.node(),n).ease},end:function(){var t,n,e=this,r=e._id,o=e.size();return new Promise((function(i,a){var s={value:a},u={value:function(){0==--o&&i()}};e.each((function(){var e=ue(this,r),o=e.on;o!==t&&((n=(t=o).copy())._.cancel.push(s),n._.interrupt.push(s),n._.end.push(u)),e.on=n}))}))}};var Ve={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Re(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return Ve.time=Gn(),Ve;return e}Nt.prototype.interrupt=function(t){return this.each((function(){le(this,t)}))},Nt.prototype.transition=function(t){var n,e;t instanceof Ie?(n=t._id,t=t._name):(n=He(),(e=Ve).time=Gn(),t=null==t?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],u=s.length,c=0;c<u;++c)(a=s[c])&&ae(a,t,n,c,s,e||Re(a,n));return new Ie(r,this._parents,t,n)};function Ze(){}function $e(t,n){var e=new Ze;if(t instanceof Ze)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,o=-1,i=t.length;if(null==n)for(;++o<i;)e.set(o,t[o]);else for(;++o<i;)e.set(n(r=t[o],o,t),r)}else if(t)for(var a in t)e.set(a,t[a]);return e}function Xe(){}Ze.prototype=$e.prototype={constructor:Ze,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var We=$e.prototype;function Ye(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function Ue(t,n){var e,r,o,i,a,s=new Ke(t),u=+t.value&&(s.value=t.value),c=[s];for(null==n&&(n=Fe);e=c.pop();)if(u&&(e.value=+e.data.value),(o=n(e.data))&&(a=o.length))for(e.children=new Array(a),i=a-1;i>=0;--i)c.push(r=e.children[i]=new Ke(o[i])),r.parent=e,r.depth=e.depth+1;return s.eachBefore(Qe)}function Fe(t){return t.children}function Ge(t){t.data=t.data.data}function Qe(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function Ke(t){this.data=t,this.depth=this.height=0,this.parent=null}function Je(t,n){return t.parent===n.parent?1:2}function tr(t){var n=t.children;return n?n[0]:t.t}function nr(t){var n=t.children;return n?n[n.length-1]:t.t}function er(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function rr(t,n,e){return t.a.parent===n.parent?t.a:e}function or(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}function ir(){var t=Je,n=1,e=1,r=null;function o(o){var u=function(t){for(var n,e,r,o,i,a=new or(t,0),s=[a];n=s.pop();)if(r=n._.children)for(n.children=new Array(i=r.length),o=i-1;o>=0;--o)s.push(e=n.children[o]=new or(r[o],o)),e.parent=n;return(a.parent=new or(null,0)).children=[a],a}(o);if(u.eachAfter(i),u.parent.m=-u.z,u.eachBefore(a),r)o.eachBefore(s);else{var c=o,l=o,h=o;o.eachBefore((function(t){t.x<c.x&&(c=t),t.x>l.x&&(l=t),t.depth>h.depth&&(h=t)}));var f=c===l?1:t(c,l)/2,d=f-c.x,p=n/(l.x+f+d),g=e/(h.depth||1);o.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return o}function i(n){var e=n.children,r=n.parent.children,o=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,o=t.children,i=o.length;--i>=0;)(n=o[i]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var i=(e[0].z+e[e.length-1].z)/2;o?(n.z=o.z+t(n._,o._),n.m=n.z-i):n.z=i}else o&&(n.z=o.z+t(n._,o._));n.parent.A=function(n,e,r){if(e){for(var o,i=n,a=n,s=e,u=i.parent.children[0],c=i.m,l=a.m,h=s.m,f=u.m;s=nr(s),i=tr(i),s&&i;)u=tr(u),(a=nr(a)).a=n,(o=s.z+h-i.z-c+t(s._,i._))>0&&(er(rr(s,n,r),n,o),c+=o,l+=o),h+=s.m,c+=i.m,f+=u.m,l+=a.m;s&&!nr(a)&&(a.t=s,a.m+=h-l),i&&!tr(u)&&(u.t=i,u.m+=c-f,r=n)}return r}(n,o,n.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=n,t.y=t.depth*e}return o.separation=function(n){return arguments.length?(t=n,o):t},o.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],o):r?null:[n,e]},o.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],o):r?[n,e]:null},o}function ar(t){return function(){return t}}function sr(t,n,e){this.target=t,this.type=n,this.transform=e}function ur(t,n,e){this.k=t,this.x=n,this.y=e}Xe.prototype=function(t,n){var e=new Xe;if(t instanceof Xe)t.each((function(t){e.add(t)}));else if(t){var r=-1,o=t.length;if(null==n)for(;++r<o;)e.add(t[r]);else for(;++r<o;)e.add(n(t[r],r,t))}return e}.prototype={constructor:Xe,has:We.has,add:function(t){return this["$"+(t+="")]=t,this},remove:We.remove,clear:We.clear,values:We.keys,size:We.size,empty:We.empty,each:We.each},Ke.prototype=Ue.prototype={constructor:Ke,count:function(){return this.eachAfter(Ye)},each:function(t){var n,e,r,o,i=this,a=[i];do{for(n=a.reverse(),a=[];i=n.pop();)if(t(i),e=i.children)for(r=0,o=e.length;r<o;++r)a.push(e[r])}while(a.length);return this},eachAfter:function(t){for(var n,e,r,o=this,i=[o],a=[];o=i.pop();)if(a.push(o),n=o.children)for(e=0,r=n.length;e<r;++e)i.push(n[e]);for(;o=a.pop();)t(o);return this},eachBefore:function(t){for(var n,e,r=this,o=[r];r=o.pop();)if(t(r),n=r.children)for(e=n.length-1;e>=0;--e)o.push(n[e]);return this},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,o=r&&r.length;--o>=0;)e+=r[o].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),o=null;t=e.pop(),n=r.pop();for(;t===n;)o=t,t=e.pop(),n=r.pop();return o}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var o=r.length;t!==e;)r.splice(o,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each((function(n){t.push(n)})),t},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return Ue(this).eachBefore(Ge)}},or.prototype=Object.create(Ke.prototype),ur.prototype={constructor:ur,scale:function(t){return 1===t?this:new ur(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new ur(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var cr=new ur(1,0,0);function lr(){kt.stopImmediatePropagation()}function hr(){kt.preventDefault(),kt.stopImmediatePropagation()}function fr(){return!kt.ctrlKey&&!kt.button}function dr(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function pr(){return this.__zoom||cr}function gr(){return-kt.deltaY*(1===kt.deltaMode?.05:kt.deltaMode?1:.002)}function mr(){return navigator.maxTouchPoints||"ontouchstart"in this}function yr(t,n,e){var r=t.invertX(n[0][0])-e[0][0],o=t.invertX(n[1][0])-e[1][0],i=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function vr(){var t,n,e=fr,r=dr,o=yr,i=gr,a=mr,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,l=Hn,h=w("start","zoom","end"),f=0;function d(t){t.property("__zoom",pr).on("wheel.zoom",x).on("mousedown.zoom",_).on("dblclick.zoom",k).filter(a).on("touchstart.zoom",C).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",M).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(t,n){return(n=Math.max(s[0],Math.min(s[1],n)))===t.k?t:new ur(n,t.x,t.y)}function g(t,n,e){var r=n[0]-e[0]*t.k,o=n[1]-e[1]*t.k;return r===t.x&&o===t.y?t:new ur(t.k,r,o)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function y(t,n,e){t.on("start.zoom",(function(){v(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){v(this,arguments).end()})).tween("zoom",(function(){var t=this,o=arguments,i=v(t,o),a=r.apply(t,o),s=null==e?m(a):"function"==typeof e?e.apply(t,o):e,u=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),c=t.__zoom,h="function"==typeof n?n.apply(t,o):n,f=l(c.invert(s).concat(u/c.k),h.invert(s).concat(u/h.k));return function(t){if(1===t)t=h;else{var n=f(t),e=u/n[2];t=new ur(e,s[0]-n[0]*e,s[1]-n[1]*e)}i.zoom(null,t)}}))}function v(t,n,e){return!e&&t.__zooming||new b(t,n)}function b(t,n){this.that=t,this.args=n,this.active=0,this.extent=r.apply(t,n),this.taps=0}function x(){if(e.apply(this,arguments)){var t=v(this,arguments),n=this.__zoom,r=Math.max(s[0],Math.min(s[1],n.k*Math.pow(2,i.apply(this,arguments)))),a=It(this);if(t.wheel)t.mouse[0][0]===a[0]&&t.mouse[0][1]===a[1]||(t.mouse[1]=n.invert(t.mouse[0]=a)),clearTimeout(t.wheel);else{if(n.k===r)return;t.mouse=[a,n.invert(a)],le(this),t.start()}hr(),t.wheel=setTimeout(c,150),t.zoom("mouse",o(g(p(n,r),t.mouse[0],t.mouse[1]),t.extent,u))}function c(){t.wheel=null,t.end()}}function _(){if(!n&&e.apply(this,arguments)){var t=v(this,arguments,!0),r=jt(kt.view).on("mousemove.zoom",c,!0).on("mouseup.zoom",l,!0),i=It(this),a=kt.clientX,s=kt.clientY;Vt(kt.view),lr(),t.mouse=[i,this.__zoom.invert(i)],le(this),t.start()}function c(){if(hr(),!t.moved){var n=kt.clientX-a,e=kt.clientY-s;t.moved=n*n+e*e>f}t.zoom("mouse",o(g(t.that.__zoom,t.mouse[0]=It(t.that),t.mouse[1]),t.extent,u))}function l(){r.on("mousemove.zoom mouseup.zoom",null),Rt(kt.view,t.moved),hr(),t.end()}}function k(){if(e.apply(this,arguments)){var t=this.__zoom,n=It(this),i=t.invert(n),a=t.k*(kt.shiftKey?.5:2),s=o(g(p(t,a),n,i),r.apply(this,arguments),u);hr(),c>0?jt(this).transition().duration(c).call(y,s,n):jt(this).call(d.transform,s)}}function C(){if(e.apply(this,arguments)){var n,r,o,i,a=kt.touches,s=a.length,u=v(this,arguments,kt.changedTouches.length===s);for(lr(),r=0;r<s;++r)i=[i=Ht(this,a,(o=a[r]).identifier),this.__zoom.invert(i),o.identifier],u.touch0?u.touch1||u.touch0[2]===i[2]||(u.touch1=i,u.taps=0):(u.touch0=i,n=!0,u.taps=1+!!t);t&&(t=clearTimeout(t)),n&&(u.taps<2&&(t=setTimeout((function(){t=null}),500)),le(this),u.start())}}function E(){if(this.__zooming){var n,e,r,i,a=v(this,arguments),s=kt.changedTouches,c=s.length;for(hr(),t&&(t=clearTimeout(t)),a.taps=0,n=0;n<c;++n)r=Ht(this,s,(e=s[n]).identifier),a.touch0&&a.touch0[2]===e.identifier?a.touch0[0]=r:a.touch1&&a.touch1[2]===e.identifier&&(a.touch1[0]=r);if(e=a.that.__zoom,a.touch1){var l=a.touch0[0],h=a.touch0[1],f=a.touch1[0],d=a.touch1[1],m=(m=f[0]-l[0])*m+(m=f[1]-l[1])*m,y=(y=d[0]-h[0])*y+(y=d[1]-h[1])*y;e=p(e,Math.sqrt(m/y)),r=[(l[0]+f[0])/2,(l[1]+f[1])/2],i=[(h[0]+d[0])/2,(h[1]+d[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],i=a.touch0[1]}a.zoom("touch",o(g(e,r,i),a.extent,u))}}function M(){if(this.__zooming){var t,e,r=v(this,arguments),o=kt.changedTouches,i=o.length;for(lr(),n&&clearTimeout(n),n=setTimeout((function(){n=null}),500),t=0;t<i;++t)e=o[t],r.touch0&&r.touch0[2]===e.identifier?delete r.touch0:r.touch1&&r.touch1[2]===e.identifier&&delete r.touch1;if(r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0)r.touch0[1]=this.__zoom.invert(r.touch0[0]);else if(r.end(),2===r.taps){var a=jt(this).on("dblclick.zoom");a&&a.apply(this,arguments)}}}return d.transform=function(t,n,e){var r=t.selection?t.selection():t;r.property("__zoom",pr),t!==r?y(t,n,e):r.interrupt().each((function(){v(this,arguments).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()}))},d.scaleBy=function(t,n,e){d.scaleTo(t,(function(){var t=this.__zoom.k,e="function"==typeof n?n.apply(this,arguments):n;return t*e}),e)},d.scaleTo=function(t,n,e){d.transform(t,(function(){var t=r.apply(this,arguments),i=this.__zoom,a=null==e?m(t):"function"==typeof e?e.apply(this,arguments):e,s=i.invert(a),c="function"==typeof n?n.apply(this,arguments):n;return o(g(p(i,c),a,s),t,u)}),e)},d.translateBy=function(t,n,e){d.transform(t,(function(){return o(this.__zoom.translate("function"==typeof n?n.apply(this,arguments):n,"function"==typeof e?e.apply(this,arguments):e),r.apply(this,arguments),u)}))},d.translateTo=function(t,n,e,i){d.transform(t,(function(){var t=r.apply(this,arguments),a=this.__zoom,s=null==i?m(t):"function"==typeof i?i.apply(this,arguments):i;return o(cr.translate(s[0],s[1]).scale(a.k).translate("function"==typeof n?-n.apply(this,arguments):-n,"function"==typeof e?-e.apply(this,arguments):-e),t,u)}),i)},b.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,n){return this.mouse&&"mouse"!==t&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){!function(t,n,e,r){var o=kt;t.sourceEvent=kt,kt=t;try{n.apply(e,r)}finally{kt=o}}(new sr(d,t,this.that.__zoom),h.apply,h,[t,this.that,this.args])}},d.wheelDelta=function(t){return arguments.length?(i="function"==typeof t?t:ar(+t),d):i},d.filter=function(t){return arguments.length?(e="function"==typeof t?t:ar(!!t),d):e},d.touchable=function(t){return arguments.length?(a="function"==typeof t?t:ar(!!t),d):a},d.extent=function(t){return arguments.length?(r="function"==typeof t?t:ar([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),d):r},d.scaleExtent=function(t){return arguments.length?(s[0]=+t[0],s[1]=+t[1],d):[s[0],s[1]]},d.translateExtent=function(t){return arguments.length?(u[0][0]=+t[0][0],u[1][0]=+t[1][0],u[0][1]=+t[0][1],u[1][1]=+t[1][1],d):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},d.constrain=function(t){return arguments.length?(o=t,d):o},d.duration=function(t){return arguments.length?(c=+t,d):c},d.interpolate=function(t){return arguments.length?(l=t,d):l},d.on=function(){var t=h.on.apply(h,arguments);return t===h?d:t},d.clickDistance=function(t){return arguments.length?(f=(t=+t)*t,d):Math.sqrt(f)},d}var br={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},rebeccapurple:{r:102,g:51,b:153},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},xr=function(t){var n=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(t);if(n)return"rgb(".concat(n[1],",").concat(n[2],",").concat(n[3],")");if(n=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(t))return"rgba(".concat(n[1],",").concat(n[2],",").concat(n[3],",").concat(n[4],")");if(n=/^argb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(t)){var e=Math.round(n[1]/2.55)/100;return"rgba(".concat(n[2],",").concat(n[3],",").concat(n[4],",").concat(e,")")}if(n=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))return t;var r=t&&br[t.toLowerCase()];if(r){var o=void 0!==r.a?r.a:1;return"rgba(".concat(r.r,",").concat(r.g,",").concat(r.b,",").concat(o,")")}return"none"},wr=function(t){var n,e,r,o;if(t.length>7){var i=-1!==(n=t.split(","))[0].indexOf("a");return e=i?parseInt(n[0].slice(5),10):parseInt(n[0].slice(4),10),o=parseInt(n[1],10),r=parseInt(n[2],10),"".concat((i?"rgba(":"rgb(")+(Math.round(.5*(0-e))+e),",").concat(Math.round(.5*(0-o))+o,",").concat(Math.round(.5*(0-r))+r).concat(i?",".concat(n[3]):")")}return e=(n=parseInt(t.slice(1),16))>>16,o=n>>8&255,r=255&n,"#".concat((16777216+65536*(Math.round(.5*(0-e))+e)+256*(Math.round(.5*(0-o))+o)+(Math.round(.5*(0-r))+r)).toString(16).slice(1))},_r=function(t){var n,e,r,o;return(o=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(t))||(o=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(t))?(n=parseInt(o[1],10),e=parseInt(o[2],10),r=parseInt(o[3],10)):(o=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))&&(n=parseInt(o[1],16),e=parseInt(o[2],16),r=parseInt(o[3],16)),.299*n+.587*e+.114*r<125},kr={colorByExpression:"color",labelExpression:"label",subLabelExpression:"subLabel",extraLabelExpression:"extraLabel"};function Cr(t){return t[0].qText}function Er(t){return t[1].qText}function Mr(t,n,e,r,o,i,a){return Lr.apply(this,arguments)}function Lr(){return(Lr=r(regeneratorRuntime.mark((function t(n,e,r,o,i,a,s){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.getHyperCubeData("/qHyperCubeDef",[{qTop:i,qLeft:0,qWidth:3,qHeight:3300}]).then((function(t){n.push(t[0]),e.push.apply(e,u(t[0].qMatrix)),i+=t[0].qArea.qHeight}));case 2:if(!(a>=s)){t.next=4;break}return t.abrupt("return","max-data-limit");case 4:if(!(o>i)){t.next=6;break}return t.abrupt("return",Mr(n,e,r,o,i,a+1,s));case 6:return t.abrupt("return","");case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Or=function(){var t=r(regeneratorRuntime.mark((function t(n,e){var r,o,i,a,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.snapshotData){t.next=2;break}return t.abrupt("return",{status:"",dataMatrix:n.snapshotData.dataMatrix});case 2:if(r=n.qHyperCube&&n.qHyperCube.qDataPages,o=n.qHyperCube.qSize.qcy,i=r[0].qArea.qHeight,a=u(r[0].qMatrix),s="",!(o>i&&1===r.length&&e)){t.next=13;break}return t.next=10,Mr(n.qHyperCube.qDataPages,a,e,o,i,0,n.rowLimit/3300||10);case 10:s=t.sent,t.next=14;break;case 13:r.forEach((function(t,n){n>0&&a.push.apply(a,u(t.qMatrix))}));case 14:return t.abrupt("return",{status:s,dataMatrix:a});case 15:case"end":return t.stop()}}),t)})));return function(n,e){return t.apply(this,arguments)}}();function Sr(t){if(t&&t.length){var n=[];return t.forEach((function(t,e){kr[t.id]&&n.push({prop:kr[t.id],index:e})})),n}return[]}function Ar(t,n){var e={};return t.forEach((function(t){"color"===t.prop?e[t.prop]=xr(n.qValues[t.index].qText):e[t.prop]=n.qValues[t.index].qText})),e}function zr(t){if(!t)return!0;for(var n=0;n<t.length;++n)if(void 0!==t[n].children)return!1;return!0}function qr(t,n,e,r,o){for(var i={},s=[],u=0;u<t.length;++u){var c=t[u],l=Cr(c),h={id:l,parentId:Er(c),children:[],elemNo:c[0].qElemNumber,attributes:Ar(n,c[0].qAttrExps),measure:c[2]&&c[2].qText,rowNo:u};i[l]=h,s.push(h)}for(var f=[],d=!1,p=0;p<s.length;++p){var g=s[p],m=i[g.parentId];g.parent=m,m?m.children.length>98?d=!0:m.children.push(a({childNumber:m.children.length},g)):f.length>98?d=!0:f.push(g)}if(0===f.length)return{error:"no_root",message:o.get("Object.OrgChart.MissingRoot")};var y=[];if("max-data-limit"===e&&y.push(o.get("Object.OrgChart.MaxData")),d&&y.push(o.get("Object.OrgChart.MaxChildren")),function(t){var n={},e={};function r(t){n[t.id]=!0,e[t.id]=!0;for(var o=0;o<t.children.length;++o){if(!n[t.children[o].id]&&r(t.children[o]))return!0;if(e[t.children[o].id])return!0}return e[t.id]=!1,!1}for(var o=0;o<t.length;++o){var i=t[o];if(!n[i.id]&&r(i))return!0}return!1}(s)&&y.push(o.get("Object.OrgChart.CycleWarning")),1===f.length)return f[0].warn=y,f[0].navigationMode=r,f[0];y.push(o.get("Object.OrgChart.DummyWarn"));var v={id:"Root",name:o.get("Object.OrgChart.DummyRoot"),isDummy:!0,warn:y,children:f,navigationMode:r};return f.forEach((function(t,n){t.parentId="Root",t.parent=v,t.childNumber=n})),v}function Tr(){return(Tr=r(regeneratorRuntime.mark((function t(n){var e,r,o,i,a,s,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=n.layout,r=n.model,o=n.translator,e.qHyperCube){t.next=3;break}throw new Error("Require a hypercube");case 3:if(!(e.qHyperCube.qDimensionInfo.length<2)){t.next=5;break}return t.abrupt("return",!1);case 5:return t.next=7,Or(e,r);case 7:if(i=t.sent,a=i.status,s=i.dataMatrix,u=Sr(e.qHyperCube.qDimensionInfo[0].qAttrExprInfo),s){t.next=13;break}return t.abrupt("return",null);case 13:if(!(s.length<1)){t.next=15;break}return t.abrupt("return",null);case 15:return t.abrupt("return",qr(s,u,a,e.navigationMode,o));case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Nr={cardWidth:152,cardHeight:64,widthMargin:32,heightMargin:56,buttonMargin:16,leafMargin:16,cardPadding:8,buttonWidth:48,buttonHeight:24,rootDiameter:20,r:4,tooltipWidth:240,tooltipPadding:15,maxZoom:6,minZoom:.2};function jr(t,n,e,r){var o,i,a,s=Nr.widthMargin,u=Nr.heightMargin,c=Nr.cardWidth,l=Nr.cardHeight,h=Nr.cardPadding;switch(t){case"ttb":o=c+s,a={depthSpacing:i="expandAll"===r?l+2*h:l+u,isVertical:!0,x:function(t){return function t(n,e,r,o,i,a){var s=Nr.buttonMargin,u=i&&i.initialX||0;return"expandAll"===a?(n[o]=n.x+u,n[o]):(n.parent?(n.parent[o]||(n.parent[o]=t(n.parent,e,r,o,i)),"Root"===n.parent.data.id?n[o]=n.parent[o]+(n.data.childNumber-(n.parent.children.length-1)/2)*e:n[o]=zr(n.parent.children)?n.parent[o]+s:n.parent[o]+(n.data.childNumber-(n.parent.children.length-1)/2)*e):n[o]=u,n[o])}(t,o,n,"xActual",e,r)},y:function(t){return function(t,n,e,r,o){var i=Nr.cardHeight,a=Nr.leafMargin,s=r&&r.initialY||0;return t.parent&&"Root"!==t.parent.data.id&&"expandAll"!==o&&zr(t.parent.children)?t[e]=t.parent.y+n+t.data.childNumber*(i+a)+s:t[e]=t.y+s,t[e]}(t,i,"yActual",e,r)}}}return a}var Dr=function(t){var n=document.createElement("div"),e=document.createTextNode(t);return n.appendChild(e),n.innerHTML};var Pr=function(t,n,e){var r=e.api,o=e.state,i=r&&r.isActive()&&-1!==o.indexOf(t.elemNo),a=function(t,n){var e=n.backgroundColor;if(t.attributes&&t.attributes.color){var r=xr(t.attributes.color);e="none"!==r?r:e}return e}(t,n),s=function(t,n){return"default"===t.fontColor?_r(n)?"#e6e6e6":"#484848":t.fontColor}(n,a),u=t.attributes||{},c='<div class="sn-org-card-title">'.concat(Dr(u.label||t.id),"</div>");if(u.subLabel&&(c+='<div class="sn-org-card-label">'.concat(Dr(u.subLabel),"</div>")),t.measure){var l=n.measureLabel?"".concat(n.measureLabel,": "):"";c+='<div class="sn-org-card-label">'.concat(Dr(l+t.measure),"</div>")}else u.extraLabel&&(c+='<div class="sn-org-card-label">'.concat(Dr(u.extraLabel),"</div>"));var h=r&&r.isActive()?i?" selected":" not-selected":"",f=n.border,d=f.top,p=void 0===d||d,g=f.fullBorder,m=f.colorType,y="auto"===(void 0===m?"auto":m)?wr(a):n.borderColor,v=p&&!i?"3px solid ".concat(y):"",b=g&&!i?"1px solid ".concat(y):"",x=Nr.cardHeight;return i?x-=8:g?x-=4:p&&(x-=3),'<div class="sn-org-card-text'.concat(h,'" style="background-color:').concat(a,";color:").concat(s,"; border:").concat(b,"; border-top:").concat(v,"; height:").concat(x,'px;">').concat(c,"</div>")},Ir=function(t,n){var e=n.api,r=n.state,o=n.singleSelect,i=n.setState;if(t&&e){var a;if(t.data.elemNo<0&&-3!==t.data.elemNo)return;if(t.data.isLocked)return;e.isActive()&&r?a=r.concat():(e.begin("/qHyperCubeDef"),a=[]);var s=a.indexOf(t.data.elemNo),u=-1===s,c=[];o||(c=function(t,n){var e=[];return t.children&&function t(r){r.children.forEach((function(r){r.data.selected=n,e.push(r.data.elemNo),r.children&&r.children.length>0&&t(r)}))}(t),e}(t,u)),u?(a.push(t.data.elemNo),c.forEach((function(t){-1===a.indexOf(t)&&a.push(t)}))):(a.splice(s,1),c.forEach((function(t){var n=a.indexOf(t);-1!==n&&a.splice(n,1)}))),0===a.length?e.clear():e.select({method:"selectHyperCubeValues",params:["/qHyperCubeDef",0,a,!1]}),i(a)}};function Hr(t,n,e,r,o){var i=Nr.tooltipPadding,a=Nr.cardWidth/2,s=n-(r(t)*o.zoom+o.y-i),u=e(t)*o.zoom+o.x+a*o.zoom;return"bottom:".concat(s,"px;left:").concat(u,"px;")}function Br(t,n){var e=t.data.attributes.label||t.data.id,r=t.data.attributes.subLabel?"".concat(t.data.attributes.subLabel,"<br />"):"",o=t.data.attributes.extraLabel?"".concat(t.data.attributes.extraLabel,"<br />"):"",i=t.data.measure?"".concat(n.measureLabel?"".concat(n.measureLabel,": "):"").concat(t.data.measure):"";return'<div class="sn-org-tooltip-inner"><div class="sn-org-tooltip-header">'.concat(e,"</div>").concat(r).concat(o).concat(i,"</div>")}function Vr(t,n,e,r,o,i,a){var s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:250;t.active=!0,t.timeout=setTimeout((function(){t.active&&t.html(Br(n,r)).classed("sn-org-tooltip-visible",!0).attr("style",(function(){return Hr(n,e,o,i,a)}))}),s)}function Rr(t){clearTimeout(t.timeout),t.active=!1,t.classed("sn-org-tooltip-visible",!1)}function Zr(t){var n=t.positioning,e=t.divBox,r=t.nodes,o=t.styling,i=t.setExpandedCallback,a=t.wrapperState,s=t.selectionObj,u=t.navigationMode,c=t.element,l=t.tooltip,h=n.x,f=n.y,d=Nr.cardWidth,p=Nr.cardHeight,g=Nr.buttonWidth,m=Nr.buttonHeight,y=Nr.cardPadding,v=Nr.rootDiameter,b=a.expandedState.topId,x=r.find((function(t){return t.data.id===b})),w=x&&x.parent?x.parent.ancestors().map((function(t){return t.data.id})):[],_=document.getElementsByTagName("html")[0].classList.contains("touch-on");e.selectAll(".sn-org-nodes").data(r.filter((function(t){return t.parent&&"Root"===t.parent.data.id}))).enter().append("div").attr("class","sn-org-root").attr("style",(function(t){return"top:".concat(f(t)-v-y,"px;left:").concat(h(t)+(d-v)/2,"px")})).attr("id",(function(t){return t.data.id})),e.selectAll(".sn-org-nodes").data(r.filter((function(t){return"Root"!==t.data.id}))).enter().append("div").attr("class","sn-org-card").attr("style",(function(t){return"width:".concat(d,"px;height:").concat(p,"px; top:").concat(f(t),"px;left:").concat(h(t),"px;")})).attr("id",(function(t){return t.data.id})).on("click",(function(t){a.constraints.select||"Root"===t.data.id||(_&&Vr(l,t,c.clientHeight,o,h,f,a.transform,0),Ir(t,s))})).html((function(t){return Pr(t.data,o,s)})).on("mouseenter",(function(t){_||a.constraints.active||0!==event.buttons||Vr(l,t,c.clientHeight,o,h,f,a.transform)})).on("mouseleave",(function(){!_&&Rr(l)})).on("mousedown",(function(){Rr(l)})).on("touchmove",(function(){Rr(l)})).on("wheel",(function(){Rr(l)})),"expandAll"!==u&&e.selectAll(".sn-org-nodes").data(r.filter((function(t){return!!t.children&&"Root"!==t.data.id}))).enter().append("div").attr("class","sn-org-traverse").attr("style",(function(t){return"width:".concat(g,"px;height:").concat(m,"px;top:").concat(f(t)+p+y,"px;left:").concat(h(t)+(d-g)/2,"px;")})).attr("id",(function(t){return"".concat(t.data.id,"-expand")})).on("mouseenter",(function(){a.constraints.active||(event.target.style.cursor="pointer")})).on("click",(function(t){a.constraints.active||(i(function(t,n,e){var r=n.topId,o=n.isExpanded,i=n.expandedChildren;if(t.data.id===r)o=!o,i=[];else if(e.includes(t.data.id))r=t.parent?t.parent.data.id:t.data.id,o=!!t.parent,i=[];else if(t.parent.data.id===r){var a=t.parent.children.filter((function(t){return i.includes(t.data.id)})).every((function(t){return zr(t.children)}));i.includes(t.data.id)?i.splice(i.indexOf(t.data.id),1):zr(t.children)&&a?i.push(t.data.id):i=[t.data.id]}else r=t.parent.data.id,o=!0,i=[t.data.id];return{topId:r,isExpanded:o,expandedChildren:i}}(t,a.expandedState,w)),event.stopPropagation())})).html((function(t){return"".concat(function(t,n,e){var r=n.topId,o=n.isExpanded,i=n.expandedChildren;return t.data.id===r&&o||t.parent&&t.parent.data.id===r&&i.includes(t.data.id)||e.includes(t.data.id)?"-":"+"}(t,a.expandedState,w)," ").concat(t.data.children.length)}))}function $r(t,n,e,r){t.append("path").attr("class","sn-org-path").attr("id",(function(t){return t.data.id})).attr("d",(function(t){var e="";return function(t,n,e,r){var o=e.depthSpacing,i=e.isVertical,a=e.x,s=e.y,u=Nr.cardHeight,c=Nr.buttonHeight,l=Nr.cardPadding,h=Nr.buttonMargin,f=[],d=Nr.cardWidth/2,p=u/2,g={x:t.xActual,y:t.yActual};if(t.parent&&"Root"!==t.parent.data.id){var m=o/2,y="expandAll"===r?u:u+l+c,v={x:a(t.parent)+d,y:s(t.parent)+y};"expandAll"!==r&&zr(t.parent.children)?f.push(i?[{x:g.x,y:g.y+p},{x:v.x-d,y:g.y+p},{x:v.x-d,y:v.y+h},{x:v.x,y:v.y+h},{x:v.x,y:v.y}]:[{x:g.x,y:g.y},{x:g.x,y:v.y-p},{x:v.x+m,y:v.y-p},{x:v.x+m,y:v.y},{x:v.x,y:v.y}]):g.x===a(t.parent)||g.y===s(t.parent)?f.push([{x:g.x+d,y:g.y},{x:v.x,y:v.y}]):f.push(i?[{x:g.x+d,y:g.y},{x:g.x+d,y:g.y-l},{x:v.x,y:g.y-l},{x:v.x,y:v.y}]:[{x:g.x,y:g.y},{x:g.x-l,y:g.y},{x:g.x-l,y:v.y},{x:v.x,y:v.y}])}else t.parent&&f.push([{x:g.x+d,y:g.y},{x:g.x+d,y:g.y-l}]);return t.children&&"Root"!==t.data.id&&f.push([{x:g.x+d,y:g.y+u},{x:g.x+d,y:g.y+u+l}]),f}(t,0,n,r).forEach((function(t){e+=function(t){var n,e=Nr.r,r="M ".concat(t[0].x," ").concat(t[0].y," "),o=function(e){var r=t[e].x-t[e-1].x,o=t[e].y-t[e-1].y;n={x:(r>0)-(r<0)||+r,y:(o>0)-(o<0)||+o}};o(1);for(var i=1;i<t.length;++i){var a=t[i];i<t.length-1?(r+="L ".concat(a.x-n.x*e," ").concat(a.y-n.y*e," "),o(i+1),r+="Q ".concat(a.x," ").concat(a.y," ").concat(a.x+n.x*e," ").concat(a.y+n.y*e," ")):r+="L ".concat(a.x," ").concat(a.y," ")}return r}(t).slice(0,-1)})),e}))}var Xr=function(t,n,e,r,o){var i=t.k,a="".concat(t.x,"px, ").concat(t.y,"px");n.attr("transform",t),e.classed("org-disable-transition",!0),n.classed("org-disable-transition",!0),e.attr("style","width:".concat(r,"px;height:").concat(o,"px; transform: translate(").concat(a,") scale(").concat(i,")"))};var Wr=function(t,n,e,r){var o=t.topId,i=t.isExpanded,a=t.expandedChildren;if("expandAll"===r)return n.descendants();var s=n.descendants().find((function(t){return t.data.id===o}))||n,c=[];if(i&&s.children&&s.children.forEach((function(t){c.push(t),t.children&&(-1!==a.indexOf(t.data.id)||e)&&t.children.forEach((function(n){c.push(n),-1!==a.indexOf(t.data.id)&&e&&n.children&&n.children.forEach((function(t){c.push(t)}))}))})),"free"===n.data.navigationMode&&s.parent){var l=s.parent.ancestors(),h=l.map((function(t){return t.data.id}));l.forEach((function(t){e&&t.children.forEach((function(t){t.children&&-1===h.indexOf(t.data.id)&&t.data.id!==s.data.id&&c.unshift.apply(c,u(t.children))})),c.unshift.apply(c,u(t.children)),t.parent||c.unshift(t)}))}else c.unshift(s);return c},Yr=function t(n){var e=n.element,r=n.dataTree,o=n.selectionObj,i=n.wrapperState,a=n.setInitialZoom,s=n.setTransform,u=n.setExpandedState,c=n.viewState,l=n.setContainerData,h=n.layout;e.innerHTML="",e.className="sn-org-chart";var f=h.navigationMode,d=jr("ttb",e,{},f),p=e.getBoundingClientRect(),g=p.width,m=p.height,y=jt(e).append("span").attr("class","sn-org-zoomwrapper").on("click",(function(){i.constraints.select||o.api.isActive()&&o.state||(o.api.begin("/qHyperCubeDef"),o.setState([]))})).node(),v=jt(y).selectAll("svg").data([{}]).enter().append("svg").attr("class","sn-org-svg").attr("width","100%").attr("height","100%"),b=jt(y).selectAll("div").data([{}]).enter().append("div").attr("class","sn-org-nodes"),x=jt(e).append("button").attr("class","sn-org-homebutton disabled").on("click",(function(){t({element:e,dataTree:r,selectionObj:o,wrapperState:i,setInitialZoom:a,setTransform:s,setExpandedState:u,viewState:c,setContainerData:l,layout:h})})).html('<span class="lui-fade-button__icon sn-org-home-icon">\n <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 16 16">\n <defs>\n <path id="home-a" d="M2,7.9 L8,3.4 L14,7.9 L14,16 L12,16 L12,11.2 C12,11.0895431 11.9104569,11 11.8,11 L9.2,11 C9.08954305,11 9,11.0895431 9,11.2 L9,16 L2,16 L2,7.9 Z M7,13.8 L7,11.2 C7,11.0895431 6.91045695,11 6.8,11 L4.2,11 C4.08954305,11 4,11.0895431 4,11.2 L4,13.8 C4,13.9104569 4.08954305,14 4.2,14 L6.8,14 C6.91045695,14 7,13.9104569 7,13.8 Z M13,4.1 L16,6.5 L15,7.5 L8,2 L1,7.5 L0,6.5 L8,0 L11,2.4 L11,1 L13,1 L13,4.1 Z"/>\n </defs>\n <use xlink:href="#home-a"/>\n </svg>\n </span>').node(),w=function(t){var n=jt(t).append("div").attr("class","sn-org-tooltip").on("mousedown",(function(){n.classed("sn-org-tooltip-visible",!1)}));return n}(e);if(r.error)return jt(y).append("div").attr("class","sn-org-error").html(r.message),!1;r.warn&&r.warn.length&&jt(y).append("span").attr("class","sn-org-warning").html("*".concat(r.warn.join(" ")));var _=v.append("g").attr("class","sn-org-paths"),k=ir().size([g,m]).nodeSize([Nr.cardWidth+Nr.cardPadding,d.depthSpacing])(Ue(r)),C=!i.expandedState||!k.descendants().find((function(t){return t.data.id===i.expandedState.topId})),E=C?{topId:k.data.id,isExpanded:!0,expandedChildren:[],useTransitions:!1}:i.expandedState,M=Wr(E,k,!1,f);M.forEach((function(t){t.xActual&&t.yActual||(d.x(t),d.y(t))}));var L=function(t){var n=Nr.cardWidth,e=Nr.cardHeight,r=Nr.buttonHeight,o=Nr.buttonMargin,i={left:1/0,top:1/0,right:-1/0,bottom:-1/0};return t.forEach((function(t){i.left=Math.min(t.xActual,i.left),i.top=Math.min(t.yActual,i.top),i.right=Math.max(t.xActual,i.right),i.bottom=Math.max(t.yActual,i.bottom)})),{x:i.left,y:i.top-r-o,width:i.right-i.left+n,height:i.bottom-i.top+e+2*(r+o)}}(M),O=c&&c.initialZoom?c.initialZoom:function(t,n,e){var r=Nr.widthMargin,o=Nr.cardHeight,i=Nr.minZoom,a="expandAll"===e?1/0:Nr.maxZoom,s=t.width,u=t.height,c=n.clientHeight,l=n.clientWidth,h=s+2*r,f=u+o,d=Math.max(Math.min(h/l,a),i),p=Math.max(Math.min(f/c,a),i);return d>p?{initialX:-t.x+r,initialY:-t.y+(c*d-u)/2,initialZoom:d}:{initialX:-t.x+(l*p-s)/2,initialY:o/2,initialZoom:p}}(L,e,f);return a(O),d=jr("ttb",e,O,f),function(t){var n=t.containerData,e=t.setTransform,r=t.transformState,o=t.wrapperState,i=t.initialZoomState,a=t.navigationMode,s=n.svg,u=n.divBox,c=n.width,l=n.height,h=n.zoomWrapper,f=n.element,d=n.tooltip,p=n.homeButton,g=r.x,m=void 0===g?0:g,y=r.y,v=void 0===y?0:y,b=Nr.minZoom,x=Nr.maxZoom,w=r&&1/r.zoom||i.initialZoom,_="expandAll"===a?w:Math.max(Math.min(x,w),b),k=function(){var t=document.createEvent("MouseEvents");t.initEvent("mousedown",!0,!1),f.dispatchEvent(t)};jt(h).call(vr().extent([[0,0],[c,l]]).filter((function(){return!(o.constraints.active||"dblclick"===kt.type||"mousedown"===kt.type&&3===kt.which)})).scaleExtent(["expandAll"===a?.8:b*_,x*_]).on("start",k).on("zoom",(function(){jt(p).attr("class","sn-org-homebutton lui-fade-button lui-fade-button--large"),e({zoom:kt.transform.k/_,x:kt.transform.x,y:kt.transform.y}),k(),Rr(d),Xr(cr.translate(kt.transform.x,kt.transform.y).scale(kt.transform.k/_),s,u,c,l)}))),e({zoom:1/_,x:m,y:v}),Xr(cr.translate(m,v).scale(1/_),s,u,c,l)}({containerData:{svg:_,divBox:b,width:g,height:m,zoomWrapper:y,element:e,tooltip:w,homeButton:x},setTransform:s,transformState:c&&c.transform||{},wrapperState:i,initialZoomState:O,navigationMode:f}),C&&u(E),l({svg:_,divBox:b,allNodes:k,positioning:d,width:g,height:m,element:e,zoomWrapper:y,tooltip:w,homeButton:x})},Ur=function(t,n,e,r){var o={expandedState:t,transform:n,size:{w:r.clientWidth,h:r.clientHeight},initialZoom:e};return o.expandedState.useTransitions=!1,o};function Fr(n,e,r,o,i){var a=t.useElement();t.onTakeSnapshot((function(t){t.snapshotData||(t.snapshotData={}),r.snapshotData&&r.snapshotData.viewState||(t.snapshotData.viewState=Ur(n,o,i,a)),t.snapshotData.dataMatrix=function(t,n,e){if(e.snapshotData&&e.snapshotData.dataMatrix)return e.snapshotData.dataMatrix;var r=e.navigationMode,o=Wr(t,n,!0,r),i=[],a=e.qHyperCube.qDataPages,s=[];return a.forEach((function(t){s.push.apply(s,u(t.qMatrix))})),o.forEach((function(t){void 0!==t.data.rowNo&&i.push(s[t.data.rowNo])})),i}(n,e.allNodes,r)})),t.useImperativeHandle((function(){return{getViewState:function(){return Ur(n,o,i,a)}}}))}var Gr={"Object.OrgChart":"Org chart","Object.OrgChart.Description":"Displays the relations of an organization or similarly structured data. Starts at the top and allows for navigation through the hierarchy.","Object.OrgChart.MaxData":"The maximum data limit is reached. The tree may display incorrectly.","Object.OrgChart.DummyWarn":"The data contains multiple root nodes.","Object.OrgChart.CycleWarning":"Data contains circular references, nodes are omitted.","Object.OrgChart.MissingRoot":"No root node, check your data for circular references.","Object.OrgChart.MaxChildren":"Maximum number of child nodes reached, nodes are omitted.","Object.OrgChart.LabelExpression":"Card title","Object.OrgChart.SubLabelExpression":"Card sub-title","Object.OrgChart.ExtraLabelExpression":"Card description","Object.OrgChart.ColorLabelExpression":"Card background color","Object.OrgChart.BackgroundColor":"Background color","Object.OrgChart.FontColor":"Font color","Object.OrgChart.IncludeDescendants":"Include descendants","Object.OrgChart.ExtraLabelDesc":"Description is only visible when a measure is not used"};function Qr(t){if(t&&t.get&&t.add){var n="Object.OrgChart.MaxData";if(t.get(n)!==n)return;Object.keys(Gr).forEach((function(n){t.add({id:n,locale:{"en-US":Gr[n]}})}))}}function Kr(t,n,e){var r;switch(t.colorType){case"byExpression":r=xr(t.colorExpression);break;case"colorPicker":r=n.getColorPickerColor(t.color);break;default:r=e}return"none"===r?e:r}var Jr=function(t){var n=t.Theme,e=t.layout,r=Kr(e.style.backgroundColor,n,"#e6e6e6"),o=Kr(e.style.fontColor,n,"default"),i=e.qHyperCube.qMeasureInfo.length?e.qHyperCube.qMeasureInfo[0].qFallbackTitle:null,a=e.style.border,s=void 0===a?{colorType:"auto"}:a;return{backgroundColor:r,fontColor:o,measureLabel:i,border:s,borderColor:"auto"!==s.colorType?Kr(s,n,wr(r)):wr(r)}},to=function(t,n){var e=t.viewState;return!e&&n.snapshotData&&n.snapshotData.viewState&&(e=n.snapshotData.viewState),e};function no(t,n){void 0===n&&(n={});var e=n.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===e&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}no(".sn-org-chart {\n /* Tooltip arrow */\n}\n.sn-org-chart .sn-org-tooltip {\n visibility: hidden;\n opacity: 0;\n /* Unsupported in IE, so there we set width explicitly */\n width: 230px;\n width: -moz-max-content;\n width: fit-content;\n /* Position the tooltip text */\n position: absolute;\n z-index: 1;\n}\n.sn-org-chart .sn-org-tooltip::after {\n content: '';\n position: absolute;\n top: 100%;\n left: 0%;\n margin-left: -10px;\n border-width: 10px;\n border-style: solid;\n border-color: #404040 transparent transparent transparent;\n}\n.sn-org-chart .sn-org-tooltip-visible {\n opacity: 0.9;\n visibility: visible;\n}\n.sn-org-chart .sn-org-tooltip-inner {\n max-width: 240px;\n right: 50%;\n font-family: 'QlikView Sans', sans-serif;\n position: relative;\n max-height: 150px;\n background-color: #404040;\n color: #e6e6e6;\n text-align: left;\n font-size: 13px;\n line-height: 15px;\n padding: 10px 10px 10px 10px;\n border-radius: 6px;\n overflow-wrap: break-word;\n word-wrap: break-word;\n word-break: break-word;\n overflow: hidden;\n}\n.sn-org-chart .sn-org-tooltip-inner .sn-org-tooltip-header {\n font-weight: bold;\n padding-bottom: 5px;\n}\n");no(".sn-org-chart .sn-org-svg {\n position: absolute;\n /* For css only transitions, does not work in IE11 */\n}\n.sn-org-chart .sn-org-svg .sn-org-path {\n fill: none;\n stroke: #4c4c4c;\n stroke-width: 1;\n}\n.sn-org-chart .sn-org-svg .sn-org-paths:not(.org-disable-transition) {\n transform-origin: 0% 0%;\n transition-property: all;\n transition-duration: 0.5s;\n}\n");no(".sn-org-chart .sn-org-warning {\n position: absolute;\n bottom: 0px;\n left: 0px;\n font-style: italic;\n font-size: 13px;\n color: #7b7a78;\n}\n.sn-org-chart .sn-org-error {\n margin: 0;\n position: absolute;\n top: 50%;\n left: 50%;\n font-size: 1.2em;\n transform: translate(-50%, -50%);\n}\n");no(".sn-org-chart {\n overflow: hidden;\n}\n.sn-org-chart .sn-org-nodes {\n position: absolute;\n transform-origin: 0% 0%;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n backface-visibility: hidden;\n}\n.sn-org-chart .sn-org-nodes:not(.org-disable-transition) {\n transition-property: all;\n transition-duration: 0.5s;\n}\n.sn-org-chart .sn-org-nodes .sn-org-traverse {\n position: absolute;\n background-color: white;\n font-size: 20px;\n font-weight: bold;\n border-radius: 3px;\n border: 1px solid #8c8c8c;\n text-align: center;\n line-height: 24px;\n}\n.sn-org-chart .sn-org-nodes .sn-org-root {\n position: absolute;\n background-color: #8c8c8c;\n width: 20px;\n height: 20px;\n border-radius: 20px;\n}\n.sn-org-chart .sn-org-nodes .sn-org-card {\n position: absolute;\n}\n.sn-org-chart .sn-org-nodes .sn-org-card .sn-org-card-text {\n padding-left: 5px;\n padding-right: 5px;\n border-radius: 3px;\n}\n.sn-org-chart .sn-org-nodes .sn-org-card .sn-org-card-text.selected {\n border: 4px solid black;\n border-radius: 4px;\n}\n.sn-org-chart .sn-org-nodes .sn-org-card .sn-org-card-text.not-selected {\n opacity: 0.5;\n}\n.sn-org-chart .sn-org-nodes .sn-org-card .sn-org-card-title {\n font-size: 14px;\n font-weight: bold;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.sn-org-chart .sn-org-nodes .sn-org-card .sn-org-card-label {\n font-size: 11px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n");return no(".sn-org-chart .sn-org-homebutton {\n position: absolute;\n top: 20px;\n right: 20px;\n height: 20px;\n width: 20px;\n border-color: transparent;\n background-color: transparent;\n fill: rgba(89, 89, 89, 0.8);\n transition: fill 200ms ease-out;\n}\n.sn-org-chart .sn-org-homebutton:hover {\n fill: #595959;\n}\n.sn-org-chart .sn-org-homebutton.disabled {\n display: none;\n}\n"),function(n){return{qae:{properties:h,data:f},component:function(){var n=t.useStaleLayout(),e=t.useModel(),r=t.useElement(),o=t.useTheme(),i=t.useOptions(),a=t.useRect(),u=t.useConstraints(),c=t.useTranslator(),l=s(t.useState(null),2),h=l[0],f=l[1],d=s(t.useState(null),2),p=d[0],g=d[1],m=s(t.useState(null),2),y=m[0],v=m[1],b=s(t.useState(null),2),x=b[0],w=b[1],_=s(t.useState(null),2),k=_[0],C=_[1],E=s(t.useState({transform:{},constraints:u,expandedState:y}),1)[0],M=function(n){var e=s(t.useState(!1),2),r=e[0],o=e[1],i=t.useSelections(),a=!!t.useLayout().qSelectionInfo.qInSelections,u=s(t.useState({api:i,setState:function(t){u.state=t},state:[],singleSelect:!1}),1)[0];t.useEffect((function(){Qr(n)}),[n]);var c=function(){u.state=[]},l=function(){u.state=[],o(!1)};return t.useEffect((function(){return u.api?(u.api=i,u.api.on("deactivated",c),u.api.on("canceled",l),u.api.on("confirmed",l),u.api.on("cleared",c),function(){u.api.removeListener("deactivated",c),u.api.removeListener("canceled",l),u.api.removeListener("confirmed",l),u.api.removeListener("cleared",c)}):function(){}}),[i]),t.useEffect((function(){u.singleSelect=r}),[r]),t.useAction((function(){return{action:function(){o(!r)},icon:{shapes:[{type:"path",attrs:{d:"M9.5,15 C9.77614237,15 10,15.2238576 10,15.5 C10,15.7761424 9.77614237,16 9.5,16 L6.5,16 C6.22385763,16 6,15.7761424 6,15.5 C6,15.2238576 6.22385763,15 6.5,15 L9.5,15 Z M15.5,13 C15.7761424,13 16,13.2238576 16,13.5 L16,15 C16,15.5522847 15.5522847,16 15,16 L13.5,16 C13.2238576,16 13,15.7761424 13,15.5 C13,15.2238576 13.2238576,15 13.5,15 L14.4,15 C14.7313708,15 15,14.7313708 15,14.4 L15,13.5 C15,13.2238576 15.2238576,13 15.5,13 Z M0.5,13 C0.776142375,13 1,13.2238576 1,13.5 L1,14.4 C1,14.7313708 1.26862915,15 1.6,15 L2.5,15 C2.77614237,15 3,15.2238576 3,15.5 C3,15.7761424 2.77614237,16 2.5,16 L1,16 C0.44771525,16 0,15.5522847 0,15 L0,13.5 C0,13.2238576 0.223857625,13 0.5,13 Z M6.8,9 C6.91045695,9 7,9.08954305 7,9.2 L7,12.8 C7,12.9104569 6.91045695,13 6.8,13 L3.2,13 C3.08954305,13 3,12.9104569 3,12.8 L3,9.2 C3,9.08954305 3.08954305,9 3.2,9 L6.8,9 Z M12.8,9 C12.9104569,9 13,9.08954305 13,9.2 L13,12.8 C13,12.9104569 12.9104569,13 12.8,13 L9.2,13 C9.08954305,13 9,12.9104569 9,12.8 L9,9.2 C9,9.08954305 9.08954305,9 9.2,9 L12.8,9 Z M6,10 L4,10 L4,12 L6,12 L6,10 Z M12,10 L10,10 L10,12 L12,12 L12,10 Z M15.5,6 C15.7761424,6 16,6.22385763 16,6.5 L16,9.5 C16,9.77614237 15.7761424,10 15.5,10 C15.2238576,10 15,9.77614237 15,9.5 L15,6.5 C15,6.22385763 15.2238576,6 15.5,6 Z M0.5,6 C0.776142375,6 1,6.22385763 1,6.5 L1,9.5 C1,9.77614237 0.776142375,10 0.5,10 C0.223857625,10 0,9.77614237 0,9.5 L0,6.5 C0,6.22385763 0.223857625,6 0.5,6 Z M6.8,3 C6.91045695,3 7,3.08954305 7,3.2 L7,6.8 C7,6.91045695 6.91045695,7 6.8,7 L3.2,7 C3.08954305,7 3,6.91045695 3,6.8 L3,3.2 C3,3.08954305 3.08954305,3 3.2,3 L6.8,3 Z M12.8,3 C12.9104569,3 13,3.08954305 13,3.2 L13,6.8 C13,6.91045695 12.9104569,7 12.8,7 L9.2,7 C9.08954305,7 9,6.91045695 9,6.8 L9,3.2 C9,3.08954305 9.08954305,3 9.2,3 L12.8,3 Z M12,4 L10,4 L10,6 L12,6 L12,4 Z M2.5,5.70654635e-14 C2.77614237,5.70654635e-14 3,0.223857625 3,0.5 C3,0.776142375 2.77614237,1 2.5,1 L1.6,1 C1.26862915,1 1,1.26862915 1,1.6 L1,2.5 C1,2.77614237 0.776142375,3 0.5,3 C0.223857625,3 0,2.77614237 0,2.5 L0,1 C0,0.44771525 0.44771525,5.70654635e-14 1,5.70654635e-14 L2.5,5.70654635e-14 Z M15,0 C15.5522847,0 16,0.44771525 16,1 L16,2.5 C16,2.77614237 15.7761424,3 15.5,3 C15.2238576,3 15,2.77614237 15,2.5 L15,1.6 C15,1.26862915 14.7313708,1 14.4,1 L13.5,1 C13.2238576,1 13,0.776142375 13,0.5 C13,0.223857625 13.2238576,0 13.5,0 L15,0 Z M9.5,5.67323966e-14 C9.77614237,5.67323966e-14 10,0.223857625 10,0.5 C10,0.776142375 9.77614237,1 9.5,1 L6.5,1 C6.22385763,1 6,0.776142375 6,0.5 C6,0.223857625 6.22385763,5.67323966e-14 6.5,5.67323966e-14 L9.5,5.67323966e-14 Z"}}]},active:r,hidden:!a,label:n.get("Object.OrgChart.SingleSelect")}}),[r,a]),t.useEffect((function(){var t=function(t){"Shift"===t.key&&o(!0)},n=function(t){"Shift"===t.key&&o(!1)};return document.addEventListener("keydown",t),document.addEventListener("keyup",n),function(){document.removeEventListener("keydown",t),document.removeEventListener("keyup",n)}}),[]),u}(c);t.useEffect((function(){Qr(c)}),[c.language()]),t.useEffect((function(){E.constraints=u}),[u]),t.useEffect((function(){E.transform=x}),[x]),t.useEffect((function(){E.expandedState=y}),[y]);var L=function(t){t.useTransitions=!0,v(t)},O=s(t.usePromise((function(){if(!n)return Promise.resolve();var t=to(i,n);return t&&t.expandedState&&v(t.expandedState),t&&t.transform&&w(t.transform),function(t){return Tr.apply(this,arguments)}({layout:n,model:e,translator:c}).then((function(t){return g(Jr({Theme:o,layout:n})),M.setState([]),t}))}),[n,e,c.language(),o.name()]),1)[0],S=function(){if(r&&O){var t=to(i,n);Yr({element:r,dataTree:O,viewState:t,wrapperState:E,selectionObj:M,setInitialZoom:C,setTransform:w,setExpandedState:v,setContainerData:f,layout:n})}},A=function(){h&&y&&p&&function(t){var n=t.containerData,e=t.styling,r=t.setExpandedCallback,o=t.wrapperState,i=t.selectionObj,a=t.element,s=n.svg,u=n.divBox,c=n.allNodes,l=n.positioning,h=n.tooltip,f=c.data.navigationMode;u.selectAll("*").remove(),s.selectAll("*").remove();var d=Wr(o.expandedState,c,!1,f);Zr({positioning:l,divBox:u,nodes:d,styling:e,setExpandedCallback:r,wrapperState:o,selectionObj:i,navigationMode:f,element:a,tooltip:h}),$r(s.selectAll(".sn-org-paths").data(d).enter(),l,o.expandedState.topId,f)}({containerData:h,styling:p,setExpandedCallback:L,wrapperState:E,selectionObj:M,useTransitions:y.useTransitions,element:r})};t.useEffect((function(){A()}),[h,M.state]),t.useEffect((function(){S()}),[r,O,u]),t.useEffect((function(){n.resizeOnExpand?S():A()}),[y]),t.useEffect((function(){if(h&&n&&n.snapshotData){var t=function(t,n,e){if(!n)return cr.translate(e.x,e.y).scale(e.zoom);var r=n.size,o=t.width/r.w>t.height/r.h?t.height/r.h:t.width/r.w,i=n.transform.x*o,a=n.transform.y*o,s=n.transform.zoom*o;return cr.translate(i,a).scale(s)}(a,n.snapshotData.viewState,x);Xr(t,h.svg,h.divBox,a.width,a.height)}}),[a,h]),Fr(y,h,n,x,k)},ext:m}}}));
7
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["sn-org-chart"]=e(t.stardust)}(this,(function(t){"use strict";var e={FONT_COLOR_TYPE:"auto",FONT_COLOR_DARK:{index:-1,color:"#484848"},FONT_COLOR_LIGHT:{index:-1,color:"#e6e6e6"},BACKGROUND_COLOR_TYPE:"colorPicker",BACKGROUND_COLOR:{index:-1,color:"#ffffff"},BORDER_COLOR_TYPE:"auto",BORDER_COLOR:{index:-1,color:"#737373"},BORDER_FULL:!0,BORDER_TOP:!0};const n={qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:5,qHeight:500}],qSuppressZero:!1,qSuppressMissing:!0},showTitles:!0,title:"",subtitle:"",footnote:"",navigationMode:"free",resizeOnExpand:!1,style:{fontColor:{colorType:e.FONT_COLOR_TYPE,color:e.FONT_COLOR_DARK,colorExpression:""},backgroundColor:{colorType:e.BACKGROUND_COLOR_TYPE,color:e.BACKGROUND_COLOR,colorExpression:""},border:{top:e.BORDER_TOP,fullBorder:e.BORDER_FULL,colorType:e.BORDER_COLOR_TYPE,color:e.BORDER_COLOR,colorExpression:""}}};var r={targets:[{path:"/qHyperCubeDef",dimensions:{min:2,max:2},measures:{min:0,max:1}}]};var o={getValue:function(t,e,n){const r=e.split(".");let o;if(void 0===t)return n;let i=t;for(o=0;o<r.length;++o){if(void 0===i[r[o]])return n;i=i[r[o]]}return i}};const i=[{value:"auto",translation:"Common.Auto"},{value:"colorPicker",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],a=t=>o.getValue(t,"style.border.top")||o.getValue(t,"style.border.fullBorder");var s,l,u={definition:{type:"items",component:"accordion",items:{data:{uses:"data",items:{measures:{disabledRef:""},dimensions:{disabledRef:"",items:{dimensionLimits:{show:!1},attributes:{component:"attribute-expression-reference",defaultValue:[],show:(t,e)=>e.getDimensions()[0]===t,ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",translation:"Object.OrgChart.LabelExpression",defaultValue:"",id:"labelExpression",tid:"labelExpression"},{component:"expression",ref:"qExpression",translation:"Object.OrgChart.SubLabelExpression",defaultValue:"",id:"subLabelExpression",tid:"subLabelExpression"},{component:"expression",ref:"qExpression",translation:"Object.OrgChart.ExtraLabelExpression",defaultValue:"",id:"extraLabelExpression",tid:"extraLabelExpression"},{component:"expression",ref:"qExpression",translation:"Object.OrgChart.ColorLabelExpression",defaultValue:"",id:"colorByExpression",tid:"nodeColorByExpression"}]},desc:{show:(t,e)=>e.getDimensions()[0]===t,component:"text",translation:"Object.OrgChart.ExtraLabelDesc",style:"hint"}}}}},sorting:{uses:"sorting"},addOns:{type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"},rowLimit:{type:"integer",translation:"$RowLimit",ref:"rowLimit",defaultValue:3e4,min:5e3,max:1e5,show:!1}}}}},settings:{uses:"settings",items:{styling:{grouped:!0,translation:"properties.presentation",type:"items",items:{navigation:{type:"items",items:{navigationMode:{ref:"navigationMode",type:"string",translation:"Object.OrgChart.NavigationMode",component:"dropdown",defaultValue:"free",options:[{value:"free",translation:"Object.OrgChart.FreeMode"},{value:"expandAll",translation:"Object.OrgChart.ExpandAll"}]},resizeOnExpand:{ref:"resizeOnExpand",type:"boolean",defaultValue:!1,translation:"Object.OrgChart.resizeOnExpand",show:t=>"expandAll"!==o.getValue(t,"navigationMode")}}},backgroundColor:{type:"items",items:{useColorExpression:{ref:"style.backgroundColor.colorType",type:"string",translation:"Object.OrgChart.BackgroundColor",component:"dropdown",defaultValue:e.BACKGROUND_COLOR_TYPE,options:i},colorPicker:{component:"color-picker",type:"object",ref:"style.backgroundColor.color",translation:"properties.color",dualOutput:!0,defaultValue:e.BACKGROUND_COLOR,show:t=>"colorPicker"===o.getValue(t,"style.backgroundColor.colorType")},colorExpression:{component:"string",type:"string",ref:"style.backgroundColor.colorExpression",translation:"Common.Expression",expression:"optional",defaultValue:"",show:t=>"byExpression"===o.getValue(t,"style.backgroundColor.colorType")}}},fontColor:{type:"items",items:{useColorExpression:{ref:"style.fontColor.colorType",type:"string",translation:"Object.OrgChart.FontColor",component:"dropdown",defaultValue:e.FONT_COLOR_TYPE,options:i},colorPicker:{component:"color-picker",type:"object",ref:"style.fontColor.color",translation:"properties.color",dualOutput:!0,defaultValue:e.FONT_COLOR_DARK,show:t=>"colorPicker"===o.getValue(t,"style.fontColor.colorType")},colorExpression:{component:"string",type:"string",ref:"style.fontColor.colorExpression",translation:"Common.Expression",expression:"optional",defaultValue:"",show:t=>"byExpression"===o.getValue(t,"style.fontColor.colorType")}}},border:{type:"items",items:{appearanceHeader:{component:"text",translation:"Object.OrgChart.CardAppearance",style:"pp-nm-hcd__list-header"},topBar:{type:"boolean",ref:"style.border.top",translation:"Object.OrgChart.TopBar",defaultValue:e.BORDER_TOP},fullBorder:{type:"boolean",ref:"style.border.fullBorder",translation:"properties.border",defaultValue:e.BORDER_FULL},colorType:{component:"dropdown",type:"string",ref:"style.border.colorType",translation:"properties.border.color",defaultValue:e.BORDER_COLOR_TYPE,options:i,show:t=>a(t)},colorPicker:{component:"color-picker",type:"object",ref:"style.border.color",translation:"properties.color",dualOutput:!0,defaultValue:e.BORDER_COLOR,show:t=>a(t)&&"colorPicker"===o.getValue(t,"style.border.colorType")},colorExpression:{component:"string",type:"string",ref:"style.border.colorExpression",translation:"Common.Expression",expression:"optional",defaultValue:"",show:t=>a(t)&&"byExpression"===o.getValue(t,"style.border.colorType")}}}}}}}}},support:{export:!0,exportData:!0,snapshot:!0,viewData:!0}};function c(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}1===(s=c).length&&(l=s,s=function(t,e){return c(l(t),e)});var h={value:function(){}};function d(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new p(r)}function p(t){this._=t}function f(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function g(t,e){for(var n,r=0,o=t.length;r<o;++r)if((n=t[r]).name===e)return n.value}function m(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=h,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}p.prototype=d.prototype={constructor:p,on:function(t,e){var n,r=this._,o=f(t+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++i<a;)if(n=(t=o[i]).type)r[n]=m(r[n],t.name,e);else if(null==e)for(n in r)r[n]=m(r[n],t.name,null);return this}for(;++i<a;)if((n=(t=o[i]).type)&&(n=g(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new p(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(r=this._[t]).length;i<n;++i)r[i].value.apply(e,o)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};var y="http://www.w3.org/1999/xhtml",b={svg:"http://www.w3.org/2000/svg",xhtml:y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function v(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),b.hasOwnProperty(e)?{space:b[e],local:t}:t}function x(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===y&&e.documentElement.namespaceURI===y?e.createElement(t):e.createElementNS(n,t)}}function w(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function _(t){var e=v(t);return(e.local?w:x)(e)}function C(){}function E(t){return null==t?C:function(){return this.querySelector(t)}}function O(){return[]}function k(t){return null==t?O:function(){return this.querySelectorAll(t)}}function L(t){return function(){return this.matches(t)}}function M(t){return new Array(t.length)}function A(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}A.prototype={constructor:A,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function T(t,e,n,r,o,i){for(var a,s=0,l=e.length,u=i.length;s<u;++s)(a=e[s])?(a.__data__=i[s],r[s]=a):n[s]=new A(t,i[s]);for(;s<l;++s)(a=e[s])&&(o[s]=a)}function S(t,e,n,r,o,i,a){var s,l,u,c={},h=e.length,d=i.length,p=new Array(h);for(s=0;s<h;++s)(l=e[s])&&(p[s]=u="$"+a.call(l,l.__data__,s,e),u in c?o[s]=l:c[u]=l);for(s=0;s<d;++s)(l=c[u="$"+a.call(t,i[s],s,i)])?(r[s]=l,l.__data__=i[s],c[u]=null):n[s]=new A(t,i[s]);for(s=0;s<h;++s)(l=e[s])&&c[p[s]]===l&&(o[s]=l)}function z(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function D(t){return function(){this.removeAttribute(t)}}function R(t){return function(){this.removeAttributeNS(t.space,t.local)}}function N(t,e){return function(){this.setAttribute(t,e)}}function q(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function $(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function B(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function P(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function j(t){return function(){this.style.removeProperty(t)}}function H(t,e,n){return function(){this.style.setProperty(t,e,n)}}function I(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function V(t,e){return t.style.getPropertyValue(e)||P(t).getComputedStyle(t,null).getPropertyValue(e)}function Z(t){return function(){delete this[t]}}function Y(t,e){return function(){this[t]=e}}function X(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function F(t){return t.trim().split(/^|\s+/)}function W(t){return t.classList||new U(t)}function U(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function G(t,e){for(var n=W(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function K(t,e){for(var n=W(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function Q(t){return function(){G(this,t)}}function J(t){return function(){K(this,t)}}function tt(t,e){return function(){(e.apply(this,arguments)?G:K)(this,t)}}function et(){this.textContent=""}function nt(t){return function(){this.textContent=t}}function rt(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function ot(){this.innerHTML=""}function it(t){return function(){this.innerHTML=t}}function at(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function st(){this.nextSibling&&this.parentNode.appendChild(this)}function lt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ut(){return null}function ct(){var t=this.parentNode;t&&t.removeChild(this)}function ht(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function dt(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}U.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var pt={},ft=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(pt={mouseenter:"mouseover",mouseleave:"mouseout"}));function gt(t,e,n){return t=mt(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function mt(t,e,n){return function(r){var o=ft;ft=r;try{t.call(this,this.__data__,e,n)}finally{ft=o}}}function yt(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function bt(t){return function(){var e=this.__on;if(e){for(var n,r=0,o=-1,i=e.length;r<i;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++o]=n:this.removeEventListener(n.type,n.listener,n.capture);++o?e.length=o:delete this.__on}}}function vt(t,e,n){var r=pt.hasOwnProperty(t.type)?gt:mt;return function(o,i,a){var s,l=this.__on,u=r(e,i,a);if(l)for(var c=0,h=l.length;c<h;++c)if((s=l[c]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=u,s.capture=n),void(s.value=e);this.addEventListener(t.type,u,n),s={type:t.type,name:t.name,value:e,listener:u,capture:n},l?l.push(s):this.__on=[s]}}function xt(t,e,n){var r=P(t),o=r.CustomEvent;"function"==typeof o?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function wt(t,e){return function(){return xt(this,t,e)}}function _t(t,e){return function(){return xt(this,t,e.apply(this,arguments))}}var Ct=[null];function Et(t,e){this._groups=t,this._parents=e}function Ot(){return new Et([[document.documentElement]],Ct)}function kt(t){return"string"==typeof t?new Et([[document.querySelector(t)]],[document.documentElement]):new Et([[t]],Ct)}function Lt(){for(var t,e=ft;t=e.sourceEvent;)e=t;return e}function Mt(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}function At(t){var e=Lt();return e.changedTouches&&(e=e.changedTouches[0]),Mt(t,e)}function Tt(t,e,n){arguments.length<3&&(n=e,e=Lt().changedTouches);for(var r,o=0,i=e?e.length:0;o<i;++o)if((r=e[o]).identifier===n)return Mt(t,r);return null}function St(){ft.preventDefault(),ft.stopImmediatePropagation()}function zt(t){var e=t.document.documentElement,n=kt(t).on("dragstart.drag",St,!0);"onselectstart"in e?n.on("selectstart.drag",St,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Dt(t,e){var n=t.document.documentElement,r=kt(t).on("dragstart.drag",null);e&&(r.on("click.drag",St,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Rt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Nt(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function qt(){}Et.prototype=Ot.prototype={constructor:Et,select:function(t){"function"!=typeof t&&(t=E(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a,s=e[o],l=s.length,u=r[o]=new Array(l),c=0;c<l;++c)(i=s[c])&&(a=t.call(i,i.__data__,c,s))&&("__data__"in i&&(a.__data__=i.__data__),u[c]=a);return new Et(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=k(t));for(var e=this._groups,n=e.length,r=[],o=[],i=0;i<n;++i)for(var a,s=e[i],l=s.length,u=0;u<l;++u)(a=s[u])&&(r.push(t.call(a,a.__data__,u,s)),o.push(a));return new Et(r,o)},filter:function(t){"function"!=typeof t&&(t=L(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a=e[o],s=a.length,l=r[o]=[],u=0;u<s;++u)(i=a[u])&&t.call(i,i.__data__,u,a)&&l.push(i);return new Et(r,this._parents)},data:function(t,e){if(!t)return f=new Array(this.size()),c=-1,this.each((function(t){f[++c]=t})),f;var n,r=e?S:T,o=this._parents,i=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=i.length,s=new Array(a),l=new Array(a),u=new Array(a),c=0;c<a;++c){var h=o[c],d=i[c],p=d.length,f=t.call(h,h&&h.__data__,c,o),g=f.length,m=l[c]=new Array(g),y=s[c]=new Array(g);r(h,d,m,y,u[c]=new Array(p),f,e);for(var b,v,x=0,w=0;x<g;++x)if(b=m[x]){for(x>=w&&(w=x+1);!(v=y[w])&&++w<g;);b._next=v||null}}return(s=new Et(s,o))._enter=l,s._exit=u,s},enter:function(){return new Et(this._enter||this._groups.map(M),this._parents)},exit:function(){return new Et(this._exit||this._groups.map(M),this._parents)},join:function(t,e,n){var r=this.enter(),o=this,i=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(o=e(o)),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var l,u=e[s],c=n[s],h=u.length,d=a[s]=new Array(h),p=0;p<h;++p)(l=u[p]||c[p])&&(d[p]=l);for(;s<r;++s)a[s]=e[s];return new Et(a,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,o=t[e],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=z);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,s=n[i],l=s.length,u=o[i]=new Array(l),c=0;c<l;++c)(a=s[c])&&(u[c]=a);u.sort(e)}return new Et(o,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o,i=e[n],a=0,s=i.length;a<s;++a)(o=i[a])&&t.call(o,o.__data__,a,i);return this},attr:function(t,e){var n=v(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?R:D:"function"==typeof e?n.local?B:$:n.local?q:N)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?j:"function"==typeof e?I:H)(t,e,null==n?"":n)):V(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Z:"function"==typeof e?X:Y)(t,e)):this.node()[t]},classed:function(t,e){var n=F(t+"");if(arguments.length<2){for(var r=W(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof e?tt:e?Q:J)(n,e))},text:function(t){return arguments.length?this.each(null==t?et:("function"==typeof t?rt:nt)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ot:("function"==typeof t?at:it)(t)):this.node().innerHTML},raise:function(){return this.each(st)},lower:function(){return this.each(lt)},append:function(t){var e="function"==typeof t?t:_(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:_(t),r=null==e?ut:"function"==typeof e?e:E(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(ct)},clone:function(t){return this.select(t?dt:ht)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,o,i=yt(t+""),a=i.length;if(!(arguments.length<2)){for(s=e?vt:bt,null==n&&(n=!1),r=0;r<a;++r)this.each(s(i[r],e,n));return this}var s=this.node().__on;if(s)for(var l,u=0,c=s.length;u<c;++u)for(r=0,l=s[u];r<a;++r)if((o=i[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?_t:wt)(t,e))}};var $t=.7,Bt=1/$t,Pt="\\s*([+-]?\\d+)\\s*",jt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ht="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",It=/^#([0-9a-f]{3,8})$/,Vt=new RegExp("^rgb\\("+[Pt,Pt,Pt]+"\\)$"),Zt=new RegExp("^rgb\\("+[Ht,Ht,Ht]+"\\)$"),Yt=new RegExp("^rgba\\("+[Pt,Pt,Pt,jt]+"\\)$"),Xt=new RegExp("^rgba\\("+[Ht,Ht,Ht,jt]+"\\)$"),Ft=new RegExp("^hsl\\("+[jt,Ht,Ht]+"\\)$"),Wt=new RegExp("^hsla\\("+[jt,Ht,Ht,jt]+"\\)$"),Ut={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 Gt(){return this.rgb().formatHex()}function Kt(){return this.rgb().formatRgb()}function Qt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=It.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Jt(e):3===n?new re(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?te(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?te(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Vt.exec(t))?new re(e[1],e[2],e[3],1):(e=Zt.exec(t))?new re(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Yt.exec(t))?te(e[1],e[2],e[3],e[4]):(e=Xt.exec(t))?te(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ft.exec(t))?se(e[1],e[2]/100,e[3]/100,1):(e=Wt.exec(t))?se(e[1],e[2]/100,e[3]/100,e[4]):Ut.hasOwnProperty(t)?Jt(Ut[t]):"transparent"===t?new re(NaN,NaN,NaN,0):null}function Jt(t){return new re(t>>16&255,t>>8&255,255&t,1)}function te(t,e,n,r){return r<=0&&(t=e=n=NaN),new re(t,e,n,r)}function ee(t){return t instanceof qt||(t=Qt(t)),t?new re((t=t.rgb()).r,t.g,t.b,t.opacity):new re}function ne(t,e,n,r){return 1===arguments.length?ee(t):new re(t,e,n,null==r?1:r)}function re(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function oe(){return"#"+ae(this.r)+ae(this.g)+ae(this.b)}function ie(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"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===t?")":", "+t+")")}function ae(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function se(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ue(t,e,n,r)}function le(t){if(t instanceof ue)return new ue(t.h,t.s,t.l,t.opacity);if(t instanceof qt||(t=Qt(t)),!t)return new ue;if(t instanceof ue)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,s=i-o,l=(i+o)/2;return s?(a=e===i?(n-r)/s+6*(n<r):n===i?(r-e)/s+2:(e-n)/s+4,s/=l<.5?i+o:2-i-o,a*=60):s=l>0&&l<1?0:a,new ue(a,s,l,t.opacity)}function ue(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function ce(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function he(t){return function(){return t}}function de(t){return 1==(t=+t)?pe:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):he(isNaN(e)?n:e)}}function pe(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):he(isNaN(t)?e:t)}Rt(qt,Qt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Gt,formatHex:Gt,formatHsl:function(){return le(this).formatHsl()},formatRgb:Kt,toString:Kt}),Rt(re,ne,Nt(qt,{brighter:function(t){return t=null==t?Bt:Math.pow(Bt,t),new re(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?$t:Math.pow($t,t),new re(this.r*t,this.g*t,this.b*t,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:oe,formatHex:oe,formatRgb:ie,toString:ie})),Rt(ue,(function(t,e,n,r){return 1===arguments.length?le(t):new ue(t,e,n,null==r?1:r)}),Nt(qt,{brighter:function(t){return t=null==t?Bt:Math.pow(Bt,t),new ue(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?$t:Math.pow($t,t),new ue(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new re(ce(t>=240?t-240:t+120,o,r),ce(t,o,r),ce(t<120?t+240:t-120,o,r),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 t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var fe=function t(e){var n=de(e);function r(t,e){var r=n((t=ne(t)).r,(e=ne(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=pe(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function ge(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var me=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ye=new RegExp(me.source,"g");function be(t,e){var n,r,o,i=me.lastIndex=ye.lastIndex=0,a=-1,s=[],l=[];for(t+="",e+="";(n=me.exec(t))&&(r=ye.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:ge(n,r)})),i=ye.lastIndex;return i<e.length&&(o=e.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,r=0;r<e;++r)s[(n=l[r]).i]=n.x(t);return s.join("")})}var ve,xe,we,_e,Ce=180/Math.PI,Ee={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Oe(t,e,n,r,o,i){var a,s,l;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),t*r<e*n&&(t=-t,e=-e,l=-l,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*Ce,skewX:Math.atan(l)*Ce,scaleX:a,scaleY:s}}function ke(t,e,n,r){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var s=[],l=[];return i=t(i),a=t(a),function(t,r,o,i,a,s){if(t!==o||r!==i){var l=a.push("translate(",null,e,null,n);s.push({i:l-4,x:ge(t,o)},{i:l-2,x:ge(r,i)})}else(o||i)&&a.push("translate("+o+e+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,l),function(t,e,n,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:ge(t,e)})):e&&n.push(o(n)+"rotate("+e+r)}(i.rotate,a.rotate,s,l),function(t,e,n,i){t!==e?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:ge(t,e)}):e&&n.push(o(n)+"skewX("+e+r)}(i.skewX,a.skewX,s,l),function(t,e,n,r,i,a){if(t!==n||e!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:ge(t,n)},{i:s-2,x:ge(e,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,l),i=a=null,function(t){for(var e,n=-1,r=l.length;++n<r;)s[(e=l[n]).i]=e.x(t);return s.join("")}}}var Le=ke((function(t){return"none"===t?Ee:(ve||(ve=document.createElement("DIV"),xe=document.documentElement,we=document.defaultView),ve.style.transform=t,t=we.getComputedStyle(xe.appendChild(ve),null).getPropertyValue("transform"),xe.removeChild(ve),Oe(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),Me=ke((function(t){return null==t?Ee:(_e||(_e=document.createElementNS("http://www.w3.org/2000/svg","g")),_e.setAttribute("transform",t),(t=_e.transform.baseVal.consolidate())?Oe((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Ee)}),", ",")",")"),Ae=Math.SQRT2;function Te(t){return((t=Math.exp(t))+1/t)/2}function Se(t,e){var n,r,o=t[0],i=t[1],a=t[2],s=e[0],l=e[1],u=e[2],c=s-o,h=l-i,d=c*c+h*h;if(d<1e-12)r=Math.log(u/a)/Ae,n=function(t){return[o+t*c,i+t*h,a*Math.exp(Ae*t*r)]};else{var p=Math.sqrt(d),f=(u*u-a*a+4*d)/(2*a*2*p),g=(u*u-a*a-4*d)/(2*u*2*p),m=Math.log(Math.sqrt(f*f+1)-f),y=Math.log(Math.sqrt(g*g+1)-g);r=(y-m)/Ae,n=function(t){var e,n=t*r,s=Te(m),l=a/(2*p)*(s*(e=Ae*n+m,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(m));return[o+l*c,i+l*h,a*s/Te(Ae*n+m)]}}return n.duration=1e3*r,n}var ze,De,Re=0,Ne=0,qe=0,$e=0,Be=0,Pe=0,je="object"==typeof performance&&performance.now?performance:Date,He="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ie(){return Be||(He(Ve),Be=je.now()+Pe)}function Ve(){Be=0}function Ze(){this._call=this._time=this._next=null}function Ye(t,e,n){var r=new Ze;return r.restart(t,e,n),r}function Xe(){Be=($e=je.now())+Pe,Re=Ne=0;try{!function(){Ie(),++Re;for(var t,e=ze;e;)(t=Be-e._time)>=0&&e._call.call(null,t),e=e._next;--Re}()}finally{Re=0,function(){var t,e,n=ze,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:ze=e);De=t,We(r)}(),Be=0}}function Fe(){var t=je.now(),e=t-$e;e>1e3&&(Pe-=e,$e=t)}function We(t){Re||(Ne&&(Ne=clearTimeout(Ne)),t-Be>24?(t<1/0&&(Ne=setTimeout(Xe,t-je.now()-Pe)),qe&&(qe=clearInterval(qe))):(qe||($e=je.now(),qe=setInterval(Fe,1e3)),Re=1,He(Xe)))}function Ue(t,e,n){var r=new Ze;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r}Ze.prototype=Ye.prototype={constructor:Ze,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Ie():+n)+(null==e?0:+e),this._next||De===this||(De?De._next=this:ze=this,De=this),this._call=t,this._time=n,We()},stop:function(){this._call&&(this._call=null,this._time=1/0,We())}};var Ge=d("start","end","cancel","interrupt"),Ke=[];function Qe(t,e,n,r,o,i){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,o=t.__transition;function i(t){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)}function a(i){var u,c,h,d;if(1!==n.state)return l();for(u in o)if((d=o[u]).name===n.name){if(3===d.state)return Ue(a);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete o[u]):+u<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete o[u])}if(Ue((function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(i))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(h=n.tween.length),u=0,c=-1;u<h;++u)(d=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(r[++c]=d);r.length=c+1}}function s(e){for(var o=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(l),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(t,o);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=n,n.timer=Ye(i,0,n.time)}(t,n,{name:e,index:r,group:o,on:Ge,tween:Ke,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Je(t,e){var n=en(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function tn(t,e){var n=en(t,e);if(n.state>3)throw new Error("too late; already running");return n}function en(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function nn(t,e){var n,r,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(n=i[o]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete t.__transition}}function rn(t,e){var n,r;return function(){var o=tn(this,t),i=o.tween;if(i!==n)for(var a=0,s=(r=n=i).length;a<s;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}o.tween=r}}function on(t,e,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=tn(this,t),a=i.tween;if(a!==r){o=(r=a).slice();for(var s={name:e,value:n},l=0,u=o.length;l<u;++l)if(o[l].name===e){o[l]=s;break}l===u&&o.push(s)}i.tween=o}}function an(t,e,n){var r=t._id;return t.each((function(){var t=tn(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return en(t,r).value[e]}}function sn(t,e){var n;return("number"==typeof e?ge:e instanceof Qt?fe:(n=Qt(e))?(e=n,fe):be)(t,e)}function ln(t){return function(){this.removeAttribute(t)}}function un(t){return function(){this.removeAttributeNS(t.space,t.local)}}function cn(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function hn(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function dn(t,e,n){var r,o,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttribute(t))===(s=l+"")?null:a===r&&s===o?i:(o=s,i=e(r=a,l));this.removeAttribute(t)}}function pn(t,e,n){var r,o,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttributeNS(t.space,t.local))===(s=l+"")?null:a===r&&s===o?i:(o=s,i=e(r=a,l));this.removeAttributeNS(t.space,t.local)}}function fn(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function gn(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function mn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&gn(t,o)),n}return o._value=e,o}function yn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&fn(t,o)),n}return o._value=e,o}function bn(t,e){return function(){Je(this,t).delay=+e.apply(this,arguments)}}function vn(t,e){return e=+e,function(){Je(this,t).delay=e}}function xn(t,e){return function(){tn(this,t).duration=+e.apply(this,arguments)}}function wn(t,e){return e=+e,function(){tn(this,t).duration=e}}function _n(t,e){if("function"!=typeof e)throw new Error;return function(){tn(this,t).ease=e}}function Cn(t,e,n){var r,o,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Je:tn;return function(){var a=i(this,t),s=a.on;s!==r&&(o=(r=s).copy()).on(e,n),a.on=o}}var En=Ot.prototype.constructor;function On(t){return function(){this.style.removeProperty(t)}}function kn(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Ln(t,e,n){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&kn(t,i,n)),r}return i._value=e,i}function Mn(t){return function(e){this.textContent=t.call(this,e)}}function An(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Mn(r)),e}return r._value=t,r}var Tn=0;function Sn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function zn(){return++Tn}var Dn=Ot.prototype;Sn.prototype={constructor:Sn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=E(t));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var s,l,u=r[a],c=u.length,h=i[a]=new Array(c),d=0;d<c;++d)(s=u[d])&&(l=t.call(s,s.__data__,d,u))&&("__data__"in s&&(l.__data__=s.__data__),h[d]=l,Qe(h[d],e,n,d,h,en(s,n)));return new Sn(i,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=k(t));for(var r=this._groups,o=r.length,i=[],a=[],s=0;s<o;++s)for(var l,u=r[s],c=u.length,h=0;h<c;++h)if(l=u[h]){for(var d,p=t.call(l,l.__data__,h,u),f=en(l,n),g=0,m=p.length;g<m;++g)(d=p[g])&&Qe(d,e,n,g,p,f);i.push(p),a.push(l)}return new Sn(i,a,e,n)},filter:function(t){"function"!=typeof t&&(t=L(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a=e[o],s=a.length,l=r[o]=[],u=0;u<s;++u)(i=a[u])&&t.call(i,i.__data__,u,a)&&l.push(i);return new Sn(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var l,u=e[s],c=n[s],h=u.length,d=a[s]=new Array(h),p=0;p<h;++p)(l=u[p]||c[p])&&(d[p]=l);for(;s<r;++s)a[s]=e[s];return new Sn(a,this._parents,this._name,this._id)},selection:function(){return new En(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=zn(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],l=s.length,u=0;u<l;++u)if(a=s[u]){var c=en(a,e);Qe(a,t,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Sn(r,this._parents,t,n)},call:Dn.call,nodes:Dn.nodes,node:Dn.node,size:Dn.size,empty:Dn.empty,each:Dn.each,on:function(t,e){var n=this._id;return arguments.length<2?en(this.node(),n).on.on(t):this.each(Cn(n,t,e))},attr:function(t,e){var n=v(t),r="transform"===n?Me:sn;return this.attrTween(t,"function"==typeof e?(n.local?pn:dn)(n,r,an(this,"attr."+t,e)):null==e?(n.local?un:ln)(n):(n.local?hn:cn)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=v(t);return this.tween(n,(r.local?mn:yn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?Le:sn;return null==e?this.styleTween(t,function(t,e){var n,r,o;return function(){var i=V(this,t),a=(this.style.removeProperty(t),V(this,t));return i===a?null:i===n&&a===r?o:o=e(n=i,r=a)}}(t,r)).on("end.style."+t,On(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,o,i;return function(){var a=V(this,t),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(t),l=s=V(this,t)),a===l?null:a===r&&l===o?i:(o=l,i=e(r=a,s))}}(t,r,an(this,"style."+t,e))).each(function(t,e){var n,r,o,i,a="style."+e,s="end."+a;return function(){var l=tn(this,t),u=l.on,c=null==l.value[a]?i||(i=On(e)):void 0;u===n&&o===c||(r=(n=u).copy()).on(s,o=c),l.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,o,i=n+"";return function(){var a=V(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,Ln(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(an(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,An(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,o=en(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===t)return r.value;return null}return this.each((null==e?rn:on)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?bn:vn)(e,t)):en(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?xn:wn)(e,t)):en(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(_n(e,t)):en(this.node(),e).ease},end:function(){var t,e,n=this,r=n._id,o=n.size();return new Promise((function(i,a){var s={value:a},l={value:function(){0==--o&&i()}};n.each((function(){var n=tn(this,r),o=n.on;o!==t&&((e=(t=o).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(l)),n.on=e}))}))}};var Rn={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Nn(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return Rn.time=Ie(),Rn;return n}Ot.prototype.interrupt=function(t){return this.each((function(){nn(this,t)}))},Ot.prototype.transition=function(t){var e,n;t instanceof Sn?(e=t._id,t=t._name):(e=zn(),(n=Rn).time=Ie(),t=null==t?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],l=s.length,u=0;u<l;++u)(a=s[u])&&Qe(a,t,e,u,s,n||Nn(a,e));return new Sn(r,this._parents,t,e)};var qn="$";function $n(){}function Bn(t,e){var n=new $n;if(t instanceof $n)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,o=-1,i=t.length;if(null==e)for(;++o<i;)n.set(o,t[o]);else for(;++o<i;)n.set(e(r=t[o],o,t),r)}else if(t)for(var a in t)n.set(a,t[a]);return n}function Pn(){}$n.prototype=Bn.prototype={constructor:$n,has:function(t){return qn+t in this},get:function(t){return this[qn+t]},set:function(t,e){return this[qn+t]=e,this},remove:function(t){var e=qn+t;return e in this&&delete this[e]},clear:function(){for(var t in this)t[0]===qn&&delete this[t]},keys:function(){var t=[];for(var e in this)e[0]===qn&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)e[0]===qn&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)e[0]===qn&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)e[0]===qn&&++t;return t},empty:function(){for(var t in this)if(t[0]===qn)return!1;return!0},each:function(t){for(var e in this)e[0]===qn&&t(this[e],e.slice(1),this)}};var jn=Bn.prototype;function Hn(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function In(t,e){var n,r,o,i,a,s=new Xn(t),l=+t.value&&(s.value=t.value),u=[s];for(null==e&&(e=Vn);n=u.pop();)if(l&&(n.value=+n.data.value),(o=e(n.data))&&(a=o.length))for(n.children=new Array(a),i=a-1;i>=0;--i)u.push(r=n.children[i]=new Xn(o[i])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Yn)}function Vn(t){return t.children}function Zn(t){t.data=t.data.data}function Yn(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Xn(t){this.data=t,this.depth=this.height=0,this.parent=null}function Fn(t,e){return t.parent===e.parent?1:2}function Wn(t){var e=t.children;return e?e[0]:t.t}function Un(t){var e=t.children;return e?e[e.length-1]:t.t}function Gn(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function Kn(t,e,n){return t.a.parent===e.parent?t.a:n}function Qn(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function Jn(){var t=Fn,e=1,n=1,r=null;function o(o){var l=function(t){for(var e,n,r,o,i,a=new Qn(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(i=r.length),o=i-1;o>=0;--o)s.push(n=e.children[o]=new Qn(r[o],o)),n.parent=e;return(a.parent=new Qn(null,0)).children=[a],a}(o);if(l.eachAfter(i),l.parent.m=-l.z,l.eachBefore(a),r)o.eachBefore(s);else{var u=o,c=o,h=o;o.eachBefore((function(t){t.x<u.x&&(u=t),t.x>c.x&&(c=t),t.depth>h.depth&&(h=t)}));var d=u===c?1:t(u,c)/2,p=d-u.x,f=e/(c.x+d+p),g=n/(h.depth||1);o.eachBefore((function(t){t.x=(t.x+p)*f,t.y=t.depth*g}))}return o}function i(e){var n=e.children,r=e.parent.children,o=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,o=t.children,i=o.length;--i>=0;)(e=o[i]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var i=(n[0].z+n[n.length-1].z)/2;o?(e.z=o.z+t(e._,o._),e.m=e.z-i):e.z=i}else o&&(e.z=o.z+t(e._,o._));e.parent.A=function(e,n,r){if(n){for(var o,i=e,a=e,s=n,l=i.parent.children[0],u=i.m,c=a.m,h=s.m,d=l.m;s=Un(s),i=Wn(i),s&&i;)l=Wn(l),(a=Un(a)).a=e,(o=s.z+h-i.z-u+t(s._,i._))>0&&(Gn(Kn(s,e,r),e,o),u+=o,c+=o),h+=s.m,u+=i.m,d+=l.m,c+=a.m;s&&!Un(a)&&(a.t=s,a.m+=h-c),i&&!Wn(l)&&(l.t=i,l.m+=u-d,r=e)}return r}(e,o,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return o.separation=function(e){return arguments.length?(t=e,o):t},o.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],o):r?null:[e,n]},o.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],o):r?[e,n]:null},o}function tr(t){return function(){return t}}function er(t,e,n){this.target=t,this.type=e,this.transform=n}function nr(t,e,n){this.k=t,this.x=e,this.y=n}Pn.prototype={constructor:Pn,has:jn.has,add:function(t){return this[qn+(t+="")]=t,this},remove:jn.remove,clear:jn.clear,values:jn.keys,size:jn.size,empty:jn.empty,each:jn.each},Xn.prototype=In.prototype={constructor:Xn,count:function(){return this.eachAfter(Hn)},each:function(t){var e,n,r,o,i=this,a=[i];do{for(e=a.reverse(),a=[];i=e.pop();)if(t(i),n=i.children)for(r=0,o=n.length;r<o;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(t){for(var e,n,r,o=this,i=[o],a=[];o=i.pop();)if(a.push(o),e=o.children)for(n=0,r=e.length;n<r;++n)i.push(e[n]);for(;o=a.pop();)t(o);return this},eachBefore:function(t){for(var e,n,r=this,o=[r];r=o.pop();)if(t(r),e=r.children)for(n=e.length-1;n>=0;--n)o.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,o=r&&r.length;--o>=0;)n+=r[o].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),o=null;t=n.pop(),e=r.pop();for(;t===e;)o=t,t=n.pop(),e=r.pop();return o}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return In(this).eachBefore(Zn)}},Qn.prototype=Object.create(Xn.prototype),nr.prototype={constructor:nr,scale:function(t){return 1===t?this:new nr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new nr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var rr=new nr(1,0,0);function or(){ft.stopImmediatePropagation()}function ir(){ft.preventDefault(),ft.stopImmediatePropagation()}function ar(){return!ft.ctrlKey&&!ft.button}function sr(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function lr(){return this.__zoom||rr}function ur(){return-ft.deltaY*(1===ft.deltaMode?.05:ft.deltaMode?1:.002)}function cr(){return navigator.maxTouchPoints||"ontouchstart"in this}function hr(t,e,n){var r=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function dr(){var t,e,n=ar,r=sr,o=hr,i=ur,a=cr,s=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,c=Se,h=d("start","zoom","end"),p=500,f=0;function g(t){t.property("__zoom",lr).on("wheel.zoom",_).on("mousedown.zoom",C).on("dblclick.zoom",E).filter(a).on("touchstart.zoom",O).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",L).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(t,e){return(e=Math.max(s[0],Math.min(s[1],e)))===t.k?t:new nr(e,t.x,t.y)}function y(t,e,n){var r=e[0]-n[0]*t.k,o=e[1]-n[1]*t.k;return r===t.x&&o===t.y?t:new nr(t.k,r,o)}function b(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function v(t,e,n){t.on("start.zoom",(function(){x(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).end()})).tween("zoom",(function(){var t=this,o=arguments,i=x(t,o),a=r.apply(t,o),s=null==n?b(a):"function"==typeof n?n.apply(t,o):n,l=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),u=t.__zoom,h="function"==typeof e?e.apply(t,o):e,d=c(u.invert(s).concat(l/u.k),h.invert(s).concat(l/h.k));return function(t){if(1===t)t=h;else{var e=d(t),n=l/e[2];t=new nr(n,s[0]-e[0]*n,s[1]-e[1]*n)}i.zoom(null,t)}}))}function x(t,e,n){return!n&&t.__zooming||new w(t,e)}function w(t,e){this.that=t,this.args=e,this.active=0,this.extent=r.apply(t,e),this.taps=0}function _(){if(n.apply(this,arguments)){var t=x(this,arguments),e=this.__zoom,r=Math.max(s[0],Math.min(s[1],e.k*Math.pow(2,i.apply(this,arguments)))),a=At(this);if(t.wheel)t.mouse[0][0]===a[0]&&t.mouse[0][1]===a[1]||(t.mouse[1]=e.invert(t.mouse[0]=a)),clearTimeout(t.wheel);else{if(e.k===r)return;t.mouse=[a,e.invert(a)],nn(this),t.start()}ir(),t.wheel=setTimeout(u,150),t.zoom("mouse",o(y(m(e,r),t.mouse[0],t.mouse[1]),t.extent,l))}function u(){t.wheel=null,t.end()}}function C(){if(!e&&n.apply(this,arguments)){var t=x(this,arguments,!0),r=kt(ft.view).on("mousemove.zoom",u,!0).on("mouseup.zoom",c,!0),i=At(this),a=ft.clientX,s=ft.clientY;zt(ft.view),or(),t.mouse=[i,this.__zoom.invert(i)],nn(this),t.start()}function u(){if(ir(),!t.moved){var e=ft.clientX-a,n=ft.clientY-s;t.moved=e*e+n*n>f}t.zoom("mouse",o(y(t.that.__zoom,t.mouse[0]=At(t.that),t.mouse[1]),t.extent,l))}function c(){r.on("mousemove.zoom mouseup.zoom",null),Dt(ft.view,t.moved),ir(),t.end()}}function E(){if(n.apply(this,arguments)){var t=this.__zoom,e=At(this),i=t.invert(e),a=t.k*(ft.shiftKey?.5:2),s=o(y(m(t,a),e,i),r.apply(this,arguments),l);ir(),u>0?kt(this).transition().duration(u).call(v,s,e):kt(this).call(g.transform,s)}}function O(){if(n.apply(this,arguments)){var e,r,o,i,a=ft.touches,s=a.length,l=x(this,arguments,ft.changedTouches.length===s);for(or(),r=0;r<s;++r)i=[i=Tt(this,a,(o=a[r]).identifier),this.__zoom.invert(i),o.identifier],l.touch0?l.touch1||l.touch0[2]===i[2]||(l.touch1=i,l.taps=0):(l.touch0=i,e=!0,l.taps=1+!!t);t&&(t=clearTimeout(t)),e&&(l.taps<2&&(t=setTimeout((function(){t=null}),p)),nn(this),l.start())}}function k(){if(this.__zooming){var e,n,r,i,a=x(this,arguments),s=ft.changedTouches,u=s.length;for(ir(),t&&(t=clearTimeout(t)),a.taps=0,e=0;e<u;++e)r=Tt(this,s,(n=s[e]).identifier),a.touch0&&a.touch0[2]===n.identifier?a.touch0[0]=r:a.touch1&&a.touch1[2]===n.identifier&&(a.touch1[0]=r);if(n=a.that.__zoom,a.touch1){var c=a.touch0[0],h=a.touch0[1],d=a.touch1[0],p=a.touch1[1],f=(f=d[0]-c[0])*f+(f=d[1]-c[1])*f,g=(g=p[0]-h[0])*g+(g=p[1]-h[1])*g;n=m(n,Math.sqrt(f/g)),r=[(c[0]+d[0])/2,(c[1]+d[1])/2],i=[(h[0]+p[0])/2,(h[1]+p[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],i=a.touch0[1]}a.zoom("touch",o(y(n,r,i),a.extent,l))}}function L(){if(this.__zooming){var t,n,r=x(this,arguments),o=ft.changedTouches,i=o.length;for(or(),e&&clearTimeout(e),e=setTimeout((function(){e=null}),p),t=0;t<i;++t)n=o[t],r.touch0&&r.touch0[2]===n.identifier?delete r.touch0:r.touch1&&r.touch1[2]===n.identifier&&delete r.touch1;if(r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0)r.touch0[1]=this.__zoom.invert(r.touch0[0]);else if(r.end(),2===r.taps){var a=kt(this).on("dblclick.zoom");a&&a.apply(this,arguments)}}}return g.transform=function(t,e,n){var r=t.selection?t.selection():t;r.property("__zoom",lr),t!==r?v(t,e,n):r.interrupt().each((function(){x(this,arguments).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},g.scaleBy=function(t,e,n){g.scaleTo(t,(function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n}),n)},g.scaleTo=function(t,e,n){g.transform(t,(function(){var t=r.apply(this,arguments),i=this.__zoom,a=null==n?b(t):"function"==typeof n?n.apply(this,arguments):n,s=i.invert(a),u="function"==typeof e?e.apply(this,arguments):e;return o(y(m(i,u),a,s),t,l)}),n)},g.translateBy=function(t,e,n){g.transform(t,(function(){return o(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),l)}))},g.translateTo=function(t,e,n,i){g.transform(t,(function(){var t=r.apply(this,arguments),a=this.__zoom,s=null==i?b(t):"function"==typeof i?i.apply(this,arguments):i;return o(rr.translate(s[0],s[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,l)}),i)},w.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){!function(t,e,n,r){var o=ft;t.sourceEvent=ft,ft=t;try{e.apply(n,r)}finally{ft=o}}(new er(g,t,this.that.__zoom),h.apply,h,[t,this.that,this.args])}},g.wheelDelta=function(t){return arguments.length?(i="function"==typeof t?t:tr(+t),g):i},g.filter=function(t){return arguments.length?(n="function"==typeof t?t:tr(!!t),g):n},g.touchable=function(t){return arguments.length?(a="function"==typeof t?t:tr(!!t),g):a},g.extent=function(t){return arguments.length?(r="function"==typeof t?t:tr([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),g):r},g.scaleExtent=function(t){return arguments.length?(s[0]=+t[0],s[1]=+t[1],g):[s[0],s[1]]},g.translateExtent=function(t){return arguments.length?(l[0][0]=+t[0][0],l[1][0]=+t[1][0],l[0][1]=+t[0][1],l[1][1]=+t[1][1],g):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},g.constrain=function(t){return arguments.length?(o=t,g):o},g.duration=function(t){return arguments.length?(u=+t,g):u},g.interpolate=function(t){return arguments.length?(c=t,g):c},g.on=function(){var t=h.on.apply(h,arguments);return t===h?g:t},g.clickDistance=function(t){return arguments.length?(f=(t=+t)*t,g):Math.sqrt(f)},g}const pr={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},rebeccapurple:{r:102,g:51,b:153},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},fr={resolveExpression:t=>{let e=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(t);if(e)return`rgb(${e[1]},${e[2]},${e[3]})`;if(e=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(t),e)return`rgba(${e[1]},${e[2]},${e[3]},${e[4]})`;if(e=/^argb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(t),e){const t=Math.round(e[1]/2.55)/100;return`rgba(${e[2]},${e[3]},${e[4]},${t})`}if(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t),e)return t;const n=t&&pr[t.toLowerCase()];if(n){const t=void 0!==n.a?n.a:1;return`rgba(${n.r},${n.g},${n.b},${t})`}return"none"},getDarkColor(t){const e=.5;let n,r,o,i;if(t.length>7){n=t.split(",");const a=-1!==n[0].indexOf("a");return r=a?parseInt(n[0].slice(5),10):parseInt(n[0].slice(4),10),i=parseInt(n[1],10),o=parseInt(n[2],10),`${(a?"rgba(":"rgb(")+(Math.round((0-r)*e)+r)},${Math.round((0-i)*e)+i},${Math.round((0-o)*e)+o}${a?`,${n[3]}`:")"}`}return n=parseInt(t.slice(1),16),r=n>>16,i=n>>8&255,o=255&n,`#${(16777216+65536*(Math.round((0-r)*e)+r)+256*(Math.round((0-i)*e)+i)+(Math.round((0-o)*e)+o)).toString(16).slice(1)}`},isDarkColor(t){let e,n,r,o;return(o=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(t))||(o=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(t))?(e=parseInt(o[1],10),n=parseInt(o[2],10),r=parseInt(o[3],10)):(o=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))&&(e=parseInt(o[1],16),n=parseInt(o[2],16),r=parseInt(o[3],16)),.299*e+.587*n+.114*r<125}},gr={colorByExpression:"color",labelExpression:"label",subLabelExpression:"subLabel",extraLabelExpression:"extraLabel"},mr="max-data-limit";function yr(t){return t[0].qText}function br(t){return t[1].qText}async function vr(t,e,n,r,o,i,a){return await n.getHyperCubeData("/qHyperCubeDef",[{qTop:o,qLeft:0,qWidth:3,qHeight:3300}]).then((n=>{t.push(n[0]),e.push(...n[0].qMatrix),o+=n[0].qArea.qHeight})),i>=a?mr:r>o?vr(t,e,n,r,o,i+1,a):""}const xr=async(t,e)=>{if(t.snapshotData)return{status:"",dataMatrix:t.snapshotData.dataMatrix};const n=t.qHyperCube&&t.qHyperCube.qDataPages,r=t.qHyperCube.qSize.qcy,o=n[0].qArea.qHeight,i=[...n[0].qMatrix];let a="";return r>o&&1===n.length&&e?a=await vr(t.qHyperCube.qDataPages,i,e,r,o,0,t.rowLimit/3300||10):n.forEach(((t,e)=>{e>0&&i.push(...t.qMatrix)})),{status:a,dataMatrix:i}};function wr(t,e){const n={};return t.forEach((t=>{"color"===t.prop?n[t.prop]=fr.resolveExpression(e.qValues[t.index].qText):n[t.prop]=e.qValues[t.index].qText})),n}function _r(t){if(!t)return!0;for(let e=0;e<t.length;++e)if(void 0!==t[e].children)return!1;return!0}async function Cr({layout:t,model:e,translator:n}){if(!t.qHyperCube)throw new Error("Require a hypercube");if(t.qHyperCube.qDimensionInfo.length<2)return!1;const{status:r,dataMatrix:o}=await xr(t,e),i=function(t){if(t&&t.length){const e=[];return t.forEach(((t,n)=>{gr[t.id]&&e.push({prop:gr[t.id],index:n})})),e}return[]}(t.qHyperCube.qDimensionInfo[0].qAttrExprInfo);return o?o.length<1?null:function(t,e,n,r,o){const i={},a=[];for(let n=0;n<t.length;++n){const r=t[n],o=yr(r),s={id:o,parentId:br(r),children:[],elemNo:r[0].qElemNumber,attributes:wr(e,r[0].qAttrExps),measure:r[2]&&r[2].qText,rowNo:n};i[o]=s,a.push(s)}const s=[];let l=!1;for(let t=0;t<a.length;++t){const e=a[t],n=i[e.parentId];e.parent=n,n?n.children.length>98?l=!0:n.children.push({childNumber:n.children.length,...e}):s.length>98?l=!0:s.push(e)}if(0===s.length)return{error:"no_root",message:o.get("Object.OrgChart.MissingRoot")};const u=[];if(n===mr&&u.push(o.get("Object.OrgChart.MaxData")),l&&u.push(o.get("Object.OrgChart.MaxChildren")),function(t){const e={},n={};function r(t){e[t.id]=!0,n[t.id]=!0;for(let o=0;o<t.children.length;++o){if(!e[t.children[o].id]&&r(t.children[o]))return!0;if(n[t.children[o].id])return!0}return n[t.id]=!1,!1}for(let n=0;n<t.length;++n){const o=t[n];if(!e[o.id]&&r(o))return!0}return!1}(a)&&u.push(o.get("Object.OrgChart.CycleWarning")),1===s.length)return s[0].warn=u,s[0].navigationMode=r,s[0];u.push(o.get("Object.OrgChart.DummyWarn"));const c={id:"Root",name:o.get("Object.OrgChart.DummyRoot"),isDummy:!0,warn:u,children:s,navigationMode:r};return s.forEach(((t,e)=>{t.parentId="Root",t.parent=c,t.childNumber=e})),c}(o,i,r,t.navigationMode,n):null}const Er={cardWidth:152,cardHeight:64,widthMargin:32,heightMargin:56,buttonMargin:16,leafMargin:16,cardPadding:8,buttonWidth:48,buttonHeight:24,rootDiameter:20,r:4,tooltipWidth:240,tooltipPadding:15,maxZoom:6,minZoom:.2},Or=(t,e,n,r,o,i)=>{const{buttonMargin:a}=Er,s=o&&o.initialX||0;return"expandAll"===i?(t[r]=t.x+s,t[r]):(t.parent?(t.parent[r]||(t.parent[r]=Or(t.parent,e,n,r,o)),"Root"===t.parent.data.id?t[r]=t.parent[r]+(t.data.childNumber-(t.parent.children.length-1)/2)*e:t[r]=_r(t.parent.children)?t.parent[r]+a:t.parent[r]+(t.data.childNumber-(t.parent.children.length-1)/2)*e):t[r]=s,t[r])};function kr(t,e,n,r){const{widthMargin:o,heightMargin:i,cardWidth:a,cardHeight:s,cardPadding:l}=Er;let u,c,h;if("ttb"===t)u=a+o,c="expandAll"===r?s+2*l:s+i,h={depthSpacing:c,isVertical:!0,x:t=>Or(t,u,e,"xActual",n,r),y:t=>((t,e,n,r,o)=>{const{cardHeight:i,leafMargin:a}=Er,s=r&&r.initialY||0;return t.parent&&"Root"!==t.parent.data.id&&"expandAll"!==o&&_r(t.parent.children)?t[n]=t.parent.y+e+t.data.childNumber*(i+a)+s:t[n]=t.y+s,t[n]})(t,c,"yActual",n,r)};return h}const Lr=t=>{const e=document.createElement("div"),n=document.createTextNode(t);return e.appendChild(n),e.innerHTML},Mr=t=>{const e=["#"," ","(",")"];let n="";for(let r=0;r<t.length;r++){const o=t.charAt(r),i=t.charCodeAt(r);if(!o.match(/[a-zA-Z0-9]/)&&e.indexOf(o)<0){const t=i.toString(16);n+=`\\${"000000".substr(t.length)}${t}`}else n+=o}return n};function Ar(t){const e=fr.resolveExpression(t);return"none"!==e?e:Mr(t)}var Tr=(t,n,r)=>{const{api:o,state:i}=r,a=o&&o.isActive()&&-1!==i.indexOf(t.elemNo),s=function(t,e){if(t.attributes&&t.attributes.color){const e=fr.resolveExpression(t.attributes.color);if("none"!==e)return e}return Ar(e.backgroundColor)}(t,n),l=Ar(function(t,n){return"default"===t.fontColor?fr.isDarkColor(n)?e.FONT_COLOR_LIGHT.color:e.FONT_COLOR_DARK.color:t.fontColor}(n,s)),u=t.attributes||{};let c=`<div class="sn-org-card-title">${Lr(u.label||t.id)}</div>`;if(u.subLabel&&(c+=`<div class="sn-org-card-label">${Lr(u.subLabel)}</div>`),t.measure){const e=n.measureLabel?`${n.measureLabel}: `:"";c+=`<div class="sn-org-card-label">${Lr(e+t.measure)}</div>`}else u.extraLabel&&(c+=`<div class="sn-org-card-label">${Lr(u.extraLabel)}</div>`);const h=o&&o.isActive()?a?" selected":" not-selected":"",{top:d=e.BORDER_TOP,fullBorder:p=e.BORDER_FULL,colorType:f=e.BORDER_COLOR_TYPE}=n.border,g="auto"===f?fr.getDarkColor(s):Ar(n.borderColor);let m=Er.cardHeight;return a?m-=8:p?m-=4:d&&(m-=3),`<div class="sn-org-card-text${h}" style="background-color:${s};color:${l}; border:${p&&!a?`1px solid ${g}`:""}; border-top:${d&&!a?`3px solid ${g}`:""}; height:${m}px;">${c}</div>`},Sr=(t,e)=>{const{api:n,state:r,singleSelect:o,setState:i}=e;if(t&&n){let e;if(t.data.elemNo<0&&-3!==t.data.elemNo)return;if(t.data.isLocked)return;n.isActive()&&r?e=r.concat():(n.begin("/qHyperCubeDef"),e=[]);const a=e.indexOf(t.data.elemNo),s=-1===a;let l=[];o||(l=function(t,e){const n=[],r=t=>{t.children.forEach((t=>{t.data.selected=e,n.push(t.data.elemNo),t.children&&t.children.length>0&&r(t)}))};return t.children&&r(t),n}(t,s)),s?(e.push(t.data.elemNo),l.forEach((t=>{-1===e.indexOf(t)&&e.push(t)}))):(e.splice(a,1),l.forEach((t=>{const n=e.indexOf(t);-1!==n&&e.splice(n,1)}))),0===e.length?n.clear():n.select({method:"selectHyperCubeValues",params:["/qHyperCubeDef",0,e,!1]}),i(e)}};function zr(t,e,n,r,o,i,a,s=250){t.active=!0,t.timeout=setTimeout((()=>{t.active&&t.html(function(t,e){return`<div class="sn-org-tooltip-inner"><div class="sn-org-tooltip-header">${Lr(t.data.attributes.label||t.data.id)}</div>${t.data.attributes.subLabel?`${Lr(t.data.attributes.subLabel)}<br />`:""}${t.data.attributes.extraLabel?`${Lr(t.data.attributes.extraLabel)}<br />`:""}${Lr(t.data.measure?`${e.measureLabel?`${e.measureLabel}: `:""}${t.data.measure}`:"")}</div>`}(e,r)).classed("sn-org-tooltip-visible",!0).attr("style",(()=>function(t,e,n,r,o){const{cardWidth:i,tooltipPadding:a}=Er,s=i/2;return`bottom:${e-(r(t)*o.zoom+o.y-a)}px;left:${n(t)*o.zoom+o.x+s*o.zoom}px;`}(e,n,o,i,a)))}),s)}function Dr(t){clearTimeout(t.timeout),t.active=!1,t.classed("sn-org-tooltip-visible",!1)}function Rr({positioning:t,divBox:e,nodes:n,styling:r,setExpandedCallback:o,wrapperState:i,selectionObj:a,navigationMode:s,element:l,tooltip:u}){const{x:c,y:h}=t,{cardWidth:d,cardHeight:p,buttonWidth:f,buttonHeight:g,cardPadding:m,rootDiameter:y}=Er,{topId:b}=i.expandedState,v=n.find((t=>t.data.id===b)),x=v&&v.parent?v.parent.ancestors().map((t=>t.data.id)):[],w=document.getElementsByTagName("html")[0].classList.contains("touch-on");e.selectAll(".sn-org-nodes").data(n.filter((t=>t.parent&&"Root"===t.parent.data.id))).enter().append("div").attr("class","sn-org-root").attr("style",(t=>`top:${h(t)-y-m}px;left:${c(t)+(d-y)/2}px`)).attr("id",(t=>t.data.id)),e.selectAll(".sn-org-nodes").data(n.filter((t=>"Root"!==t.data.id))).enter().append("div").attr("class","sn-org-card").attr("style",(t=>`width:${d}px;height:${p}px; top:${h(t)}px;left:${c(t)}px;`)).attr("id",(t=>t.data.id)).on("click",(t=>{i.constraints.active||"Root"===t.data.id||(w&&zr(u,t,l.clientHeight,r,c,h,i.transform,0),Sr(t,a))})).html((t=>Tr(t.data,r,a))).on("mouseenter",(t=>{w||i.constraints.active||0!==event.buttons||zr(u,t,l.clientHeight,r,c,h,i.transform)})).on("mouseleave",(()=>{!w&&Dr(u)})).on("mousedown",(()=>{Dr(u)})).on("touchmove",(()=>{Dr(u)})).on("wheel",(()=>{Dr(u)})),"expandAll"!==s&&e.selectAll(".sn-org-nodes").data(n.filter((t=>!!t.children&&"Root"!==t.data.id))).enter().append("div").attr("class","sn-org-traverse").attr("style",(t=>`width:${f}px;height:${g}px;top:${h(t)+p+m}px;left:${c(t)+(d-f)/2}px;`)).attr("id",(t=>`${t.data.id}-expand`)).on("mouseenter",(()=>{i.constraints.active||(event.target.style.cursor="pointer")})).on("click",(t=>{i.constraints.active||(o(((t,{topId:e,isExpanded:n,expandedChildren:r},o)=>{if(t.data.id===e)n=!n,r=[];else if(o.includes(t.data.id))e=t.parent?t.parent.data.id:t.data.id,n=!!t.parent,r=[];else if(t.parent.data.id===e){const e=t.parent.children.filter((t=>r.includes(t.data.id))).every((t=>_r(t.children)));r.includes(t.data.id)?r.splice(r.indexOf(t.data.id),1):_r(t.children)&&e?r.push(t.data.id):r=[t.data.id]}else e=t.parent.data.id,n=!0,r=[t.data.id];return{topId:e,isExpanded:n,expandedChildren:r}})(t,i.expandedState,x)),event.stopPropagation())})).html((t=>`${((t,{topId:e,isExpanded:n,expandedChildren:r},o)=>t.data.id===e&&n||t.parent&&t.parent.data.id===e&&r.includes(t.data.id)||o.includes(t.data.id)?"-":"+")(t,i.expandedState,x)} ${t.data.children.length}`))}function Nr(t,e,n,r){t.append("path").attr("class","sn-org-path").attr("id",(t=>t.data.id)).attr("d",(t=>{let n="";const o=function(t,e,{depthSpacing:n,isVertical:r,x:o,y:i},a){const{cardWidth:s,cardHeight:l,buttonHeight:u,cardPadding:c,buttonMargin:h}=Er,d=[],p=s/2,f=l/2,g={x:t.xActual,y:t.yActual};if(t.parent&&"Root"!==t.parent.data.id){const e=n/2,s="expandAll"===a?l:l+c+u,m={x:o(t.parent)+p,y:i(t.parent)+s};"expandAll"!==a&&_r(t.parent.children)?d.push(r?[{x:g.x,y:g.y+f},{x:m.x-p,y:g.y+f},{x:m.x-p,y:m.y+h},{x:m.x,y:m.y+h},{x:m.x,y:m.y}]:[{x:g.x,y:g.y},{x:g.x,y:m.y-f},{x:m.x+e,y:m.y-f},{x:m.x+e,y:m.y},{x:m.x,y:m.y}]):g.x===o(t.parent)||g.y===i(t.parent)?d.push([{x:g.x+p,y:g.y},{x:m.x,y:m.y}]):d.push(r?[{x:g.x+p,y:g.y},{x:g.x+p,y:g.y-c},{x:m.x,y:g.y-c},{x:m.x,y:m.y}]:[{x:g.x,y:g.y},{x:g.x-c,y:g.y},{x:g.x-c,y:m.y},{x:m.x,y:m.y}])}else t.parent&&d.push([{x:g.x+p,y:g.y},{x:g.x+p,y:g.y-c}]);return t.children&&"Root"!==t.data.id&&d.push([{x:g.x+p,y:g.y+l},{x:g.x+p,y:g.y+l+c}]),d}(t,0,e,r);return o.forEach((t=>{n+=function(t){const{r:e}=Er;let n,r=`M ${t[0].x} ${t[0].y} `;const o=e=>{const r=t[e].x-t[e-1].x,o=t[e].y-t[e-1].y;n={x:(r>0)-(r<0)||+r,y:(o>0)-(o<0)||+o}};o(1);for(let i=1;i<t.length;++i){const a=t[i];i<t.length-1?(r+=`L ${a.x-n.x*e} ${a.y-n.y*e} `,o(i+1),r+=`Q ${a.x} ${a.y} ${a.x+n.x*e} ${a.y+n.y*e} `):r+=`L ${a.x} ${a.y} `}return r}(t).slice(0,-1)})),n}))}const qr=(t,e,n,r,o)=>{const i=t.k,a=`${t.x}px, ${t.y}px`;e.attr("transform",t),n.classed("org-disable-transition",!0),e.classed("org-disable-transition",!0),n.attr("style",`width:${r}px;height:${o}px; transform: translate(${a}) scale(${i})`)};const $r=({topId:t,isExpanded:e,expandedChildren:n},r,o,i)=>{if("expandAll"===i)return r.descendants();const a=r.descendants().find((e=>e.data.id===t))||r,s=[];if(e&&a.children&&a.children.forEach((t=>{s.push(t),t.children&&(-1!==n.indexOf(t.data.id)||o)&&t.children.forEach((e=>{s.push(e),-1!==n.indexOf(t.data.id)&&o&&e.children&&e.children.forEach((t=>{s.push(t)}))}))})),"free"===r.data.navigationMode&&a.parent){const t=a.parent.ancestors(),e=t.map((t=>t.data.id));t.forEach((t=>{o&&t.children.forEach((t=>{t.children&&-1===e.indexOf(t.data.id)&&t.data.id!==a.data.id&&s.unshift(...t.children)})),s.unshift(...t.children),t.parent||s.unshift(t)}))}else s.unshift(a);return s},Br=({element:t,dataTree:e,selectionObj:n,wrapperState:r,setInitialZoom:o,setTransform:i,setExpandedState:a,viewState:s,setContainerData:l,layout:u})=>{t.innerHTML="",t.className="sn-org-chart";const{navigationMode:c}=u;let h=kr("ttb",t,{},c);const{width:d,height:p}=t.getBoundingClientRect(),f=kt(t).append("span").attr("class","sn-org-zoomwrapper").on("click",(()=>{r.constraints.active||n.api.isActive()&&n.state||(n.api.begin("/qHyperCubeDef"),n.setState([]))})).node(),g=kt(f).selectAll("svg").data([{}]).enter().append("svg").attr("class","sn-org-svg").attr("width","100%").attr("height","100%"),m=kt(f).selectAll("div").data([{}]).enter().append("div").attr("class","sn-org-nodes"),y=kt(t).append("button").attr("class","sn-org-homebutton disabled").on("click",(()=>{Br({element:t,dataTree:e,selectionObj:n,wrapperState:r,setInitialZoom:o,setTransform:i,setExpandedState:a,viewState:s,setContainerData:l,layout:u})})).html('<span class="lui-fade-button__icon sn-org-home-icon">\n <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 16 16">\n <defs>\n <path id="home-a" d="M2,7.9 L8,3.4 L14,7.9 L14,16 L12,16 L12,11.2 C12,11.0895431 11.9104569,11 11.8,11 L9.2,11 C9.08954305,11 9,11.0895431 9,11.2 L9,16 L2,16 L2,7.9 Z M7,13.8 L7,11.2 C7,11.0895431 6.91045695,11 6.8,11 L4.2,11 C4.08954305,11 4,11.0895431 4,11.2 L4,13.8 C4,13.9104569 4.08954305,14 4.2,14 L6.8,14 C6.91045695,14 7,13.9104569 7,13.8 Z M13,4.1 L16,6.5 L15,7.5 L8,2 L1,7.5 L0,6.5 L8,0 L11,2.4 L11,1 L13,1 L13,4.1 Z"/>\n </defs>\n <use xlink:href="#home-a"/>\n </svg>\n </span>').node(),b=function(t){const e=kt(t).append("div").attr("class","sn-org-tooltip").on("mousedown",(()=>{e.classed("sn-org-tooltip-visible",!1)}));return e}(t);if(e.error)return kt(f).append("div").attr("class","sn-org-error").html(e.message),!1;e.warn&&e.warn.length&&kt(f).append("span").attr("class","sn-org-warning").html(`*${e.warn.join(" ")}`);const v=g.append("g").attr("class","sn-org-paths"),x=Jn().size([d,p]).nodeSize([Er.cardWidth+Er.cardPadding,h.depthSpacing])(In(e)),w=!r.expandedState||!x.descendants().find((t=>t.data.id===r.expandedState.topId)),_=w?{topId:x.data.id,isExpanded:!0,expandedChildren:[],useTransitions:!1}:r.expandedState,C=$r(_,x,!1,c);C.forEach((t=>{t.xActual&&t.yActual||(h.x(t),h.y(t))}));const E=(t=>{const{cardWidth:e,cardHeight:n,buttonHeight:r,buttonMargin:o}=Er,i={left:1/0,top:1/0,right:-1/0,bottom:-1/0};return t.forEach((t=>{i.left=Math.min(t.xActual,i.left),i.top=Math.min(t.yActual,i.top),i.right=Math.max(t.xActual,i.right),i.bottom=Math.max(t.yActual,i.bottom)})),{x:i.left,y:i.top-r-o,width:i.right-i.left+e,height:i.bottom-i.top+n+2*(r+o)}})(C),O=s&&s.initialZoom?s.initialZoom:((t,e,n)=>{const{widthMargin:r,cardHeight:o,minZoom:i}=Er,a="expandAll"===n?1/0:Er.maxZoom,{width:s,height:l}=t,{clientHeight:u,clientWidth:c}=e,h=s+2*r,d=l+o,p=Math.max(Math.min(h/c,a),i),f=Math.max(Math.min(d/u,a),i);return p>f?{initialX:-t.x+r,initialY:-t.y+(u*p-l)/2,initialZoom:p}:{initialX:-t.x+(c*f-s)/2,initialY:o/2,initialZoom:f}})(E,t,c);return o(O),h=kr("ttb",t,O,c),function({containerData:t,setTransform:e,transformState:n,wrapperState:r,initialZoomState:o,navigationMode:i}){const{svg:a,divBox:s,width:l,height:u,zoomWrapper:c,element:h,tooltip:d,homeButton:p}=t,{x:f=0,y:g=0}=n,{minZoom:m,maxZoom:y}=Er,b=n&&1/n.zoom||o.initialZoom,v="expandAll"===i?b:Math.max(Math.min(y,b),m),x=()=>{const t=document.createEvent("MouseEvents");t.initEvent("mousedown",!0,!1),h.dispatchEvent(t)};kt(c).call(dr().extent([[0,0],[l,u]]).filter((()=>!(r.constraints.active||"dblclick"===ft.type||"mousedown"===ft.type&&3===ft.which))).scaleExtent(["expandAll"===i?.8:m*v,y*v]).on("start",x).on("zoom",(()=>{kt(p).attr("class","sn-org-homebutton lui-fade-button lui-fade-button--large"),e({zoom:ft.transform.k/v,x:ft.transform.x,y:ft.transform.y}),x(),Dr(d),qr(rr.translate(ft.transform.x,ft.transform.y).scale(ft.transform.k/v),a,s,l,u)}))),e({zoom:1/v,x:f,y:g}),qr(rr.translate(f,g).scale(1/v),a,s,l,u)}({containerData:{svg:v,divBox:m,width:d,height:p,zoomWrapper:f,element:t,tooltip:b,homeButton:y},setTransform:i,transformState:s&&s.transform||{},wrapperState:r,initialZoomState:O,navigationMode:c}),w&&a(_),l({svg:v,divBox:m,allNodes:x,positioning:h,width:d,height:p,element:t,zoomWrapper:f,tooltip:b,homeButton:y})},Pr=(t,e,n,r)=>{const o={expandedState:t,transform:e,size:{w:r.clientWidth,h:r.clientHeight},initialZoom:n};return o.expandedState.useTransitions=!1,o};function jr(e,n,r,o,i){const a=t.useElement();t.onTakeSnapshot((t=>{t.snapshotData||(t.snapshotData={}),r.snapshotData&&r.snapshotData.viewState||(t.snapshotData.viewState=Pr(e,o,i,a)),t.snapshotData.dataMatrix=((t,e,n)=>{if(n.snapshotData&&n.snapshotData.dataMatrix)return n.snapshotData.dataMatrix;const{navigationMode:r}=n,o=$r(t,e,!0,r),i=[],{qDataPages:a}=n.qHyperCube,s=[];return a.forEach((t=>{s.push(...t.qMatrix)})),o.forEach((t=>{void 0!==t.data.rowNo&&i.push(s[t.data.rowNo])})),i})(e,n.allNodes,r)})),t.useImperativeHandle((()=>({getViewState:()=>Pr(e,o,i,a)})))}var Hr={"Object.OrgChart":"Org chart","Object.OrgChart.Description":"Displays the relations of an organization or similarly structured data. Starts at the top and allows for navigation through the hierarchy.","Object.OrgChart.MaxData":"The maximum data limit is reached. The tree may display incorrectly.","Object.OrgChart.DummyWarn":"The data contains multiple root nodes.","Object.OrgChart.CycleWarning":"Data contains circular references, nodes are omitted.","Object.OrgChart.MissingRoot":"No root node, check your data for circular references.","Object.OrgChart.MaxChildren":"Maximum number of child nodes reached, nodes are omitted.","Object.OrgChart.LabelExpression":"Card title","Object.OrgChart.SubLabelExpression":"Card sub-title","Object.OrgChart.ExtraLabelExpression":"Card description","Object.OrgChart.ColorLabelExpression":"Card background color","Object.OrgChart.BackgroundColor":"Background color","Object.OrgChart.FontColor":"Font color","Object.OrgChart.IncludeDescendants":"Include descendants","Object.OrgChart.ExtraLabelDesc":"Description is only visible when a measure is not used"};function Ir(t){if(t&&t.get&&t.add){const e="Object.OrgChart.MaxData";if(t.get(e)!==e)return;Object.keys(Hr).forEach((e=>{t.add({id:e,locale:{"en-US":Hr[e]}})}))}}function Vr(t,e,n){let r;switch(t.colorType){case"byExpression":r=fr.resolveExpression(t.colorExpression);break;case"colorPicker":r=e.getColorPickerColor(t.color);break;default:r=n}return"none"===r?n:r}const Zr=({Theme:t,layout:n})=>{const r=Vr(n.style.backgroundColor,t,e.BACKGROUND_COLOR.color),o=Vr(n.style.fontColor,t,"default"),i=n.qHyperCube.qMeasureInfo.length?n.qHyperCube.qMeasureInfo[0].qFallbackTitle:null,{border:a={colorType:e.BORDER_COLOR_TYPE}}=n.style;return{backgroundColor:r,fontColor:o,measureLabel:i,border:a,borderColor:"auto"!==a.colorType?Vr(a,t,fr.getDarkColor(r)):fr.getDarkColor(r)}},Yr=(t,e)=>{let{viewState:n}=t;return!n&&e.snapshotData&&e.snapshotData.viewState&&(n=e.snapshotData.viewState),n};function Xr(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}Xr(".sn-org-chart {\n /* Tooltip arrow */\n}\n.sn-org-chart .sn-org-tooltip {\n visibility: hidden;\n opacity: 0;\n /* Unsupported in IE, so there we set width explicitly */\n width: 230px;\n width: -moz-max-content;\n width: fit-content;\n /* Position the tooltip text */\n position: absolute;\n z-index: 1;\n}\n.sn-org-chart .sn-org-tooltip::after {\n content: '';\n position: absolute;\n top: 100%;\n left: 0%;\n margin-left: -10px;\n border-width: 10px;\n border-style: solid;\n border-color: #404040 transparent transparent transparent;\n}\n.sn-org-chart .sn-org-tooltip-visible {\n opacity: 0.9;\n visibility: visible;\n}\n.sn-org-chart .sn-org-tooltip-inner {\n max-width: 240px;\n right: 50%;\n font-family: 'QlikView Sans', sans-serif;\n position: relative;\n max-height: 150px;\n background-color: #404040;\n color: #e6e6e6;\n text-align: left;\n font-size: 13px;\n line-height: 15px;\n padding: 10px 10px 10px 10px;\n border-radius: 6px;\n overflow-wrap: break-word;\n word-wrap: break-word;\n word-break: break-word;\n overflow: hidden;\n}\n.sn-org-chart .sn-org-tooltip-inner .sn-org-tooltip-header {\n font-weight: bold;\n padding-bottom: 5px;\n}\n");Xr(".sn-org-chart .sn-org-svg {\n position: absolute;\n /* For css only transitions, does not work in IE11 */\n}\n.sn-org-chart .sn-org-svg .sn-org-path {\n fill: none;\n stroke: #4c4c4c;\n stroke-width: 1;\n}\n.sn-org-chart .sn-org-svg .sn-org-paths:not(.org-disable-transition) {\n transform-origin: 0% 0%;\n transition-property: all;\n transition-duration: 0.5s;\n}\n");Xr(".sn-org-chart .sn-org-warning {\n position: absolute;\n bottom: 0px;\n left: 0px;\n font-style: italic;\n font-size: 13px;\n color: #7b7a78;\n}\n.sn-org-chart .sn-org-error {\n margin: 0;\n position: absolute;\n top: 50%;\n left: 50%;\n font-size: 1.2em;\n transform: translate(-50%, -50%);\n}\n");Xr(".sn-org-chart {\n overflow: hidden;\n}\n.sn-org-chart .sn-org-nodes {\n position: absolute;\n transform-origin: 0% 0%;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n backface-visibility: hidden;\n}\n.sn-org-chart .sn-org-nodes:not(.org-disable-transition) {\n transition-property: all;\n transition-duration: 0.5s;\n}\n.sn-org-chart .sn-org-nodes .sn-org-traverse {\n position: absolute;\n background-color: white;\n font-size: 20px;\n font-weight: bold;\n border-radius: 3px;\n border: 1px solid #8c8c8c;\n text-align: center;\n line-height: 24px;\n}\n.sn-org-chart .sn-org-nodes .sn-org-root {\n position: absolute;\n background-color: #8c8c8c;\n width: 20px;\n height: 20px;\n border-radius: 20px;\n}\n.sn-org-chart .sn-org-nodes .sn-org-card {\n position: absolute;\n}\n.sn-org-chart .sn-org-nodes .sn-org-card .sn-org-card-text {\n padding-left: 5px;\n padding-right: 5px;\n border-radius: 3px;\n}\n.sn-org-chart .sn-org-nodes .sn-org-card .sn-org-card-text.selected {\n border: 4px solid black;\n border-radius: 4px;\n}\n.sn-org-chart .sn-org-nodes .sn-org-card .sn-org-card-text.not-selected {\n opacity: 0.5;\n}\n.sn-org-chart .sn-org-nodes .sn-org-card .sn-org-card-title {\n font-size: 14px;\n font-weight: bold;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.sn-org-chart .sn-org-nodes .sn-org-card .sn-org-card-label {\n font-size: 11px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n");return Xr(".sn-org-chart .sn-org-homebutton {\n position: absolute;\n top: 20px;\n right: 20px;\n height: 20px;\n width: 20px;\n border-color: transparent;\n background-color: transparent;\n fill: rgba(89, 89, 89, 0.8);\n transition: fill 200ms ease-out;\n}\n.sn-org-chart .sn-org-homebutton:hover {\n fill: #595959;\n}\n.sn-org-chart .sn-org-homebutton.disabled {\n display: none;\n}\n"),function(e){return{qae:{properties:n,data:r},component:()=>{const e=t.useStaleLayout(),n=t.useModel(),r=t.useElement(),o=t.useTheme(),i=t.useOptions(),a=t.useRect(),s=t.useConstraints(),l=t.useTranslator(),[u,c]=t.useState(null),[h,d]=t.useState(null),[p,f]=t.useState(null),[g,m]=t.useState(null),[y,b]=t.useState(null),[v]=t.useState({transform:{},constraints:s,expandedState:p}),x=function(e){const[n,r]=t.useState(!1),o=t.useSelections(),i=!!t.useLayout().qSelectionInfo.qInSelections,[a]=t.useState({api:o,setState:t=>{a.state=t},state:[],singleSelect:!1});t.useEffect((()=>{Ir(e)}),[e]);const s=()=>{a.state=[]},l=()=>{a.state=[],r(!1)};return t.useEffect((()=>a.api?(a.api=o,a.api.on("deactivated",s),a.api.on("canceled",l),a.api.on("confirmed",l),a.api.on("cleared",s),()=>{a.api.removeListener("deactivated",s),a.api.removeListener("canceled",l),a.api.removeListener("confirmed",l),a.api.removeListener("cleared",s)}):()=>{}),[o]),t.useEffect((()=>{a.singleSelect=n}),[n]),t.useAction((()=>({action(){r(!n)},icon:{shapes:[{type:"path",attrs:{d:"M9.5,15 C9.77614237,15 10,15.2238576 10,15.5 C10,15.7761424 9.77614237,16 9.5,16 L6.5,16 C6.22385763,16 6,15.7761424 6,15.5 C6,15.2238576 6.22385763,15 6.5,15 L9.5,15 Z M15.5,13 C15.7761424,13 16,13.2238576 16,13.5 L16,15 C16,15.5522847 15.5522847,16 15,16 L13.5,16 C13.2238576,16 13,15.7761424 13,15.5 C13,15.2238576 13.2238576,15 13.5,15 L14.4,15 C14.7313708,15 15,14.7313708 15,14.4 L15,13.5 C15,13.2238576 15.2238576,13 15.5,13 Z M0.5,13 C0.776142375,13 1,13.2238576 1,13.5 L1,14.4 C1,14.7313708 1.26862915,15 1.6,15 L2.5,15 C2.77614237,15 3,15.2238576 3,15.5 C3,15.7761424 2.77614237,16 2.5,16 L1,16 C0.44771525,16 0,15.5522847 0,15 L0,13.5 C0,13.2238576 0.223857625,13 0.5,13 Z M6.8,9 C6.91045695,9 7,9.08954305 7,9.2 L7,12.8 C7,12.9104569 6.91045695,13 6.8,13 L3.2,13 C3.08954305,13 3,12.9104569 3,12.8 L3,9.2 C3,9.08954305 3.08954305,9 3.2,9 L6.8,9 Z M12.8,9 C12.9104569,9 13,9.08954305 13,9.2 L13,12.8 C13,12.9104569 12.9104569,13 12.8,13 L9.2,13 C9.08954305,13 9,12.9104569 9,12.8 L9,9.2 C9,9.08954305 9.08954305,9 9.2,9 L12.8,9 Z M6,10 L4,10 L4,12 L6,12 L6,10 Z M12,10 L10,10 L10,12 L12,12 L12,10 Z M15.5,6 C15.7761424,6 16,6.22385763 16,6.5 L16,9.5 C16,9.77614237 15.7761424,10 15.5,10 C15.2238576,10 15,9.77614237 15,9.5 L15,6.5 C15,6.22385763 15.2238576,6 15.5,6 Z M0.5,6 C0.776142375,6 1,6.22385763 1,6.5 L1,9.5 C1,9.77614237 0.776142375,10 0.5,10 C0.223857625,10 0,9.77614237 0,9.5 L0,6.5 C0,6.22385763 0.223857625,6 0.5,6 Z M6.8,3 C6.91045695,3 7,3.08954305 7,3.2 L7,6.8 C7,6.91045695 6.91045695,7 6.8,7 L3.2,7 C3.08954305,7 3,6.91045695 3,6.8 L3,3.2 C3,3.08954305 3.08954305,3 3.2,3 L6.8,3 Z M12.8,3 C12.9104569,3 13,3.08954305 13,3.2 L13,6.8 C13,6.91045695 12.9104569,7 12.8,7 L9.2,7 C9.08954305,7 9,6.91045695 9,6.8 L9,3.2 C9,3.08954305 9.08954305,3 9.2,3 L12.8,3 Z M12,4 L10,4 L10,6 L12,6 L12,4 Z M2.5,5.70654635e-14 C2.77614237,5.70654635e-14 3,0.223857625 3,0.5 C3,0.776142375 2.77614237,1 2.5,1 L1.6,1 C1.26862915,1 1,1.26862915 1,1.6 L1,2.5 C1,2.77614237 0.776142375,3 0.5,3 C0.223857625,3 0,2.77614237 0,2.5 L0,1 C0,0.44771525 0.44771525,5.70654635e-14 1,5.70654635e-14 L2.5,5.70654635e-14 Z M15,0 C15.5522847,0 16,0.44771525 16,1 L16,2.5 C16,2.77614237 15.7761424,3 15.5,3 C15.2238576,3 15,2.77614237 15,2.5 L15,1.6 C15,1.26862915 14.7313708,1 14.4,1 L13.5,1 C13.2238576,1 13,0.776142375 13,0.5 C13,0.223857625 13.2238576,0 13.5,0 L15,0 Z M9.5,5.67323966e-14 C9.77614237,5.67323966e-14 10,0.223857625 10,0.5 C10,0.776142375 9.77614237,1 9.5,1 L6.5,1 C6.22385763,1 6,0.776142375 6,0.5 C6,0.223857625 6.22385763,5.67323966e-14 6.5,5.67323966e-14 L9.5,5.67323966e-14 Z"}}]},active:n,hidden:!i,label:e.get("Object.OrgChart.SingleSelect")})),[n,i]),t.useEffect((()=>{const t=t=>{"Shift"===t.key&&r(!0)},e=t=>{"Shift"===t.key&&r(!1)};return document.addEventListener("keydown",t),document.addEventListener("keyup",e),()=>{document.removeEventListener("keydown",t),document.removeEventListener("keyup",e)}}),[]),a}(l);t.useEffect((()=>{Ir(l)}),[l.language()]),t.useEffect((()=>{v.constraints=s}),[s]),t.useEffect((()=>{v.transform=g}),[g]),t.useEffect((()=>{v.expandedState=p}),[p]);const w=t=>{t.useTransitions=!0,f(t)},[_]=t.usePromise((()=>{if(!e)return Promise.resolve();const t=Yr(i,e);return t&&t.expandedState&&f(t.expandedState),t&&t.transform&&m(t.transform),Cr({layout:e,model:n,translator:l}).then((t=>(d(Zr({Theme:o,layout:e})),x.setState([]),t)))}),[e,n,l.language(),o.name()]),C=()=>{if(r&&_){const t=Yr(i,e);Br({element:r,dataTree:_,viewState:t,wrapperState:v,selectionObj:x,setInitialZoom:b,setTransform:m,setExpandedState:f,setContainerData:c,layout:e})}},E=()=>{u&&p&&h&&(({containerData:t,styling:e,setExpandedCallback:n,wrapperState:r,selectionObj:o,element:i})=>{const{svg:a,divBox:s,allNodes:l,positioning:u,tooltip:c}=t,{navigationMode:h}=l.data;s.selectAll("*").remove(),a.selectAll("*").remove();const d=$r(r.expandedState,l,!1,h);Rr({positioning:u,divBox:s,nodes:d,styling:e,setExpandedCallback:n,wrapperState:r,selectionObj:o,navigationMode:h,element:i,tooltip:c}),Nr(a.selectAll(".sn-org-paths").data(d).enter(),u,r.expandedState.topId,h)})({containerData:u,styling:h,setExpandedCallback:w,wrapperState:v,selectionObj:x,useTransitions:p.useTransitions,element:r})};t.useEffect((()=>{E()}),[u,x.state]),t.useEffect((()=>{C()}),[r,_,s]),t.useEffect((()=>{e.resizeOnExpand?C():E()}),[p]),t.useEffect((()=>{if(u&&e&&e.snapshotData){const t=((t,e,n)=>{if(!e)return rr.translate(n.x,n.y).scale(n.zoom);const{size:r}=e,o=t.width/r.w>t.height/r.h?t.height/r.h:t.width/r.w,i=e.transform.x*o,a=e.transform.y*o,s=e.transform.zoom*o;return rr.translate(i,a).scale(s)})(a,e.snapshotData.viewState,g);qr(t,u.svg,u.divBox,a.width,a.height)}}),[a,u]),jr(p,u,e,g,y)},ext:u}}}));
@@ -6,5 +6,5 @@
6
6
  "author": "QlikTech International AB",
7
7
  "supernova": true,
8
8
  "type": "visualization",
9
- "version": "0.13.0"
9
+ "version": "0.16.0"
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nebula.js/sn-org-chart",
3
- "version": "0.13.0",
3
+ "version": "0.16.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "QlikTech International AB",
@@ -24,17 +24,18 @@
24
24
  "dist"
25
25
  ],
26
26
  "engines": {
27
- "node": ">=10"
27
+ "node": ">=16"
28
28
  },
29
29
  "main": "dist/sn-org-chart.js",
30
30
  "module": "dist/sn-org-chart.esm.js",
31
31
  "scripts": {
32
- "build": "nebula build --no-sourcemap && shx cp assets/* dist",
32
+ "build": "nebula build --sourcemap false && shx cp assets/* dist",
33
33
  "sense": "nebula sense --ext ./src/extension/ext-raw.js --meta ./src/extension/meta.json",
34
34
  "lint": "eslint src",
35
35
  "start": "nebula serve --type sn-org-chart",
36
- "test:unit": "aw -c aw.config.js",
36
+ "test:unit": "jest",
37
37
  "test:integration": "aw puppet --glob 'test/integration/**/*.spec.js' --chrome.headless true --chrome.slowMo 10",
38
+ "test:rendering": "aw puppet --testExt '*.spec.js' --glob 'test/rendering/**/*.spec.js' --mocha.bail false --mocha.timeout 30000",
38
39
  "prepublishOnly": "rm -rf dist && npm run build",
39
40
  "version": "node ./scripts/version-qext.js && git add -A"
40
41
  },
@@ -49,30 +50,32 @@
49
50
  ]
50
51
  },
51
52
  "peerDependencies": {
52
- "@nebula.js/stardust": ">=1.0.1"
53
+ "@nebula.js/stardust": ">=2.1.0"
53
54
  },
54
55
  "devDependencies": {
55
56
  "@after-work.js/aw": "6.0.14",
56
- "@babel/cli": "7.12.1",
57
- "@babel/core": "7.12.3",
58
- "@babel/preset-env": "7.12.1",
59
- "@commitlint/cli": "11.0.0",
60
- "@commitlint/config-conventional": "11.0.0",
61
- "@nebula.js/cli": "1.0.0",
62
- "@nebula.js/cli-build": "1.0.0",
63
- "@nebula.js/cli-serve": "1.0.1",
64
- "@nebula.js/stardust": "1.0.2-alpha.0",
65
- "babel-plugin-istanbul": "6.0.0",
57
+ "@babel/cli": "7.15.7",
58
+ "@babel/core": "7.15.8",
59
+ "@babel/preset-env": "7.15.8",
60
+ "@commitlint/cli": "12.1.4",
61
+ "@commitlint/config-conventional": "12.1.4",
62
+ "@nebula.js/cli": "2.3.0",
63
+ "@nebula.js/cli-build": "2.3.0",
64
+ "@nebula.js/cli-sense": "2.3.0",
65
+ "@nebula.js/cli-serve": "2.3.0",
66
+ "@nebula.js/stardust": "2.3.0",
67
+ "babel-plugin-istanbul": "6.1.1",
66
68
  "d3": "5.16.0",
67
- "eslint": "7.12.1",
68
- "eslint-config-airbnb-base": "14.2.0",
69
- "eslint-plugin-import": "2.22.1",
70
- "eslint-plugin-mocha": "8.0.0",
71
- "husky": "4.3.0",
72
- "less": "^3.12.2",
73
- "lint-staged": "10.5.0",
74
- "mocha-junit-reporter": "2.0.0",
75
- "shx": "0.3.3",
76
- "sinon": "^9.2.1"
69
+ "eslint": "7.32.0",
70
+ "eslint-config-airbnb-base": "14.2.1",
71
+ "eslint-plugin-import": "2.25.2",
72
+ "eslint-plugin-mocha": "9.0.0",
73
+ "husky": "4.3.8",
74
+ "jest": "^27.3.1",
75
+ "jest-junit": "^13.0.0",
76
+ "less": "^4.1.2",
77
+ "lint-staged": "11.2.3",
78
+ "mocha-junit-reporter": "2.0.2",
79
+ "shx": "0.3.3"
77
80
  }
78
81
  }