quixotic-gol 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("react"),dt=require("react/jsx-runtime"),Or=500;function Tr(t){return JSON.stringify(JSON.stringify(t))}function Vr(t){return JSON.parse(JSON.parse(t))}var Hr={value:()=>{}};function Xe(){for(var t=0,e=arguments.length,r={},n;t<e;++t){if(!(n=arguments[t]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new se(r)}function se(t){this._=t}function Wr(t,e){return t.trim().split(/^|\s+/).map(function(r){var n="",o=r.indexOf(".");if(o>=0&&(n=r.slice(o+1),r=r.slice(0,o)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}se.prototype=Xe.prototype={constructor:se,on:function(t,e){var r=this._,n=Wr(t+"",r),o,a=-1,i=n.length;if(arguments.length<2){for(;++a<i;)if((o=(t=n[a]).type)&&(o=qr(r[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<i;)if(o=(t=n[a]).type)r[o]=Oe(r[o],t.name,e);else if(e==null)for(o in r)r[o]=Oe(r[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new se(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var r=new Array(o),n=0,o,a;n<o;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],n=0,o=a.length;n<o;++n)a[n].value.apply(e,r)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],o=0,a=n.length;o<a;++o)n[o].value.apply(e,r)}};function qr(t,e){for(var r=0,n=t.length,o;r<n;++r)if((o=t[r]).name===e)return o.value}function Oe(t,e,r){for(var n=0,o=t.length;n<o;++n)if(t[n].name===e){t[n]=Hr,t=t.slice(0,n).concat(t.slice(n+1));break}return r!=null&&t.push({name:e,value:r}),t}var Ce="http://www.w3.org/1999/xhtml";const Te={svg:"http://www.w3.org/2000/svg",xhtml:Ce,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function me(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),Te.hasOwnProperty(e)?{space:Te[e],local:t}:t}function Kr(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Ce&&e.documentElement.namespaceURI===Ce?e.createElement(t):e.createElementNS(r,t)}}function Qr(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function lr(t){var e=me(t);return(e.local?Qr:Kr)(e)}function Zr(){}function Ue(t){return t==null?Zr:function(){return this.querySelector(t)}}function Jr(t){typeof t!="function"&&(t=Ue(t));for(var e=this._groups,r=e.length,n=new Array(r),o=0;o<r;++o)for(var a=e[o],i=a.length,c=n[o]=new Array(i),l,s,u=0;u<i;++u)(l=a[u])&&(s=t.call(l,l.__data__,u,a))&&("__data__"in l&&(s.__data__=l.__data__),c[u]=s);return new ft(n,this._parents)}function Ar(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function tn(){return[]}function ur(t){return t==null?tn:function(){return this.querySelectorAll(t)}}function en(t){return function(){return Ar(t.apply(this,arguments))}}function rn(t){typeof t=="function"?t=en(t):t=ur(t);for(var e=this._groups,r=e.length,n=[],o=[],a=0;a<r;++a)for(var i=e[a],c=i.length,l,s=0;s<c;++s)(l=i[s])&&(n.push(t.call(l,l.__data__,s,i)),o.push(l));return new ft(n,o)}function fr(t){return function(){return this.matches(t)}}function hr(t){return function(e){return e.matches(t)}}var nn=Array.prototype.find;function on(t){return function(){return nn.call(this.children,t)}}function an(){return this.firstElementChild}function sn(t){return this.select(t==null?an:on(typeof t=="function"?t:hr(t)))}var cn=Array.prototype.filter;function ln(){return Array.from(this.children)}function un(t){return function(){return cn.call(this.children,t)}}function fn(t){return this.selectAll(t==null?ln:un(typeof t=="function"?t:hr(t)))}function hn(t){typeof t!="function"&&(t=fr(t));for(var e=this._groups,r=e.length,n=new Array(r),o=0;o<r;++o)for(var a=e[o],i=a.length,c=n[o]=[],l,s=0;s<i;++s)(l=a[s])&&t.call(l,l.__data__,s,a)&&c.push(l);return new ft(n,this._parents)}function dr(t){return new Array(t.length)}function dn(){return new ft(this._enter||this._groups.map(dr),this._parents)}function fe(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}fe.prototype={constructor:fe,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 pn(t){return function(){return t}}function vn(t,e,r,n,o,a){for(var i=0,c,l=e.length,s=a.length;i<s;++i)(c=e[i])?(c.__data__=a[i],n[i]=c):r[i]=new fe(t,a[i]);for(;i<l;++i)(c=e[i])&&(o[i]=c)}function yn(t,e,r,n,o,a,i){var c,l,s=new Map,u=e.length,d=a.length,v=new Array(u),g;for(c=0;c<u;++c)(l=e[c])&&(v[c]=g=i.call(l,l.__data__,c,e)+"",s.has(g)?o[c]=l:s.set(g,l));for(c=0;c<d;++c)g=i.call(t,a[c],c,a)+"",(l=s.get(g))?(n[c]=l,l.__data__=a[c],s.delete(g)):r[c]=new fe(t,a[c]);for(c=0;c<u;++c)(l=e[c])&&s.get(v[c])===l&&(o[c]=l)}function mn(t){return t.__data__}function gn(t,e){if(!arguments.length)return Array.from(this,mn);var r=e?yn:vn,n=this._parents,o=this._groups;typeof t!="function"&&(t=pn(t));for(var a=o.length,i=new Array(a),c=new Array(a),l=new Array(a),s=0;s<a;++s){var u=n[s],d=o[s],v=d.length,g=wn(t.call(u,u&&u.__data__,s,n)),F=g.length,L=c[s]=new Array(F),$=i[s]=new Array(F),C=l[s]=new Array(v);r(u,d,L,$,C,g,e);for(var Q=0,O=0,Z,V;Q<F;++Q)if(Z=L[Q]){for(Q>=O&&(O=Q+1);!(V=$[O])&&++O<F;);Z._next=V||null}}return i=new ft(i,n),i._enter=c,i._exit=l,i}function wn(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function xn(){return new ft(this._exit||this._groups.map(dr),this._parents)}function En(t,e,r){var n=this.enter(),o=this,a=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),r==null?a.remove():r(a),n&&o?n.merge(o).order():o}function bn(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,o=r.length,a=n.length,i=Math.min(o,a),c=new Array(o),l=0;l<i;++l)for(var s=r[l],u=n[l],d=s.length,v=c[l]=new Array(d),g,F=0;F<d;++F)(g=s[F]||u[F])&&(v[F]=g);for(;l<o;++l)c[l]=r[l];return new ft(c,this._parents)}function Mn(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n=t[e],o=n.length-1,a=n[o],i;--o>=0;)(i=n[o])&&(a&&i.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(i,a),a=i);return this}function Fn(t){t||(t=Cn);function e(d,v){return d&&v?t(d.__data__,v.__data__):!d-!v}for(var r=this._groups,n=r.length,o=new Array(n),a=0;a<n;++a){for(var i=r[a],c=i.length,l=o[a]=new Array(c),s,u=0;u<c;++u)(s=i[u])&&(l[u]=s);l.sort(e)}return new ft(o,this._parents).order()}function Cn(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function _n(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Rn(){return Array.from(this)}function Ln(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],o=0,a=n.length;o<a;++o){var i=n[o];if(i)return i}return null}function Yn(){let t=0;for(const e of this)++t;return t}function Dn(){return!this.node()}function Bn(t){for(var e=this._groups,r=0,n=e.length;r<n;++r)for(var o=e[r],a=0,i=o.length,c;a<i;++a)(c=o[a])&&t.call(c,c.__data__,a,o);return this}function Pn(t){return function(){this.removeAttribute(t)}}function Nn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function $n(t,e){return function(){this.setAttribute(t,e)}}function Xn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Un(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function Sn(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function In(t,e){var r=me(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((e==null?r.local?Nn:Pn:typeof e=="function"?r.local?Sn:Un:r.local?Xn:$n)(r,e))}function pr(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function kn(t){return function(){this.style.removeProperty(t)}}function zn(t,e,r){return function(){this.style.setProperty(t,e,r)}}function jn(t,e,r){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function Gn(t,e,r){return arguments.length>1?this.each((e==null?kn:typeof e=="function"?jn:zn)(t,e,r??"")):St(this.node(),t)}function St(t,e){return t.style.getPropertyValue(e)||pr(t).getComputedStyle(t,null).getPropertyValue(e)}function On(t){return function(){delete this[t]}}function Tn(t,e){return function(){this[t]=e}}function Vn(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Hn(t,e){return arguments.length>1?this.each((e==null?On:typeof e=="function"?Vn:Tn)(t,e)):this.node()[t]}function vr(t){return t.trim().split(/^|\s+/)}function Se(t){return t.classList||new yr(t)}function yr(t){this._node=t,this._names=vr(t.getAttribute("class")||"")}yr.prototype={add:function(t){var e=this._names.indexOf(t);e<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}};function mr(t,e){for(var r=Se(t),n=-1,o=e.length;++n<o;)r.add(e[n])}function gr(t,e){for(var r=Se(t),n=-1,o=e.length;++n<o;)r.remove(e[n])}function Wn(t){return function(){mr(this,t)}}function qn(t){return function(){gr(this,t)}}function Kn(t,e){return function(){(e.apply(this,arguments)?mr:gr)(this,t)}}function Qn(t,e){var r=vr(t+"");if(arguments.length<2){for(var n=Se(this.node()),o=-1,a=r.length;++o<a;)if(!n.contains(r[o]))return!1;return!0}return this.each((typeof e=="function"?Kn:e?Wn:qn)(r,e))}function Zn(){this.textContent=""}function Jn(t){return function(){this.textContent=t}}function An(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function to(t){return arguments.length?this.each(t==null?Zn:(typeof t=="function"?An:Jn)(t)):this.node().textContent}function eo(){this.innerHTML=""}function ro(t){return function(){this.innerHTML=t}}function no(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function oo(t){return arguments.length?this.each(t==null?eo:(typeof t=="function"?no:ro)(t)):this.node().innerHTML}function io(){this.nextSibling&&this.parentNode.appendChild(this)}function ao(){return this.each(io)}function so(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function co(){return this.each(so)}function lo(t){var e=typeof t=="function"?t:lr(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function uo(){return null}function fo(t,e){var r=typeof t=="function"?t:lr(t),n=e==null?uo:typeof e=="function"?e:Ue(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function ho(){var t=this.parentNode;t&&t.removeChild(this)}function po(){return this.each(ho)}function vo(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function yo(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function mo(t){return this.select(t?yo:vo)}function go(t){return arguments.length?this.property("__data__",t):this.node().__data__}function wo(t){return function(e){t.call(this,e,this.__data__)}}function xo(t){return t.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");return n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function Eo(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,o=e.length,a;r<o;++r)a=e[r],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++n]=a;++n?e.length=n:delete this.__on}}}function bo(t,e,r){return function(){var n=this.__on,o,a=wo(e);if(n){for(var i=0,c=n.length;i<c;++i)if((o=n[i]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=r),o.value=e;return}}this.addEventListener(t.type,a,r),o={type:t.type,name:t.name,value:e,listener:a,options:r},n?n.push(o):this.__on=[o]}}function Mo(t,e,r){var n=xo(t+""),o,a=n.length,i;if(arguments.length<2){var c=this.node().__on;if(c){for(var l=0,s=c.length,u;l<s;++l)for(o=0,u=c[l];o<a;++o)if((i=n[o]).type===u.type&&i.name===u.name)return u.value}return}for(c=e?bo:Eo,o=0;o<a;++o)this.each(c(n[o],e,r));return this}function wr(t,e,r){var n=pr(t),o=n.CustomEvent;typeof o=="function"?o=new o(e,r):(o=n.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function Fo(t,e){return function(){return wr(this,t,e)}}function Co(t,e){return function(){return wr(this,t,e.apply(this,arguments))}}function _o(t,e){return this.each((typeof e=="function"?Co:Fo)(t,e))}function*Ro(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],o=0,a=n.length,i;o<a;++o)(i=n[o])&&(yield i)}var xr=[null];function ft(t,e){this._groups=t,this._parents=e}function Zt(){return new ft([[document.documentElement]],xr)}function Lo(){return this}ft.prototype=Zt.prototype={constructor:ft,select:Jr,selectAll:rn,selectChild:sn,selectChildren:fn,filter:hn,data:gn,enter:dn,exit:xn,join:En,merge:bn,selection:Lo,order:Mn,sort:Fn,call:_n,nodes:Rn,node:Ln,size:Yn,empty:Dn,each:Bn,attr:In,style:Gn,property:Hn,classed:Qn,text:to,html:oo,raise:ao,lower:co,append:lo,insert:fo,remove:po,clone:mo,datum:go,on:Mo,dispatch:_o,[Symbol.iterator]:Ro};function at(t){return typeof t=="string"?new ft([[document.querySelector(t)]],[document.documentElement]):new ft([[t]],xr)}function Yo(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Yt(t,e){if(t=Yo(t),e===void 0&&(e=t.currentTarget),e){var r=e.ownerSVGElement||e;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}const _e={capture:!0,passive:!1};function Re(t){t.preventDefault(),t.stopImmediatePropagation()}function Do(t){var e=t.document.documentElement,r=at(t).on("dragstart.drag",Re,_e);"onselectstart"in e?r.on("selectstart.drag",Re,_e):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Bo(t,e){var r=t.document.documentElement,n=at(t).on("dragstart.drag",null);e&&(n.on("click.drag",Re,_e),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}function Ie(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function Er(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Jt(){}var Wt=.7,he=1/Wt,Ut="\\s*([+-]?\\d+)\\s*",qt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Po=/^#([0-9a-f]{3,8})$/,No=new RegExp(`^rgb\\(${Ut},${Ut},${Ut}\\)$`),$o=new RegExp(`^rgb\\(${gt},${gt},${gt}\\)$`),Xo=new RegExp(`^rgba\\(${Ut},${Ut},${Ut},${qt}\\)$`),Uo=new RegExp(`^rgba\\(${gt},${gt},${gt},${qt}\\)$`),So=new RegExp(`^hsl\\(${qt},${gt},${gt}\\)$`),Io=new RegExp(`^hsla\\(${qt},${gt},${gt},${qt}\\)$`),Ve={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};Ie(Jt,Kt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:He,formatHex:He,formatHex8:ko,formatHsl:zo,formatRgb:We,toString:We});function He(){return this.rgb().formatHex()}function ko(){return this.rgb().formatHex8()}function zo(){return br(this).formatHsl()}function We(){return this.rgb().formatRgb()}function Kt(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Po.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?qe(e):r===3?new ut(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?re(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?re(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=No.exec(t))?new ut(e[1],e[2],e[3],1):(e=$o.exec(t))?new ut(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Xo.exec(t))?re(e[1],e[2],e[3],e[4]):(e=Uo.exec(t))?re(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=So.exec(t))?Ze(e[1],e[2]/100,e[3]/100,1):(e=Io.exec(t))?Ze(e[1],e[2]/100,e[3]/100,e[4]):Ve.hasOwnProperty(t)?qe(Ve[t]):t==="transparent"?new ut(NaN,NaN,NaN,0):null}function qe(t){return new ut(t>>16&255,t>>8&255,t&255,1)}function re(t,e,r,n){return n<=0&&(t=e=r=NaN),new ut(t,e,r,n)}function jo(t){return t instanceof Jt||(t=Kt(t)),t?(t=t.rgb(),new ut(t.r,t.g,t.b,t.opacity)):new ut}function Le(t,e,r,n){return arguments.length===1?jo(t):new ut(t,e,r,n??1)}function ut(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}Ie(ut,Le,Er(Jt,{brighter(t){return t=t==null?he:Math.pow(he,t),new ut(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Wt:Math.pow(Wt,t),new ut(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ut(Pt(this.r),Pt(this.g),Pt(this.b),de(this.opacity))},displayable(){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:Ke,formatHex:Ke,formatHex8:Go,formatRgb:Qe,toString:Qe}));function Ke(){return`#${Bt(this.r)}${Bt(this.g)}${Bt(this.b)}`}function Go(){return`#${Bt(this.r)}${Bt(this.g)}${Bt(this.b)}${Bt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qe(){const t=de(this.opacity);return`${t===1?"rgb(":"rgba("}${Pt(this.r)}, ${Pt(this.g)}, ${Pt(this.b)}${t===1?")":`, ${t})`}`}function de(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Pt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Bt(t){return t=Pt(t),(t<16?"0":"")+t.toString(16)}function Ze(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new pt(t,e,r,n)}function br(t){if(t instanceof pt)return new pt(t.h,t.s,t.l,t.opacity);if(t instanceof Jt||(t=Kt(t)),!t)return new pt;if(t instanceof pt)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,o=Math.min(e,r,n),a=Math.max(e,r,n),i=NaN,c=a-o,l=(a+o)/2;return c?(e===a?i=(r-n)/c+(r<n)*6:r===a?i=(n-e)/c+2:i=(e-r)/c+4,c/=l<.5?a+o:2-a-o,i*=60):c=l>0&&l<1?0:i,new pt(i,c,l,t.opacity)}function Oo(t,e,r,n){return arguments.length===1?br(t):new pt(t,e,r,n??1)}function pt(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}Ie(pt,Oo,Er(Jt,{brighter(t){return t=t==null?he:Math.pow(he,t),new pt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Wt:Math.pow(Wt,t),new pt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,o=2*r-n;return new ut(Ee(t>=240?t-240:t+120,o,n),Ee(t,o,n),Ee(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new pt(Je(this.h),ne(this.s),ne(this.l),de(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=de(this.opacity);return`${t===1?"hsl(":"hsla("}${Je(this.h)}, ${ne(this.s)*100}%, ${ne(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Je(t){return t=(t||0)%360,t<0?t+360:t}function ne(t){return Math.max(0,Math.min(1,t||0))}function Ee(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const Mr=t=>()=>t;function To(t,e){return function(r){return t+r*e}}function Vo(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function Ho(t){return(t=+t)==1?Fr:function(e,r){return r-e?Vo(e,r,t):Mr(isNaN(e)?r:e)}}function Fr(t,e){var r=e-t;return r?To(t,r):Mr(isNaN(t)?e:t)}const Ae=(function t(e){var r=Ho(e);function n(o,a){var i=r((o=Le(o)).r,(a=Le(a)).r),c=r(o.g,a.g),l=r(o.b,a.b),s=Fr(o.opacity,a.opacity);return function(u){return o.r=i(u),o.g=c(u),o.b=l(u),o.opacity=s(u),o+""}}return n.gamma=t,n})(1);function Mt(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var Ye=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,be=new RegExp(Ye.source,"g");function Wo(t){return function(){return t}}function qo(t){return function(e){return t(e)+""}}function Ko(t,e){var r=Ye.lastIndex=be.lastIndex=0,n,o,a,i=-1,c=[],l=[];for(t=t+"",e=e+"";(n=Ye.exec(t))&&(o=be.exec(e));)(a=o.index)>r&&(a=e.slice(r,a),c[i]?c[i]+=a:c[++i]=a),(n=n[0])===(o=o[0])?c[i]?c[i]+=o:c[++i]=o:(c[++i]=null,l.push({i,x:Mt(n,o)})),r=be.lastIndex;return r<e.length&&(a=e.slice(r),c[i]?c[i]+=a:c[++i]=a),c.length<2?l[0]?qo(l[0].x):Wo(e):(e=l.length,function(s){for(var u=0,d;u<e;++u)c[(d=l[u]).i]=d.x(s);return c.join("")})}var tr=180/Math.PI,De={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Cr(t,e,r,n,o,a){var i,c,l;return(i=Math.sqrt(t*t+e*e))&&(t/=i,e/=i),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(c=Math.sqrt(r*r+n*n))&&(r/=c,n/=c,l/=c),t*n<e*r&&(t=-t,e=-e,l=-l,i=-i),{translateX:o,translateY:a,rotate:Math.atan2(e,t)*tr,skewX:Math.atan(l)*tr,scaleX:i,scaleY:c}}var oe;function Qo(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?De:Cr(e.a,e.b,e.c,e.d,e.e,e.f)}function Zo(t){return t==null||(oe||(oe=document.createElementNS("http://www.w3.org/2000/svg","g")),oe.setAttribute("transform",t),!(t=oe.transform.baseVal.consolidate()))?De:(t=t.matrix,Cr(t.a,t.b,t.c,t.d,t.e,t.f))}function _r(t,e,r,n){function o(s){return s.length?s.pop()+" ":""}function a(s,u,d,v,g,F){if(s!==d||u!==v){var L=g.push("translate(",null,e,null,r);F.push({i:L-4,x:Mt(s,d)},{i:L-2,x:Mt(u,v)})}else(d||v)&&g.push("translate("+d+e+v+r)}function i(s,u,d,v){s!==u?(s-u>180?u+=360:u-s>180&&(s+=360),v.push({i:d.push(o(d)+"rotate(",null,n)-2,x:Mt(s,u)})):u&&d.push(o(d)+"rotate("+u+n)}function c(s,u,d,v){s!==u?v.push({i:d.push(o(d)+"skewX(",null,n)-2,x:Mt(s,u)}):u&&d.push(o(d)+"skewX("+u+n)}function l(s,u,d,v,g,F){if(s!==d||u!==v){var L=g.push(o(g)+"scale(",null,",",null,")");F.push({i:L-4,x:Mt(s,d)},{i:L-2,x:Mt(u,v)})}else(d!==1||v!==1)&&g.push(o(g)+"scale("+d+","+v+")")}return function(s,u){var d=[],v=[];return s=t(s),u=t(u),a(s.translateX,s.translateY,u.translateX,u.translateY,d,v),i(s.rotate,u.rotate,d,v),c(s.skewX,u.skewX,d,v),l(s.scaleX,s.scaleY,u.scaleX,u.scaleY,d,v),s=u=null,function(g){for(var F=-1,L=v.length,$;++F<L;)d[($=v[F]).i]=$.x(g);return d.join("")}}}var Jo=_r(Qo,"px, ","px)","deg)"),Ao=_r(Zo,", ",")",")"),ti=1e-12;function er(t){return((t=Math.exp(t))+1/t)/2}function ei(t){return((t=Math.exp(t))-1/t)/2}function ri(t){return((t=Math.exp(2*t))-1)/(t+1)}const ni=(function t(e,r,n){function o(a,i){var c=a[0],l=a[1],s=a[2],u=i[0],d=i[1],v=i[2],g=u-c,F=d-l,L=g*g+F*F,$,C;if(L<ti)C=Math.log(v/s)/e,$=function(et){return[c+et*g,l+et*F,s*Math.exp(e*et*C)]};else{var Q=Math.sqrt(L),O=(v*v-s*s+n*L)/(2*s*r*Q),Z=(v*v-s*s-n*L)/(2*v*r*Q),V=Math.log(Math.sqrt(O*O+1)-O),z=Math.log(Math.sqrt(Z*Z+1)-Z);C=(z-V)/e,$=function(et){var B=et*C,U=er(V),j=s/(r*Q)*(U*ri(e*B+V)-ei(V));return[c+j*g,l+j*F,s*U/er(e*B+V)]}}return $.duration=C*1e3*e/Math.SQRT2,$}return o.rho=function(a){var i=Math.max(.001,+a),c=i*i,l=c*c;return t(i,c,l)},o})(Math.SQRT2,2,4);var It=0,Tt=0,Gt=0,Rr=1e3,pe,Vt,ve=0,Nt=0,ge=0,Qt=typeof performance=="object"&&performance.now?performance:Date,Lr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ke(){return Nt||(Lr(oi),Nt=Qt.now()+ge)}function oi(){Nt=0}function ye(){this._call=this._time=this._next=null}ye.prototype=Yr.prototype={constructor:ye,restart:function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?ke():+r)+(e==null?0:+e),!this._next&&Vt!==this&&(Vt?Vt._next=this:pe=this,Vt=this),this._call=t,this._time=r,Be()},stop:function(){this._call&&(this._call=null,this._time=1/0,Be())}};function Yr(t,e,r){var n=new ye;return n.restart(t,e,r),n}function ii(){ke(),++It;for(var t=pe,e;t;)(e=Nt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--It}function rr(){Nt=(ve=Qt.now())+ge,It=Tt=0;try{ii()}finally{It=0,si(),Nt=0}}function ai(){var t=Qt.now(),e=t-ve;e>Rr&&(ge-=e,ve=t)}function si(){for(var t,e=pe,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:pe=r);Vt=t,Be(n)}function Be(t){if(!It){Tt&&(Tt=clearTimeout(Tt));var e=t-Nt;e>24?(t<1/0&&(Tt=setTimeout(rr,t-Qt.now()-ge)),Gt&&(Gt=clearInterval(Gt))):(Gt||(ve=Qt.now(),Gt=setInterval(ai,Rr)),It=1,Lr(rr))}}function nr(t,e,r){var n=new ye;return e=e==null?0:+e,n.restart(o=>{n.stop(),t(o+e)},e,r),n}var ci=Xe("start","end","cancel","interrupt"),li=[],Dr=0,or=1,Pe=2,ce=3,ir=4,Ne=5,le=6;function we(t,e,r,n,o,a){var i=t.__transition;if(!i)t.__transition={};else if(r in i)return;ui(t,r,{name:e,index:n,group:o,on:ci,tween:li,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Dr})}function ze(t,e){var r=vt(t,e);if(r.state>Dr)throw new Error("too late; already scheduled");return r}function wt(t,e){var r=vt(t,e);if(r.state>ce)throw new Error("too late; already running");return r}function vt(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function ui(t,e,r){var n=t.__transition,o;n[e]=r,r.timer=Yr(a,0,r.time);function a(s){r.state=or,r.timer.restart(i,r.delay,r.time),r.delay<=s&&i(s-r.delay)}function i(s){var u,d,v,g;if(r.state!==or)return l();for(u in n)if(g=n[u],g.name===r.name){if(g.state===ce)return nr(i);g.state===ir?(g.state=le,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete n[u]):+u<e&&(g.state=le,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete n[u])}if(nr(function(){r.state===ce&&(r.state=ir,r.timer.restart(c,r.delay,r.time),c(s))}),r.state=Pe,r.on.call("start",t,t.__data__,r.index,r.group),r.state===Pe){for(r.state=ce,o=new Array(v=r.tween.length),u=0,d=-1;u<v;++u)(g=r.tween[u].value.call(t,t.__data__,r.index,r.group))&&(o[++d]=g);o.length=d+1}}function c(s){for(var u=s<r.duration?r.ease.call(null,s/r.duration):(r.timer.restart(l),r.state=Ne,1),d=-1,v=o.length;++d<v;)o[d].call(t,u);r.state===Ne&&(r.on.call("end",t,t.__data__,r.index,r.group),l())}function l(){r.state=le,r.timer.stop(),delete n[e];for(var s in n)return;delete t.__transition}}function ue(t,e){var r=t.__transition,n,o,a=!0,i;if(r){e=e==null?null:e+"";for(i in r){if((n=r[i]).name!==e){a=!1;continue}o=n.state>Pe&&n.state<Ne,n.state=le,n.timer.stop(),n.on.call(o?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[i]}a&&delete t.__transition}}function fi(t){return this.each(function(){ue(this,t)})}function hi(t,e){var r,n;return function(){var o=wt(this,t),a=o.tween;if(a!==r){n=r=a;for(var i=0,c=n.length;i<c;++i)if(n[i].name===e){n=n.slice(),n.splice(i,1);break}}o.tween=n}}function di(t,e,r){var n,o;if(typeof r!="function")throw new Error;return function(){var a=wt(this,t),i=a.tween;if(i!==n){o=(n=i).slice();for(var c={name:e,value:r},l=0,s=o.length;l<s;++l)if(o[l].name===e){o[l]=c;break}l===s&&o.push(c)}a.tween=o}}function pi(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n=vt(this.node(),r).tween,o=0,a=n.length,i;o<a;++o)if((i=n[o]).name===t)return i.value;return null}return this.each((e==null?hi:di)(r,t,e))}function je(t,e,r){var n=t._id;return t.each(function(){var o=wt(this,n);(o.value||(o.value={}))[e]=r.apply(this,arguments)}),function(o){return vt(o,n).value[e]}}function Br(t,e){var r;return(typeof e=="number"?Mt:e instanceof Kt?Ae:(r=Kt(e))?(e=r,Ae):Ko)(t,e)}function vi(t){return function(){this.removeAttribute(t)}}function yi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function mi(t,e,r){var n,o=r+"",a;return function(){var i=this.getAttribute(t);return i===o?null:i===n?a:a=e(n=i,r)}}function gi(t,e,r){var n,o=r+"",a;return function(){var i=this.getAttributeNS(t.space,t.local);return i===o?null:i===n?a:a=e(n=i,r)}}function wi(t,e,r){var n,o,a;return function(){var i,c=r(this),l;return c==null?void this.removeAttribute(t):(i=this.getAttribute(t),l=c+"",i===l?null:i===n&&l===o?a:(o=l,a=e(n=i,c)))}}function xi(t,e,r){var n,o,a;return function(){var i,c=r(this),l;return c==null?void this.removeAttributeNS(t.space,t.local):(i=this.getAttributeNS(t.space,t.local),l=c+"",i===l?null:i===n&&l===o?a:(o=l,a=e(n=i,c)))}}function Ei(t,e){var r=me(t),n=r==="transform"?Ao:Br;return this.attrTween(t,typeof e=="function"?(r.local?xi:wi)(r,n,je(this,"attr."+t,e)):e==null?(r.local?yi:vi)(r):(r.local?gi:mi)(r,n,e))}function bi(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function Mi(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function Fi(t,e){var r,n;function o(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&Mi(t,a)),r}return o._value=e,o}function Ci(t,e){var r,n;function o(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&bi(t,a)),r}return o._value=e,o}function _i(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var n=me(t);return this.tween(r,(n.local?Fi:Ci)(n,e))}function Ri(t,e){return function(){ze(this,t).delay=+e.apply(this,arguments)}}function Li(t,e){return e=+e,function(){ze(this,t).delay=e}}function Yi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ri:Li)(e,t)):vt(this.node(),e).delay}function Di(t,e){return function(){wt(this,t).duration=+e.apply(this,arguments)}}function Bi(t,e){return e=+e,function(){wt(this,t).duration=e}}function Pi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Di:Bi)(e,t)):vt(this.node(),e).duration}function Ni(t,e){if(typeof e!="function")throw new Error;return function(){wt(this,t).ease=e}}function $i(t){var e=this._id;return arguments.length?this.each(Ni(e,t)):vt(this.node(),e).ease}function Xi(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;wt(this,t).ease=r}}function Ui(t){if(typeof t!="function")throw new Error;return this.each(Xi(this._id,t))}function Si(t){typeof t!="function"&&(t=fr(t));for(var e=this._groups,r=e.length,n=new Array(r),o=0;o<r;++o)for(var a=e[o],i=a.length,c=n[o]=[],l,s=0;s<i;++s)(l=a[s])&&t.call(l,l.__data__,s,a)&&c.push(l);return new bt(n,this._parents,this._name,this._id)}function Ii(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,o=r.length,a=Math.min(n,o),i=new Array(n),c=0;c<a;++c)for(var l=e[c],s=r[c],u=l.length,d=i[c]=new Array(u),v,g=0;g<u;++g)(v=l[g]||s[g])&&(d[g]=v);for(;c<n;++c)i[c]=e[c];return new bt(i,this._parents,this._name,this._id)}function ki(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function zi(t,e,r){var n,o,a=ki(e)?ze:wt;return function(){var i=a(this,t),c=i.on;c!==n&&(o=(n=c).copy()).on(e,r),i.on=o}}function ji(t,e){var r=this._id;return arguments.length<2?vt(this.node(),r).on.on(t):this.each(zi(r,t,e))}function Gi(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function Oi(){return this.on("end.remove",Gi(this._id))}function Ti(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Ue(t));for(var n=this._groups,o=n.length,a=new Array(o),i=0;i<o;++i)for(var c=n[i],l=c.length,s=a[i]=new Array(l),u,d,v=0;v<l;++v)(u=c[v])&&(d=t.call(u,u.__data__,v,c))&&("__data__"in u&&(d.__data__=u.__data__),s[v]=d,we(s[v],e,r,v,s,vt(u,r)));return new bt(a,this._parents,e,r)}function Vi(t){var e=this._name,r=this._id;typeof t!="function"&&(t=ur(t));for(var n=this._groups,o=n.length,a=[],i=[],c=0;c<o;++c)for(var l=n[c],s=l.length,u,d=0;d<s;++d)if(u=l[d]){for(var v=t.call(u,u.__data__,d,l),g,F=vt(u,r),L=0,$=v.length;L<$;++L)(g=v[L])&&we(g,e,r,L,v,F);a.push(v),i.push(u)}return new bt(a,i,e,r)}var Hi=Zt.prototype.constructor;function Wi(){return new Hi(this._groups,this._parents)}function qi(t,e){var r,n,o;return function(){var a=St(this,t),i=(this.style.removeProperty(t),St(this,t));return a===i?null:a===r&&i===n?o:o=e(r=a,n=i)}}function Pr(t){return function(){this.style.removeProperty(t)}}function Ki(t,e,r){var n,o=r+"",a;return function(){var i=St(this,t);return i===o?null:i===n?a:a=e(n=i,r)}}function Qi(t,e,r){var n,o,a;return function(){var i=St(this,t),c=r(this),l=c+"";return c==null&&(l=c=(this.style.removeProperty(t),St(this,t))),i===l?null:i===n&&l===o?a:(o=l,a=e(n=i,c))}}function Zi(t,e){var r,n,o,a="style."+e,i="end."+a,c;return function(){var l=wt(this,t),s=l.on,u=l.value[a]==null?c||(c=Pr(e)):void 0;(s!==r||o!==u)&&(n=(r=s).copy()).on(i,o=u),l.on=n}}function Ji(t,e,r){var n=(t+="")=="transform"?Jo:Br;return e==null?this.styleTween(t,qi(t,n)).on("end.style."+t,Pr(t)):typeof e=="function"?this.styleTween(t,Qi(t,n,je(this,"style."+t,e))).each(Zi(this._id,t)):this.styleTween(t,Ki(t,n,e),r).on("end.style."+t,null)}function Ai(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}function ta(t,e,r){var n,o;function a(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&Ai(t,i,r)),n}return a._value=e,a}function ea(t,e,r){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,ta(t,e,r??""))}function ra(t){return function(){this.textContent=t}}function na(t){return function(){var e=t(this);this.textContent=e??""}}function oa(t){return this.tween("text",typeof t=="function"?na(je(this,"text",t)):ra(t==null?"":t+""))}function ia(t){return function(e){this.textContent=t.call(this,e)}}function aa(t){var e,r;function n(){var o=t.apply(this,arguments);return o!==r&&(e=(r=o)&&ia(o)),e}return n._value=t,n}function sa(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,aa(t))}function ca(){for(var t=this._name,e=this._id,r=Nr(),n=this._groups,o=n.length,a=0;a<o;++a)for(var i=n[a],c=i.length,l,s=0;s<c;++s)if(l=i[s]){var u=vt(l,e);we(l,t,r,s,i,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new bt(n,this._parents,t,r)}function la(){var t,e,r=this,n=r._id,o=r.size();return new Promise(function(a,i){var c={value:i},l={value:function(){--o===0&&a()}};r.each(function(){var s=wt(this,n),u=s.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(c),e._.interrupt.push(c),e._.end.push(l)),s.on=e}),o===0&&a()})}var ua=0;function bt(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function Nr(){return++ua}var xt=Zt.prototype;bt.prototype={constructor:bt,select:Ti,selectAll:Vi,selectChild:xt.selectChild,selectChildren:xt.selectChildren,filter:Si,merge:Ii,selection:Wi,transition:ca,call:xt.call,nodes:xt.nodes,node:xt.node,size:xt.size,empty:xt.empty,each:xt.each,on:ji,attr:Ei,attrTween:_i,style:Ji,styleTween:ea,text:oa,textTween:sa,remove:Oi,tween:pi,delay:Yi,duration:Pi,ease:$i,easeVarying:Ui,end:la,[Symbol.iterator]:xt[Symbol.iterator]};function fa(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var ha={time:null,delay:0,duration:250,ease:fa};function da(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function pa(t){var e,r;t instanceof bt?(e=t._id,t=t._name):(e=Nr(),(r=ha).time=ke(),t=t==null?null:t+"");for(var n=this._groups,o=n.length,a=0;a<o;++a)for(var i=n[a],c=i.length,l,s=0;s<c;++s)(l=i[s])&&we(l,t,e,s,i,r||da(l,e));return new bt(n,this._parents,t,e)}Zt.prototype.interrupt=fi;Zt.prototype.transition=pa;const ie=t=>()=>t;function va(t,{sourceEvent:e,target:r,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function Et(t,e,r){this.k=t,this.x=e,this.y=r}Et.prototype={constructor:Et,scale:function(t){return t===1?this:new Et(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Et(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 Ft=new Et(1,0,0);Ht.prototype=Et.prototype;function Ht(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Ft;return t.__zoom}function Me(t){t.stopImmediatePropagation()}function Ot(t){t.preventDefault(),t.stopImmediatePropagation()}function ya(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function ma(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.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 ar(){return this.__zoom||Ft}function ga(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function wa(){return navigator.maxTouchPoints||"ontouchstart"in this}function xa(t,e,r){var n=t.invertX(e[0][0])-r[0][0],o=t.invertX(e[1][0])-r[1][0],a=t.invertY(e[0][1])-r[0][1],i=t.invertY(e[1][1])-r[1][1];return t.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),i>a?(a+i)/2:Math.min(0,a)||Math.max(0,i))}function Ge(){var t=ya,e=ma,r=xa,n=ga,o=wa,a=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],c=250,l=ni,s=Xe("start","zoom","end"),u,d,v,g=500,F=150,L=0,$=10;function C(h){h.property("__zoom",ar).on("wheel.zoom",B,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",j).filter(o).on("touchstart.zoom",P).on("touchmove.zoom",K).on("touchend.zoom touchcancel.zoom",tt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(h,_,m,R){var X=h.selection?h.selection():h;X.property("__zoom",ar),h!==X?V(h,_,m,R):X.interrupt().each(function(){z(this,arguments).event(R).start().zoom(null,typeof _=="function"?_.apply(this,arguments):_).end()})},C.scaleBy=function(h,_,m,R){C.scaleTo(h,function(){var X=this.__zoom.k,S=typeof _=="function"?_.apply(this,arguments):_;return X*S},m,R)},C.scaleTo=function(h,_,m,R){C.transform(h,function(){var X=e.apply(this,arguments),S=this.__zoom,D=m==null?Z(X):typeof m=="function"?m.apply(this,arguments):m,f=S.invert(D),p=typeof _=="function"?_.apply(this,arguments):_;return r(O(Q(S,p),D,f),X,i)},m,R)},C.translateBy=function(h,_,m,R){C.transform(h,function(){return r(this.__zoom.translate(typeof _=="function"?_.apply(this,arguments):_,typeof m=="function"?m.apply(this,arguments):m),e.apply(this,arguments),i)},null,R)},C.translateTo=function(h,_,m,R,X){C.transform(h,function(){var S=e.apply(this,arguments),D=this.__zoom,f=R==null?Z(S):typeof R=="function"?R.apply(this,arguments):R;return r(Ft.translate(f[0],f[1]).scale(D.k).translate(typeof _=="function"?-_.apply(this,arguments):-_,typeof m=="function"?-m.apply(this,arguments):-m),S,i)},R,X)};function Q(h,_){return _=Math.max(a[0],Math.min(a[1],_)),_===h.k?h:new Et(_,h.x,h.y)}function O(h,_,m){var R=_[0]-m[0]*h.k,X=_[1]-m[1]*h.k;return R===h.x&&X===h.y?h:new Et(h.k,R,X)}function Z(h){return[(+h[0][0]+ +h[1][0])/2,(+h[0][1]+ +h[1][1])/2]}function V(h,_,m,R){h.on("start.zoom",function(){z(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(R).end()}).tween("zoom",function(){var X=this,S=arguments,D=z(X,S).event(R),f=e.apply(X,S),p=m==null?Z(f):typeof m=="function"?m.apply(X,S):m,Y=Math.max(f[1][0]-f[0][0],f[1][1]-f[0][1]),w=X.__zoom,x=typeof _=="function"?_.apply(X,S):_,b=l(w.invert(p).concat(Y/w.k),x.invert(p).concat(Y/x.k));return function(y){if(y===1)y=x;else{var E=b(y),M=Y/E[2];y=new Et(M,p[0]-E[0]*M,p[1]-E[1]*M)}D.zoom(null,y)}})}function z(h,_,m){return!m&&h.__zooming||new et(h,_)}function et(h,_){this.that=h,this.args=_,this.active=0,this.sourceEvent=null,this.extent=e.apply(h,_),this.taps=0}et.prototype={event:function(h){return h&&(this.sourceEvent=h),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(h,_){return this.mouse&&h!=="mouse"&&(this.mouse[1]=_.invert(this.mouse[0])),this.touch0&&h!=="touch"&&(this.touch0[1]=_.invert(this.touch0[0])),this.touch1&&h!=="touch"&&(this.touch1[1]=_.invert(this.touch1[0])),this.that.__zoom=_,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(h){var _=at(this.that).datum();s.call(h,this.that,new va(h,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:s}),_)}};function B(h,..._){if(!t.apply(this,arguments))return;var m=z(this,_).event(h),R=this.__zoom,X=Math.max(a[0],Math.min(a[1],R.k*Math.pow(2,n.apply(this,arguments)))),S=Yt(h);if(m.wheel)(m.mouse[0][0]!==S[0]||m.mouse[0][1]!==S[1])&&(m.mouse[1]=R.invert(m.mouse[0]=S)),clearTimeout(m.wheel);else{if(R.k===X)return;m.mouse=[S,R.invert(S)],ue(this),m.start()}Ot(h),m.wheel=setTimeout(D,F),m.zoom("mouse",r(O(Q(R,X),m.mouse[0],m.mouse[1]),m.extent,i));function D(){m.wheel=null,m.end()}}function U(h,..._){if(v||!t.apply(this,arguments))return;var m=h.currentTarget,R=z(this,_,!0).event(h),X=at(h.view).on("mousemove.zoom",p,!0).on("mouseup.zoom",Y,!0),S=Yt(h,m),D=h.clientX,f=h.clientY;Do(h.view),Me(h),R.mouse=[S,this.__zoom.invert(S)],ue(this),R.start();function p(w){if(Ot(w),!R.moved){var x=w.clientX-D,b=w.clientY-f;R.moved=x*x+b*b>L}R.event(w).zoom("mouse",r(O(R.that.__zoom,R.mouse[0]=Yt(w,m),R.mouse[1]),R.extent,i))}function Y(w){X.on("mousemove.zoom mouseup.zoom",null),Bo(w.view,R.moved),Ot(w),R.event(w).end()}}function j(h,..._){if(t.apply(this,arguments)){var m=this.__zoom,R=Yt(h.changedTouches?h.changedTouches[0]:h,this),X=m.invert(R),S=m.k*(h.shiftKey?.5:2),D=r(O(Q(m,S),R,X),e.apply(this,_),i);Ot(h),c>0?at(this).transition().duration(c).call(V,D,R,h):at(this).call(C.transform,D,R,h)}}function P(h,..._){if(t.apply(this,arguments)){var m=h.touches,R=m.length,X=z(this,_,h.changedTouches.length===R).event(h),S,D,f,p;for(Me(h),D=0;D<R;++D)f=m[D],p=Yt(f,this),p=[p,this.__zoom.invert(p),f.identifier],X.touch0?!X.touch1&&X.touch0[2]!==p[2]&&(X.touch1=p,X.taps=0):(X.touch0=p,S=!0,X.taps=1+!!u);u&&(u=clearTimeout(u)),S&&(X.taps<2&&(d=p[0],u=setTimeout(function(){u=null},g)),ue(this),X.start())}}function K(h,..._){if(this.__zooming){var m=z(this,_).event(h),R=h.changedTouches,X=R.length,S,D,f,p;for(Ot(h),S=0;S<X;++S)D=R[S],f=Yt(D,this),m.touch0&&m.touch0[2]===D.identifier?m.touch0[0]=f:m.touch1&&m.touch1[2]===D.identifier&&(m.touch1[0]=f);if(D=m.that.__zoom,m.touch1){var Y=m.touch0[0],w=m.touch0[1],x=m.touch1[0],b=m.touch1[1],y=(y=x[0]-Y[0])*y+(y=x[1]-Y[1])*y,E=(E=b[0]-w[0])*E+(E=b[1]-w[1])*E;D=Q(D,Math.sqrt(y/E)),f=[(Y[0]+x[0])/2,(Y[1]+x[1])/2],p=[(w[0]+b[0])/2,(w[1]+b[1])/2]}else if(m.touch0)f=m.touch0[0],p=m.touch0[1];else return;m.zoom("touch",r(O(D,f,p),m.extent,i))}}function tt(h,..._){if(this.__zooming){var m=z(this,_).event(h),R=h.changedTouches,X=R.length,S,D;for(Me(h),v&&clearTimeout(v),v=setTimeout(function(){v=null},g),S=0;S<X;++S)D=R[S],m.touch0&&m.touch0[2]===D.identifier?delete m.touch0:m.touch1&&m.touch1[2]===D.identifier&&delete m.touch1;if(m.touch1&&!m.touch0&&(m.touch0=m.touch1,delete m.touch1),m.touch0)m.touch0[1]=this.__zoom.invert(m.touch0[0]);else if(m.end(),m.taps===2&&(D=Yt(D,this),Math.hypot(d[0]-D[0],d[1]-D[1])<$)){var f=at(this).on("dblclick.zoom");f&&f.apply(this,arguments)}}}return C.wheelDelta=function(h){return arguments.length?(n=typeof h=="function"?h:ie(+h),C):n},C.filter=function(h){return arguments.length?(t=typeof h=="function"?h:ie(!!h),C):t},C.touchable=function(h){return arguments.length?(o=typeof h=="function"?h:ie(!!h),C):o},C.extent=function(h){return arguments.length?(e=typeof h=="function"?h:ie([[+h[0][0],+h[0][1]],[+h[1][0],+h[1][1]]]),C):e},C.scaleExtent=function(h){return arguments.length?(a[0]=+h[0],a[1]=+h[1],C):[a[0],a[1]]},C.translateExtent=function(h){return arguments.length?(i[0][0]=+h[0][0],i[1][0]=+h[1][0],i[0][1]=+h[0][1],i[1][1]=+h[1][1],C):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},C.constrain=function(h){return arguments.length?(r=h,C):r},C.duration=function(h){return arguments.length?(c=+h,C):c},C.interpolate=function(h){return arguments.length?(l=h,C):l},C.on=function(){var h=s.on.apply(s,arguments);return h===s?C:h},C.clickDistance=function(h){return arguments.length?(L=(h=+h)*h,C):Math.sqrt(L)},C.tapDistance=function(h){return arguments.length?($=+h,C):$},C}const At={horizontalExtension:30,minEdgeDistance:50,minVerticalSegment:20,loopRadius:40,edgeSpacing:80,cornerRadius:15,arrowWidth:10,arrowHeight:6,labelHeight:15,labelFontSize:10,labelPadding:6,labelCornerRadius:4,nodeSpacing:50,nearlyHorizontalThreshold:5,nearlyAlignedThreshold:30};function $r(t){return{...At,...t}}function Ea(t,e,r){const i=(t.clientWidth||800)/e,c=32/(r*i);return Math.max(3,c)}function Fe(t,e,r){const n=t.node();if(!n)return;t.text(r);let o=n.getComputedTextLength();if(o<=e)return;const a="...";let i=0,c=r.length;for(;i<c;){const l=Math.floor((i+c+1)/2);t.text(r.slice(0,l)+a),o=n.getComputedTextLength(),o<=e?i=l:c=l-1}i>0?t.text(r.slice(0,i)+a):t.text(a)}class Xr{constructor(e,r,n,o,a){this.type=e,this._gvid=r,this.name=n,this._draw_=o,this._ldraw_=a}}class Ur extends Xr{constructor({_gvid:e,name:r,_draw_:n,_ldraw_:o,bb:a,pos:i,width:c,height:l,label:s}){super("node",e,r,n,o),this.virtualNode=!1,this.bb=a,this.pos=i,this.width=c,this.height=l,this.label=s}getPosition(){if(!this.pos)return null;const[e,r]=this.pos.split(",").map(Number);return[e,r]}getWidthPoints(){return parseFloat(this.width||"1")*72}getHeightPoints(){return parseFloat(this.height||"0.5")*72}getBounds(){const e=this.getPosition();if(!e)return null;const[r,n]=e,o=this.getWidthPoints(),a=this.getHeightPoints();return{x:r-o/2,y:n-a/2,width:o,height:a}}leftIn(){const e=this.getBounds();return e?{x:e.x,y:Math.trunc(e.y+e.height/4)}:null}leftOut(){const e=this.getBounds();return e?{x:e.x,y:Math.trunc(e.y+e.height/4*3)}:null}rightOut(){const e=this.getBounds();return e?{x:e.x+e.width,y:Math.trunc(e.y+e.height/4)}:null}rightIn(){const e=this.getBounds();return e?{x:e.x+e.width,y:Math.trunc(e.y+e.height/4*3)}:null}}class ba extends Xr{constructor({_gvid:e,name:r,_draw_:n,_ldraw_:o,_hdraw_:a,_tdraw_:i,head:c,tail:l,label:s}){if(super("edge",e,r,n,o),this.isBaseEdge=!1,this.depth=0,this.baseOffset=0,this.midY=0,this._hdraw_=a,this._tdraw_=i,this.head=c,this.tail=l,this.label=s,s){const u=s.match(/\[(\d+)\]/);u&&u[1]&&(this.edgeId=parseInt(u[1],10))}}setNodes(e,r){this.sourceNode=e,this.targetNode=r}getDirection(){if(!this.sourceNode||!this.targetNode)return null;const e=this.sourceNode.getPosition(),r=this.targetNode.getPosition();return!e||!r?null:this.sourceNode._gvid===this.targetNode._gvid?"self":e[0]<r[0]?"right":"left"}getStartPoint(){if(!this.sourceNode)return null;const e=this.getDirection();if(!e)return null;switch(e){case"right":return this.sourceNode.rightOut();case"left":return this.sourceNode.leftOut();case"self":return this.sourceNode.leftOut()}}getEndPoint(){if(!this.targetNode)return null;const e=this.getDirection();if(!e)return null;switch(e){case"right":return this.targetNode.leftIn();case"left":return this.targetNode.rightIn();case"self":return this.targetNode.rightIn()}}getLabelText(){if(this.label)return this.label.replace(/<[^>]*>/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&nbsp;/g," ").replace(/\s+/g," ").trim()||null;if(this._ldraw_){const e=[];if(this._ldraw_.forEach(r=>{r.op==="T"&&r.text&&e.push(r.text)}),e.length>0)return e.join(" ")}return null}getColor(){const e="#9AA4B2";if(this._draw_){for(const r of this._draw_)if(r.op==="c"&&r.color)return r.color}if(this._hdraw_){for(const r of this._hdraw_)if(r.op==="c"&&r.color)return r.color}return e}}class Sr{constructor(e,r=0){this.index=e,this.aboveY=r,this.belowY=r}allocateAbove(e){return this.aboveY-=e,this.aboveY}allocateBelow(e){const r=this.belowY;return this.belowY+=e,r}getRange(){return{above:this.aboveY,below:this.belowY}}}class Ma extends Sr{constructor(e,r=0){super(e,r),this.nodes=[]}addNode(e,r=!0){if(this.nodes.push(e),!r)return;const n=e.getPosition();if(n){const o=e.height?parseFloat(e.height)*72:40,a=n[1]-o/2,i=n[1]+o/2;this.aboveY=Math.min(this.aboveY,a),this.belowY=Math.max(this.belowY,i)}}}class Fa extends Sr{constructor(e,r,n=0){super(Math.min(e,r),n),this.edges=[],this.baseEdgeIndex=-1,this.sourceColIndex=e,this.targetColIndex=r}addEdge(e){this.edges.push(e)}setBaseEdge(e,r){this.baseEdge=e,this.baseEdgeIndex=r??this.edges.indexOf(e)}getKey(){const e=Math.min(this.sourceColIndex,this.targetColIndex),r=Math.max(this.sourceColIndex,this.targetColIndex);return`${e}-${r}`}}function Ir(t){if(!t)return[];const e=[],r=/<TD[^>]*>(.*?)<\/TD>/gi;let n;for(;(n=r.exec(t))!==null;){let o=n[1];o=o.replace(/<[^>]+>/g,"").trim(),o&&e.push(o)}if(e.length===0){const o=t.replace(/<[^>]+>/g,"").trim();o&&e.push(o)}return e}function Ca(t){const e=at(t).select("svg"),r=e.select("g#graph0");if(e.empty()||r.empty()){console.warn("SVG or graph group not found");return}e.attr("width","100%").attr("height","100%");const n=Ge().scaleExtent([.1,2]).on("zoom",i=>{r.attr("transform",i.transform.toString())});e.call(n);const o=e.node(),a=r.node();if(o&&a){const i=a.getBBox(),c=o.parentElement;if(c){const l=c.clientWidth,s=c.clientHeight,u=i.width,d=i.height,v=i.x+u/2,g=i.y+d/2,F=.8/Math.max(u/l,d/s),L=[l/2-F*v,s/2-F*g];e.call(n.transform,Ft.translate(L[0],L[1]).scale(F))}}}function _a(t){if(!t.sourceNode)return null;const e=t.sourceNode.getPosition();if(!e)return null;const n=50/72,o=new Ur({_gvid:-1e3-t._gvid,name:`virtual_edge_${t._gvid}`,label:t.label,pos:`${e[0]},${e[1]}`,width:"0.5",height:n.toString()});return o.virtualNode=!0,o.edge=t,t.virtualNode=o,o}function Ra(t,e,r){const n=e.nodes,o=n.findIndex(a=>a._gvid===r._gvid);if(o===-1){n.push(t);return}n.splice(o,0,t)}function La(t,e){const n=[],o=new Map;t.forEach(s=>{const u=s.getPosition();if(!u)return;const d=u[0];let v=n.findIndex(g=>Math.abs(d-g)<=20);v===-1&&(v=n.length,n.push(d)),o.set(s._gvid,v)});const a=n.map((s,u)=>({x:s,i:u})).sort((s,u)=>s.x-u.x).map((s,u)=>({oldIndex:s.i,newIndex:u})),i=new Map;a.forEach(({oldIndex:s,newIndex:u})=>{i.set(s,u)});for(const[s,u]of o)o.set(s,i.get(u)??u);const c=new Map;t.forEach(s=>{const u=o.get(s._gvid);u!==void 0&&(c.has(u)||c.set(u,new Ma(u,0)),c.get(u).addNode(s,!1))}),e.forEach(s=>{if(!s.sourceNode||!s.targetNode||s.sourceNode._gvid!==s.targetNode._gvid)return;const u=o.get(s.sourceNode._gvid);if(u===void 0)return;const d=c.get(u);if(!d)return;const v=_a(s);v&&Ra(v,d,s.sourceNode)});const l=new Map;return e.forEach(s=>{if(!s.sourceNode||!s.targetNode)return;const u=o.get(s.sourceNode._gvid),d=o.get(s.targetNode._gvid);if(u===void 0||d===void 0)return;s.depth=Math.abs(d-u)-1,s.depth<0&&(s.depth=0);const v=Math.min(u,d),g=Math.max(u,d),F=`${v}-${g}`;l.has(F)||l.set(F,new Fa(u,d,0)),l.get(F).addEdge(s)}),l.forEach(s=>{s.edges.sort((u,d)=>{const v=u.getStartPoint(),g=u.getEndPoint(),F=v&&g?(v.y+g.y)/2:0,L=d.getStartPoint(),$=d.getEndPoint();return(L&&$?(L.y+$.y)/2:0)-F})}),{nodeColumnMap:o,nodeColumns:c,edgeColumns:l}}function Ya(t,e){t.forEach(r=>{if(r.nodes.length===0)return;let n=!0;r.nodes.forEach(o=>{const a=o.getPosition();if(!a)return;const i=o.height?parseFloat(o.height)*72:40,c=e-a[1],l=c-i/2,s=c+i/2;n?(r.aboveY=l,r.belowY=s,n=!1):(r.aboveY=Math.min(r.aboveY,l),r.belowY=Math.max(r.belowY,s))})})}function Da(t,e){t.length!==0&&e.forEach(r=>{const n=r.edges;if(n.length===0)return;const o=n.filter(d=>d.depth===0);if(o.length===0)return;const a=Math.floor(o.length/2),i=o[a];i.isBaseEdge=!0,i.baseDirection=void 0;const c=n.indexOf(i);r.setBaseEdge(i,c);const l=i.getStartPoint(),s=i.getEndPoint(),u=l&&s?(l.y+s.y)/2:0;o.forEach((d,v)=>{if(d===i)return;const g=d.getStartPoint(),F=d.getEndPoint();(g&&F?(g.y+F.y)/2:0)>u?d.baseDirection="above":d.baseDirection="below"})})}function ae(t,e,r,n=At){const o=t.getStartPoint(),a=t.getEndPoint(),i=t.getDirection();if(!o||!a||!i||i==="self")return;const c={x:o.x,y:e-o.y},l={x:a.x,y:e-a.y};let s={x:l.x,y:l.y};i==="right"?s={x:l.x-n.arrowWidth,y:l.y}:i==="left"&&(s={x:l.x+n.arrowWidth,y:l.y});const u=n.horizontalExtension,d=n.minEdgeDistance,v=n.minVerticalSegment,g=V=>{if(V.length<2)return V;const z=[V[0]];for(let et=1;et<V.length;et++){const B=z[z.length-1];(Math.abs(V[et].x-B.x)>.1||Math.abs(V[et].y-B.y)>.1)&&z.push(V[et])}return z};let F;const L=t.baseDirection===void 0;t.baseDirection==="above"?F=Math.min(c.y,s.y):t.baseDirection==="below"?F=Math.max(c.y,s.y):F=(c.y+s.y)/2;let $=F;if(!L&&r&&r.midY!==void 0){if(t.baseDirection==="above"){const V=r.midY-d;$>V&&($=V)}else if(t.baseDirection==="below"){const V=r.midY+d;$<V&&($=V)}}const C=Math.abs(c.y-s.y)<5,Q=(V,z)=>{const et=Math.abs(c.y-z),B=Math.abs(z-s.y),U=i==="right"?c.x+u:c.x-u,j=i==="right"?s.x-u:s.x+u;let P=[],K=z;switch(V){case"straight":if(C){const _=(c.y+s.y)/2;Math.abs(z-_)<v?(P=[c,s],K=_):(P=[c,{x:U,y:c.y},{x:U,y:z},{x:j,y:z},{x:j,y:s.y},s],K=z)}else return null;break;case"2seg":et<B?Math.abs(z-c.y)<v?(P=[c,{x:s.x,y:c.y},s],K=c.y):(P=[c,{x:U,y:c.y},{x:U,y:z},{x:j,y:z},{x:j,y:s.y},s],K=z):Math.abs(z-s.y)<v?(P=[c,{x:U,y:c.y},{x:U,y:s.y},s],K=s.y):(P=[c,{x:U,y:c.y},{x:U,y:z},{x:j,y:z},{x:j,y:s.y},s],K=z);break;case"3seg":const h=z;P=[c,{x:U,y:c.y},{x:U,y:h},{x:j,y:h},{x:j,y:s.y},s],K=h;break;case"4seg":P=[c,{x:U,y:c.y},{x:U,y:z},{x:j,y:z},s],K=z;break;case"5seg":if(et<v)P=[c,{x:U,y:c.y},{x:j,y:z},{x:j,y:s.y},s],K=z;else if(B<v)P=[c,{x:U,y:c.y},{x:U,y:z},{x:j,y:z},s],K=z;else return null;break;case"6seg":P=[c,{x:U,y:c.y},{x:U,y:z},{x:j,y:z},{x:j,y:s.y},s],K=z;break}const tt=g(P);return tt.length>0?{points:tt,actualMidY:K}:null};let O;L?O=C?["straight","3seg"]:["3seg"]:O=C?["straight","3seg","4seg","5seg","6seg"]:["3seg","4seg","5seg","6seg"];for(const V of O){const z=Q(V,$);if(z)return{midY:z.actualMidY,points:z.points}}const Z=Q("6seg",$);return Z?{midY:Z.actualMidY,points:Z.points}:void 0}function sr(t,e){if(t.length<2)return"";if(e===0||t.length===2)return`M${t[0].x},${t[0].y} ${t.slice(1).map(o=>`L${o.x},${o.y}`).join(" ")}`;const r=[];r.push(`M${t[0].x},${t[0].y}`);for(let o=1;o<t.length-1;o++){const a=t[o-1],i=t[o],c=t[o+1],l=Math.sqrt((i.x-a.x)**2+(i.y-a.y)**2),s=Math.sqrt((c.x-i.x)**2+(c.y-i.y)**2),u=Math.min(l,s)/2,d=Math.min(e,u);if(d>0){const v=d/l,g=d/s,F={x:i.x-(i.x-a.x)*v,y:i.y-(i.y-a.y)*v},L={x:i.x+(c.x-i.x)*g,y:i.y+(c.y-i.y)*g};r.push(`L${F.x},${F.y}`),r.push(`Q${i.x},${i.y} ${L.x},${L.y}`)}else r.push(`L${i.x},${i.y}`)}const n=t[t.length-1];return r.push(`L${n.x},${n.y}`),r.join(" ")}function Ba(t,e,r,n=At,o=!0,a=0,i=1/0,c,l,s,u,d,v,g,F=!1){var z,et;const L=v!=null&&t.edgeId===v,$=t.getColor(),C=e.append("g").attr("class",L?"edge selected":"edge").attr("id",`edge_${t._gvid}`).attr("data-edge-id",t.edgeId!==void 0?String(t.edgeId):"").attr("data-is-base",t.isBaseEdge?"true":"false").attr("data-color",$),Q=t.getStartPoint(),O=t.getEndPoint(),Z=t.getDirection();console.log(`Edge ${t._gvid}: direction=${Z}, isBase=${t.isBaseEdge}, depth=${t.depth}`,{start:Q,end:O,sourceNode:(z=t.sourceNode)==null?void 0:z.name,targetNode:(et=t.targetNode)==null?void 0:et.name});const V=n.arrowWidth;if(n.arrowHeight,Q&&O&&Z){const B={x:Q.x,y:r-Q.y},U={x:O.x,y:r-O.y},j={x:U.x,y:U.y};let P={x:U.x,y:U.y};Z==="right"?P={x:U.x-V,y:U.y}:Z==="left"?P={x:U.x+V,y:U.y}:Z==="self"&&(P={x:U.x+V,y:U.y});let K;const tt=n.loopRadius,h=n.horizontalExtension,_=n.cornerRadius;if(o)if(Z==="self")if(t.virtualNode){const f=t.virtualNode.getPosition();if(f){const p=r-f[1];t.midY=p;const Y=[B,{x:B.x-h,y:B.y},{x:B.x-h,y:p},{x:P.x+h,y:p},{x:P.x+h,y:P.y},P];K=sr(Y,_)}else{const p=B.x-tt,Y=B.y-tt,w=P.x+tt,x=P.y-tt;K=`M${B.x},${B.y} C${p},${Y} ${w},${x} ${P.x},${P.y}`}}else{const f=B.x-tt,p=B.y-tt,Y=P.x+tt,w=P.y-tt;K=`M${B.x},${B.y} C${f},${p} ${Y},${w} ${P.x},${P.y}`}else{let f;if(t.orthogonalPathPoints&&t.orthogonalPathPoints.length>0)f=t.orthogonalPathPoints;else{const p=Math.abs(B.y-t.midY),Y=Math.abs(t.midY-P.y),w=20,x=p>=w,b=Y>=w,y=Z==="right"?B.x+h:B.x-h,E=Z==="right"?P.x-h:P.x+h;if(f=[],!x&&!b){const M=(B.y+P.y)/2;f.push(B,{x:y,y:M},{x:E,y:M},P)}else x?b?f.push(B,{x:y,y:B.y},{x:y,y:t.midY},{x:E,y:t.midY},{x:E,y:P.y},P):f.push(B,{x:y,y:B.y},{x:y,y:t.midY},{x:E,y:t.midY},P):f.push(B,{x:y,y:t.midY},{x:E,y:t.midY},{x:E,y:P.y},P)}K=sr(f,_)}else if(Z==="self"){const f=B.x-tt,p=B.y-tt,Y=P.x+tt,w=P.y-tt;K=`M${B.x},${B.y} C${f},${p} ${Y},${w} ${P.x},${P.y}`}else{const f=P.x-B.x;P.y-B.y;const p=.4,Y=B.x+f*p,w=B.y,x=P.x-f*p,b=P.y;K=`M${B.x},${B.y} C${Y},${w} ${x},${b} ${P.x},${P.y}`}const m=F&&t.isBaseEdge?"#000000":t.getColor(),R=F&&t.isBaseEdge?4:1.5;C.append("path").attr("d",K).attr("fill","none").attr("stroke","transparent").attr("stroke-width",10).attr("class","edge-hit-area").style("cursor","pointer"),C.append("path").attr("d",K).attr("fill","none").attr("stroke",m).attr("stroke-width",R).attr("class","edge-path").style("pointer-events","none"),C.on("mouseenter",function(){at(this).raise()});const X=12;let S="";Z==="right"?S=`translate(${j.x-X}, ${j.y-X/2})`:Z==="left"?S=`translate(${j.x+X}, ${j.y+X/2}) rotate(180)`:Z==="self"&&(S=`translate(${j.x+X}, ${j.y+X/2}) rotate(180)`),C.append("use").attr("class","edge-arrow").attr("href","#arrow-right").attr("width",X).attr("height",X).attr("transform",S).attr("fill",m).attr("stroke",m).style("stroke-width",0);const D={x:(B.x+P.x)/2,y:t.midY};if(t.label){const p=Ir(t.label).map(st=>st.length>20?st.slice(0,20)+"...":st).join(" "),Y=p.length>60?p.slice(0,60)+"...":p,w=n.labelFontSize,x=w*.6,b=Y.length*x,y=w,E=n.labelPadding,M=16,G=L?16:0,J=t.edgeId!==void 0,nt=J&&t.edgeId>a,q=J&&t.edgeId<i,I=(nt?M:0)+(q?M:0)+G,T=b+E*2+I,N=y+E*2,k=n.labelCornerRadius,H=D.y,ot=D.x,it=st=>at(`g.edge[data-edge-id="${st}"]`),W=12,A=C.append("g").attr("class","label-area");A.append("rect").attr("class","label-bg").attr("x",ot-T/2).attr("y",H-N/2).attr("width",T).attr("height",N).attr("rx",k).attr("ry",k).attr("fill","white").attr("stroke",m).attr("stroke-width",1);const lt=ot-T/2+M/2,yt=ot+T/2-M/2-G,ct=ot+T/2-G/2,te=ot+(nt?M/2:0)-(q?M/2:0)-(L?G/2:0);if(J&&g&&C.style("cursor","pointer").on("click",function(st){st.stopPropagation(),!L&&g(t.edgeId)}),A.append("text").attr("class","label-text").attr("x",te).attr("y",H).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","Inter, Helvetica, Arial").attr("font-size","10px").attr("fill",m).style("pointer-events","none").text(Y),F&&C.append("circle").attr("cx",te).attr("cy",H).attr("r",4).attr("fill","blue").attr("opacity",.8).style("pointer-events","none").attr("class","debug-label-center"),nt){const st=t.edgeId-1,ht=A.append("g").attr("class","nav-btn-group prev-btn-group");ht.append("rect").attr("class","nav-btn-area prev-btn-area").attr("x",ot-T/2).attr("y",H-N/2).attr("width",M).attr("height",N).attr("fill","transparent").attr("rx",k).style("cursor","pointer").style("pointer-events","all"),ht.append("use").attr("class","nav-icon prev-icon").attr("href","#nav-left").attr("x",lt-W/2).attr("y",H-W/2).attr("width",W).attr("height",W).attr("fill","#888"),ht.on("click",function(mt){mt.stopPropagation();const Ct=it(st);if(!Ct.empty()){if(c&&l&&s&&u&&d){const $t=Ct.node();if($t){const _t=at($t).select(".label-text").node();let Rt,Lt;if(_t)Rt=parseFloat(_t.getAttribute("x")||"0"),Lt=parseFloat(_t.getAttribute("y")||"0");else{const Xt=$t.getBBox();Rt=Xt.x+Xt.width/2,Lt=Xt.y+Xt.height/2}const kt=s.clientWidth,zt=1.2*u/kt,jt=u/2-Rt*zt,xe=d/2-Lt*zt;l.transition().duration(500).call(c.transform,Ft.translate(jt,xe).scale(zt))}}g&&g(st)}})}if(q&&t.edgeId!==void 0){const st=t.edgeId+1,ht=L?yt:ot+T/2-M/2,mt=A.append("g").attr("class","nav-btn-group next-btn-group");mt.append("rect").attr("class","nav-btn-area next-btn-area").attr("x",ot+T/2-M-G).attr("y",H-N/2).attr("width",M).attr("height",N).attr("fill","transparent").attr("rx",k).style("cursor","pointer").style("pointer-events","all"),mt.append("use").attr("class","nav-icon next-icon").attr("href","#nav-right").attr("x",ht-W/2).attr("y",H-W/2).attr("width",W).attr("height",W).attr("fill","#888"),mt.on("click",function(Ct){Ct.stopPropagation();const $t=it(st);if(!$t.empty()){if(c&&l&&s&&u&&d){const _t=$t.node();if(_t){const Rt=at(_t).select(".label-text").node();let Lt,kt;if(Rt)Lt=parseFloat(Rt.getAttribute("x")||"0"),kt=parseFloat(Rt.getAttribute("y")||"0");else{const ee=_t.getBBox();Lt=ee.x+ee.width/2,kt=ee.y+ee.height/2}const zt=s.clientWidth,jt=1.2*u/zt,xe=u/2-Lt*jt,Xt=d/2-kt*jt;l.transition().duration(500).call(c.transform,Ft.translate(xe,Xt).scale(jt))}}g&&g(st)}})}L&&J&&g&&C.append("text").attr("class","close-btn").attr("x",ct).attr("y",H).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","Arial").attr("font-size","12px").attr("font-weight","bold").attr("fill","#888").style("cursor","pointer").text("✕").on("mouseenter",function(){at(this).attr("fill","#EF4444")}).on("mouseleave",function(){at(this).attr("fill","#888")}).on("click",function(st){st.stopPropagation(),g(null)})}else t._ldraw_&&t._ldraw_.forEach(f=>{if(f.op==="T"&&f.text){const p=f.size||10,Y=p*.6,w=f.text.length*Y,x=p,b=6,y=w+b*2,E=x+b*2,M=4,G=D.y;C.append("rect").attr("x",D.x-y/2).attr("y",G-E/2).attr("width",y).attr("height",E).attr("rx",M).attr("ry",M).attr("fill","white").attr("stroke","#d0d0d0").attr("stroke-width",.5),C.append("text").attr("x",D.x).attr("y",G).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family",f.face||"Inter, Helvetica, Arial").attr("font-size",`${p}px`).attr("fill",f.color||"#666").text(f.text)}});if(F){let f;t.depth===0?f=`d:0 dir:${t.baseDirection||"base"} off:${t.baseOffset} id:${t._gvid}`:f=`d:${t.depth} dir:${t.baseDirection||"?"} midY:${Math.round(t.midY)} id:${t._gvid}`,C.append("text").attr("x",D.x).attr("y",D.y+15).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","monospace").attr("font-size","9px").attr("fill","#999").text(f)}}else t._draw_&&t._draw_.forEach(B=>{if(B.op==="b"&&B.points){const U=B.points.map(([P,K])=>[P,r-K]),j=`M${U[0][0]},${U[0][1]} C${U.slice(1).map(P=>`${P[0]},${P[1]}`).join(" ")}`;C.append("path").attr("d",j).attr("fill","none").attr("stroke",B.color||"#9AA4B2").attr("stroke-width",2)}}),t._hdraw_&&t._hdraw_.forEach(B=>{if(B.op==="P"&&B.points){const U=B.points.map(([j,P])=>[j,r-P]);C.append("polygon").attr("points",U.map(j=>j.join(",")).join(" ")).attr("fill",B.color||"#9AA4B2")}}),t._ldraw_&&Dt(C,t._ldraw_,r)}function kr(t,e,r,n,o=!0,a=At,i=!0,c=14,l=!1,s,u,d,v,g){var D;t.innerHTML="";const F=((D=e.bb)==null?void 0:D.split(",").map(Number))||[0,0,1e3,800];let[,,L,$]=F;const C=at(t).append("svg").attr("width","100%").attr("height","100%").attr("viewBox",`0 0 ${L} ${$}`).style("background","white");C.append("defs").html(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("react"),dt=require("react/jsx-runtime"),Or=500;function Tr(t){return JSON.stringify(JSON.stringify(t)).slice(1,-1)}function Vr(t){return JSON.parse(`"${t}"`)}var Hr={value:()=>{}};function Xe(){for(var t=0,e=arguments.length,r={},n;t<e;++t){if(!(n=arguments[t]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new se(r)}function se(t){this._=t}function Wr(t,e){return t.trim().split(/^|\s+/).map(function(r){var n="",o=r.indexOf(".");if(o>=0&&(n=r.slice(o+1),r=r.slice(0,o)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}se.prototype=Xe.prototype={constructor:se,on:function(t,e){var r=this._,n=Wr(t+"",r),o,a=-1,i=n.length;if(arguments.length<2){for(;++a<i;)if((o=(t=n[a]).type)&&(o=qr(r[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<i;)if(o=(t=n[a]).type)r[o]=Oe(r[o],t.name,e);else if(e==null)for(o in r)r[o]=Oe(r[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new se(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var r=new Array(o),n=0,o,a;n<o;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],n=0,o=a.length;n<o;++n)a[n].value.apply(e,r)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],o=0,a=n.length;o<a;++o)n[o].value.apply(e,r)}};function qr(t,e){for(var r=0,n=t.length,o;r<n;++r)if((o=t[r]).name===e)return o.value}function Oe(t,e,r){for(var n=0,o=t.length;n<o;++n)if(t[n].name===e){t[n]=Hr,t=t.slice(0,n).concat(t.slice(n+1));break}return r!=null&&t.push({name:e,value:r}),t}var Ce="http://www.w3.org/1999/xhtml";const Te={svg:"http://www.w3.org/2000/svg",xhtml:Ce,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function me(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),Te.hasOwnProperty(e)?{space:Te[e],local:t}:t}function Kr(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Ce&&e.documentElement.namespaceURI===Ce?e.createElement(t):e.createElementNS(r,t)}}function Qr(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function lr(t){var e=me(t);return(e.local?Qr:Kr)(e)}function Zr(){}function Ue(t){return t==null?Zr:function(){return this.querySelector(t)}}function Jr(t){typeof t!="function"&&(t=Ue(t));for(var e=this._groups,r=e.length,n=new Array(r),o=0;o<r;++o)for(var a=e[o],i=a.length,c=n[o]=new Array(i),l,s,u=0;u<i;++u)(l=a[u])&&(s=t.call(l,l.__data__,u,a))&&("__data__"in l&&(s.__data__=l.__data__),c[u]=s);return new ft(n,this._parents)}function Ar(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function tn(){return[]}function ur(t){return t==null?tn:function(){return this.querySelectorAll(t)}}function en(t){return function(){return Ar(t.apply(this,arguments))}}function rn(t){typeof t=="function"?t=en(t):t=ur(t);for(var e=this._groups,r=e.length,n=[],o=[],a=0;a<r;++a)for(var i=e[a],c=i.length,l,s=0;s<c;++s)(l=i[s])&&(n.push(t.call(l,l.__data__,s,i)),o.push(l));return new ft(n,o)}function fr(t){return function(){return this.matches(t)}}function hr(t){return function(e){return e.matches(t)}}var nn=Array.prototype.find;function on(t){return function(){return nn.call(this.children,t)}}function an(){return this.firstElementChild}function sn(t){return this.select(t==null?an:on(typeof t=="function"?t:hr(t)))}var cn=Array.prototype.filter;function ln(){return Array.from(this.children)}function un(t){return function(){return cn.call(this.children,t)}}function fn(t){return this.selectAll(t==null?ln:un(typeof t=="function"?t:hr(t)))}function hn(t){typeof t!="function"&&(t=fr(t));for(var e=this._groups,r=e.length,n=new Array(r),o=0;o<r;++o)for(var a=e[o],i=a.length,c=n[o]=[],l,s=0;s<i;++s)(l=a[s])&&t.call(l,l.__data__,s,a)&&c.push(l);return new ft(n,this._parents)}function dr(t){return new Array(t.length)}function dn(){return new ft(this._enter||this._groups.map(dr),this._parents)}function fe(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}fe.prototype={constructor:fe,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 pn(t){return function(){return t}}function vn(t,e,r,n,o,a){for(var i=0,c,l=e.length,s=a.length;i<s;++i)(c=e[i])?(c.__data__=a[i],n[i]=c):r[i]=new fe(t,a[i]);for(;i<l;++i)(c=e[i])&&(o[i]=c)}function yn(t,e,r,n,o,a,i){var c,l,s=new Map,u=e.length,d=a.length,v=new Array(u),g;for(c=0;c<u;++c)(l=e[c])&&(v[c]=g=i.call(l,l.__data__,c,e)+"",s.has(g)?o[c]=l:s.set(g,l));for(c=0;c<d;++c)g=i.call(t,a[c],c,a)+"",(l=s.get(g))?(n[c]=l,l.__data__=a[c],s.delete(g)):r[c]=new fe(t,a[c]);for(c=0;c<u;++c)(l=e[c])&&s.get(v[c])===l&&(o[c]=l)}function mn(t){return t.__data__}function gn(t,e){if(!arguments.length)return Array.from(this,mn);var r=e?yn:vn,n=this._parents,o=this._groups;typeof t!="function"&&(t=pn(t));for(var a=o.length,i=new Array(a),c=new Array(a),l=new Array(a),s=0;s<a;++s){var u=n[s],d=o[s],v=d.length,g=wn(t.call(u,u&&u.__data__,s,n)),F=g.length,L=c[s]=new Array(F),$=i[s]=new Array(F),C=l[s]=new Array(v);r(u,d,L,$,C,g,e);for(var Q=0,O=0,Z,V;Q<F;++Q)if(Z=L[Q]){for(Q>=O&&(O=Q+1);!(V=$[O])&&++O<F;);Z._next=V||null}}return i=new ft(i,n),i._enter=c,i._exit=l,i}function wn(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function xn(){return new ft(this._exit||this._groups.map(dr),this._parents)}function En(t,e,r){var n=this.enter(),o=this,a=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),r==null?a.remove():r(a),n&&o?n.merge(o).order():o}function bn(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,o=r.length,a=n.length,i=Math.min(o,a),c=new Array(o),l=0;l<i;++l)for(var s=r[l],u=n[l],d=s.length,v=c[l]=new Array(d),g,F=0;F<d;++F)(g=s[F]||u[F])&&(v[F]=g);for(;l<o;++l)c[l]=r[l];return new ft(c,this._parents)}function Mn(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n=t[e],o=n.length-1,a=n[o],i;--o>=0;)(i=n[o])&&(a&&i.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(i,a),a=i);return this}function Fn(t){t||(t=Cn);function e(d,v){return d&&v?t(d.__data__,v.__data__):!d-!v}for(var r=this._groups,n=r.length,o=new Array(n),a=0;a<n;++a){for(var i=r[a],c=i.length,l=o[a]=new Array(c),s,u=0;u<c;++u)(s=i[u])&&(l[u]=s);l.sort(e)}return new ft(o,this._parents).order()}function Cn(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function _n(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Rn(){return Array.from(this)}function Ln(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],o=0,a=n.length;o<a;++o){var i=n[o];if(i)return i}return null}function Yn(){let t=0;for(const e of this)++t;return t}function Dn(){return!this.node()}function Bn(t){for(var e=this._groups,r=0,n=e.length;r<n;++r)for(var o=e[r],a=0,i=o.length,c;a<i;++a)(c=o[a])&&t.call(c,c.__data__,a,o);return this}function Pn(t){return function(){this.removeAttribute(t)}}function Nn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function $n(t,e){return function(){this.setAttribute(t,e)}}function Xn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Un(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function Sn(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function In(t,e){var r=me(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((e==null?r.local?Nn:Pn:typeof e=="function"?r.local?Sn:Un:r.local?Xn:$n)(r,e))}function pr(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function kn(t){return function(){this.style.removeProperty(t)}}function zn(t,e,r){return function(){this.style.setProperty(t,e,r)}}function jn(t,e,r){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function Gn(t,e,r){return arguments.length>1?this.each((e==null?kn:typeof e=="function"?jn:zn)(t,e,r??"")):St(this.node(),t)}function St(t,e){return t.style.getPropertyValue(e)||pr(t).getComputedStyle(t,null).getPropertyValue(e)}function On(t){return function(){delete this[t]}}function Tn(t,e){return function(){this[t]=e}}function Vn(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Hn(t,e){return arguments.length>1?this.each((e==null?On:typeof e=="function"?Vn:Tn)(t,e)):this.node()[t]}function vr(t){return t.trim().split(/^|\s+/)}function Se(t){return t.classList||new yr(t)}function yr(t){this._node=t,this._names=vr(t.getAttribute("class")||"")}yr.prototype={add:function(t){var e=this._names.indexOf(t);e<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}};function mr(t,e){for(var r=Se(t),n=-1,o=e.length;++n<o;)r.add(e[n])}function gr(t,e){for(var r=Se(t),n=-1,o=e.length;++n<o;)r.remove(e[n])}function Wn(t){return function(){mr(this,t)}}function qn(t){return function(){gr(this,t)}}function Kn(t,e){return function(){(e.apply(this,arguments)?mr:gr)(this,t)}}function Qn(t,e){var r=vr(t+"");if(arguments.length<2){for(var n=Se(this.node()),o=-1,a=r.length;++o<a;)if(!n.contains(r[o]))return!1;return!0}return this.each((typeof e=="function"?Kn:e?Wn:qn)(r,e))}function Zn(){this.textContent=""}function Jn(t){return function(){this.textContent=t}}function An(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function to(t){return arguments.length?this.each(t==null?Zn:(typeof t=="function"?An:Jn)(t)):this.node().textContent}function eo(){this.innerHTML=""}function ro(t){return function(){this.innerHTML=t}}function no(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function oo(t){return arguments.length?this.each(t==null?eo:(typeof t=="function"?no:ro)(t)):this.node().innerHTML}function io(){this.nextSibling&&this.parentNode.appendChild(this)}function ao(){return this.each(io)}function so(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function co(){return this.each(so)}function lo(t){var e=typeof t=="function"?t:lr(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function uo(){return null}function fo(t,e){var r=typeof t=="function"?t:lr(t),n=e==null?uo:typeof e=="function"?e:Ue(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function ho(){var t=this.parentNode;t&&t.removeChild(this)}function po(){return this.each(ho)}function vo(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function yo(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function mo(t){return this.select(t?yo:vo)}function go(t){return arguments.length?this.property("__data__",t):this.node().__data__}function wo(t){return function(e){t.call(this,e,this.__data__)}}function xo(t){return t.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");return n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function Eo(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,o=e.length,a;r<o;++r)a=e[r],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++n]=a;++n?e.length=n:delete this.__on}}}function bo(t,e,r){return function(){var n=this.__on,o,a=wo(e);if(n){for(var i=0,c=n.length;i<c;++i)if((o=n[i]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=r),o.value=e;return}}this.addEventListener(t.type,a,r),o={type:t.type,name:t.name,value:e,listener:a,options:r},n?n.push(o):this.__on=[o]}}function Mo(t,e,r){var n=xo(t+""),o,a=n.length,i;if(arguments.length<2){var c=this.node().__on;if(c){for(var l=0,s=c.length,u;l<s;++l)for(o=0,u=c[l];o<a;++o)if((i=n[o]).type===u.type&&i.name===u.name)return u.value}return}for(c=e?bo:Eo,o=0;o<a;++o)this.each(c(n[o],e,r));return this}function wr(t,e,r){var n=pr(t),o=n.CustomEvent;typeof o=="function"?o=new o(e,r):(o=n.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function Fo(t,e){return function(){return wr(this,t,e)}}function Co(t,e){return function(){return wr(this,t,e.apply(this,arguments))}}function _o(t,e){return this.each((typeof e=="function"?Co:Fo)(t,e))}function*Ro(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],o=0,a=n.length,i;o<a;++o)(i=n[o])&&(yield i)}var xr=[null];function ft(t,e){this._groups=t,this._parents=e}function Zt(){return new ft([[document.documentElement]],xr)}function Lo(){return this}ft.prototype=Zt.prototype={constructor:ft,select:Jr,selectAll:rn,selectChild:sn,selectChildren:fn,filter:hn,data:gn,enter:dn,exit:xn,join:En,merge:bn,selection:Lo,order:Mn,sort:Fn,call:_n,nodes:Rn,node:Ln,size:Yn,empty:Dn,each:Bn,attr:In,style:Gn,property:Hn,classed:Qn,text:to,html:oo,raise:ao,lower:co,append:lo,insert:fo,remove:po,clone:mo,datum:go,on:Mo,dispatch:_o,[Symbol.iterator]:Ro};function at(t){return typeof t=="string"?new ft([[document.querySelector(t)]],[document.documentElement]):new ft([[t]],xr)}function Yo(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Yt(t,e){if(t=Yo(t),e===void 0&&(e=t.currentTarget),e){var r=e.ownerSVGElement||e;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}const _e={capture:!0,passive:!1};function Re(t){t.preventDefault(),t.stopImmediatePropagation()}function Do(t){var e=t.document.documentElement,r=at(t).on("dragstart.drag",Re,_e);"onselectstart"in e?r.on("selectstart.drag",Re,_e):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Bo(t,e){var r=t.document.documentElement,n=at(t).on("dragstart.drag",null);e&&(n.on("click.drag",Re,_e),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}function Ie(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function Er(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Jt(){}var Wt=.7,he=1/Wt,Ut="\\s*([+-]?\\d+)\\s*",qt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Po=/^#([0-9a-f]{3,8})$/,No=new RegExp(`^rgb\\(${Ut},${Ut},${Ut}\\)$`),$o=new RegExp(`^rgb\\(${gt},${gt},${gt}\\)$`),Xo=new RegExp(`^rgba\\(${Ut},${Ut},${Ut},${qt}\\)$`),Uo=new RegExp(`^rgba\\(${gt},${gt},${gt},${qt}\\)$`),So=new RegExp(`^hsl\\(${qt},${gt},${gt}\\)$`),Io=new RegExp(`^hsla\\(${qt},${gt},${gt},${qt}\\)$`),Ve={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};Ie(Jt,Kt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:He,formatHex:He,formatHex8:ko,formatHsl:zo,formatRgb:We,toString:We});function He(){return this.rgb().formatHex()}function ko(){return this.rgb().formatHex8()}function zo(){return br(this).formatHsl()}function We(){return this.rgb().formatRgb()}function Kt(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Po.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?qe(e):r===3?new ut(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?re(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?re(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=No.exec(t))?new ut(e[1],e[2],e[3],1):(e=$o.exec(t))?new ut(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Xo.exec(t))?re(e[1],e[2],e[3],e[4]):(e=Uo.exec(t))?re(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=So.exec(t))?Ze(e[1],e[2]/100,e[3]/100,1):(e=Io.exec(t))?Ze(e[1],e[2]/100,e[3]/100,e[4]):Ve.hasOwnProperty(t)?qe(Ve[t]):t==="transparent"?new ut(NaN,NaN,NaN,0):null}function qe(t){return new ut(t>>16&255,t>>8&255,t&255,1)}function re(t,e,r,n){return n<=0&&(t=e=r=NaN),new ut(t,e,r,n)}function jo(t){return t instanceof Jt||(t=Kt(t)),t?(t=t.rgb(),new ut(t.r,t.g,t.b,t.opacity)):new ut}function Le(t,e,r,n){return arguments.length===1?jo(t):new ut(t,e,r,n??1)}function ut(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}Ie(ut,Le,Er(Jt,{brighter(t){return t=t==null?he:Math.pow(he,t),new ut(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Wt:Math.pow(Wt,t),new ut(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ut(Pt(this.r),Pt(this.g),Pt(this.b),de(this.opacity))},displayable(){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:Ke,formatHex:Ke,formatHex8:Go,formatRgb:Qe,toString:Qe}));function Ke(){return`#${Bt(this.r)}${Bt(this.g)}${Bt(this.b)}`}function Go(){return`#${Bt(this.r)}${Bt(this.g)}${Bt(this.b)}${Bt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qe(){const t=de(this.opacity);return`${t===1?"rgb(":"rgba("}${Pt(this.r)}, ${Pt(this.g)}, ${Pt(this.b)}${t===1?")":`, ${t})`}`}function de(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Pt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Bt(t){return t=Pt(t),(t<16?"0":"")+t.toString(16)}function Ze(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new pt(t,e,r,n)}function br(t){if(t instanceof pt)return new pt(t.h,t.s,t.l,t.opacity);if(t instanceof Jt||(t=Kt(t)),!t)return new pt;if(t instanceof pt)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,o=Math.min(e,r,n),a=Math.max(e,r,n),i=NaN,c=a-o,l=(a+o)/2;return c?(e===a?i=(r-n)/c+(r<n)*6:r===a?i=(n-e)/c+2:i=(e-r)/c+4,c/=l<.5?a+o:2-a-o,i*=60):c=l>0&&l<1?0:i,new pt(i,c,l,t.opacity)}function Oo(t,e,r,n){return arguments.length===1?br(t):new pt(t,e,r,n??1)}function pt(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}Ie(pt,Oo,Er(Jt,{brighter(t){return t=t==null?he:Math.pow(he,t),new pt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Wt:Math.pow(Wt,t),new pt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,o=2*r-n;return new ut(Ee(t>=240?t-240:t+120,o,n),Ee(t,o,n),Ee(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new pt(Je(this.h),ne(this.s),ne(this.l),de(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=de(this.opacity);return`${t===1?"hsl(":"hsla("}${Je(this.h)}, ${ne(this.s)*100}%, ${ne(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Je(t){return t=(t||0)%360,t<0?t+360:t}function ne(t){return Math.max(0,Math.min(1,t||0))}function Ee(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const Mr=t=>()=>t;function To(t,e){return function(r){return t+r*e}}function Vo(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function Ho(t){return(t=+t)==1?Fr:function(e,r){return r-e?Vo(e,r,t):Mr(isNaN(e)?r:e)}}function Fr(t,e){var r=e-t;return r?To(t,r):Mr(isNaN(t)?e:t)}const Ae=(function t(e){var r=Ho(e);function n(o,a){var i=r((o=Le(o)).r,(a=Le(a)).r),c=r(o.g,a.g),l=r(o.b,a.b),s=Fr(o.opacity,a.opacity);return function(u){return o.r=i(u),o.g=c(u),o.b=l(u),o.opacity=s(u),o+""}}return n.gamma=t,n})(1);function Mt(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var Ye=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,be=new RegExp(Ye.source,"g");function Wo(t){return function(){return t}}function qo(t){return function(e){return t(e)+""}}function Ko(t,e){var r=Ye.lastIndex=be.lastIndex=0,n,o,a,i=-1,c=[],l=[];for(t=t+"",e=e+"";(n=Ye.exec(t))&&(o=be.exec(e));)(a=o.index)>r&&(a=e.slice(r,a),c[i]?c[i]+=a:c[++i]=a),(n=n[0])===(o=o[0])?c[i]?c[i]+=o:c[++i]=o:(c[++i]=null,l.push({i,x:Mt(n,o)})),r=be.lastIndex;return r<e.length&&(a=e.slice(r),c[i]?c[i]+=a:c[++i]=a),c.length<2?l[0]?qo(l[0].x):Wo(e):(e=l.length,function(s){for(var u=0,d;u<e;++u)c[(d=l[u]).i]=d.x(s);return c.join("")})}var tr=180/Math.PI,De={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Cr(t,e,r,n,o,a){var i,c,l;return(i=Math.sqrt(t*t+e*e))&&(t/=i,e/=i),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(c=Math.sqrt(r*r+n*n))&&(r/=c,n/=c,l/=c),t*n<e*r&&(t=-t,e=-e,l=-l,i=-i),{translateX:o,translateY:a,rotate:Math.atan2(e,t)*tr,skewX:Math.atan(l)*tr,scaleX:i,scaleY:c}}var oe;function Qo(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?De:Cr(e.a,e.b,e.c,e.d,e.e,e.f)}function Zo(t){return t==null||(oe||(oe=document.createElementNS("http://www.w3.org/2000/svg","g")),oe.setAttribute("transform",t),!(t=oe.transform.baseVal.consolidate()))?De:(t=t.matrix,Cr(t.a,t.b,t.c,t.d,t.e,t.f))}function _r(t,e,r,n){function o(s){return s.length?s.pop()+" ":""}function a(s,u,d,v,g,F){if(s!==d||u!==v){var L=g.push("translate(",null,e,null,r);F.push({i:L-4,x:Mt(s,d)},{i:L-2,x:Mt(u,v)})}else(d||v)&&g.push("translate("+d+e+v+r)}function i(s,u,d,v){s!==u?(s-u>180?u+=360:u-s>180&&(s+=360),v.push({i:d.push(o(d)+"rotate(",null,n)-2,x:Mt(s,u)})):u&&d.push(o(d)+"rotate("+u+n)}function c(s,u,d,v){s!==u?v.push({i:d.push(o(d)+"skewX(",null,n)-2,x:Mt(s,u)}):u&&d.push(o(d)+"skewX("+u+n)}function l(s,u,d,v,g,F){if(s!==d||u!==v){var L=g.push(o(g)+"scale(",null,",",null,")");F.push({i:L-4,x:Mt(s,d)},{i:L-2,x:Mt(u,v)})}else(d!==1||v!==1)&&g.push(o(g)+"scale("+d+","+v+")")}return function(s,u){var d=[],v=[];return s=t(s),u=t(u),a(s.translateX,s.translateY,u.translateX,u.translateY,d,v),i(s.rotate,u.rotate,d,v),c(s.skewX,u.skewX,d,v),l(s.scaleX,s.scaleY,u.scaleX,u.scaleY,d,v),s=u=null,function(g){for(var F=-1,L=v.length,$;++F<L;)d[($=v[F]).i]=$.x(g);return d.join("")}}}var Jo=_r(Qo,"px, ","px)","deg)"),Ao=_r(Zo,", ",")",")"),ti=1e-12;function er(t){return((t=Math.exp(t))+1/t)/2}function ei(t){return((t=Math.exp(t))-1/t)/2}function ri(t){return((t=Math.exp(2*t))-1)/(t+1)}const ni=(function t(e,r,n){function o(a,i){var c=a[0],l=a[1],s=a[2],u=i[0],d=i[1],v=i[2],g=u-c,F=d-l,L=g*g+F*F,$,C;if(L<ti)C=Math.log(v/s)/e,$=function(et){return[c+et*g,l+et*F,s*Math.exp(e*et*C)]};else{var Q=Math.sqrt(L),O=(v*v-s*s+n*L)/(2*s*r*Q),Z=(v*v-s*s-n*L)/(2*v*r*Q),V=Math.log(Math.sqrt(O*O+1)-O),z=Math.log(Math.sqrt(Z*Z+1)-Z);C=(z-V)/e,$=function(et){var B=et*C,U=er(V),j=s/(r*Q)*(U*ri(e*B+V)-ei(V));return[c+j*g,l+j*F,s*U/er(e*B+V)]}}return $.duration=C*1e3*e/Math.SQRT2,$}return o.rho=function(a){var i=Math.max(.001,+a),c=i*i,l=c*c;return t(i,c,l)},o})(Math.SQRT2,2,4);var It=0,Tt=0,Gt=0,Rr=1e3,pe,Vt,ve=0,Nt=0,ge=0,Qt=typeof performance=="object"&&performance.now?performance:Date,Lr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ke(){return Nt||(Lr(oi),Nt=Qt.now()+ge)}function oi(){Nt=0}function ye(){this._call=this._time=this._next=null}ye.prototype=Yr.prototype={constructor:ye,restart:function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?ke():+r)+(e==null?0:+e),!this._next&&Vt!==this&&(Vt?Vt._next=this:pe=this,Vt=this),this._call=t,this._time=r,Be()},stop:function(){this._call&&(this._call=null,this._time=1/0,Be())}};function Yr(t,e,r){var n=new ye;return n.restart(t,e,r),n}function ii(){ke(),++It;for(var t=pe,e;t;)(e=Nt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--It}function rr(){Nt=(ve=Qt.now())+ge,It=Tt=0;try{ii()}finally{It=0,si(),Nt=0}}function ai(){var t=Qt.now(),e=t-ve;e>Rr&&(ge-=e,ve=t)}function si(){for(var t,e=pe,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:pe=r);Vt=t,Be(n)}function Be(t){if(!It){Tt&&(Tt=clearTimeout(Tt));var e=t-Nt;e>24?(t<1/0&&(Tt=setTimeout(rr,t-Qt.now()-ge)),Gt&&(Gt=clearInterval(Gt))):(Gt||(ve=Qt.now(),Gt=setInterval(ai,Rr)),It=1,Lr(rr))}}function nr(t,e,r){var n=new ye;return e=e==null?0:+e,n.restart(o=>{n.stop(),t(o+e)},e,r),n}var ci=Xe("start","end","cancel","interrupt"),li=[],Dr=0,or=1,Pe=2,ce=3,ir=4,Ne=5,le=6;function we(t,e,r,n,o,a){var i=t.__transition;if(!i)t.__transition={};else if(r in i)return;ui(t,r,{name:e,index:n,group:o,on:ci,tween:li,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Dr})}function ze(t,e){var r=vt(t,e);if(r.state>Dr)throw new Error("too late; already scheduled");return r}function wt(t,e){var r=vt(t,e);if(r.state>ce)throw new Error("too late; already running");return r}function vt(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function ui(t,e,r){var n=t.__transition,o;n[e]=r,r.timer=Yr(a,0,r.time);function a(s){r.state=or,r.timer.restart(i,r.delay,r.time),r.delay<=s&&i(s-r.delay)}function i(s){var u,d,v,g;if(r.state!==or)return l();for(u in n)if(g=n[u],g.name===r.name){if(g.state===ce)return nr(i);g.state===ir?(g.state=le,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete n[u]):+u<e&&(g.state=le,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete n[u])}if(nr(function(){r.state===ce&&(r.state=ir,r.timer.restart(c,r.delay,r.time),c(s))}),r.state=Pe,r.on.call("start",t,t.__data__,r.index,r.group),r.state===Pe){for(r.state=ce,o=new Array(v=r.tween.length),u=0,d=-1;u<v;++u)(g=r.tween[u].value.call(t,t.__data__,r.index,r.group))&&(o[++d]=g);o.length=d+1}}function c(s){for(var u=s<r.duration?r.ease.call(null,s/r.duration):(r.timer.restart(l),r.state=Ne,1),d=-1,v=o.length;++d<v;)o[d].call(t,u);r.state===Ne&&(r.on.call("end",t,t.__data__,r.index,r.group),l())}function l(){r.state=le,r.timer.stop(),delete n[e];for(var s in n)return;delete t.__transition}}function ue(t,e){var r=t.__transition,n,o,a=!0,i;if(r){e=e==null?null:e+"";for(i in r){if((n=r[i]).name!==e){a=!1;continue}o=n.state>Pe&&n.state<Ne,n.state=le,n.timer.stop(),n.on.call(o?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[i]}a&&delete t.__transition}}function fi(t){return this.each(function(){ue(this,t)})}function hi(t,e){var r,n;return function(){var o=wt(this,t),a=o.tween;if(a!==r){n=r=a;for(var i=0,c=n.length;i<c;++i)if(n[i].name===e){n=n.slice(),n.splice(i,1);break}}o.tween=n}}function di(t,e,r){var n,o;if(typeof r!="function")throw new Error;return function(){var a=wt(this,t),i=a.tween;if(i!==n){o=(n=i).slice();for(var c={name:e,value:r},l=0,s=o.length;l<s;++l)if(o[l].name===e){o[l]=c;break}l===s&&o.push(c)}a.tween=o}}function pi(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n=vt(this.node(),r).tween,o=0,a=n.length,i;o<a;++o)if((i=n[o]).name===t)return i.value;return null}return this.each((e==null?hi:di)(r,t,e))}function je(t,e,r){var n=t._id;return t.each(function(){var o=wt(this,n);(o.value||(o.value={}))[e]=r.apply(this,arguments)}),function(o){return vt(o,n).value[e]}}function Br(t,e){var r;return(typeof e=="number"?Mt:e instanceof Kt?Ae:(r=Kt(e))?(e=r,Ae):Ko)(t,e)}function vi(t){return function(){this.removeAttribute(t)}}function yi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function mi(t,e,r){var n,o=r+"",a;return function(){var i=this.getAttribute(t);return i===o?null:i===n?a:a=e(n=i,r)}}function gi(t,e,r){var n,o=r+"",a;return function(){var i=this.getAttributeNS(t.space,t.local);return i===o?null:i===n?a:a=e(n=i,r)}}function wi(t,e,r){var n,o,a;return function(){var i,c=r(this),l;return c==null?void this.removeAttribute(t):(i=this.getAttribute(t),l=c+"",i===l?null:i===n&&l===o?a:(o=l,a=e(n=i,c)))}}function xi(t,e,r){var n,o,a;return function(){var i,c=r(this),l;return c==null?void this.removeAttributeNS(t.space,t.local):(i=this.getAttributeNS(t.space,t.local),l=c+"",i===l?null:i===n&&l===o?a:(o=l,a=e(n=i,c)))}}function Ei(t,e){var r=me(t),n=r==="transform"?Ao:Br;return this.attrTween(t,typeof e=="function"?(r.local?xi:wi)(r,n,je(this,"attr."+t,e)):e==null?(r.local?yi:vi)(r):(r.local?gi:mi)(r,n,e))}function bi(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function Mi(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function Fi(t,e){var r,n;function o(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&Mi(t,a)),r}return o._value=e,o}function Ci(t,e){var r,n;function o(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&bi(t,a)),r}return o._value=e,o}function _i(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var n=me(t);return this.tween(r,(n.local?Fi:Ci)(n,e))}function Ri(t,e){return function(){ze(this,t).delay=+e.apply(this,arguments)}}function Li(t,e){return e=+e,function(){ze(this,t).delay=e}}function Yi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ri:Li)(e,t)):vt(this.node(),e).delay}function Di(t,e){return function(){wt(this,t).duration=+e.apply(this,arguments)}}function Bi(t,e){return e=+e,function(){wt(this,t).duration=e}}function Pi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Di:Bi)(e,t)):vt(this.node(),e).duration}function Ni(t,e){if(typeof e!="function")throw new Error;return function(){wt(this,t).ease=e}}function $i(t){var e=this._id;return arguments.length?this.each(Ni(e,t)):vt(this.node(),e).ease}function Xi(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;wt(this,t).ease=r}}function Ui(t){if(typeof t!="function")throw new Error;return this.each(Xi(this._id,t))}function Si(t){typeof t!="function"&&(t=fr(t));for(var e=this._groups,r=e.length,n=new Array(r),o=0;o<r;++o)for(var a=e[o],i=a.length,c=n[o]=[],l,s=0;s<i;++s)(l=a[s])&&t.call(l,l.__data__,s,a)&&c.push(l);return new bt(n,this._parents,this._name,this._id)}function Ii(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,o=r.length,a=Math.min(n,o),i=new Array(n),c=0;c<a;++c)for(var l=e[c],s=r[c],u=l.length,d=i[c]=new Array(u),v,g=0;g<u;++g)(v=l[g]||s[g])&&(d[g]=v);for(;c<n;++c)i[c]=e[c];return new bt(i,this._parents,this._name,this._id)}function ki(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function zi(t,e,r){var n,o,a=ki(e)?ze:wt;return function(){var i=a(this,t),c=i.on;c!==n&&(o=(n=c).copy()).on(e,r),i.on=o}}function ji(t,e){var r=this._id;return arguments.length<2?vt(this.node(),r).on.on(t):this.each(zi(r,t,e))}function Gi(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function Oi(){return this.on("end.remove",Gi(this._id))}function Ti(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Ue(t));for(var n=this._groups,o=n.length,a=new Array(o),i=0;i<o;++i)for(var c=n[i],l=c.length,s=a[i]=new Array(l),u,d,v=0;v<l;++v)(u=c[v])&&(d=t.call(u,u.__data__,v,c))&&("__data__"in u&&(d.__data__=u.__data__),s[v]=d,we(s[v],e,r,v,s,vt(u,r)));return new bt(a,this._parents,e,r)}function Vi(t){var e=this._name,r=this._id;typeof t!="function"&&(t=ur(t));for(var n=this._groups,o=n.length,a=[],i=[],c=0;c<o;++c)for(var l=n[c],s=l.length,u,d=0;d<s;++d)if(u=l[d]){for(var v=t.call(u,u.__data__,d,l),g,F=vt(u,r),L=0,$=v.length;L<$;++L)(g=v[L])&&we(g,e,r,L,v,F);a.push(v),i.push(u)}return new bt(a,i,e,r)}var Hi=Zt.prototype.constructor;function Wi(){return new Hi(this._groups,this._parents)}function qi(t,e){var r,n,o;return function(){var a=St(this,t),i=(this.style.removeProperty(t),St(this,t));return a===i?null:a===r&&i===n?o:o=e(r=a,n=i)}}function Pr(t){return function(){this.style.removeProperty(t)}}function Ki(t,e,r){var n,o=r+"",a;return function(){var i=St(this,t);return i===o?null:i===n?a:a=e(n=i,r)}}function Qi(t,e,r){var n,o,a;return function(){var i=St(this,t),c=r(this),l=c+"";return c==null&&(l=c=(this.style.removeProperty(t),St(this,t))),i===l?null:i===n&&l===o?a:(o=l,a=e(n=i,c))}}function Zi(t,e){var r,n,o,a="style."+e,i="end."+a,c;return function(){var l=wt(this,t),s=l.on,u=l.value[a]==null?c||(c=Pr(e)):void 0;(s!==r||o!==u)&&(n=(r=s).copy()).on(i,o=u),l.on=n}}function Ji(t,e,r){var n=(t+="")=="transform"?Jo:Br;return e==null?this.styleTween(t,qi(t,n)).on("end.style."+t,Pr(t)):typeof e=="function"?this.styleTween(t,Qi(t,n,je(this,"style."+t,e))).each(Zi(this._id,t)):this.styleTween(t,Ki(t,n,e),r).on("end.style."+t,null)}function Ai(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}function ta(t,e,r){var n,o;function a(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&Ai(t,i,r)),n}return a._value=e,a}function ea(t,e,r){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,ta(t,e,r??""))}function ra(t){return function(){this.textContent=t}}function na(t){return function(){var e=t(this);this.textContent=e??""}}function oa(t){return this.tween("text",typeof t=="function"?na(je(this,"text",t)):ra(t==null?"":t+""))}function ia(t){return function(e){this.textContent=t.call(this,e)}}function aa(t){var e,r;function n(){var o=t.apply(this,arguments);return o!==r&&(e=(r=o)&&ia(o)),e}return n._value=t,n}function sa(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,aa(t))}function ca(){for(var t=this._name,e=this._id,r=Nr(),n=this._groups,o=n.length,a=0;a<o;++a)for(var i=n[a],c=i.length,l,s=0;s<c;++s)if(l=i[s]){var u=vt(l,e);we(l,t,r,s,i,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new bt(n,this._parents,t,r)}function la(){var t,e,r=this,n=r._id,o=r.size();return new Promise(function(a,i){var c={value:i},l={value:function(){--o===0&&a()}};r.each(function(){var s=wt(this,n),u=s.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(c),e._.interrupt.push(c),e._.end.push(l)),s.on=e}),o===0&&a()})}var ua=0;function bt(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function Nr(){return++ua}var xt=Zt.prototype;bt.prototype={constructor:bt,select:Ti,selectAll:Vi,selectChild:xt.selectChild,selectChildren:xt.selectChildren,filter:Si,merge:Ii,selection:Wi,transition:ca,call:xt.call,nodes:xt.nodes,node:xt.node,size:xt.size,empty:xt.empty,each:xt.each,on:ji,attr:Ei,attrTween:_i,style:Ji,styleTween:ea,text:oa,textTween:sa,remove:Oi,tween:pi,delay:Yi,duration:Pi,ease:$i,easeVarying:Ui,end:la,[Symbol.iterator]:xt[Symbol.iterator]};function fa(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var ha={time:null,delay:0,duration:250,ease:fa};function da(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function pa(t){var e,r;t instanceof bt?(e=t._id,t=t._name):(e=Nr(),(r=ha).time=ke(),t=t==null?null:t+"");for(var n=this._groups,o=n.length,a=0;a<o;++a)for(var i=n[a],c=i.length,l,s=0;s<c;++s)(l=i[s])&&we(l,t,e,s,i,r||da(l,e));return new bt(n,this._parents,t,e)}Zt.prototype.interrupt=fi;Zt.prototype.transition=pa;const ie=t=>()=>t;function va(t,{sourceEvent:e,target:r,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function Et(t,e,r){this.k=t,this.x=e,this.y=r}Et.prototype={constructor:Et,scale:function(t){return t===1?this:new Et(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Et(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 Ft=new Et(1,0,0);Ht.prototype=Et.prototype;function Ht(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Ft;return t.__zoom}function Me(t){t.stopImmediatePropagation()}function Ot(t){t.preventDefault(),t.stopImmediatePropagation()}function ya(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function ma(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.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 ar(){return this.__zoom||Ft}function ga(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function wa(){return navigator.maxTouchPoints||"ontouchstart"in this}function xa(t,e,r){var n=t.invertX(e[0][0])-r[0][0],o=t.invertX(e[1][0])-r[1][0],a=t.invertY(e[0][1])-r[0][1],i=t.invertY(e[1][1])-r[1][1];return t.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),i>a?(a+i)/2:Math.min(0,a)||Math.max(0,i))}function Ge(){var t=ya,e=ma,r=xa,n=ga,o=wa,a=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],c=250,l=ni,s=Xe("start","zoom","end"),u,d,v,g=500,F=150,L=0,$=10;function C(h){h.property("__zoom",ar).on("wheel.zoom",B,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",j).filter(o).on("touchstart.zoom",P).on("touchmove.zoom",K).on("touchend.zoom touchcancel.zoom",tt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(h,_,m,R){var X=h.selection?h.selection():h;X.property("__zoom",ar),h!==X?V(h,_,m,R):X.interrupt().each(function(){z(this,arguments).event(R).start().zoom(null,typeof _=="function"?_.apply(this,arguments):_).end()})},C.scaleBy=function(h,_,m,R){C.scaleTo(h,function(){var X=this.__zoom.k,S=typeof _=="function"?_.apply(this,arguments):_;return X*S},m,R)},C.scaleTo=function(h,_,m,R){C.transform(h,function(){var X=e.apply(this,arguments),S=this.__zoom,D=m==null?Z(X):typeof m=="function"?m.apply(this,arguments):m,f=S.invert(D),p=typeof _=="function"?_.apply(this,arguments):_;return r(O(Q(S,p),D,f),X,i)},m,R)},C.translateBy=function(h,_,m,R){C.transform(h,function(){return r(this.__zoom.translate(typeof _=="function"?_.apply(this,arguments):_,typeof m=="function"?m.apply(this,arguments):m),e.apply(this,arguments),i)},null,R)},C.translateTo=function(h,_,m,R,X){C.transform(h,function(){var S=e.apply(this,arguments),D=this.__zoom,f=R==null?Z(S):typeof R=="function"?R.apply(this,arguments):R;return r(Ft.translate(f[0],f[1]).scale(D.k).translate(typeof _=="function"?-_.apply(this,arguments):-_,typeof m=="function"?-m.apply(this,arguments):-m),S,i)},R,X)};function Q(h,_){return _=Math.max(a[0],Math.min(a[1],_)),_===h.k?h:new Et(_,h.x,h.y)}function O(h,_,m){var R=_[0]-m[0]*h.k,X=_[1]-m[1]*h.k;return R===h.x&&X===h.y?h:new Et(h.k,R,X)}function Z(h){return[(+h[0][0]+ +h[1][0])/2,(+h[0][1]+ +h[1][1])/2]}function V(h,_,m,R){h.on("start.zoom",function(){z(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(R).end()}).tween("zoom",function(){var X=this,S=arguments,D=z(X,S).event(R),f=e.apply(X,S),p=m==null?Z(f):typeof m=="function"?m.apply(X,S):m,Y=Math.max(f[1][0]-f[0][0],f[1][1]-f[0][1]),w=X.__zoom,x=typeof _=="function"?_.apply(X,S):_,b=l(w.invert(p).concat(Y/w.k),x.invert(p).concat(Y/x.k));return function(y){if(y===1)y=x;else{var E=b(y),M=Y/E[2];y=new Et(M,p[0]-E[0]*M,p[1]-E[1]*M)}D.zoom(null,y)}})}function z(h,_,m){return!m&&h.__zooming||new et(h,_)}function et(h,_){this.that=h,this.args=_,this.active=0,this.sourceEvent=null,this.extent=e.apply(h,_),this.taps=0}et.prototype={event:function(h){return h&&(this.sourceEvent=h),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(h,_){return this.mouse&&h!=="mouse"&&(this.mouse[1]=_.invert(this.mouse[0])),this.touch0&&h!=="touch"&&(this.touch0[1]=_.invert(this.touch0[0])),this.touch1&&h!=="touch"&&(this.touch1[1]=_.invert(this.touch1[0])),this.that.__zoom=_,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(h){var _=at(this.that).datum();s.call(h,this.that,new va(h,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:s}),_)}};function B(h,..._){if(!t.apply(this,arguments))return;var m=z(this,_).event(h),R=this.__zoom,X=Math.max(a[0],Math.min(a[1],R.k*Math.pow(2,n.apply(this,arguments)))),S=Yt(h);if(m.wheel)(m.mouse[0][0]!==S[0]||m.mouse[0][1]!==S[1])&&(m.mouse[1]=R.invert(m.mouse[0]=S)),clearTimeout(m.wheel);else{if(R.k===X)return;m.mouse=[S,R.invert(S)],ue(this),m.start()}Ot(h),m.wheel=setTimeout(D,F),m.zoom("mouse",r(O(Q(R,X),m.mouse[0],m.mouse[1]),m.extent,i));function D(){m.wheel=null,m.end()}}function U(h,..._){if(v||!t.apply(this,arguments))return;var m=h.currentTarget,R=z(this,_,!0).event(h),X=at(h.view).on("mousemove.zoom",p,!0).on("mouseup.zoom",Y,!0),S=Yt(h,m),D=h.clientX,f=h.clientY;Do(h.view),Me(h),R.mouse=[S,this.__zoom.invert(S)],ue(this),R.start();function p(w){if(Ot(w),!R.moved){var x=w.clientX-D,b=w.clientY-f;R.moved=x*x+b*b>L}R.event(w).zoom("mouse",r(O(R.that.__zoom,R.mouse[0]=Yt(w,m),R.mouse[1]),R.extent,i))}function Y(w){X.on("mousemove.zoom mouseup.zoom",null),Bo(w.view,R.moved),Ot(w),R.event(w).end()}}function j(h,..._){if(t.apply(this,arguments)){var m=this.__zoom,R=Yt(h.changedTouches?h.changedTouches[0]:h,this),X=m.invert(R),S=m.k*(h.shiftKey?.5:2),D=r(O(Q(m,S),R,X),e.apply(this,_),i);Ot(h),c>0?at(this).transition().duration(c).call(V,D,R,h):at(this).call(C.transform,D,R,h)}}function P(h,..._){if(t.apply(this,arguments)){var m=h.touches,R=m.length,X=z(this,_,h.changedTouches.length===R).event(h),S,D,f,p;for(Me(h),D=0;D<R;++D)f=m[D],p=Yt(f,this),p=[p,this.__zoom.invert(p),f.identifier],X.touch0?!X.touch1&&X.touch0[2]!==p[2]&&(X.touch1=p,X.taps=0):(X.touch0=p,S=!0,X.taps=1+!!u);u&&(u=clearTimeout(u)),S&&(X.taps<2&&(d=p[0],u=setTimeout(function(){u=null},g)),ue(this),X.start())}}function K(h,..._){if(this.__zooming){var m=z(this,_).event(h),R=h.changedTouches,X=R.length,S,D,f,p;for(Ot(h),S=0;S<X;++S)D=R[S],f=Yt(D,this),m.touch0&&m.touch0[2]===D.identifier?m.touch0[0]=f:m.touch1&&m.touch1[2]===D.identifier&&(m.touch1[0]=f);if(D=m.that.__zoom,m.touch1){var Y=m.touch0[0],w=m.touch0[1],x=m.touch1[0],b=m.touch1[1],y=(y=x[0]-Y[0])*y+(y=x[1]-Y[1])*y,E=(E=b[0]-w[0])*E+(E=b[1]-w[1])*E;D=Q(D,Math.sqrt(y/E)),f=[(Y[0]+x[0])/2,(Y[1]+x[1])/2],p=[(w[0]+b[0])/2,(w[1]+b[1])/2]}else if(m.touch0)f=m.touch0[0],p=m.touch0[1];else return;m.zoom("touch",r(O(D,f,p),m.extent,i))}}function tt(h,..._){if(this.__zooming){var m=z(this,_).event(h),R=h.changedTouches,X=R.length,S,D;for(Me(h),v&&clearTimeout(v),v=setTimeout(function(){v=null},g),S=0;S<X;++S)D=R[S],m.touch0&&m.touch0[2]===D.identifier?delete m.touch0:m.touch1&&m.touch1[2]===D.identifier&&delete m.touch1;if(m.touch1&&!m.touch0&&(m.touch0=m.touch1,delete m.touch1),m.touch0)m.touch0[1]=this.__zoom.invert(m.touch0[0]);else if(m.end(),m.taps===2&&(D=Yt(D,this),Math.hypot(d[0]-D[0],d[1]-D[1])<$)){var f=at(this).on("dblclick.zoom");f&&f.apply(this,arguments)}}}return C.wheelDelta=function(h){return arguments.length?(n=typeof h=="function"?h:ie(+h),C):n},C.filter=function(h){return arguments.length?(t=typeof h=="function"?h:ie(!!h),C):t},C.touchable=function(h){return arguments.length?(o=typeof h=="function"?h:ie(!!h),C):o},C.extent=function(h){return arguments.length?(e=typeof h=="function"?h:ie([[+h[0][0],+h[0][1]],[+h[1][0],+h[1][1]]]),C):e},C.scaleExtent=function(h){return arguments.length?(a[0]=+h[0],a[1]=+h[1],C):[a[0],a[1]]},C.translateExtent=function(h){return arguments.length?(i[0][0]=+h[0][0],i[1][0]=+h[1][0],i[0][1]=+h[0][1],i[1][1]=+h[1][1],C):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},C.constrain=function(h){return arguments.length?(r=h,C):r},C.duration=function(h){return arguments.length?(c=+h,C):c},C.interpolate=function(h){return arguments.length?(l=h,C):l},C.on=function(){var h=s.on.apply(s,arguments);return h===s?C:h},C.clickDistance=function(h){return arguments.length?(L=(h=+h)*h,C):Math.sqrt(L)},C.tapDistance=function(h){return arguments.length?($=+h,C):$},C}const At={horizontalExtension:30,minEdgeDistance:50,minVerticalSegment:20,loopRadius:40,edgeSpacing:80,cornerRadius:15,arrowWidth:10,arrowHeight:6,labelHeight:15,labelFontSize:10,labelPadding:6,labelCornerRadius:4,nodeSpacing:50,nearlyHorizontalThreshold:5,nearlyAlignedThreshold:30};function $r(t){return{...At,...t}}function Ea(t,e,r){const i=(t.clientWidth||800)/e,c=32/(r*i);return Math.max(3,c)}function Fe(t,e,r){const n=t.node();if(!n)return;t.text(r);let o=n.getComputedTextLength();if(o<=e)return;const a="...";let i=0,c=r.length;for(;i<c;){const l=Math.floor((i+c+1)/2);t.text(r.slice(0,l)+a),o=n.getComputedTextLength(),o<=e?i=l:c=l-1}i>0?t.text(r.slice(0,i)+a):t.text(a)}class Xr{constructor(e,r,n,o,a){this.type=e,this._gvid=r,this.name=n,this._draw_=o,this._ldraw_=a}}class Ur extends Xr{constructor({_gvid:e,name:r,_draw_:n,_ldraw_:o,bb:a,pos:i,width:c,height:l,label:s}){super("node",e,r,n,o),this.virtualNode=!1,this.bb=a,this.pos=i,this.width=c,this.height=l,this.label=s}getPosition(){if(!this.pos)return null;const[e,r]=this.pos.split(",").map(Number);return[e,r]}getWidthPoints(){return parseFloat(this.width||"1")*72}getHeightPoints(){return parseFloat(this.height||"0.5")*72}getBounds(){const e=this.getPosition();if(!e)return null;const[r,n]=e,o=this.getWidthPoints(),a=this.getHeightPoints();return{x:r-o/2,y:n-a/2,width:o,height:a}}leftIn(){const e=this.getBounds();return e?{x:e.x,y:Math.trunc(e.y+e.height/4)}:null}leftOut(){const e=this.getBounds();return e?{x:e.x,y:Math.trunc(e.y+e.height/4*3)}:null}rightOut(){const e=this.getBounds();return e?{x:e.x+e.width,y:Math.trunc(e.y+e.height/4)}:null}rightIn(){const e=this.getBounds();return e?{x:e.x+e.width,y:Math.trunc(e.y+e.height/4*3)}:null}}class ba extends Xr{constructor({_gvid:e,name:r,_draw_:n,_ldraw_:o,_hdraw_:a,_tdraw_:i,head:c,tail:l,label:s}){if(super("edge",e,r,n,o),this.isBaseEdge=!1,this.depth=0,this.baseOffset=0,this.midY=0,this._hdraw_=a,this._tdraw_=i,this.head=c,this.tail=l,this.label=s,s){const u=s.match(/\[(\d+)\]/);u&&u[1]&&(this.edgeId=parseInt(u[1],10))}}setNodes(e,r){this.sourceNode=e,this.targetNode=r}getDirection(){if(!this.sourceNode||!this.targetNode)return null;const e=this.sourceNode.getPosition(),r=this.targetNode.getPosition();return!e||!r?null:this.sourceNode._gvid===this.targetNode._gvid?"self":e[0]<r[0]?"right":"left"}getStartPoint(){if(!this.sourceNode)return null;const e=this.getDirection();if(!e)return null;switch(e){case"right":return this.sourceNode.rightOut();case"left":return this.sourceNode.leftOut();case"self":return this.sourceNode.leftOut()}}getEndPoint(){if(!this.targetNode)return null;const e=this.getDirection();if(!e)return null;switch(e){case"right":return this.targetNode.leftIn();case"left":return this.targetNode.rightIn();case"self":return this.targetNode.rightIn()}}getLabelText(){if(this.label)return this.label.replace(/<[^>]*>/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&nbsp;/g," ").replace(/\s+/g," ").trim()||null;if(this._ldraw_){const e=[];if(this._ldraw_.forEach(r=>{r.op==="T"&&r.text&&e.push(r.text)}),e.length>0)return e.join(" ")}return null}getColor(){const e="#9AA4B2";if(this._draw_){for(const r of this._draw_)if(r.op==="c"&&r.color)return r.color}if(this._hdraw_){for(const r of this._hdraw_)if(r.op==="c"&&r.color)return r.color}return e}}class Sr{constructor(e,r=0){this.index=e,this.aboveY=r,this.belowY=r}allocateAbove(e){return this.aboveY-=e,this.aboveY}allocateBelow(e){const r=this.belowY;return this.belowY+=e,r}getRange(){return{above:this.aboveY,below:this.belowY}}}class Ma extends Sr{constructor(e,r=0){super(e,r),this.nodes=[]}addNode(e,r=!0){if(this.nodes.push(e),!r)return;const n=e.getPosition();if(n){const o=e.height?parseFloat(e.height)*72:40,a=n[1]-o/2,i=n[1]+o/2;this.aboveY=Math.min(this.aboveY,a),this.belowY=Math.max(this.belowY,i)}}}class Fa extends Sr{constructor(e,r,n=0){super(Math.min(e,r),n),this.edges=[],this.baseEdgeIndex=-1,this.sourceColIndex=e,this.targetColIndex=r}addEdge(e){this.edges.push(e)}setBaseEdge(e,r){this.baseEdge=e,this.baseEdgeIndex=r??this.edges.indexOf(e)}getKey(){const e=Math.min(this.sourceColIndex,this.targetColIndex),r=Math.max(this.sourceColIndex,this.targetColIndex);return`${e}-${r}`}}function Ir(t){if(!t)return[];const e=[],r=/<TD[^>]*>(.*?)<\/TD>/gi;let n;for(;(n=r.exec(t))!==null;){let o=n[1];o=o.replace(/<[^>]+>/g,"").trim(),o&&e.push(o)}if(e.length===0){const o=t.replace(/<[^>]+>/g,"").trim();o&&e.push(o)}return e}function Ca(t){const e=at(t).select("svg"),r=e.select("g#graph0");if(e.empty()||r.empty()){console.warn("SVG or graph group not found");return}e.attr("width","100%").attr("height","100%");const n=Ge().scaleExtent([.1,2]).on("zoom",i=>{r.attr("transform",i.transform.toString())});e.call(n);const o=e.node(),a=r.node();if(o&&a){const i=a.getBBox(),c=o.parentElement;if(c){const l=c.clientWidth,s=c.clientHeight,u=i.width,d=i.height,v=i.x+u/2,g=i.y+d/2,F=.8/Math.max(u/l,d/s),L=[l/2-F*v,s/2-F*g];e.call(n.transform,Ft.translate(L[0],L[1]).scale(F))}}}function _a(t){if(!t.sourceNode)return null;const e=t.sourceNode.getPosition();if(!e)return null;const n=50/72,o=new Ur({_gvid:-1e3-t._gvid,name:`virtual_edge_${t._gvid}`,label:t.label,pos:`${e[0]},${e[1]}`,width:"0.5",height:n.toString()});return o.virtualNode=!0,o.edge=t,t.virtualNode=o,o}function Ra(t,e,r){const n=e.nodes,o=n.findIndex(a=>a._gvid===r._gvid);if(o===-1){n.push(t);return}n.splice(o,0,t)}function La(t,e){const n=[],o=new Map;t.forEach(s=>{const u=s.getPosition();if(!u)return;const d=u[0];let v=n.findIndex(g=>Math.abs(d-g)<=20);v===-1&&(v=n.length,n.push(d)),o.set(s._gvid,v)});const a=n.map((s,u)=>({x:s,i:u})).sort((s,u)=>s.x-u.x).map((s,u)=>({oldIndex:s.i,newIndex:u})),i=new Map;a.forEach(({oldIndex:s,newIndex:u})=>{i.set(s,u)});for(const[s,u]of o)o.set(s,i.get(u)??u);const c=new Map;t.forEach(s=>{const u=o.get(s._gvid);u!==void 0&&(c.has(u)||c.set(u,new Ma(u,0)),c.get(u).addNode(s,!1))}),e.forEach(s=>{if(!s.sourceNode||!s.targetNode||s.sourceNode._gvid!==s.targetNode._gvid)return;const u=o.get(s.sourceNode._gvid);if(u===void 0)return;const d=c.get(u);if(!d)return;const v=_a(s);v&&Ra(v,d,s.sourceNode)});const l=new Map;return e.forEach(s=>{if(!s.sourceNode||!s.targetNode)return;const u=o.get(s.sourceNode._gvid),d=o.get(s.targetNode._gvid);if(u===void 0||d===void 0)return;s.depth=Math.abs(d-u)-1,s.depth<0&&(s.depth=0);const v=Math.min(u,d),g=Math.max(u,d),F=`${v}-${g}`;l.has(F)||l.set(F,new Fa(u,d,0)),l.get(F).addEdge(s)}),l.forEach(s=>{s.edges.sort((u,d)=>{const v=u.getStartPoint(),g=u.getEndPoint(),F=v&&g?(v.y+g.y)/2:0,L=d.getStartPoint(),$=d.getEndPoint();return(L&&$?(L.y+$.y)/2:0)-F})}),{nodeColumnMap:o,nodeColumns:c,edgeColumns:l}}function Ya(t,e){t.forEach(r=>{if(r.nodes.length===0)return;let n=!0;r.nodes.forEach(o=>{const a=o.getPosition();if(!a)return;const i=o.height?parseFloat(o.height)*72:40,c=e-a[1],l=c-i/2,s=c+i/2;n?(r.aboveY=l,r.belowY=s,n=!1):(r.aboveY=Math.min(r.aboveY,l),r.belowY=Math.max(r.belowY,s))})})}function Da(t,e){t.length!==0&&e.forEach(r=>{const n=r.edges;if(n.length===0)return;const o=n.filter(d=>d.depth===0);if(o.length===0)return;const a=Math.floor(o.length/2),i=o[a];i.isBaseEdge=!0,i.baseDirection=void 0;const c=n.indexOf(i);r.setBaseEdge(i,c);const l=i.getStartPoint(),s=i.getEndPoint(),u=l&&s?(l.y+s.y)/2:0;o.forEach((d,v)=>{if(d===i)return;const g=d.getStartPoint(),F=d.getEndPoint();(g&&F?(g.y+F.y)/2:0)>u?d.baseDirection="above":d.baseDirection="below"})})}function ae(t,e,r,n=At){const o=t.getStartPoint(),a=t.getEndPoint(),i=t.getDirection();if(!o||!a||!i||i==="self")return;const c={x:o.x,y:e-o.y},l={x:a.x,y:e-a.y};let s={x:l.x,y:l.y};i==="right"?s={x:l.x-n.arrowWidth,y:l.y}:i==="left"&&(s={x:l.x+n.arrowWidth,y:l.y});const u=n.horizontalExtension,d=n.minEdgeDistance,v=n.minVerticalSegment,g=V=>{if(V.length<2)return V;const z=[V[0]];for(let et=1;et<V.length;et++){const B=z[z.length-1];(Math.abs(V[et].x-B.x)>.1||Math.abs(V[et].y-B.y)>.1)&&z.push(V[et])}return z};let F;const L=t.baseDirection===void 0;t.baseDirection==="above"?F=Math.min(c.y,s.y):t.baseDirection==="below"?F=Math.max(c.y,s.y):F=(c.y+s.y)/2;let $=F;if(!L&&r&&r.midY!==void 0){if(t.baseDirection==="above"){const V=r.midY-d;$>V&&($=V)}else if(t.baseDirection==="below"){const V=r.midY+d;$<V&&($=V)}}const C=Math.abs(c.y-s.y)<5,Q=(V,z)=>{const et=Math.abs(c.y-z),B=Math.abs(z-s.y),U=i==="right"?c.x+u:c.x-u,j=i==="right"?s.x-u:s.x+u;let P=[],K=z;switch(V){case"straight":if(C){const _=(c.y+s.y)/2;Math.abs(z-_)<v?(P=[c,s],K=_):(P=[c,{x:U,y:c.y},{x:U,y:z},{x:j,y:z},{x:j,y:s.y},s],K=z)}else return null;break;case"2seg":et<B?Math.abs(z-c.y)<v?(P=[c,{x:s.x,y:c.y},s],K=c.y):(P=[c,{x:U,y:c.y},{x:U,y:z},{x:j,y:z},{x:j,y:s.y},s],K=z):Math.abs(z-s.y)<v?(P=[c,{x:U,y:c.y},{x:U,y:s.y},s],K=s.y):(P=[c,{x:U,y:c.y},{x:U,y:z},{x:j,y:z},{x:j,y:s.y},s],K=z);break;case"3seg":const h=z;P=[c,{x:U,y:c.y},{x:U,y:h},{x:j,y:h},{x:j,y:s.y},s],K=h;break;case"4seg":P=[c,{x:U,y:c.y},{x:U,y:z},{x:j,y:z},s],K=z;break;case"5seg":if(et<v)P=[c,{x:U,y:c.y},{x:j,y:z},{x:j,y:s.y},s],K=z;else if(B<v)P=[c,{x:U,y:c.y},{x:U,y:z},{x:j,y:z},s],K=z;else return null;break;case"6seg":P=[c,{x:U,y:c.y},{x:U,y:z},{x:j,y:z},{x:j,y:s.y},s],K=z;break}const tt=g(P);return tt.length>0?{points:tt,actualMidY:K}:null};let O;L?O=C?["straight","3seg"]:["3seg"]:O=C?["straight","3seg","4seg","5seg","6seg"]:["3seg","4seg","5seg","6seg"];for(const V of O){const z=Q(V,$);if(z)return{midY:z.actualMidY,points:z.points}}const Z=Q("6seg",$);return Z?{midY:Z.actualMidY,points:Z.points}:void 0}function sr(t,e){if(t.length<2)return"";if(e===0||t.length===2)return`M${t[0].x},${t[0].y} ${t.slice(1).map(o=>`L${o.x},${o.y}`).join(" ")}`;const r=[];r.push(`M${t[0].x},${t[0].y}`);for(let o=1;o<t.length-1;o++){const a=t[o-1],i=t[o],c=t[o+1],l=Math.sqrt((i.x-a.x)**2+(i.y-a.y)**2),s=Math.sqrt((c.x-i.x)**2+(c.y-i.y)**2),u=Math.min(l,s)/2,d=Math.min(e,u);if(d>0){const v=d/l,g=d/s,F={x:i.x-(i.x-a.x)*v,y:i.y-(i.y-a.y)*v},L={x:i.x+(c.x-i.x)*g,y:i.y+(c.y-i.y)*g};r.push(`L${F.x},${F.y}`),r.push(`Q${i.x},${i.y} ${L.x},${L.y}`)}else r.push(`L${i.x},${i.y}`)}const n=t[t.length-1];return r.push(`L${n.x},${n.y}`),r.join(" ")}function Ba(t,e,r,n=At,o=!0,a=0,i=1/0,c,l,s,u,d,v,g,F=!1){var z,et;const L=v!=null&&t.edgeId===v,$=t.getColor(),C=e.append("g").attr("class",L?"edge selected":"edge").attr("id",`edge_${t._gvid}`).attr("data-edge-id",t.edgeId!==void 0?String(t.edgeId):"").attr("data-is-base",t.isBaseEdge?"true":"false").attr("data-color",$),Q=t.getStartPoint(),O=t.getEndPoint(),Z=t.getDirection();console.log(`Edge ${t._gvid}: direction=${Z}, isBase=${t.isBaseEdge}, depth=${t.depth}`,{start:Q,end:O,sourceNode:(z=t.sourceNode)==null?void 0:z.name,targetNode:(et=t.targetNode)==null?void 0:et.name});const V=n.arrowWidth;if(n.arrowHeight,Q&&O&&Z){const B={x:Q.x,y:r-Q.y},U={x:O.x,y:r-O.y},j={x:U.x,y:U.y};let P={x:U.x,y:U.y};Z==="right"?P={x:U.x-V,y:U.y}:Z==="left"?P={x:U.x+V,y:U.y}:Z==="self"&&(P={x:U.x+V,y:U.y});let K;const tt=n.loopRadius,h=n.horizontalExtension,_=n.cornerRadius;if(o)if(Z==="self")if(t.virtualNode){const f=t.virtualNode.getPosition();if(f){const p=r-f[1];t.midY=p;const Y=[B,{x:B.x-h,y:B.y},{x:B.x-h,y:p},{x:P.x+h,y:p},{x:P.x+h,y:P.y},P];K=sr(Y,_)}else{const p=B.x-tt,Y=B.y-tt,w=P.x+tt,x=P.y-tt;K=`M${B.x},${B.y} C${p},${Y} ${w},${x} ${P.x},${P.y}`}}else{const f=B.x-tt,p=B.y-tt,Y=P.x+tt,w=P.y-tt;K=`M${B.x},${B.y} C${f},${p} ${Y},${w} ${P.x},${P.y}`}else{let f;if(t.orthogonalPathPoints&&t.orthogonalPathPoints.length>0)f=t.orthogonalPathPoints;else{const p=Math.abs(B.y-t.midY),Y=Math.abs(t.midY-P.y),w=20,x=p>=w,b=Y>=w,y=Z==="right"?B.x+h:B.x-h,E=Z==="right"?P.x-h:P.x+h;if(f=[],!x&&!b){const M=(B.y+P.y)/2;f.push(B,{x:y,y:M},{x:E,y:M},P)}else x?b?f.push(B,{x:y,y:B.y},{x:y,y:t.midY},{x:E,y:t.midY},{x:E,y:P.y},P):f.push(B,{x:y,y:B.y},{x:y,y:t.midY},{x:E,y:t.midY},P):f.push(B,{x:y,y:t.midY},{x:E,y:t.midY},{x:E,y:P.y},P)}K=sr(f,_)}else if(Z==="self"){const f=B.x-tt,p=B.y-tt,Y=P.x+tt,w=P.y-tt;K=`M${B.x},${B.y} C${f},${p} ${Y},${w} ${P.x},${P.y}`}else{const f=P.x-B.x;P.y-B.y;const p=.4,Y=B.x+f*p,w=B.y,x=P.x-f*p,b=P.y;K=`M${B.x},${B.y} C${Y},${w} ${x},${b} ${P.x},${P.y}`}const m=F&&t.isBaseEdge?"#000000":t.getColor(),R=F&&t.isBaseEdge?4:1.5;C.append("path").attr("d",K).attr("fill","none").attr("stroke","transparent").attr("stroke-width",10).attr("class","edge-hit-area").style("cursor","pointer"),C.append("path").attr("d",K).attr("fill","none").attr("stroke",m).attr("stroke-width",R).attr("class","edge-path").style("pointer-events","none"),C.on("mouseenter",function(){at(this).raise()});const X=12;let S="";Z==="right"?S=`translate(${j.x-X}, ${j.y-X/2})`:Z==="left"?S=`translate(${j.x+X}, ${j.y+X/2}) rotate(180)`:Z==="self"&&(S=`translate(${j.x+X}, ${j.y+X/2}) rotate(180)`),C.append("use").attr("class","edge-arrow").attr("href","#arrow-right").attr("width",X).attr("height",X).attr("transform",S).attr("fill",m).attr("stroke",m).style("stroke-width",0);const D={x:(B.x+P.x)/2,y:t.midY};if(t.label){const p=Ir(t.label).map(st=>st.length>20?st.slice(0,20)+"...":st).join(" "),Y=p.length>60?p.slice(0,60)+"...":p,w=n.labelFontSize,x=w*.6,b=Y.length*x,y=w,E=n.labelPadding,M=16,G=L?16:0,J=t.edgeId!==void 0,nt=J&&t.edgeId>a,q=J&&t.edgeId<i,I=(nt?M:0)+(q?M:0)+G,T=b+E*2+I,N=y+E*2,k=n.labelCornerRadius,H=D.y,ot=D.x,it=st=>at(`g.edge[data-edge-id="${st}"]`),W=12,A=C.append("g").attr("class","label-area");A.append("rect").attr("class","label-bg").attr("x",ot-T/2).attr("y",H-N/2).attr("width",T).attr("height",N).attr("rx",k).attr("ry",k).attr("fill","white").attr("stroke",m).attr("stroke-width",1);const lt=ot-T/2+M/2,yt=ot+T/2-M/2-G,ct=ot+T/2-G/2,te=ot+(nt?M/2:0)-(q?M/2:0)-(L?G/2:0);if(J&&g&&C.style("cursor","pointer").on("click",function(st){st.stopPropagation(),!L&&g(t.edgeId)}),A.append("text").attr("class","label-text").attr("x",te).attr("y",H).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","Inter, Helvetica, Arial").attr("font-size","10px").attr("fill",m).style("pointer-events","none").text(Y),F&&C.append("circle").attr("cx",te).attr("cy",H).attr("r",4).attr("fill","blue").attr("opacity",.8).style("pointer-events","none").attr("class","debug-label-center"),nt){const st=t.edgeId-1,ht=A.append("g").attr("class","nav-btn-group prev-btn-group");ht.append("rect").attr("class","nav-btn-area prev-btn-area").attr("x",ot-T/2).attr("y",H-N/2).attr("width",M).attr("height",N).attr("fill","transparent").attr("rx",k).style("cursor","pointer").style("pointer-events","all"),ht.append("use").attr("class","nav-icon prev-icon").attr("href","#nav-left").attr("x",lt-W/2).attr("y",H-W/2).attr("width",W).attr("height",W).attr("fill","#888"),ht.on("click",function(mt){mt.stopPropagation();const Ct=it(st);if(!Ct.empty()){if(c&&l&&s&&u&&d){const $t=Ct.node();if($t){const _t=at($t).select(".label-text").node();let Rt,Lt;if(_t)Rt=parseFloat(_t.getAttribute("x")||"0"),Lt=parseFloat(_t.getAttribute("y")||"0");else{const Xt=$t.getBBox();Rt=Xt.x+Xt.width/2,Lt=Xt.y+Xt.height/2}const kt=s.clientWidth,zt=1.2*u/kt,jt=u/2-Rt*zt,xe=d/2-Lt*zt;l.transition().duration(500).call(c.transform,Ft.translate(jt,xe).scale(zt))}}g&&g(st)}})}if(q&&t.edgeId!==void 0){const st=t.edgeId+1,ht=L?yt:ot+T/2-M/2,mt=A.append("g").attr("class","nav-btn-group next-btn-group");mt.append("rect").attr("class","nav-btn-area next-btn-area").attr("x",ot+T/2-M-G).attr("y",H-N/2).attr("width",M).attr("height",N).attr("fill","transparent").attr("rx",k).style("cursor","pointer").style("pointer-events","all"),mt.append("use").attr("class","nav-icon next-icon").attr("href","#nav-right").attr("x",ht-W/2).attr("y",H-W/2).attr("width",W).attr("height",W).attr("fill","#888"),mt.on("click",function(Ct){Ct.stopPropagation();const $t=it(st);if(!$t.empty()){if(c&&l&&s&&u&&d){const _t=$t.node();if(_t){const Rt=at(_t).select(".label-text").node();let Lt,kt;if(Rt)Lt=parseFloat(Rt.getAttribute("x")||"0"),kt=parseFloat(Rt.getAttribute("y")||"0");else{const ee=_t.getBBox();Lt=ee.x+ee.width/2,kt=ee.y+ee.height/2}const zt=s.clientWidth,jt=1.2*u/zt,xe=u/2-Lt*jt,Xt=d/2-kt*jt;l.transition().duration(500).call(c.transform,Ft.translate(xe,Xt).scale(jt))}}g&&g(st)}})}L&&J&&g&&C.append("text").attr("class","close-btn").attr("x",ct).attr("y",H).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","Arial").attr("font-size","12px").attr("font-weight","bold").attr("fill","#888").style("cursor","pointer").text("✕").on("mouseenter",function(){at(this).attr("fill","#EF4444")}).on("mouseleave",function(){at(this).attr("fill","#888")}).on("click",function(st){st.stopPropagation(),g(null)})}else t._ldraw_&&t._ldraw_.forEach(f=>{if(f.op==="T"&&f.text){const p=f.size||10,Y=p*.6,w=f.text.length*Y,x=p,b=6,y=w+b*2,E=x+b*2,M=4,G=D.y;C.append("rect").attr("x",D.x-y/2).attr("y",G-E/2).attr("width",y).attr("height",E).attr("rx",M).attr("ry",M).attr("fill","white").attr("stroke","#d0d0d0").attr("stroke-width",.5),C.append("text").attr("x",D.x).attr("y",G).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family",f.face||"Inter, Helvetica, Arial").attr("font-size",`${p}px`).attr("fill",f.color||"#666").text(f.text)}});if(F){let f;t.depth===0?f=`d:0 dir:${t.baseDirection||"base"} off:${t.baseOffset} id:${t._gvid}`:f=`d:${t.depth} dir:${t.baseDirection||"?"} midY:${Math.round(t.midY)} id:${t._gvid}`,C.append("text").attr("x",D.x).attr("y",D.y+15).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","monospace").attr("font-size","9px").attr("fill","#999").text(f)}}else t._draw_&&t._draw_.forEach(B=>{if(B.op==="b"&&B.points){const U=B.points.map(([P,K])=>[P,r-K]),j=`M${U[0][0]},${U[0][1]} C${U.slice(1).map(P=>`${P[0]},${P[1]}`).join(" ")}`;C.append("path").attr("d",j).attr("fill","none").attr("stroke",B.color||"#9AA4B2").attr("stroke-width",2)}}),t._hdraw_&&t._hdraw_.forEach(B=>{if(B.op==="P"&&B.points){const U=B.points.map(([j,P])=>[j,r-P]);C.append("polygon").attr("points",U.map(j=>j.join(",")).join(" ")).attr("fill",B.color||"#9AA4B2")}}),t._ldraw_&&Dt(C,t._ldraw_,r)}function kr(t,e,r,n,o=!0,a=At,i=!0,c=14,l=!1,s,u,d,v,g){var D;t.innerHTML="";const F=((D=e.bb)==null?void 0:D.split(",").map(Number))||[0,0,1e3,800];let[,,L,$]=F;const C=at(t).append("svg").attr("width","100%").attr("height","100%").attr("viewBox",`0 0 ${L} ${$}`).style("background","white");C.append("defs").html(`
2
2
  <style>
3
3
  @keyframes selected-pulse {
4
4
  0%, 100% {
package/dist/index.mjs CHANGED
@@ -2,10 +2,10 @@ import { useRef as lt, useState as He, useCallback as be, useEffect as Re, forwa
2
2
  import { jsx as Mt, jsxs as ue } from "react/jsx-runtime";
3
3
  const Sa = 500;
4
4
  function ka(t) {
5
- return JSON.stringify(JSON.stringify(t));
5
+ return JSON.stringify(JSON.stringify(t)).slice(1, -1);
6
6
  }
7
7
  function za(t) {
8
- return JSON.parse(JSON.parse(t));
8
+ return JSON.parse(`"${t}"`);
9
9
  }
10
10
  var Tr = { value: () => {
11
11
  } };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quixotic-gol",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",