gitopo 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +110 -0
  3. package/bin/gitopo.js +20 -0
  4. package/dist/renderer/assets/index-B-xnAFkZ.css +1 -0
  5. package/dist/renderer/assets/index-B4NR76vm.css +1 -0
  6. package/dist/renderer/assets/index-B8-bMEZL.js +3 -0
  7. package/dist/renderer/assets/index-BSM6CD5c.js +3 -0
  8. package/dist/renderer/assets/index-Biwf0g5L.js +3 -0
  9. package/dist/renderer/assets/index-BkSteF7v.js +3 -0
  10. package/dist/renderer/assets/index-Bu2Is4Gi.js +3 -0
  11. package/dist/renderer/assets/index-BuunUFeT.js +3 -0
  12. package/dist/renderer/assets/index-BztqQcTT.js +3 -0
  13. package/dist/renderer/assets/index-C5GvfFhL.js +3 -0
  14. package/dist/renderer/assets/index-C5pqhkpE.css +1 -0
  15. package/dist/renderer/assets/index-CAjBcm7_.js +3 -0
  16. package/dist/renderer/assets/index-CPhqr81-.css +1 -0
  17. package/dist/renderer/assets/index-CRBk_3U9.js +4 -0
  18. package/dist/renderer/assets/index-CV77y4NX.js +3 -0
  19. package/dist/renderer/assets/index-CX4EqujF.js +3 -0
  20. package/dist/renderer/assets/index-Caevx9so.js +3 -0
  21. package/dist/renderer/assets/index-CbVNESqC.js +3 -0
  22. package/dist/renderer/assets/index-CgV3hEXF.js +3 -0
  23. package/dist/renderer/assets/index-Cgxb7yXH.js +3 -0
  24. package/dist/renderer/assets/index-Cu7Bdfdp.js +3 -0
  25. package/dist/renderer/assets/index-D-4eDZ-q.css +1 -0
  26. package/dist/renderer/assets/index-D3WoIbyB.js +3 -0
  27. package/dist/renderer/assets/index-DATWWeXq.js +3 -0
  28. package/dist/renderer/assets/index-DGVlk6ue.css +1 -0
  29. package/dist/renderer/assets/index-DKxk7KCa.js +3 -0
  30. package/dist/renderer/assets/index-DPD27o55.js +3 -0
  31. package/dist/renderer/assets/index-DaP2KGsB.js +3 -0
  32. package/dist/renderer/assets/index-DeuGEmKM.js +3 -0
  33. package/dist/renderer/assets/index-Dg_WVb0M.js +3 -0
  34. package/dist/renderer/assets/index-Dhbf0Fci.js +3 -0
  35. package/dist/renderer/assets/index-DnUHDinm.css +1 -0
  36. package/dist/renderer/assets/index-DuNCgxuJ.js +3 -0
  37. package/dist/renderer/assets/index-HYzjpgUI.js +3 -0
  38. package/dist/renderer/assets/index-Mn_-m7Tt.js +3 -0
  39. package/dist/renderer/assets/index-N_FqOAes.js +3 -0
  40. package/dist/renderer/assets/index-TVFDuiMT.js +3 -0
  41. package/dist/renderer/assets/index-UF9gobFY.css +1 -0
  42. package/dist/renderer/assets/index-V7JII7CO.js +3 -0
  43. package/dist/renderer/assets/index-jDaMuPPI.css +1 -0
  44. package/dist/renderer/assets/index-kUku5Va6.js +3 -0
  45. package/dist/renderer/index.html +38 -0
  46. package/docs/screenshot.png +0 -0
  47. package/package.json +57 -0
  48. package/src/main/index.js +85 -0
  49. package/src/main/preload.js +16 -0
@@ -0,0 +1,3 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var je={value:()=>{}};function Ee(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new yt(n)}function yt(t){this._=t}function tn(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}yt.prototype=Ee.prototype={constructor:yt,on:function(t,e){var n=this._,r=tn(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=en(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(t=r[o]).type)n[i]=ce(n[i],t.name,e);else if(e==null)for(i in n)n[i]=ce(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new yt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function en(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function ce(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=je,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Ht="http://www.w3.org/1999/xhtml";const le={svg:"http://www.w3.org/2000/svg",xhtml:Ht,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function At(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),le.hasOwnProperty(e)?{space:le[e],local:t}:t}function nn(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Ht&&e.documentElement.namespaceURI===Ht?e.createElement(t):e.createElementNS(n,t)}}function rn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ne(t){var e=At(t);return(e.local?rn:nn)(e)}function on(){}function Wt(t){return t==null?on:function(){return this.querySelector(t)}}function sn(t){typeof t!="function"&&(t=Wt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=new Array(s),c,l,u=0;u<s;++u)(c=o[u])&&(l=t.call(c,c.__data__,u,o))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new N(r,this._parents)}function an(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function cn(){return[]}function Ae(t){return t==null?cn:function(){return this.querySelectorAll(t)}}function ln(t){return function(){return an(t.apply(this,arguments))}}function un(t){typeof t=="function"?t=ln(t):t=Ae(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s=e[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(r.push(t.call(c,c.__data__,l,s)),i.push(c));return new N(r,i)}function Ce(t){return function(){return this.matches(t)}}function ke(t){return function(e){return e.matches(t)}}var fn=Array.prototype.find;function hn(t){return function(){return fn.call(this.children,t)}}function pn(){return this.firstElementChild}function dn(t){return this.select(t==null?pn:hn(typeof t=="function"?t:ke(t)))}var gn=Array.prototype.filter;function mn(){return Array.from(this.children)}function wn(t){return function(){return gn.call(this.children,t)}}function yn(t){return this.selectAll(t==null?mn:wn(typeof t=="function"?t:ke(t)))}function _n(t){typeof t!="function"&&(t=Ce(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new N(r,this._parents)}function Re(t){return new Array(t.length)}function xn(){return new N(this._enter||this._groups.map(Re),this._parents)}function vt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}vt.prototype={constructor:vt,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 vn(t){return function(){return t}}function bn(t,e,n,r,i,o){for(var s=0,a,c=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new vt(t,o[s]);for(;s<c;++s)(a=e[s])&&(i[s]=a)}function $n(t,e,n,r,i,o,s){var a,c,l=new Map,u=e.length,h=o.length,d=new Array(u),g;for(a=0;a<u;++a)(c=e[a])&&(d[a]=g=s.call(c,c.__data__,a,e)+"",l.has(g)?i[a]=c:l.set(g,c));for(a=0;a<h;++a)g=s.call(t,o[a],a,o)+"",(c=l.get(g))?(r[a]=c,c.__data__=o[a],l.delete(g)):n[a]=new vt(t,o[a]);for(a=0;a<u;++a)(c=e[a])&&l.get(d[a])===c&&(i[a]=c)}function Sn(t){return t.__data__}function En(t,e){if(!arguments.length)return Array.from(this,Sn);var n=e?$n:bn,r=this._parents,i=this._groups;typeof t!="function"&&(t=vn(t));for(var o=i.length,s=new Array(o),a=new Array(o),c=new Array(o),l=0;l<o;++l){var u=r[l],h=i[l],d=h.length,g=Nn(t.call(u,u&&u.__data__,l,r)),m=g.length,y=a[l]=new Array(m),v=s[l]=new Array(m),Rt=c[l]=new Array(d);n(u,h,y,v,Rt,g,e);for(var M=0,H=0,A,ut;M<m;++M)if(A=y[M]){for(M>=H&&(H=M+1);!(ut=v[H])&&++H<m;);A._next=ut||null}}return s=new N(s,r),s._enter=a,s._exit=c,s}function Nn(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function An(){return new N(this._exit||this._groups.map(Re),this._parents)}function Cn(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function kn(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var l=n[c],u=r[c],h=l.length,d=a[c]=new Array(h),g,m=0;m<h;++m)(g=l[m]||u[m])&&(d[m]=g);for(;c<i;++c)a[c]=n[c];return new N(a,this._parents)}function Rn(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function Mn(t){t||(t=Bn);function e(h,d){return h&&d?t(h.__data__,d.__data__):!h-!d}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,c=i[o]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(e)}return new N(i,this._parents).order()}function Bn(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Tn(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function In(){return Array.from(this)}function On(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function Pn(){let t=0;for(const e of this)++t;return t}function Xn(){return!this.node()}function Fn(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function Hn(t){return function(){this.removeAttribute(t)}}function Ln(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Yn(t,e){return function(){this.setAttribute(t,e)}}function Dn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function qn(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Vn(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function zn(t,e){var n=At(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Ln:Hn:typeof e=="function"?n.local?Vn:qn:n.local?Dn:Yn)(n,e))}function Me(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Un(t){return function(){this.style.removeProperty(t)}}function Kn(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Wn(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Gn(t,e,n){return arguments.length>1?this.each((e==null?Un:typeof e=="function"?Wn:Kn)(t,e,n??"")):G(this.node(),t)}function G(t,e){return t.style.getPropertyValue(e)||Me(t).getComputedStyle(t,null).getPropertyValue(e)}function Jn(t){return function(){delete this[t]}}function Qn(t,e){return function(){this[t]=e}}function Zn(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function jn(t,e){return arguments.length>1?this.each((e==null?Jn:typeof e=="function"?Zn:Qn)(t,e)):this.node()[t]}function Be(t){return t.trim().split(/^|\s+/)}function Gt(t){return t.classList||new Te(t)}function Te(t){this._node=t,this._names=Be(t.getAttribute("class")||"")}Te.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 Ie(t,e){for(var n=Gt(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Oe(t,e){for(var n=Gt(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function tr(t){return function(){Ie(this,t)}}function er(t){return function(){Oe(this,t)}}function nr(t,e){return function(){(e.apply(this,arguments)?Ie:Oe)(this,t)}}function rr(t,e){var n=Be(t+"");if(arguments.length<2){for(var r=Gt(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?nr:e?tr:er)(n,e))}function ir(){this.textContent=""}function or(t){return function(){this.textContent=t}}function sr(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function ar(t){return arguments.length?this.each(t==null?ir:(typeof t=="function"?sr:or)(t)):this.node().textContent}function cr(){this.innerHTML=""}function lr(t){return function(){this.innerHTML=t}}function ur(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function fr(t){return arguments.length?this.each(t==null?cr:(typeof t=="function"?ur:lr)(t)):this.node().innerHTML}function hr(){this.nextSibling&&this.parentNode.appendChild(this)}function pr(){return this.each(hr)}function dr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gr(){return this.each(dr)}function mr(t){var e=typeof t=="function"?t:Ne(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function wr(){return null}function yr(t,e){var n=typeof t=="function"?t:Ne(t),r=e==null?wr:typeof e=="function"?e:Wt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function _r(){var t=this.parentNode;t&&t.removeChild(this)}function xr(){return this.each(_r)}function vr(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function br(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function $r(t){return this.select(t?br:vr)}function Sr(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Er(t){return function(e){t.call(this,e,this.__data__)}}function Nr(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Ar(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function Cr(t,e,n){return function(){var r=this.__on,i,o=Er(e);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function kr(t,e,n){var r=Nr(t+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(i=0,u=a[c];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?Cr:Ar,i=0;i<o;++i)this.each(a(r[i],e,n));return this}function Pe(t,e,n){var r=Me(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Rr(t,e){return function(){return Pe(this,t,e)}}function Mr(t,e){return function(){return Pe(this,t,e.apply(this,arguments))}}function Br(t,e){return this.each((typeof e=="function"?Mr:Rr)(t,e))}function*Tr(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var Xe=[null];function N(t,e){this._groups=t,this._parents=e}function ct(){return new N([[document.documentElement]],Xe)}function Ir(){return this}N.prototype=ct.prototype={constructor:N,select:sn,selectAll:un,selectChild:dn,selectChildren:yn,filter:_n,data:En,enter:xn,exit:An,join:Cn,merge:kn,selection:Ir,order:Rn,sort:Mn,call:Tn,nodes:In,node:On,size:Pn,empty:Xn,each:Fn,attr:zn,style:Gn,property:jn,classed:rr,text:ar,html:fr,raise:pr,lower:gr,append:mr,insert:yr,remove:xr,clone:$r,datum:Sr,on:kr,dispatch:Br,[Symbol.iterator]:Tr};function ue(t){return typeof t=="string"?new N([[document.querySelector(t)]],[document.documentElement]):new N([[t]],Xe)}function Jt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Fe(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function lt(){}var it=.7,bt=1/it,K="\\s*([+-]?\\d+)\\s*",ot="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",B="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Or=/^#([0-9a-f]{3,8})$/,Pr=new RegExp(`^rgb\\(${K},${K},${K}\\)$`),Xr=new RegExp(`^rgb\\(${B},${B},${B}\\)$`),Fr=new RegExp(`^rgba\\(${K},${K},${K},${ot}\\)$`),Hr=new RegExp(`^rgba\\(${B},${B},${B},${ot}\\)$`),Lr=new RegExp(`^hsl\\(${ot},${B},${B}\\)$`),Yr=new RegExp(`^hsla\\(${ot},${B},${B},${ot}\\)$`),fe={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};Jt(lt,st,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:he,formatHex:he,formatHex8:Dr,formatHsl:qr,formatRgb:pe,toString:pe});function he(){return this.rgb().formatHex()}function Dr(){return this.rgb().formatHex8()}function qr(){return He(this).formatHsl()}function pe(){return this.rgb().formatRgb()}function st(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Or.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?de(e):n===3?new $(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?gt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?gt(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=Pr.exec(t))?new $(e[1],e[2],e[3],1):(e=Xr.exec(t))?new $(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Fr.exec(t))?gt(e[1],e[2],e[3],e[4]):(e=Hr.exec(t))?gt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Lr.exec(t))?we(e[1],e[2]/100,e[3]/100,1):(e=Yr.exec(t))?we(e[1],e[2]/100,e[3]/100,e[4]):fe.hasOwnProperty(t)?de(fe[t]):t==="transparent"?new $(NaN,NaN,NaN,0):null}function de(t){return new $(t>>16&255,t>>8&255,t&255,1)}function gt(t,e,n,r){return r<=0&&(t=e=n=NaN),new $(t,e,n,r)}function Vr(t){return t instanceof lt||(t=st(t)),t?(t=t.rgb(),new $(t.r,t.g,t.b,t.opacity)):new $}function Lt(t,e,n,r){return arguments.length===1?Vr(t):new $(t,e,n,r??1)}function $(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Jt($,Lt,Fe(lt,{brighter(t){return t=t==null?bt:Math.pow(bt,t),new $(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?it:Math.pow(it,t),new $(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new $(V(this.r),V(this.g),V(this.b),$t(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:ge,formatHex:ge,formatHex8:zr,formatRgb:me,toString:me}));function ge(){return`#${q(this.r)}${q(this.g)}${q(this.b)}`}function zr(){return`#${q(this.r)}${q(this.g)}${q(this.b)}${q((isNaN(this.opacity)?1:this.opacity)*255)}`}function me(){const t=$t(this.opacity);return`${t===1?"rgb(":"rgba("}${V(this.r)}, ${V(this.g)}, ${V(this.b)}${t===1?")":`, ${t})`}`}function $t(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function V(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function q(t){return t=V(t),(t<16?"0":"")+t.toString(16)}function we(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new k(t,e,n,r)}function He(t){if(t instanceof k)return new k(t.h,t.s,t.l,t.opacity);if(t instanceof lt||(t=st(t)),!t)return new k;if(t instanceof k)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,c=(o+i)/2;return a?(e===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-e)/a+2:s=(e-n)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new k(s,a,c,t.opacity)}function Ur(t,e,n,r){return arguments.length===1?He(t):new k(t,e,n,r??1)}function k(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Jt(k,Ur,Fe(lt,{brighter(t){return t=t==null?bt:Math.pow(bt,t),new k(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?it:Math.pow(it,t),new k(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,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new $(Pt(t>=240?t-240:t+120,i,r),Pt(t,i,r),Pt(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new k(ye(this.h),mt(this.s),mt(this.l),$t(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=$t(this.opacity);return`${t===1?"hsl(":"hsla("}${ye(this.h)}, ${mt(this.s)*100}%, ${mt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function ye(t){return t=(t||0)%360,t<0?t+360:t}function mt(t){return Math.max(0,Math.min(1,t||0))}function Pt(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Le=t=>()=>t;function Kr(t,e){return function(n){return t+n*e}}function Wr(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Gr(t){return(t=+t)==1?Ye:function(e,n){return n-e?Wr(e,n,t):Le(isNaN(e)?n:e)}}function Ye(t,e){var n=e-t;return n?Kr(t,n):Le(isNaN(t)?e:t)}const _e=(function t(e){var n=Gr(e);function r(i,o){var s=n((i=Lt(i)).r,(o=Lt(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),l=Ye(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=t,r})(1);function F(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Yt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xt=new RegExp(Yt.source,"g");function Jr(t){return function(){return t}}function Qr(t){return function(e){return t(e)+""}}function Zr(t,e){var n=Yt.lastIndex=Xt.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(r=Yt.exec(t))&&(i=Xt.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:F(r,i)})),n=Xt.lastIndex;return n<e.length&&(o=e.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?Qr(c[0].x):Jr(e):(e=c.length,function(l){for(var u=0,h;u<e;++u)a[(h=c[u]).i]=h.x(l);return a.join("")})}var xe=180/Math.PI,Dt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function De(t,e,n,r,i,o){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),t*r<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*xe,skewX:Math.atan(c)*xe,scaleX:s,scaleY:a}}var wt;function jr(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Dt:De(e.a,e.b,e.c,e.d,e.e,e.f)}function ti(t){return t==null||(wt||(wt=document.createElementNS("http://www.w3.org/2000/svg","g")),wt.setAttribute("transform",t),!(t=wt.transform.baseVal.consolidate()))?Dt:(t=t.matrix,De(t.a,t.b,t.c,t.d,t.e,t.f))}function qe(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,h,d,g,m){if(l!==h||u!==d){var y=g.push("translate(",null,e,null,n);m.push({i:y-4,x:F(l,h)},{i:y-2,x:F(u,d)})}else(h||d)&&g.push("translate("+h+e+d+n)}function s(l,u,h,d){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),d.push({i:h.push(i(h)+"rotate(",null,r)-2,x:F(l,u)})):u&&h.push(i(h)+"rotate("+u+r)}function a(l,u,h,d){l!==u?d.push({i:h.push(i(h)+"skewX(",null,r)-2,x:F(l,u)}):u&&h.push(i(h)+"skewX("+u+r)}function c(l,u,h,d,g,m){if(l!==h||u!==d){var y=g.push(i(g)+"scale(",null,",",null,")");m.push({i:y-4,x:F(l,h)},{i:y-2,x:F(u,d)})}else(h!==1||d!==1)&&g.push(i(g)+"scale("+h+","+d+")")}return function(l,u){var h=[],d=[];return l=t(l),u=t(u),o(l.translateX,l.translateY,u.translateX,u.translateY,h,d),s(l.rotate,u.rotate,h,d),a(l.skewX,u.skewX,h,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,h,d),l=u=null,function(g){for(var m=-1,y=d.length,v;++m<y;)h[(v=d[m]).i]=v.x(g);return h.join("")}}}var ei=qe(jr,"px, ","px)","deg)"),ni=qe(ti,", ",")",")"),J=0,tt=0,j=0,Ve=1e3,St,et,Et=0,z=0,Ct=0,at=typeof performance=="object"&&performance.now?performance:Date,ze=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Qt(){return z||(ze(ri),z=at.now()+Ct)}function ri(){z=0}function Nt(){this._call=this._time=this._next=null}Nt.prototype=Ue.prototype={constructor:Nt,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Qt():+n)+(e==null?0:+e),!this._next&&et!==this&&(et?et._next=this:St=this,et=this),this._call=t,this._time=n,qt()},stop:function(){this._call&&(this._call=null,this._time=1/0,qt())}};function Ue(t,e,n){var r=new Nt;return r.restart(t,e,n),r}function ii(){Qt(),++J;for(var t=St,e;t;)(e=z-t._time)>=0&&t._call.call(void 0,e),t=t._next;--J}function ve(){z=(Et=at.now())+Ct,J=tt=0;try{ii()}finally{J=0,si(),z=0}}function oi(){var t=at.now(),e=t-Et;e>Ve&&(Ct-=e,Et=t)}function si(){for(var t,e=St,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:St=n);et=t,qt(r)}function qt(t){if(!J){tt&&(tt=clearTimeout(tt));var e=t-z;e>24?(t<1/0&&(tt=setTimeout(ve,t-at.now()-Ct)),j&&(j=clearInterval(j))):(j||(Et=at.now(),j=setInterval(oi,Ve)),J=1,ze(ve))}}function be(t,e,n){var r=new Nt;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var ai=Ee("start","end","cancel","interrupt"),ci=[],Ke=0,$e=1,Vt=2,_t=3,Se=4,zt=5,xt=6;function kt(t,e,n,r,i,o){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;li(t,n,{name:e,index:r,group:i,on:ai,tween:ci,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Ke})}function Zt(t,e){var n=R(t,e);if(n.state>Ke)throw new Error("too late; already scheduled");return n}function T(t,e){var n=R(t,e);if(n.state>_t)throw new Error("too late; already running");return n}function R(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function li(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Ue(o,0,n.time);function o(l){n.state=$e,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,h,d,g;if(n.state!==$e)return c();for(u in r)if(g=r[u],g.name===n.name){if(g.state===_t)return be(s);g.state===Se?(g.state=xt,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete r[u]):+u<e&&(g.state=xt,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete r[u])}if(be(function(){n.state===_t&&(n.state=Se,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Vt,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Vt){for(n.state=_t,i=new Array(d=n.tween.length),u=0,h=-1;u<d;++u)(g=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++h]=g);i.length=h+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=zt,1),h=-1,d=i.length;++h<d;)i[h].call(t,u);n.state===zt&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=xt,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function ui(t,e){var n=t.__transition,r,i,o=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((r=n[s]).name!==e){o=!1;continue}i=r.state>Vt&&r.state<zt,r.state=xt,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}o&&delete t.__transition}}function fi(t){return this.each(function(){ui(this,t)})}function hi(t,e){var n,r;return function(){var i=T(this,t),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function pi(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=T(this,t),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:e,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===e){i[c]=a;break}c===l&&i.push(a)}o.tween=i}}function di(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=R(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===t)return s.value;return null}return this.each((e==null?hi:pi)(n,t,e))}function jt(t,e,n){var r=t._id;return t.each(function(){var i=T(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return R(i,r).value[e]}}function We(t,e){var n;return(typeof e=="number"?F:e instanceof st?_e:(n=st(e))?(e=n,_e):Zr)(t,e)}function gi(t){return function(){this.removeAttribute(t)}}function mi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function wi(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttribute(t);return s===i?null:s===r?o:o=e(r=s,n)}}function yi(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===r?o:o=e(r=s,n)}}function _i(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function xi(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function vi(t,e){var n=At(t),r=n==="transform"?ni:We;return this.attrTween(t,typeof e=="function"?(n.local?xi:_i)(n,r,jt(this,"attr."+t,e)):e==null?(n.local?mi:gi)(n):(n.local?yi:wi)(n,r,e))}function bi(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function $i(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Si(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&$i(t,o)),n}return i._value=e,i}function Ei(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&bi(t,o)),n}return i._value=e,i}function Ni(t,e){var n="attr."+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;var r=At(t);return this.tween(n,(r.local?Si:Ei)(r,e))}function Ai(t,e){return function(){Zt(this,t).delay=+e.apply(this,arguments)}}function Ci(t,e){return e=+e,function(){Zt(this,t).delay=e}}function ki(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ai:Ci)(e,t)):R(this.node(),e).delay}function Ri(t,e){return function(){T(this,t).duration=+e.apply(this,arguments)}}function Mi(t,e){return e=+e,function(){T(this,t).duration=e}}function Bi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ri:Mi)(e,t)):R(this.node(),e).duration}function Ti(t,e){if(typeof e!="function")throw new Error;return function(){T(this,t).ease=e}}function Ii(t){var e=this._id;return arguments.length?this.each(Ti(e,t)):R(this.node(),e).ease}function Oi(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;T(this,t).ease=n}}function Pi(t){if(typeof t!="function")throw new Error;return this.each(Oi(this._id,t))}function Xi(t){typeof t!="function"&&(t=Ce(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new O(r,this._parents,this._name,this._id)}function Fi(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var c=e[a],l=n[a],u=c.length,h=s[a]=new Array(u),d,g=0;g<u;++g)(d=c[g]||l[g])&&(h[g]=d);for(;a<r;++a)s[a]=e[a];return new O(s,this._parents,this._name,this._id)}function Hi(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Li(t,e,n){var r,i,o=Hi(e)?Zt:T;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}function Yi(t,e){var n=this._id;return arguments.length<2?R(this.node(),n).on.on(t):this.each(Li(n,t,e))}function Di(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function qi(){return this.on("end.remove",Di(this._id))}function Vi(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Wt(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],c=a.length,l=o[s]=new Array(c),u,h,d=0;d<c;++d)(u=a[d])&&(h=t.call(u,u.__data__,d,a))&&("__data__"in u&&(h.__data__=u.__data__),l[d]=h,kt(l[d],e,n,d,l,R(u,n)));return new O(o,this._parents,e,n)}function zi(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ae(t));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var c=r[a],l=c.length,u,h=0;h<l;++h)if(u=c[h]){for(var d=t.call(u,u.__data__,h,c),g,m=R(u,n),y=0,v=d.length;y<v;++y)(g=d[y])&&kt(g,e,n,y,d,m);o.push(d),s.push(u)}return new O(o,s,e,n)}var Ui=ct.prototype.constructor;function Ki(){return new Ui(this._groups,this._parents)}function Wi(t,e){var n,r,i;return function(){var o=G(this,t),s=(this.style.removeProperty(t),G(this,t));return o===s?null:o===n&&s===r?i:i=e(n=o,r=s)}}function Ge(t){return function(){this.style.removeProperty(t)}}function Gi(t,e,n){var r,i=n+"",o;return function(){var s=G(this,t);return s===i?null:s===r?o:o=e(r=s,n)}}function Ji(t,e,n){var r,i,o;return function(){var s=G(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),G(this,t))),s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a))}}function Qi(t,e){var n,r,i,o="style."+e,s="end."+o,a;return function(){var c=T(this,t),l=c.on,u=c.value[o]==null?a||(a=Ge(e)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function Zi(t,e,n){var r=(t+="")=="transform"?ei:We;return e==null?this.styleTween(t,Wi(t,r)).on("end.style."+t,Ge(t)):typeof e=="function"?this.styleTween(t,Ji(t,r,jt(this,"style."+t,e))).each(Qi(this._id,t)):this.styleTween(t,Gi(t,r,e),n).on("end.style."+t,null)}function ji(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function to(t,e,n){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&ji(t,s,n)),r}return o._value=e,o}function eo(t,e,n){var r="style."+(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;return this.tween(r,to(t,e,n??""))}function no(t){return function(){this.textContent=t}}function ro(t){return function(){var e=t(this);this.textContent=e??""}}function io(t){return this.tween("text",typeof t=="function"?ro(jt(this,"text",t)):no(t==null?"":t+""))}function oo(t){return function(e){this.textContent=t.call(this,e)}}function so(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&oo(i)),e}return r._value=t,r}function ao(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,so(t))}function co(){for(var t=this._name,e=this._id,n=Je(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=R(c,e);kt(c,t,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new O(r,this._parents,t,n)}function lo(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},c={value:function(){--i===0&&o()}};n.each(function(){var l=T(this,r),u=l.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),l.on=e}),i===0&&o()})}var uo=0;function O(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Je(){return++uo}var I=ct.prototype;O.prototype={constructor:O,select:Vi,selectAll:zi,selectChild:I.selectChild,selectChildren:I.selectChildren,filter:Xi,merge:Fi,selection:Ki,transition:co,call:I.call,nodes:I.nodes,node:I.node,size:I.size,empty:I.empty,each:I.each,on:Yi,attr:vi,attrTween:Ni,style:Zi,styleTween:eo,text:io,textTween:ao,remove:qi,tween:di,delay:ki,duration:Bi,ease:Ii,easeVarying:Pi,end:lo,[Symbol.iterator]:I[Symbol.iterator]};function fo(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var ho={time:null,delay:0,duration:250,ease:fo};function po(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function go(t){var e,n;t instanceof O?(e=t._id,t=t._name):(e=Je(),(n=ho).time=Qt(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&kt(c,t,e,l,s,n||po(c,e));return new O(r,this._parents,t,e)}ct.prototype.interrupt=fi;ct.prototype.transition=go;function nt(t,e,n){this.k=t,this.x=e,this.y=n}nt.prototype={constructor:nt,scale:function(t){return t===1?this:new nt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new nt(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+")"}};nt.prototype;let C=[],rt=[],Ut=[],W=new Map,Ft="";async function mo(){const t=await window.gitopo.git.exec("rev-parse --show-toplevel");if(t.success){const e=t.output.trim();return e.split("/").pop()||e}return"Unknown Repository"}async function wo(){const t=await window.gitopo.gh.exec("pr list --state open --json number,title,headRefName,headRefOid");if(!t.success)return console.error("Failed to fetch pull requests:",t.error),[];try{return JSON.parse(t.output).map(n=>({number:n.number,title:n.title,branch:n.headRefName,headCommit:n.headRefOid}))}catch(e){return console.error("Failed to parse PR data:",e),[]}}async function yo(){const t=await window.gitopo.git.exec('log --all --format="%H|%P|%ct|%s" --date-order -1000');if(!t.success)return console.error("Failed to fetch commits:",t.error),[];const e=[],n=t.output.trim().split(`
2
+ `);for(const r of n){const i=r.split("|");if(i.length>=4){const o=i[0],s=i[1],a=parseInt(i[2],10),c=i.slice(3).join("|"),l=s.trim()?s.trim().split(" "):[];e.push({hash:o,parents:l,timestamp:a,message:c})}}return e.sort((r,i)=>i.timestamp-r.timestamp),e}async function _o(){const t=await window.gitopo.git.exec('branch -a --format="%(refname:short) %(objectname)"');if(!t.success)return console.error("Failed to fetch branches:",t.error),[];const e=[],n=t.output.trim().split(`
3
+ `);for(const r of n){const i=r.trim().split(" ");if(i.length>=2){const o=i[0],s=i[1];e.push({name:o,hash:s})}}return e}function xo(t){const e=["branch1","branch2","branch3"],n=t.find(r=>r.name==="main"||r.name==="master");e.forEach((r,i)=>{const o=document.getElementById(r);o.innerHTML="";const s=document.createElement("option");s.value="",s.textContent="----",o.appendChild(s),t.forEach(a=>{const c=document.createElement("option");c.value=a.name,c.textContent=a.name,o.appendChild(c)}),i===0&&n&&(o.value=n.name),o.addEventListener("change",()=>Kt())})}function vo(t){const e=rt.find(i=>i.name===t);if(!e)return new Set;const n=new Set;let r=e.hash;for(;r;){n.add(r);const i=W.get(r);if(i&&i.parents.length>0)r=i.parents[0];else break}return n}function bo(t,e=new Set){const n=[],r=new Set,i=new Map;for(const c of C)for(const l of c.parents)i.has(l)||i.set(l,[]),i.get(l).push(c.hash);function o(c){const l=new Set,u=[c];for(;u.length>0;){const h=u.pop();if(l.has(h)||t.has(h)||e.has(h)||r.has(h))continue;const d=W.get(h);if(!d)continue;l.add(h);for(const m of d.parents)!t.has(m)&&!e.has(m)&&!l.has(m)&&u.push(m);const g=i.get(h)||[];for(const m of g)!t.has(m)&&!e.has(m)&&!l.has(m)&&u.push(m)}return l}function s(c){for(const l of c){const u=W.get(l);if(u){for(const h of u.parents)if(!t.has(h)&&!c.has(h))return!1}}return!0}function a(c){for(const l of t){const u=W.get(l);if(!(!u||u.parents.length<2)){for(let h=1;h<u.parents.length;h++)if(c.has(u.parents[h]))return l}}return null}for(const c of C){if(t.has(c.hash)||e.has(c.hash)||r.has(c.hash))continue;const l=o(c.hash);l.size>0&&s(l)&&(l.forEach(u=>r.add(u)),n.push({mergeCommit:a(l),commits:l}))}return n}function $o(){const t=[];return["branch1","branch2","branch3"].forEach(e=>{const n=document.getElementById(e);n&&n.value&&t.push(n.value)}),t}function Kt(){const t=ue("#graph");t.selectAll("*").remove();const e=ue("#app");e.selectAll(".tooltip").remove();const n=document.getElementById("controls").offsetHeight,r=window.innerWidth,i=window.innerHeight-n;t.attr("width",r).attr("height",i);const o=6,s=30,a=150,c=30,l=50,u=50,d=$o().map(f=>({name:f,lineage:vo(f)})),g=new Set;d.forEach(({lineage:f})=>{f.forEach(p=>g.add(p))});const m=d.map(({name:f,lineage:p})=>{const w=new Set;d.forEach(x=>{x.name!==f&&x.lineage.forEach(b=>w.add(b))});const _=bo(p,w);return{name:f,lineage:p,subBranches:_}}),y=new Map;rt.forEach(f=>{y.has(f.hash)||y.set(f.hash,[]),y.get(f.hash).push(f.name)});const v=new Map;C.forEach(f=>{v.set(f.hash,{mainCol:m.length,subOffset:0,isSubBranch:!1})}),m.forEach((f,p)=>{for(const w of f.lineage)v.set(w,{mainCol:p,subOffset:0,isSubBranch:!1})});let Rt=0;m.forEach((f,p)=>{const w=new Map;f.subBranches.forEach(_=>{const x=`sb-${Rt++}`,b=[];_.commits.forEach(E=>{const Y=C.findIndex(D=>D.hash===E);Y>=0&&b.push(Y)});let S=1,X=!0;for(;X;){X=!1;for(const E of b)if((w.get(E)||new Set).has(S)){X=!0,S++;break}}for(const E of b)w.has(E)||w.set(E,new Set),w.get(E).add(S);_.commits.forEach(E=>{v.set(E,{mainCol:p,subOffset:S,isSubBranch:!0,subBranchId:x})})})});const M=new Map;let H=u;for(let f=0;f<=m.length;f++)if(M.set(f,H),f<m.length){let p=0;C.forEach(w=>{const _=v.get(w.hash);_.mainCol===f&&_.subOffset>p&&(p=_.subOffset)}),H+=a+p*c}const A=new Map;C.forEach((f,p)=>{const w=v.get(f.hash),x=M.get(w.mainCol)+w.subOffset*c;A.set(f.hash,{col:w.mainCol,subOffset:w.subOffset,row:p,x,y:l+p*s,isSubBranch:w.isSubBranch,subBranchId:w.subBranchId||null})});const ut=Array.from(v.values()).some(f=>f.mainCol===m.length),L=t.append("g").attr("class","main-group"),Mt=e.append("div").attr("class","tooltip").style("opacity",0),ft=["#4CAF50","#2196F3","#FF9800"];m.forEach((f,p)=>{L.append("text").attr("x",M.get(p)).attr("y",25).attr("fill",ft[p]||"#888").attr("font-size","14px").attr("font-weight","bold").text(f.name)}),ut&&L.append("text").attr("x",M.get(m.length)).attr("y",25).attr("fill","#888").attr("font-size","14px").text("Other"),C.forEach(f=>{const p=A.get(f.hash);p&&f.parents.forEach(w=>{const _=A.get(w);if(_){const x=p.col===m.length||_.col===m.length,b=p.x,S=p.y,X=_.x,E=_.y;let Y;if(b===X)Y=`M ${b} ${S} L ${X} ${E}`;else{const dt=(S+E)/2;Y=`M ${b} ${S} C ${b} ${dt}, ${X} ${dt}, ${X} ${E}`}const D=p.subBranchId||_.subBranchId||null,It=p.isSubBranch||_.isSubBranch,Qe=!It&&!x&&p.col<m.length;let Ot="#666";x?Ot="#444":p.col<m.length&&(Ot=ft[p.col]||"#666");let Z=1.5;x?Z=1:Qe?Z=3:It&&(Z=1.5);const Ze=L.append("path").attr("d",Y).attr("fill","none").attr("stroke",Ot).attr("stroke-width",Z).attr("stroke-opacity",x?.4:It?.5:.8).attr("stroke-dasharray",x?"4,4":"none").attr("class",D?`edge edge-${D}`:"edge");if(D){const dt=Z;Ze.style("cursor","pointer").on("mouseenter",()=>{L.selectAll(`.edge-${D}`).attr("stroke-width",3).attr("stroke-opacity",.9)}).on("mouseleave",()=>{L.selectAll(`.edge-${D}`).attr("stroke-width",dt).attr("stroke-opacity",.5)})}}})});const Q=new Map;Ut.forEach(f=>{Q.set(f.headCommit,f)});const Bt=L.selectAll("g.node").data(C).enter().append("g").attr("class","node").attr("transform",f=>{const p=A.get(f.hash);return p?`translate(${p.x}, ${p.y})`:"translate(-100, -100)"});Bt.filter(f=>Q.has(f.hash)).append("circle").attr("r",o+6).attr("fill","none").attr("stroke","#888").attr("stroke-width",2).attr("stroke-dasharray","3,2"),Bt.append("circle").attr("r",f=>{const p=A.get(f.hash);return p.isSubBranch?o*.6:p.col<m.length?o:o*.7}).attr("fill",f=>{const p=A.get(f.hash);return p.col<m.length?ft[p.col]||"#fff":p.isSubBranch?"#a0a0a0":"#888"}).attr("stroke",f=>{const p=A.get(f.hash);return p.col<m.length&&ft[p.col]||"#333"}).attr("stroke-width",f=>{const p=A.get(f.hash);return p.isSubBranch?1:p.col<m.length?2:1}).style("cursor","pointer").on("mouseenter",(f,p)=>{const w=y.get(p.hash),_=w?`[${w.join(", ")}]<br/>`:"",x=Q.get(p.hash),b=x?`<span class="pr-info">PR #${x.number}: ${x.title}</span><br/>`:"",S=new Date(p.timestamp*1e3).toLocaleString();Mt.html(`<strong>${p.hash.substring(0,7)}</strong><br/>${b}${_}${p.message}<br/><span class="date">${S}</span>`).style("left",f.pageX+15+"px").style("top",f.pageY-10+"px").style("opacity",1)}).on("mousemove",f=>{Mt.style("left",f.pageX+15+"px").style("top",f.pageY-10+"px")}).on("mouseleave",()=>{Mt.style("opacity",0)}),Bt.filter(f=>Q.has(f.hash)).append("text").attr("x",o+10).attr("y",4).attr("fill","#ccc").attr("font-size","11px").text(f=>{const p=Q.get(f.hash);return`PR #${p.number}: ${p.title.substring(0,30)}${p.title.length>30?"...":""}`});let U=0,P=0,ht=1,pt=!1,te=0,ee=0,ne=0,re=0;function Tt(){L.attr("transform",`translate(${U}, ${P}) scale(1, ${ht})`)}t.on("wheel",f=>{if(f.preventDefault(),f.ctrlKey){const p=f.deltaY>0?.9:1.1,x=Math.max(.1,Math.min(5,ht*p)),b=t.node().getBoundingClientRect(),S=f.clientY-b.top;P=S-(S-P)*(x/ht),ht=x}else U-=f.deltaX,P-=f.deltaY;Tt()}),t.on("mousedown",f=>{f.button===0&&(pt=!0,te=f.clientX,ee=f.clientY,ne=U,re=P,f.preventDefault())}),t.on("mousemove",f=>{pt&&(U=ne+(f.clientX-te),P=re+(f.clientY-ee),Tt())}),t.on("mouseup",f=>{f.button===0&&(pt=!1)}),t.on("mouseleave",()=>{pt=!1});let ie=0,oe=0,se=0,ae=0;t.on("touchstart",f=>{if(f.touches.length===1){const p=f.touches[0];ie=p.clientX,oe=p.clientY,se=U,ae=P}}),t.on("touchmove",f=>{if(f.touches.length===1){f.preventDefault();const p=f.touches[0];U=se+(p.clientX-ie),P=ae+(p.clientY-oe),Tt()}}),t.on("contextmenu",f=>{f.preventDefault()})}async function So(){[C,rt,Ft,Ut]=await Promise.all([yo(),_o(),mo(),wo()]),document.getElementById("repo-name").textContent=Ft,W.clear(),C.forEach(t=>W.set(t.hash,t)),console.log("Repository:",Ft),console.log("Commits:",C.length),console.log("Branches:",rt.length),console.log("Open PRs:",Ut.length),xo(rt),Kt(),window.addEventListener("resize",()=>{Kt()})}So();
@@ -0,0 +1,3 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Qe={value:()=>{}};function Qt(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new bt(n)}function bt(t){this._=t}function Ze(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}bt.prototype=Qt.prototype={constructor:bt,on:function(t,e){var n=this._,r=Ze(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=Je(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(t=r[o]).type)n[i]=re(n[i],t.name,e);else if(e==null)for(i in n)n[i]=re(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new bt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function Je(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function re(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Qe,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Xt="http://www.w3.org/1999/xhtml";const ie={svg:"http://www.w3.org/2000/svg",xhtml:Xt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ct(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),ie.hasOwnProperty(e)?{space:ie[e],local:t}:t}function je(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Xt&&e.documentElement.namespaceURI===Xt?e.createElement(t):e.createElementNS(n,t)}}function tn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function xe(t){var e=Ct(t);return(e.local?tn:je)(e)}function en(){}function Zt(t){return t==null?en:function(){return this.querySelector(t)}}function nn(t){typeof t!="function"&&(t=Zt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=new Array(s),u,c,f=0;f<s;++f)(u=o[f])&&(c=t.call(u,u.__data__,f,o))&&("__data__"in u&&(c.__data__=u.__data__),a[f]=c);return new P(r,this._parents)}function rn(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function on(){return[]}function be(t){return t==null?on:function(){return this.querySelectorAll(t)}}function sn(t){return function(){return rn(t.apply(this,arguments))}}function an(t){typeof t=="function"?t=sn(t):t=be(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s=e[o],a=s.length,u,c=0;c<a;++c)(u=s[c])&&(r.push(t.call(u,u.__data__,c,s)),i.push(u));return new P(r,i)}function Ee(t){return function(){return this.matches(t)}}function Ne(t){return function(e){return e.matches(t)}}var un=Array.prototype.find;function cn(t){return function(){return un.call(this.children,t)}}function ln(){return this.firstElementChild}function fn(t){return this.select(t==null?ln:cn(typeof t=="function"?t:Ne(t)))}var hn=Array.prototype.filter;function pn(){return Array.from(this.children)}function dn(t){return function(){return hn.call(this.children,t)}}function gn(t){return this.selectAll(t==null?pn:dn(typeof t=="function"?t:Ne(t)))}function mn(t){typeof t!="function"&&(t=Ee(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],u,c=0;c<s;++c)(u=o[c])&&t.call(u,u.__data__,c,o)&&a.push(u);return new P(r,this._parents)}function Ae(t){return new Array(t.length)}function yn(){return new P(this._enter||this._groups.map(Ae),this._parents)}function $t(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}$t.prototype={constructor:$t,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 _n(t){return function(){return t}}function wn(t,e,n,r,i,o){for(var s=0,a,u=e.length,c=o.length;s<c;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new $t(t,o[s]);for(;s<u;++s)(a=e[s])&&(i[s]=a)}function vn(t,e,n,r,i,o,s){var a,u,c=new Map,f=e.length,p=o.length,d=new Array(f),g;for(a=0;a<f;++a)(u=e[a])&&(d[a]=g=s.call(u,u.__data__,a,e)+"",c.has(g)?i[a]=u:c.set(g,u));for(a=0;a<p;++a)g=s.call(t,o[a],a,o)+"",(u=c.get(g))?(r[a]=u,u.__data__=o[a],c.delete(g)):n[a]=new $t(t,o[a]);for(a=0;a<f;++a)(u=e[a])&&c.get(d[a])===u&&(i[a]=u)}function xn(t){return t.__data__}function bn(t,e){if(!arguments.length)return Array.from(this,xn);var n=e?vn:wn,r=this._parents,i=this._groups;typeof t!="function"&&(t=_n(t));for(var o=i.length,s=new Array(o),a=new Array(o),u=new Array(o),c=0;c<o;++c){var f=r[c],p=i[c],d=p.length,g=En(t.call(f,f&&f.__data__,c,r)),N=g.length,A=a[c]=new Array(N),M=s[c]=new Array(N),w=u[c]=new Array(d);n(f,p,A,M,w,g,e);for(var C=0,T=0,m,x;C<N;++C)if(m=A[C]){for(C>=T&&(T=C+1);!(x=M[T])&&++T<N;);m._next=x||null}}return s=new P(s,r),s._enter=a,s._exit=u,s}function En(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Nn(){return new P(this._exit||this._groups.map(Ae),this._parents)}function An(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function $n(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),u=0;u<s;++u)for(var c=n[u],f=r[u],p=c.length,d=a[u]=new Array(p),g,N=0;N<p;++N)(g=c[N]||f[N])&&(d[N]=g);for(;u<i;++u)a[u]=n[u];return new P(a,this._parents)}function kn(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function Mn(t){t||(t=Sn);function e(p,d){return p&&d?t(p.__data__,d.__data__):!p-!d}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,u=i[o]=new Array(a),c,f=0;f<a;++f)(c=s[f])&&(u[f]=c);u.sort(e)}return new P(i,this._parents).order()}function Sn(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Tn(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function zn(){return Array.from(this)}function Cn(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function Rn(){let t=0;for(const e of this)++t;return t}function In(){return!this.node()}function Pn(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function Dn(t){return function(){this.removeAttribute(t)}}function Fn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Hn(t,e){return function(){this.setAttribute(t,e)}}function Xn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ln(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function qn(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Bn(t,e){var n=Ct(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Fn:Dn:typeof e=="function"?n.local?qn:Ln:n.local?Xn:Hn)(n,e))}function $e(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function On(t){return function(){this.style.removeProperty(t)}}function Yn(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Vn(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Gn(t,e,n){return arguments.length>1?this.each((e==null?On:typeof e=="function"?Vn:Yn)(t,e,n??"")):rt(this.node(),t)}function rt(t,e){return t.style.getPropertyValue(e)||$e(t).getComputedStyle(t,null).getPropertyValue(e)}function Un(t){return function(){delete this[t]}}function Kn(t,e){return function(){this[t]=e}}function Wn(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Qn(t,e){return arguments.length>1?this.each((e==null?Un:typeof e=="function"?Wn:Kn)(t,e)):this.node()[t]}function ke(t){return t.trim().split(/^|\s+/)}function Jt(t){return t.classList||new Me(t)}function Me(t){this._node=t,this._names=ke(t.getAttribute("class")||"")}Me.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 Se(t,e){for(var n=Jt(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Te(t,e){for(var n=Jt(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Zn(t){return function(){Se(this,t)}}function Jn(t){return function(){Te(this,t)}}function jn(t,e){return function(){(e.apply(this,arguments)?Se:Te)(this,t)}}function tr(t,e){var n=ke(t+"");if(arguments.length<2){for(var r=Jt(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?jn:e?Zn:Jn)(n,e))}function er(){this.textContent=""}function nr(t){return function(){this.textContent=t}}function rr(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function ir(t){return arguments.length?this.each(t==null?er:(typeof t=="function"?rr:nr)(t)):this.node().textContent}function or(){this.innerHTML=""}function sr(t){return function(){this.innerHTML=t}}function ar(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function ur(t){return arguments.length?this.each(t==null?or:(typeof t=="function"?ar:sr)(t)):this.node().innerHTML}function cr(){this.nextSibling&&this.parentNode.appendChild(this)}function lr(){return this.each(cr)}function fr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function hr(){return this.each(fr)}function pr(t){var e=typeof t=="function"?t:xe(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function dr(){return null}function gr(t,e){var n=typeof t=="function"?t:xe(t),r=e==null?dr:typeof e=="function"?e:Zt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function mr(){var t=this.parentNode;t&&t.removeChild(this)}function yr(){return this.each(mr)}function _r(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function wr(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function vr(t){return this.select(t?wr:_r)}function xr(t){return arguments.length?this.property("__data__",t):this.node().__data__}function br(t){return function(e){t.call(this,e,this.__data__)}}function Er(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Nr(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function Ar(t,e,n){return function(){var r=this.__on,i,o=br(e);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function $r(t,e,n){var r=Er(t+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var u=0,c=a.length,f;u<c;++u)for(i=0,f=a[u];i<o;++i)if((s=r[i]).type===f.type&&s.name===f.name)return f.value}return}for(a=e?Ar:Nr,i=0;i<o;++i)this.each(a(r[i],e,n));return this}function ze(t,e,n){var r=$e(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function kr(t,e){return function(){return ze(this,t,e)}}function Mr(t,e){return function(){return ze(this,t,e.apply(this,arguments))}}function Sr(t,e){return this.each((typeof e=="function"?Mr:kr)(t,e))}function*Tr(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var Ce=[null];function P(t,e){this._groups=t,this._parents=e}function dt(){return new P([[document.documentElement]],Ce)}function zr(){return this}P.prototype=dt.prototype={constructor:P,select:nn,selectAll:an,selectChild:fn,selectChildren:gn,filter:mn,data:bn,enter:yn,exit:Nn,join:An,merge:$n,selection:zr,order:kn,sort:Mn,call:Tn,nodes:zn,node:Cn,size:Rn,empty:In,each:Pn,attr:Bn,style:Gn,property:Qn,classed:tr,text:ir,html:ur,raise:lr,lower:hr,append:pr,insert:gr,remove:yr,clone:vr,datum:xr,on:$r,dispatch:Sr,[Symbol.iterator]:Tr};function G(t){return typeof t=="string"?new P([[document.querySelector(t)]],[document.documentElement]):new P([[t]],Ce)}function Cr(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Z(t,e){if(t=Cr(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}const Lt={capture:!0,passive:!1};function qt(t){t.preventDefault(),t.stopImmediatePropagation()}function Rr(t){var e=t.document.documentElement,n=G(t).on("dragstart.drag",qt,Lt);"onselectstart"in e?n.on("selectstart.drag",qt,Lt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Ir(t,e){var n=t.document.documentElement,r=G(t).on("dragstart.drag",null);e&&(r.on("click.drag",qt,Lt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function jt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Re(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function gt(){}var lt=.7,kt=1/lt,nt="\\s*([+-]?\\d+)\\s*",ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",q="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Pr=/^#([0-9a-f]{3,8})$/,Dr=new RegExp(`^rgb\\(${nt},${nt},${nt}\\)$`),Fr=new RegExp(`^rgb\\(${q},${q},${q}\\)$`),Hr=new RegExp(`^rgba\\(${nt},${nt},${nt},${ft}\\)$`),Xr=new RegExp(`^rgba\\(${q},${q},${q},${ft}\\)$`),Lr=new RegExp(`^hsl\\(${ft},${q},${q}\\)$`),qr=new RegExp(`^hsla\\(${ft},${q},${q},${ft}\\)$`),oe={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};jt(gt,ht,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:se,formatHex:se,formatHex8:Br,formatHsl:Or,formatRgb:ae,toString:ae});function se(){return this.rgb().formatHex()}function Br(){return this.rgb().formatHex8()}function Or(){return Ie(this).formatHsl()}function ae(){return this.rgb().formatRgb()}function ht(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Pr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?ue(e):n===3?new I(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?_t(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?_t(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=Dr.exec(t))?new I(e[1],e[2],e[3],1):(e=Fr.exec(t))?new I(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Hr.exec(t))?_t(e[1],e[2],e[3],e[4]):(e=Xr.exec(t))?_t(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Lr.exec(t))?fe(e[1],e[2]/100,e[3]/100,1):(e=qr.exec(t))?fe(e[1],e[2]/100,e[3]/100,e[4]):oe.hasOwnProperty(t)?ue(oe[t]):t==="transparent"?new I(NaN,NaN,NaN,0):null}function ue(t){return new I(t>>16&255,t>>8&255,t&255,1)}function _t(t,e,n,r){return r<=0&&(t=e=n=NaN),new I(t,e,n,r)}function Yr(t){return t instanceof gt||(t=ht(t)),t?(t=t.rgb(),new I(t.r,t.g,t.b,t.opacity)):new I}function Bt(t,e,n,r){return arguments.length===1?Yr(t):new I(t,e,n,r??1)}function I(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}jt(I,Bt,Re(gt,{brighter(t){return t=t==null?kt:Math.pow(kt,t),new I(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?lt:Math.pow(lt,t),new I(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new I(j(this.r),j(this.g),j(this.b),Mt(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:ce,formatHex:ce,formatHex8:Vr,formatRgb:le,toString:le}));function ce(){return`#${J(this.r)}${J(this.g)}${J(this.b)}`}function Vr(){return`#${J(this.r)}${J(this.g)}${J(this.b)}${J((isNaN(this.opacity)?1:this.opacity)*255)}`}function le(){const t=Mt(this.opacity);return`${t===1?"rgb(":"rgba("}${j(this.r)}, ${j(this.g)}, ${j(this.b)}${t===1?")":`, ${t})`}`}function Mt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function j(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function J(t){return t=j(t),(t<16?"0":"")+t.toString(16)}function fe(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new H(t,e,n,r)}function Ie(t){if(t instanceof H)return new H(t.h,t.s,t.l,t.opacity);if(t instanceof gt||(t=ht(t)),!t)return new H;if(t instanceof H)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,u=(o+i)/2;return a?(e===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-e)/a+2:s=(e-n)/a+4,a/=u<.5?o+i:2-o-i,s*=60):a=u>0&&u<1?0:s,new H(s,a,u,t.opacity)}function Gr(t,e,n,r){return arguments.length===1?Ie(t):new H(t,e,n,r??1)}function H(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}jt(H,Gr,Re(gt,{brighter(t){return t=t==null?kt:Math.pow(kt,t),new H(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?lt:Math.pow(lt,t),new H(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,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new I(Dt(t>=240?t-240:t+120,i,r),Dt(t,i,r),Dt(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new H(he(this.h),wt(this.s),wt(this.l),Mt(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=Mt(this.opacity);return`${t===1?"hsl(":"hsla("}${he(this.h)}, ${wt(this.s)*100}%, ${wt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function he(t){return t=(t||0)%360,t<0?t+360:t}function wt(t){return Math.max(0,Math.min(1,t||0))}function Dt(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Pe=t=>()=>t;function Ur(t,e){return function(n){return t+n*e}}function Kr(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Wr(t){return(t=+t)==1?De:function(e,n){return n-e?Kr(e,n,t):Pe(isNaN(e)?n:e)}}function De(t,e){var n=e-t;return n?Ur(t,n):Pe(isNaN(t)?e:t)}const pe=(function t(e){var n=Wr(e);function r(i,o){var s=n((i=Bt(i)).r,(o=Bt(o)).r),a=n(i.g,o.g),u=n(i.b,o.b),c=De(i.opacity,o.opacity);return function(f){return i.r=s(f),i.g=a(f),i.b=u(f),i.opacity=c(f),i+""}}return r.gamma=t,r})(1);function W(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Ot=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ft=new RegExp(Ot.source,"g");function Qr(t){return function(){return t}}function Zr(t){return function(e){return t(e)+""}}function Jr(t,e){var n=Ot.lastIndex=Ft.lastIndex=0,r,i,o,s=-1,a=[],u=[];for(t=t+"",e=e+"";(r=Ot.exec(t))&&(i=Ft.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,u.push({i:s,x:W(r,i)})),n=Ft.lastIndex;return n<e.length&&(o=e.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?u[0]?Zr(u[0].x):Qr(e):(e=u.length,function(c){for(var f=0,p;f<e;++f)a[(p=u[f]).i]=p.x(c);return a.join("")})}var de=180/Math.PI,Yt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Fe(t,e,n,r,i,o){var s,a,u;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,u/=a),t*r<e*n&&(t=-t,e=-e,u=-u,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*de,skewX:Math.atan(u)*de,scaleX:s,scaleY:a}}var vt;function jr(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Yt:Fe(e.a,e.b,e.c,e.d,e.e,e.f)}function ti(t){return t==null||(vt||(vt=document.createElementNS("http://www.w3.org/2000/svg","g")),vt.setAttribute("transform",t),!(t=vt.transform.baseVal.consolidate()))?Yt:(t=t.matrix,Fe(t.a,t.b,t.c,t.d,t.e,t.f))}function He(t,e,n,r){function i(c){return c.length?c.pop()+" ":""}function o(c,f,p,d,g,N){if(c!==p||f!==d){var A=g.push("translate(",null,e,null,n);N.push({i:A-4,x:W(c,p)},{i:A-2,x:W(f,d)})}else(p||d)&&g.push("translate("+p+e+d+n)}function s(c,f,p,d){c!==f?(c-f>180?f+=360:f-c>180&&(c+=360),d.push({i:p.push(i(p)+"rotate(",null,r)-2,x:W(c,f)})):f&&p.push(i(p)+"rotate("+f+r)}function a(c,f,p,d){c!==f?d.push({i:p.push(i(p)+"skewX(",null,r)-2,x:W(c,f)}):f&&p.push(i(p)+"skewX("+f+r)}function u(c,f,p,d,g,N){if(c!==p||f!==d){var A=g.push(i(g)+"scale(",null,",",null,")");N.push({i:A-4,x:W(c,p)},{i:A-2,x:W(f,d)})}else(p!==1||d!==1)&&g.push(i(g)+"scale("+p+","+d+")")}return function(c,f){var p=[],d=[];return c=t(c),f=t(f),o(c.translateX,c.translateY,f.translateX,f.translateY,p,d),s(c.rotate,f.rotate,p,d),a(c.skewX,f.skewX,p,d),u(c.scaleX,c.scaleY,f.scaleX,f.scaleY,p,d),c=f=null,function(g){for(var N=-1,A=d.length,M;++N<A;)p[(M=d[N]).i]=M.x(g);return p.join("")}}}var ei=He(jr,"px, ","px)","deg)"),ni=He(ti,", ",")",")"),ri=1e-12;function ge(t){return((t=Math.exp(t))+1/t)/2}function ii(t){return((t=Math.exp(t))-1/t)/2}function oi(t){return((t=Math.exp(2*t))-1)/(t+1)}const si=(function t(e,n,r){function i(o,s){var a=o[0],u=o[1],c=o[2],f=s[0],p=s[1],d=s[2],g=f-a,N=p-u,A=g*g+N*N,M,w;if(A<ri)w=Math.log(d/c)/e,M=function(R){return[a+R*g,u+R*N,c*Math.exp(e*R*w)]};else{var C=Math.sqrt(A),T=(d*d-c*c+r*A)/(2*c*n*C),m=(d*d-c*c-r*A)/(2*d*n*C),x=Math.log(Math.sqrt(T*T+1)-T),k=Math.log(Math.sqrt(m*m+1)-m);w=(k-x)/e,M=function(R){var et=R*w,mt=ge(x),yt=c/(n*C)*(mt*oi(e*et+x)-ii(x));return[a+yt*g,u+yt*N,c*mt/ge(e*et+x)]}}return M.duration=w*1e3*e/Math.SQRT2,M}return i.rho=function(o){var s=Math.max(.001,+o),a=s*s,u=a*a;return t(s,a,u)},i})(Math.SQRT2,2,4);var it=0,at=0,ot=0,Xe=1e3,St,ut,Tt=0,tt=0,Rt=0,pt=typeof performance=="object"&&performance.now?performance:Date,Le=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function te(){return tt||(Le(ai),tt=pt.now()+Rt)}function ai(){tt=0}function zt(){this._call=this._time=this._next=null}zt.prototype=qe.prototype={constructor:zt,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?te():+n)+(e==null?0:+e),!this._next&&ut!==this&&(ut?ut._next=this:St=this,ut=this),this._call=t,this._time=n,Vt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Vt())}};function qe(t,e,n){var r=new zt;return r.restart(t,e,n),r}function ui(){te(),++it;for(var t=St,e;t;)(e=tt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--it}function me(){tt=(Tt=pt.now())+Rt,it=at=0;try{ui()}finally{it=0,li(),tt=0}}function ci(){var t=pt.now(),e=t-Tt;e>Xe&&(Rt-=e,Tt=t)}function li(){for(var t,e=St,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:St=n);ut=t,Vt(r)}function Vt(t){if(!it){at&&(at=clearTimeout(at));var e=t-tt;e>24?(t<1/0&&(at=setTimeout(me,t-pt.now()-Rt)),ot&&(ot=clearInterval(ot))):(ot||(Tt=pt.now(),ot=setInterval(ci,Xe)),it=1,Le(me))}}function ye(t,e,n){var r=new zt;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var fi=Qt("start","end","cancel","interrupt"),hi=[],Be=0,_e=1,Gt=2,Et=3,we=4,Ut=5,Nt=6;function It(t,e,n,r,i,o){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;pi(t,n,{name:e,index:r,group:i,on:fi,tween:hi,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Be})}function ee(t,e){var n=X(t,e);if(n.state>Be)throw new Error("too late; already scheduled");return n}function B(t,e){var n=X(t,e);if(n.state>Et)throw new Error("too late; already running");return n}function X(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function pi(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=qe(o,0,n.time);function o(c){n.state=_e,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var f,p,d,g;if(n.state!==_e)return u();for(f in r)if(g=r[f],g.name===n.name){if(g.state===Et)return ye(s);g.state===we?(g.state=Nt,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete r[f]):+f<e&&(g.state=Nt,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete r[f])}if(ye(function(){n.state===Et&&(n.state=we,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Gt,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Gt){for(n.state=Et,i=new Array(d=n.tween.length),f=0,p=-1;f<d;++f)(g=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(i[++p]=g);i.length=p+1}}function a(c){for(var f=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=Ut,1),p=-1,d=i.length;++p<d;)i[p].call(t,f);n.state===Ut&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=Nt,n.timer.stop(),delete r[e];for(var c in r)return;delete t.__transition}}function At(t,e){var n=t.__transition,r,i,o=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((r=n[s]).name!==e){o=!1;continue}i=r.state>Gt&&r.state<Ut,r.state=Nt,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}o&&delete t.__transition}}function di(t){return this.each(function(){At(this,t)})}function gi(t,e){var n,r;return function(){var i=B(this,t),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function mi(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=B(this,t),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:e,value:n},u=0,c=i.length;u<c;++u)if(i[u].name===e){i[u]=a;break}u===c&&i.push(a)}o.tween=i}}function yi(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=X(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===t)return s.value;return null}return this.each((e==null?gi:mi)(n,t,e))}function ne(t,e,n){var r=t._id;return t.each(function(){var i=B(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return X(i,r).value[e]}}function Oe(t,e){var n;return(typeof e=="number"?W:e instanceof ht?pe:(n=ht(e))?(e=n,pe):Jr)(t,e)}function _i(t){return function(){this.removeAttribute(t)}}function wi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function vi(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttribute(t);return s===i?null:s===r?o:o=e(r=s,n)}}function xi(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===r?o:o=e(r=s,n)}}function bi(t,e,n){var r,i,o;return function(){var s,a=n(this),u;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),u=a+"",s===u?null:s===r&&u===i?o:(i=u,o=e(r=s,a)))}}function Ei(t,e,n){var r,i,o;return function(){var s,a=n(this),u;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),u=a+"",s===u?null:s===r&&u===i?o:(i=u,o=e(r=s,a)))}}function Ni(t,e){var n=Ct(t),r=n==="transform"?ni:Oe;return this.attrTween(t,typeof e=="function"?(n.local?Ei:bi)(n,r,ne(this,"attr."+t,e)):e==null?(n.local?wi:_i)(n):(n.local?xi:vi)(n,r,e))}function Ai(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function $i(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function ki(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&$i(t,o)),n}return i._value=e,i}function Mi(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Ai(t,o)),n}return i._value=e,i}function Si(t,e){var n="attr."+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;var r=Ct(t);return this.tween(n,(r.local?ki:Mi)(r,e))}function Ti(t,e){return function(){ee(this,t).delay=+e.apply(this,arguments)}}function zi(t,e){return e=+e,function(){ee(this,t).delay=e}}function Ci(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ti:zi)(e,t)):X(this.node(),e).delay}function Ri(t,e){return function(){B(this,t).duration=+e.apply(this,arguments)}}function Ii(t,e){return e=+e,function(){B(this,t).duration=e}}function Pi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ri:Ii)(e,t)):X(this.node(),e).duration}function Di(t,e){if(typeof e!="function")throw new Error;return function(){B(this,t).ease=e}}function Fi(t){var e=this._id;return arguments.length?this.each(Di(e,t)):X(this.node(),e).ease}function Hi(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;B(this,t).ease=n}}function Xi(t){if(typeof t!="function")throw new Error;return this.each(Hi(this._id,t))}function Li(t){typeof t!="function"&&(t=Ee(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],u,c=0;c<s;++c)(u=o[c])&&t.call(u,u.__data__,c,o)&&a.push(u);return new K(r,this._parents,this._name,this._id)}function qi(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var u=e[a],c=n[a],f=u.length,p=s[a]=new Array(f),d,g=0;g<f;++g)(d=u[g]||c[g])&&(p[g]=d);for(;a<r;++a)s[a]=e[a];return new K(s,this._parents,this._name,this._id)}function Bi(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Oi(t,e,n){var r,i,o=Bi(e)?ee:B;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}function Yi(t,e){var n=this._id;return arguments.length<2?X(this.node(),n).on.on(t):this.each(Oi(n,t,e))}function Vi(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Gi(){return this.on("end.remove",Vi(this._id))}function Ui(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Zt(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],u=a.length,c=o[s]=new Array(u),f,p,d=0;d<u;++d)(f=a[d])&&(p=t.call(f,f.__data__,d,a))&&("__data__"in f&&(p.__data__=f.__data__),c[d]=p,It(c[d],e,n,d,c,X(f,n)));return new K(o,this._parents,e,n)}function Ki(t){var e=this._name,n=this._id;typeof t!="function"&&(t=be(t));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var u=r[a],c=u.length,f,p=0;p<c;++p)if(f=u[p]){for(var d=t.call(f,f.__data__,p,u),g,N=X(f,n),A=0,M=d.length;A<M;++A)(g=d[A])&&It(g,e,n,A,d,N);o.push(d),s.push(f)}return new K(o,s,e,n)}var Wi=dt.prototype.constructor;function Qi(){return new Wi(this._groups,this._parents)}function Zi(t,e){var n,r,i;return function(){var o=rt(this,t),s=(this.style.removeProperty(t),rt(this,t));return o===s?null:o===n&&s===r?i:i=e(n=o,r=s)}}function Ye(t){return function(){this.style.removeProperty(t)}}function Ji(t,e,n){var r,i=n+"",o;return function(){var s=rt(this,t);return s===i?null:s===r?o:o=e(r=s,n)}}function ji(t,e,n){var r,i,o;return function(){var s=rt(this,t),a=n(this),u=a+"";return a==null&&(u=a=(this.style.removeProperty(t),rt(this,t))),s===u?null:s===r&&u===i?o:(i=u,o=e(r=s,a))}}function to(t,e){var n,r,i,o="style."+e,s="end."+o,a;return function(){var u=B(this,t),c=u.on,f=u.value[o]==null?a||(a=Ye(e)):void 0;(c!==n||i!==f)&&(r=(n=c).copy()).on(s,i=f),u.on=r}}function eo(t,e,n){var r=(t+="")=="transform"?ei:Oe;return e==null?this.styleTween(t,Zi(t,r)).on("end.style."+t,Ye(t)):typeof e=="function"?this.styleTween(t,ji(t,r,ne(this,"style."+t,e))).each(to(this._id,t)):this.styleTween(t,Ji(t,r,e),n).on("end.style."+t,null)}function no(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function ro(t,e,n){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&no(t,s,n)),r}return o._value=e,o}function io(t,e,n){var r="style."+(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;return this.tween(r,ro(t,e,n??""))}function oo(t){return function(){this.textContent=t}}function so(t){return function(){var e=t(this);this.textContent=e??""}}function ao(t){return this.tween("text",typeof t=="function"?so(ne(this,"text",t)):oo(t==null?"":t+""))}function uo(t){return function(e){this.textContent=t.call(this,e)}}function co(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&uo(i)),e}return r._value=t,r}function lo(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,co(t))}function fo(){for(var t=this._name,e=this._id,n=Ve(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,u,c=0;c<a;++c)if(u=s[c]){var f=X(u,e);It(u,t,n,c,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new K(r,this._parents,t,n)}function ho(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},u={value:function(){--i===0&&o()}};n.each(function(){var c=B(this,r),f=c.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(u)),c.on=e}),i===0&&o()})}var po=0;function K(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Ve(){return++po}var V=dt.prototype;K.prototype={constructor:K,select:Ui,selectAll:Ki,selectChild:V.selectChild,selectChildren:V.selectChildren,filter:Li,merge:qi,selection:Qi,transition:fo,call:V.call,nodes:V.nodes,node:V.node,size:V.size,empty:V.empty,each:V.each,on:Yi,attr:Ni,attrTween:Si,style:eo,styleTween:io,text:ao,textTween:lo,remove:Gi,tween:yi,delay:Ci,duration:Pi,ease:Fi,easeVarying:Xi,end:ho,[Symbol.iterator]:V[Symbol.iterator]};function go(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var mo={time:null,delay:0,duration:250,ease:go};function yo(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function _o(t){var e,n;t instanceof K?(e=t._id,t=t._name):(e=Ve(),(n=mo).time=te(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,u,c=0;c<a;++c)(u=s[c])&&It(u,t,e,c,s,n||yo(u,e));return new K(r,this._parents,t,e)}dt.prototype.interrupt=di;dt.prototype.transition=_o;const xt=t=>()=>t;function wo(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function U(t,e,n){this.k=t,this.x=e,this.y=n}U.prototype={constructor:U,scale:function(t){return t===1?this:new U(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new U(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 Ge=new U(1,0,0);U.prototype;function Ht(t){t.stopImmediatePropagation()}function st(t){t.preventDefault(),t.stopImmediatePropagation()}function vo(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function xo(){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 ve(){return this.__zoom||Ge}function bo(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Eo(){return navigator.maxTouchPoints||"ontouchstart"in this}function No(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function Ao(){var t=vo,e=xo,n=No,r=bo,i=Eo,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,u=si,c=Qt("start","zoom","end"),f,p,d,g=500,N=150,A=0,M=10;function w(l){l.property("__zoom",ve).on("wheel.zoom",et,{passive:!1}).on("mousedown.zoom",mt).on("dblclick.zoom",yt).filter(i).on("touchstart.zoom",Ue).on("touchmove.zoom",Ke).on("touchend.zoom touchcancel.zoom",We).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(l,y,h,_){var v=l.selection?l.selection():l;v.property("__zoom",ve),l!==v?x(l,y,h,_):v.interrupt().each(function(){k(this,arguments).event(_).start().zoom(null,typeof y=="function"?y.apply(this,arguments):y).end()})},w.scaleBy=function(l,y,h,_){w.scaleTo(l,function(){var v=this.__zoom.k,b=typeof y=="function"?y.apply(this,arguments):y;return v*b},h,_)},w.scaleTo=function(l,y,h,_){w.transform(l,function(){var v=e.apply(this,arguments),b=this.__zoom,E=h==null?m(v):typeof h=="function"?h.apply(this,arguments):h,$=b.invert(E),S=typeof y=="function"?y.apply(this,arguments):y;return n(T(C(b,S),E,$),v,s)},h,_)},w.translateBy=function(l,y,h,_){w.transform(l,function(){return n(this.__zoom.translate(typeof y=="function"?y.apply(this,arguments):y,typeof h=="function"?h.apply(this,arguments):h),e.apply(this,arguments),s)},null,_)},w.translateTo=function(l,y,h,_,v){w.transform(l,function(){var b=e.apply(this,arguments),E=this.__zoom,$=_==null?m(b):typeof _=="function"?_.apply(this,arguments):_;return n(Ge.translate($[0],$[1]).scale(E.k).translate(typeof y=="function"?-y.apply(this,arguments):-y,typeof h=="function"?-h.apply(this,arguments):-h),b,s)},_,v)};function C(l,y){return y=Math.max(o[0],Math.min(o[1],y)),y===l.k?l:new U(y,l.x,l.y)}function T(l,y,h){var _=y[0]-h[0]*l.k,v=y[1]-h[1]*l.k;return _===l.x&&v===l.y?l:new U(l.k,_,v)}function m(l){return[(+l[0][0]+ +l[1][0])/2,(+l[0][1]+ +l[1][1])/2]}function x(l,y,h,_){l.on("start.zoom",function(){k(this,arguments).event(_).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(_).end()}).tween("zoom",function(){var v=this,b=arguments,E=k(v,b).event(_),$=e.apply(v,b),S=h==null?m($):typeof h=="function"?h.apply(v,b):h,L=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),z=v.__zoom,D=typeof y=="function"?y.apply(v,b):y,O=u(z.invert(S).concat(L/z.k),D.invert(S).concat(L/D.k));return function(F){if(F===1)F=D;else{var Y=O(F),Pt=L/Y[2];F=new U(Pt,S[0]-Y[0]*Pt,S[1]-Y[1]*Pt)}E.zoom(null,F)}})}function k(l,y,h){return!h&&l.__zooming||new R(l,y)}function R(l,y){this.that=l,this.args=y,this.active=0,this.sourceEvent=null,this.extent=e.apply(l,y),this.taps=0}R.prototype={event:function(l){return l&&(this.sourceEvent=l),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(l,y){return this.mouse&&l!=="mouse"&&(this.mouse[1]=y.invert(this.mouse[0])),this.touch0&&l!=="touch"&&(this.touch0[1]=y.invert(this.touch0[0])),this.touch1&&l!=="touch"&&(this.touch1[1]=y.invert(this.touch1[0])),this.that.__zoom=y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(l){var y=G(this.that).datum();c.call(l,this.that,new wo(l,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:c}),y)}};function et(l,...y){if(!t.apply(this,arguments))return;var h=k(this,y).event(l),_=this.__zoom,v=Math.max(o[0],Math.min(o[1],_.k*Math.pow(2,r.apply(this,arguments)))),b=Z(l);if(h.wheel)(h.mouse[0][0]!==b[0]||h.mouse[0][1]!==b[1])&&(h.mouse[1]=_.invert(h.mouse[0]=b)),clearTimeout(h.wheel);else{if(_.k===v)return;h.mouse=[b,_.invert(b)],At(this),h.start()}st(l),h.wheel=setTimeout(E,N),h.zoom("mouse",n(T(C(_,v),h.mouse[0],h.mouse[1]),h.extent,s));function E(){h.wheel=null,h.end()}}function mt(l,...y){if(d||!t.apply(this,arguments))return;var h=l.currentTarget,_=k(this,y,!0).event(l),v=G(l.view).on("mousemove.zoom",S,!0).on("mouseup.zoom",L,!0),b=Z(l,h),E=l.clientX,$=l.clientY;Rr(l.view),Ht(l),_.mouse=[b,this.__zoom.invert(b)],At(this),_.start();function S(z){if(st(z),!_.moved){var D=z.clientX-E,O=z.clientY-$;_.moved=D*D+O*O>A}_.event(z).zoom("mouse",n(T(_.that.__zoom,_.mouse[0]=Z(z,h),_.mouse[1]),_.extent,s))}function L(z){v.on("mousemove.zoom mouseup.zoom",null),Ir(z.view,_.moved),st(z),_.event(z).end()}}function yt(l,...y){if(t.apply(this,arguments)){var h=this.__zoom,_=Z(l.changedTouches?l.changedTouches[0]:l,this),v=h.invert(_),b=h.k*(l.shiftKey?.5:2),E=n(T(C(h,b),_,v),e.apply(this,y),s);st(l),a>0?G(this).transition().duration(a).call(x,E,_,l):G(this).call(w.transform,E,_,l)}}function Ue(l,...y){if(t.apply(this,arguments)){var h=l.touches,_=h.length,v=k(this,y,l.changedTouches.length===_).event(l),b,E,$,S;for(Ht(l),E=0;E<_;++E)$=h[E],S=Z($,this),S=[S,this.__zoom.invert(S),$.identifier],v.touch0?!v.touch1&&v.touch0[2]!==S[2]&&(v.touch1=S,v.taps=0):(v.touch0=S,b=!0,v.taps=1+!!f);f&&(f=clearTimeout(f)),b&&(v.taps<2&&(p=S[0],f=setTimeout(function(){f=null},g)),At(this),v.start())}}function Ke(l,...y){if(this.__zooming){var h=k(this,y).event(l),_=l.changedTouches,v=_.length,b,E,$,S;for(st(l),b=0;b<v;++b)E=_[b],$=Z(E,this),h.touch0&&h.touch0[2]===E.identifier?h.touch0[0]=$:h.touch1&&h.touch1[2]===E.identifier&&(h.touch1[0]=$);if(E=h.that.__zoom,h.touch1){var L=h.touch0[0],z=h.touch0[1],D=h.touch1[0],O=h.touch1[1],F=(F=D[0]-L[0])*F+(F=D[1]-L[1])*F,Y=(Y=O[0]-z[0])*Y+(Y=O[1]-z[1])*Y;E=C(E,Math.sqrt(F/Y)),$=[(L[0]+D[0])/2,(L[1]+D[1])/2],S=[(z[0]+O[0])/2,(z[1]+O[1])/2]}else if(h.touch0)$=h.touch0[0],S=h.touch0[1];else return;h.zoom("touch",n(T(E,$,S),h.extent,s))}}function We(l,...y){if(this.__zooming){var h=k(this,y).event(l),_=l.changedTouches,v=_.length,b,E;for(Ht(l),d&&clearTimeout(d),d=setTimeout(function(){d=null},g),b=0;b<v;++b)E=_[b],h.touch0&&h.touch0[2]===E.identifier?delete h.touch0:h.touch1&&h.touch1[2]===E.identifier&&delete h.touch1;if(h.touch1&&!h.touch0&&(h.touch0=h.touch1,delete h.touch1),h.touch0)h.touch0[1]=this.__zoom.invert(h.touch0[0]);else if(h.end(),h.taps===2&&(E=Z(E,this),Math.hypot(p[0]-E[0],p[1]-E[1])<M)){var $=G(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return w.wheelDelta=function(l){return arguments.length?(r=typeof l=="function"?l:xt(+l),w):r},w.filter=function(l){return arguments.length?(t=typeof l=="function"?l:xt(!!l),w):t},w.touchable=function(l){return arguments.length?(i=typeof l=="function"?l:xt(!!l),w):i},w.extent=function(l){return arguments.length?(e=typeof l=="function"?l:xt([[+l[0][0],+l[0][1]],[+l[1][0],+l[1][1]]]),w):e},w.scaleExtent=function(l){return arguments.length?(o[0]=+l[0],o[1]=+l[1],w):[o[0],o[1]]},w.translateExtent=function(l){return arguments.length?(s[0][0]=+l[0][0],s[1][0]=+l[1][0],s[0][1]=+l[0][1],s[1][1]=+l[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(l){return arguments.length?(n=l,w):n},w.duration=function(l){return arguments.length?(a=+l,w):a},w.interpolate=function(l){return arguments.length?(u=l,w):u},w.on=function(){var l=c.on.apply(c,arguments);return l===c?w:l},w.clickDistance=function(l){return arguments.length?(A=(l=+l)*l,w):Math.sqrt(A)},w.tapDistance=function(l){return arguments.length?(M=+l,w):M},w}let Q=[],ct=[],Kt=new Map;async function $o(){const t=await window.gitopo.git.exec('log --all --format="%H|%P|%ct|%s" --date-order -1000');if(!t.success)return console.error("Failed to fetch commits:",t.error),[];const e=[],n=t.output.trim().split(`
2
+ `);for(const r of n){const i=r.split("|");if(i.length>=4){const o=i[0],s=i[1],a=parseInt(i[2],10),u=i.slice(3).join("|"),c=s.trim()?s.trim().split(" "):[];e.push({hash:o,parents:c,timestamp:a,message:u})}}return e.sort((r,i)=>i.timestamp-r.timestamp),e}async function ko(){const t=await window.gitopo.git.exec('branch -a --format="%(refname:short) %(objectname)"');if(!t.success)return console.error("Failed to fetch branches:",t.error),[];const e=[],n=t.output.trim().split(`
3
+ `);for(const r of n){const i=r.trim().split(" ");if(i.length>=2){const o=i[0],s=i[1];e.push({name:o,hash:s})}}return e}function Mo(t){const e=["branch1","branch2","branch3"],n=t.find(r=>r.name==="main"||r.name==="master");e.forEach((r,i)=>{const o=document.getElementById(r);o.innerHTML="";const s=document.createElement("option");s.value="",s.textContent="----",o.appendChild(s),t.forEach(a=>{const u=document.createElement("option");u.value=a.name,u.textContent=a.name,o.appendChild(u)}),i===0&&n&&(o.value=n.name),o.addEventListener("change",()=>Wt())})}function So(t){const e=ct.find(i=>i.name===t);if(!e)return new Set;const n=new Set;let r=e.hash;for(;r;){n.add(r);const i=Kt.get(r);if(i&&i.parents.length>0)r=i.parents[0];else break}return n}function To(){const t=[];return["branch1","branch2","branch3"].forEach(e=>{const n=document.getElementById(e);n&&n.value&&t.push(n.value)}),t}function Wt(){const t=G("#graph");t.selectAll("*").remove();const e=G("#app");e.selectAll(".tooltip").remove();const n=document.getElementById("controls").offsetHeight,r=window.innerWidth,i=window.innerHeight-n;t.attr("width",r).attr("height",i);const o=6,s=30,a=150,u=50,c=50,p=To().map(m=>({name:m,lineage:So(m)})),d=new Map;ct.forEach(m=>{d.has(m.hash)||d.set(m.hash,[]),d.get(m.hash).push(m.name)});const g=new Map;Q.forEach(m=>{let x=-1;for(let k=0;k<p.length;k++)if(p[k].lineage.has(m.hash)){x=k;break}x===-1&&(x=p.length),g.set(m.hash,x)});const N=new Map;Q.forEach((m,x)=>{const k=g.get(m.hash);N.set(m.hash,{col:k,row:x,x:c+k*a,y:u+x*s})}),Q.length*s+u*2;const A=Array.from(g.values()).some(m=>m===p.length),M=t.append("g").attr("class","main-group"),w=e.append("div").attr("class","tooltip").style("opacity",0);p.forEach((m,x)=>{M.append("text").attr("x",c+x*a).attr("y",25).attr("fill","#4fc3f7").attr("font-size","14px").attr("font-weight","bold").text(m.name)}),A&&M.append("text").attr("x",c+p.length*a).attr("y",25).attr("fill","#888").attr("font-size","14px").text("Other"),Q.forEach(m=>{const x=N.get(m.hash);x&&m.parents.forEach(k=>{const R=N.get(k);R&&M.append("line").attr("x1",x.x).attr("y1",x.y).attr("x2",R.x).attr("y2",R.y).attr("stroke","#666").attr("stroke-width",1.5).attr("stroke-opacity",.6)})}),M.selectAll("g.node").data(Q).enter().append("g").attr("class","node").attr("transform",m=>{const x=N.get(m.hash);return x?`translate(${x.x}, ${x.y})`:"translate(-100, -100)"}).append("circle").attr("r",m=>g.get(m.hash)<p.length?o:o*.7).attr("fill",m=>g.get(m.hash)<p.length?d.has(m.hash)?"#4fc3f7":"#fff":"#888").attr("stroke","#333").attr("stroke-width",m=>g.get(m.hash)<p.length?2:1).style("cursor","pointer").on("mouseenter",(m,x)=>{const k=d.get(x.hash),R=k?`[${k.join(", ")}]<br/>`:"",et=new Date(x.timestamp*1e3).toLocaleString();w.html(`<strong>${x.hash.substring(0,7)}</strong><br/>${R}${x.message}<br/><span class="date">${et}</span>`).style("left",m.pageX+15+"px").style("top",m.pageY-10+"px").style("opacity",1)}).on("mousemove",m=>{w.style("left",m.pageX+15+"px").style("top",m.pageY-10+"px")}).on("mouseleave",()=>{w.style("opacity",0)});const T=Ao().scaleExtent([.1,3]).on("zoom",m=>{M.attr("transform",m.transform)});T.filter(m=>m.type==="wheel"||m.touches||m.type==="mousedown"&&m.button===2||m.type==="mousemove"&&m.buttons===2?!0:!(m.type==="mousedown"&&m.button===0)),t.call(T),t.on("contextmenu",m=>{m.preventDefault()})}async function zo(){[Q,ct]=await Promise.all([$o(),ko()]),Kt.clear(),Q.forEach(t=>Kt.set(t.hash,t)),console.log("Commits:",Q.length),console.log("Branches:",ct.length),Mo(ct),Wt(),window.addEventListener("resize",()=>{Wt()})}zo();
@@ -0,0 +1,3 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var cn={value:()=>{}};function Re(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new xt(n)}function xt(t){this._=t}function ln(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}xt.prototype=Re.prototype={constructor:xt,on:function(t,e){var n=this._,r=ln(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=un(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(t=r[o]).type)n[i]=ge(n[i],t.name,e);else if(e==null)for(i in n)n[i]=ge(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new xt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function un(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function ge(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=cn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var qt="http://www.w3.org/1999/xhtml";const me={svg:"http://www.w3.org/2000/svg",xhtml:qt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function kt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),me.hasOwnProperty(e)?{space:me[e],local:t}:t}function fn(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===qt&&e.documentElement.namespaceURI===qt?e.createElement(t):e.createElementNS(n,t)}}function hn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Me(t){var e=kt(t);return(e.local?hn:fn)(e)}function pn(){}function jt(t){return t==null?pn:function(){return this.querySelector(t)}}function dn(t){typeof t!="function"&&(t=jt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=new Array(s),c,l,u=0;u<s;++u)(c=o[u])&&(l=t.call(c,c.__data__,u,o))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new A(r,this._parents)}function gn(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function mn(){return[]}function Te(t){return t==null?mn:function(){return this.querySelectorAll(t)}}function wn(t){return function(){return gn(t.apply(this,arguments))}}function yn(t){typeof t=="function"?t=wn(t):t=Te(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s=e[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(r.push(t.call(c,c.__data__,l,s)),i.push(c));return new A(r,i)}function Ie(t){return function(){return this.matches(t)}}function Oe(t){return function(e){return e.matches(t)}}var _n=Array.prototype.find;function xn(t){return function(){return _n.call(this.children,t)}}function vn(){return this.firstElementChild}function bn(t){return this.select(t==null?vn:xn(typeof t=="function"?t:Oe(t)))}var $n=Array.prototype.filter;function En(){return Array.from(this.children)}function Sn(t){return function(){return $n.call(this.children,t)}}function Nn(t){return this.selectAll(t==null?En:Sn(typeof t=="function"?t:Oe(t)))}function Cn(t){typeof t!="function"&&(t=Ie(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new A(r,this._parents)}function Pe(t){return new Array(t.length)}function An(){return new A(this._enter||this._groups.map(Pe),this._parents)}function $t(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}$t.prototype={constructor:$t,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 kn(t){return function(){return t}}function Bn(t,e,n,r,i,o){for(var s=0,a,c=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new $t(t,o[s]);for(;s<c;++s)(a=e[s])&&(i[s]=a)}function Rn(t,e,n,r,i,o,s){var a,c,l=new Map,u=e.length,p=o.length,d=new Array(u),g;for(a=0;a<u;++a)(c=e[a])&&(d[a]=g=s.call(c,c.__data__,a,e)+"",l.has(g)?i[a]=c:l.set(g,c));for(a=0;a<p;++a)g=s.call(t,o[a],a,o)+"",(c=l.get(g))?(r[a]=c,c.__data__=o[a],l.delete(g)):n[a]=new $t(t,o[a]);for(a=0;a<u;++a)(c=e[a])&&l.get(d[a])===c&&(i[a]=c)}function Mn(t){return t.__data__}function Tn(t,e){if(!arguments.length)return Array.from(this,Mn);var n=e?Rn:Bn,r=this._parents,i=this._groups;typeof t!="function"&&(t=kn(t));for(var o=i.length,s=new Array(o),a=new Array(o),c=new Array(o),l=0;l<o;++l){var u=r[l],p=i[l],d=p.length,g=In(t.call(u,u&&u.__data__,l,r)),m=g.length,E=a[l]=new Array(m),N=s[l]=new Array(m),Mt=c[l]=new Array(d);n(u,p,E,N,Mt,g,e);for(var T=0,D=0,S,ft;T<m;++T)if(S=E[T]){for(T>=D&&(D=T+1);!(ft=N[D])&&++D<m;);S._next=ft||null}}return s=new A(s,r),s._enter=a,s._exit=c,s}function In(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function On(){return new A(this._exit||this._groups.map(Pe),this._parents)}function Pn(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Fn(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var l=n[c],u=r[c],p=l.length,d=a[c]=new Array(p),g,m=0;m<p;++m)(g=l[m]||u[m])&&(d[m]=g);for(;c<i;++c)a[c]=n[c];return new A(a,this._parents)}function Xn(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function Ln(t){t||(t=Yn);function e(p,d){return p&&d?t(p.__data__,d.__data__):!p-!d}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,c=i[o]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(e)}return new A(i,this._parents).order()}function Yn(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Hn(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Dn(){return Array.from(this)}function qn(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function Vn(){let t=0;for(const e of this)++t;return t}function zn(){return!this.node()}function Un(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function Zn(t){return function(){this.removeAttribute(t)}}function Kn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Gn(t,e){return function(){this.setAttribute(t,e)}}function Wn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Jn(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Qn(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function jn(t,e){var n=kt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Kn:Zn:typeof e=="function"?n.local?Qn:Jn:n.local?Wn:Gn)(n,e))}function Fe(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function tr(t){return function(){this.style.removeProperty(t)}}function er(t,e,n){return function(){this.style.setProperty(t,e,n)}}function nr(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function rr(t,e,n){return arguments.length>1?this.each((e==null?tr:typeof e=="function"?nr:er)(t,e,n??"")):W(this.node(),t)}function W(t,e){return t.style.getPropertyValue(e)||Fe(t).getComputedStyle(t,null).getPropertyValue(e)}function ir(t){return function(){delete this[t]}}function or(t,e){return function(){this[t]=e}}function sr(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function ar(t,e){return arguments.length>1?this.each((e==null?ir:typeof e=="function"?sr:or)(t,e)):this.node()[t]}function Xe(t){return t.trim().split(/^|\s+/)}function te(t){return t.classList||new Le(t)}function Le(t){this._node=t,this._names=Xe(t.getAttribute("class")||"")}Le.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 Ye(t,e){for(var n=te(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function He(t,e){for(var n=te(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function cr(t){return function(){Ye(this,t)}}function lr(t){return function(){He(this,t)}}function ur(t,e){return function(){(e.apply(this,arguments)?Ye:He)(this,t)}}function fr(t,e){var n=Xe(t+"");if(arguments.length<2){for(var r=te(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?ur:e?cr:lr)(n,e))}function hr(){this.textContent=""}function pr(t){return function(){this.textContent=t}}function dr(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function gr(t){return arguments.length?this.each(t==null?hr:(typeof t=="function"?dr:pr)(t)):this.node().textContent}function mr(){this.innerHTML=""}function wr(t){return function(){this.innerHTML=t}}function yr(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function _r(t){return arguments.length?this.each(t==null?mr:(typeof t=="function"?yr:wr)(t)):this.node().innerHTML}function xr(){this.nextSibling&&this.parentNode.appendChild(this)}function vr(){return this.each(xr)}function br(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $r(){return this.each(br)}function Er(t){var e=typeof t=="function"?t:Me(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Sr(){return null}function Nr(t,e){var n=typeof t=="function"?t:Me(t),r=e==null?Sr:typeof e=="function"?e:jt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Cr(){var t=this.parentNode;t&&t.removeChild(this)}function Ar(){return this.each(Cr)}function kr(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Br(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Rr(t){return this.select(t?Br:kr)}function Mr(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Tr(t){return function(e){t.call(this,e,this.__data__)}}function Ir(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Or(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function Pr(t,e,n){return function(){var r=this.__on,i,o=Tr(e);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Fr(t,e,n){var r=Ir(t+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(i=0,u=a[c];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?Pr:Or,i=0;i<o;++i)this.each(a(r[i],e,n));return this}function De(t,e,n){var r=Fe(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Xr(t,e){return function(){return De(this,t,e)}}function Lr(t,e){return function(){return De(this,t,e.apply(this,arguments))}}function Yr(t,e){return this.each((typeof e=="function"?Lr:Xr)(t,e))}function*Hr(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var qe=[null];function A(t,e){this._groups=t,this._parents=e}function lt(){return new A([[document.documentElement]],qe)}function Dr(){return this}A.prototype=lt.prototype={constructor:A,select:dn,selectAll:yn,selectChild:bn,selectChildren:Nn,filter:Cn,data:Tn,enter:An,exit:On,join:Pn,merge:Fn,selection:Dr,order:Xn,sort:Ln,call:Hn,nodes:Dn,node:qn,size:Vn,empty:zn,each:Un,attr:jn,style:rr,property:ar,classed:fr,text:gr,html:_r,raise:vr,lower:$r,append:Er,insert:Nr,remove:Ar,clone:Rr,datum:Mr,on:Fr,dispatch:Yr,[Symbol.iterator]:Hr};function Lt(t){return typeof t=="string"?new A([[document.querySelector(t)]],[document.documentElement]):new A([[t]],qe)}function ee(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ve(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ut(){}var ot=.7,Et=1/ot,G="\\s*([+-]?\\d+)\\s*",st="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",I="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qr=/^#([0-9a-f]{3,8})$/,Vr=new RegExp(`^rgb\\(${G},${G},${G}\\)$`),zr=new RegExp(`^rgb\\(${I},${I},${I}\\)$`),Ur=new RegExp(`^rgba\\(${G},${G},${G},${st}\\)$`),Zr=new RegExp(`^rgba\\(${I},${I},${I},${st}\\)$`),Kr=new RegExp(`^hsl\\(${st},${I},${I}\\)$`),Gr=new RegExp(`^hsla\\(${st},${I},${I},${st}\\)$`),we={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};ee(ut,at,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ye,formatHex:ye,formatHex8:Wr,formatHsl:Jr,formatRgb:_e,toString:_e});function ye(){return this.rgb().formatHex()}function Wr(){return this.rgb().formatHex8()}function Jr(){return ze(this).formatHsl()}function _e(){return this.rgb().formatRgb()}function at(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=qr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?xe(e):n===3?new C(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?wt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?wt(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=Vr.exec(t))?new C(e[1],e[2],e[3],1):(e=zr.exec(t))?new C(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ur.exec(t))?wt(e[1],e[2],e[3],e[4]):(e=Zr.exec(t))?wt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Kr.exec(t))?$e(e[1],e[2]/100,e[3]/100,1):(e=Gr.exec(t))?$e(e[1],e[2]/100,e[3]/100,e[4]):we.hasOwnProperty(t)?xe(we[t]):t==="transparent"?new C(NaN,NaN,NaN,0):null}function xe(t){return new C(t>>16&255,t>>8&255,t&255,1)}function wt(t,e,n,r){return r<=0&&(t=e=n=NaN),new C(t,e,n,r)}function Qr(t){return t instanceof ut||(t=at(t)),t?(t=t.rgb(),new C(t.r,t.g,t.b,t.opacity)):new C}function Vt(t,e,n,r){return arguments.length===1?Qr(t):new C(t,e,n,r??1)}function C(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}ee(C,Vt,Ve(ut,{brighter(t){return t=t==null?Et:Math.pow(Et,t),new C(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ot:Math.pow(ot,t),new C(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new C(U(this.r),U(this.g),U(this.b),St(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:ve,formatHex:ve,formatHex8:jr,formatRgb:be,toString:be}));function ve(){return`#${z(this.r)}${z(this.g)}${z(this.b)}`}function jr(){return`#${z(this.r)}${z(this.g)}${z(this.b)}${z((isNaN(this.opacity)?1:this.opacity)*255)}`}function be(){const t=St(this.opacity);return`${t===1?"rgb(":"rgba("}${U(this.r)}, ${U(this.g)}, ${U(this.b)}${t===1?")":`, ${t})`}`}function St(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function U(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function z(t){return t=U(t),(t<16?"0":"")+t.toString(16)}function $e(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new R(t,e,n,r)}function ze(t){if(t instanceof R)return new R(t.h,t.s,t.l,t.opacity);if(t instanceof ut||(t=at(t)),!t)return new R;if(t instanceof R)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,c=(o+i)/2;return a?(e===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-e)/a+2:s=(e-n)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new R(s,a,c,t.opacity)}function ti(t,e,n,r){return arguments.length===1?ze(t):new R(t,e,n,r??1)}function R(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ee(R,ti,Ve(ut,{brighter(t){return t=t==null?Et:Math.pow(Et,t),new R(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ot:Math.pow(ot,t),new R(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,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new C(Yt(t>=240?t-240:t+120,i,r),Yt(t,i,r),Yt(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new R(Ee(this.h),yt(this.s),yt(this.l),St(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=St(this.opacity);return`${t===1?"hsl(":"hsla("}${Ee(this.h)}, ${yt(this.s)*100}%, ${yt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ee(t){return t=(t||0)%360,t<0?t+360:t}function yt(t){return Math.max(0,Math.min(1,t||0))}function Yt(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Ue=t=>()=>t;function ei(t,e){return function(n){return t+n*e}}function ni(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function ri(t){return(t=+t)==1?Ze:function(e,n){return n-e?ni(e,n,t):Ue(isNaN(e)?n:e)}}function Ze(t,e){var n=e-t;return n?ei(t,n):Ue(isNaN(t)?e:t)}const Se=(function t(e){var n=ri(e);function r(i,o){var s=n((i=Vt(i)).r,(o=Vt(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),l=Ze(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=t,r})(1);function H(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var zt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ht=new RegExp(zt.source,"g");function ii(t){return function(){return t}}function oi(t){return function(e){return t(e)+""}}function si(t,e){var n=zt.lastIndex=Ht.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(r=zt.exec(t))&&(i=Ht.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:H(r,i)})),n=Ht.lastIndex;return n<e.length&&(o=e.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?oi(c[0].x):ii(e):(e=c.length,function(l){for(var u=0,p;u<e;++u)a[(p=c[u]).i]=p.x(l);return a.join("")})}var Ne=180/Math.PI,Ut={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ke(t,e,n,r,i,o){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),t*r<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*Ne,skewX:Math.atan(c)*Ne,scaleX:s,scaleY:a}}var _t;function ai(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ut:Ke(e.a,e.b,e.c,e.d,e.e,e.f)}function ci(t){return t==null||(_t||(_t=document.createElementNS("http://www.w3.org/2000/svg","g")),_t.setAttribute("transform",t),!(t=_t.transform.baseVal.consolidate()))?Ut:(t=t.matrix,Ke(t.a,t.b,t.c,t.d,t.e,t.f))}function Ge(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,p,d,g,m){if(l!==p||u!==d){var E=g.push("translate(",null,e,null,n);m.push({i:E-4,x:H(l,p)},{i:E-2,x:H(u,d)})}else(p||d)&&g.push("translate("+p+e+d+n)}function s(l,u,p,d){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),d.push({i:p.push(i(p)+"rotate(",null,r)-2,x:H(l,u)})):u&&p.push(i(p)+"rotate("+u+r)}function a(l,u,p,d){l!==u?d.push({i:p.push(i(p)+"skewX(",null,r)-2,x:H(l,u)}):u&&p.push(i(p)+"skewX("+u+r)}function c(l,u,p,d,g,m){if(l!==p||u!==d){var E=g.push(i(g)+"scale(",null,",",null,")");m.push({i:E-4,x:H(l,p)},{i:E-2,x:H(u,d)})}else(p!==1||d!==1)&&g.push(i(g)+"scale("+p+","+d+")")}return function(l,u){var p=[],d=[];return l=t(l),u=t(u),o(l.translateX,l.translateY,u.translateX,u.translateY,p,d),s(l.rotate,u.rotate,p,d),a(l.skewX,u.skewX,p,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,p,d),l=u=null,function(g){for(var m=-1,E=d.length,N;++m<E;)p[(N=d[m]).i]=N.x(g);return p.join("")}}}var li=Ge(ai,"px, ","px)","deg)"),ui=Ge(ci,", ",")",")"),J=0,et=0,tt=0,We=1e3,Nt,nt,Ct=0,K=0,Bt=0,ct=typeof performance=="object"&&performance.now?performance:Date,Je=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ne(){return K||(Je(fi),K=ct.now()+Bt)}function fi(){K=0}function At(){this._call=this._time=this._next=null}At.prototype=Qe.prototype={constructor:At,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?ne():+n)+(e==null?0:+e),!this._next&&nt!==this&&(nt?nt._next=this:Nt=this,nt=this),this._call=t,this._time=n,Zt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zt())}};function Qe(t,e,n){var r=new At;return r.restart(t,e,n),r}function hi(){ne(),++J;for(var t=Nt,e;t;)(e=K-t._time)>=0&&t._call.call(void 0,e),t=t._next;--J}function Ce(){K=(Ct=ct.now())+Bt,J=et=0;try{hi()}finally{J=0,di(),K=0}}function pi(){var t=ct.now(),e=t-Ct;e>We&&(Bt-=e,Ct=t)}function di(){for(var t,e=Nt,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Nt=n);nt=t,Zt(r)}function Zt(t){if(!J){et&&(et=clearTimeout(et));var e=t-K;e>24?(t<1/0&&(et=setTimeout(Ce,t-ct.now()-Bt)),tt&&(tt=clearInterval(tt))):(tt||(Ct=ct.now(),tt=setInterval(pi,We)),J=1,Je(Ce))}}function Ae(t,e,n){var r=new At;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var gi=Re("start","end","cancel","interrupt"),mi=[],je=0,ke=1,Kt=2,vt=3,Be=4,Gt=5,bt=6;function Rt(t,e,n,r,i,o){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;wi(t,n,{name:e,index:r,group:i,on:gi,tween:mi,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:je})}function re(t,e){var n=M(t,e);if(n.state>je)throw new Error("too late; already scheduled");return n}function O(t,e){var n=M(t,e);if(n.state>vt)throw new Error("too late; already running");return n}function M(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function wi(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Qe(o,0,n.time);function o(l){n.state=ke,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,p,d,g;if(n.state!==ke)return c();for(u in r)if(g=r[u],g.name===n.name){if(g.state===vt)return Ae(s);g.state===Be?(g.state=bt,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete r[u]):+u<e&&(g.state=bt,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete r[u])}if(Ae(function(){n.state===vt&&(n.state=Be,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Kt,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Kt){for(n.state=vt,i=new Array(d=n.tween.length),u=0,p=-1;u<d;++u)(g=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++p]=g);i.length=p+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Gt,1),p=-1,d=i.length;++p<d;)i[p].call(t,u);n.state===Gt&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=bt,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function yi(t,e){var n=t.__transition,r,i,o=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((r=n[s]).name!==e){o=!1;continue}i=r.state>Kt&&r.state<Gt,r.state=bt,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}o&&delete t.__transition}}function _i(t){return this.each(function(){yi(this,t)})}function xi(t,e){var n,r;return function(){var i=O(this,t),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function vi(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=O(this,t),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:e,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===e){i[c]=a;break}c===l&&i.push(a)}o.tween=i}}function bi(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=M(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===t)return s.value;return null}return this.each((e==null?xi:vi)(n,t,e))}function ie(t,e,n){var r=t._id;return t.each(function(){var i=O(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return M(i,r).value[e]}}function tn(t,e){var n;return(typeof e=="number"?H:e instanceof at?Se:(n=at(e))?(e=n,Se):si)(t,e)}function $i(t){return function(){this.removeAttribute(t)}}function Ei(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Si(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttribute(t);return s===i?null:s===r?o:o=e(r=s,n)}}function Ni(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===r?o:o=e(r=s,n)}}function Ci(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function Ai(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function ki(t,e){var n=kt(t),r=n==="transform"?ui:tn;return this.attrTween(t,typeof e=="function"?(n.local?Ai:Ci)(n,r,ie(this,"attr."+t,e)):e==null?(n.local?Ei:$i)(n):(n.local?Ni:Si)(n,r,e))}function Bi(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Ri(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Mi(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Ri(t,o)),n}return i._value=e,i}function Ti(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Bi(t,o)),n}return i._value=e,i}function Ii(t,e){var n="attr."+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;var r=kt(t);return this.tween(n,(r.local?Mi:Ti)(r,e))}function Oi(t,e){return function(){re(this,t).delay=+e.apply(this,arguments)}}function Pi(t,e){return e=+e,function(){re(this,t).delay=e}}function Fi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Oi:Pi)(e,t)):M(this.node(),e).delay}function Xi(t,e){return function(){O(this,t).duration=+e.apply(this,arguments)}}function Li(t,e){return e=+e,function(){O(this,t).duration=e}}function Yi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Xi:Li)(e,t)):M(this.node(),e).duration}function Hi(t,e){if(typeof e!="function")throw new Error;return function(){O(this,t).ease=e}}function Di(t){var e=this._id;return arguments.length?this.each(Hi(e,t)):M(this.node(),e).ease}function qi(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;O(this,t).ease=n}}function Vi(t){if(typeof t!="function")throw new Error;return this.each(qi(this._id,t))}function zi(t){typeof t!="function"&&(t=Ie(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new L(r,this._parents,this._name,this._id)}function Ui(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var c=e[a],l=n[a],u=c.length,p=s[a]=new Array(u),d,g=0;g<u;++g)(d=c[g]||l[g])&&(p[g]=d);for(;a<r;++a)s[a]=e[a];return new L(s,this._parents,this._name,this._id)}function Zi(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Ki(t,e,n){var r,i,o=Zi(e)?re:O;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}function Gi(t,e){var n=this._id;return arguments.length<2?M(this.node(),n).on.on(t):this.each(Ki(n,t,e))}function Wi(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Ji(){return this.on("end.remove",Wi(this._id))}function Qi(t){var e=this._name,n=this._id;typeof t!="function"&&(t=jt(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],c=a.length,l=o[s]=new Array(c),u,p,d=0;d<c;++d)(u=a[d])&&(p=t.call(u,u.__data__,d,a))&&("__data__"in u&&(p.__data__=u.__data__),l[d]=p,Rt(l[d],e,n,d,l,M(u,n)));return new L(o,this._parents,e,n)}function ji(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Te(t));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var c=r[a],l=c.length,u,p=0;p<l;++p)if(u=c[p]){for(var d=t.call(u,u.__data__,p,c),g,m=M(u,n),E=0,N=d.length;E<N;++E)(g=d[E])&&Rt(g,e,n,E,d,m);o.push(d),s.push(u)}return new L(o,s,e,n)}var to=lt.prototype.constructor;function eo(){return new to(this._groups,this._parents)}function no(t,e){var n,r,i;return function(){var o=W(this,t),s=(this.style.removeProperty(t),W(this,t));return o===s?null:o===n&&s===r?i:i=e(n=o,r=s)}}function en(t){return function(){this.style.removeProperty(t)}}function ro(t,e,n){var r,i=n+"",o;return function(){var s=W(this,t);return s===i?null:s===r?o:o=e(r=s,n)}}function io(t,e,n){var r,i,o;return function(){var s=W(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),W(this,t))),s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a))}}function oo(t,e){var n,r,i,o="style."+e,s="end."+o,a;return function(){var c=O(this,t),l=c.on,u=c.value[o]==null?a||(a=en(e)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function so(t,e,n){var r=(t+="")=="transform"?li:tn;return e==null?this.styleTween(t,no(t,r)).on("end.style."+t,en(t)):typeof e=="function"?this.styleTween(t,io(t,r,ie(this,"style."+t,e))).each(oo(this._id,t)):this.styleTween(t,ro(t,r,e),n).on("end.style."+t,null)}function ao(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function co(t,e,n){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&ao(t,s,n)),r}return o._value=e,o}function lo(t,e,n){var r="style."+(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;return this.tween(r,co(t,e,n??""))}function uo(t){return function(){this.textContent=t}}function fo(t){return function(){var e=t(this);this.textContent=e??""}}function ho(t){return this.tween("text",typeof t=="function"?fo(ie(this,"text",t)):uo(t==null?"":t+""))}function po(t){return function(e){this.textContent=t.call(this,e)}}function go(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&po(i)),e}return r._value=t,r}function mo(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,go(t))}function wo(){for(var t=this._name,e=this._id,n=nn(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=M(c,e);Rt(c,t,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new L(r,this._parents,t,n)}function yo(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},c={value:function(){--i===0&&o()}};n.each(function(){var l=O(this,r),u=l.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),l.on=e}),i===0&&o()})}var _o=0;function L(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function nn(){return++_o}var X=lt.prototype;L.prototype={constructor:L,select:Qi,selectAll:ji,selectChild:X.selectChild,selectChildren:X.selectChildren,filter:zi,merge:Ui,selection:eo,transition:wo,call:X.call,nodes:X.nodes,node:X.node,size:X.size,empty:X.empty,each:X.each,on:Gi,attr:ki,attrTween:Ii,style:so,styleTween:lo,text:ho,textTween:mo,remove:Ji,tween:bi,delay:Fi,duration:Yi,ease:Di,easeVarying:Vi,end:yo,[Symbol.iterator]:X[Symbol.iterator]};function xo(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var vo={time:null,delay:0,duration:250,ease:xo};function bo(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function $o(t){var e,n;t instanceof L?(e=t._id,t=t._name):(e=nn(),(n=vo).time=ne(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&Rt(c,t,e,l,s,n||bo(c,e));return new L(r,this._parents,t,e)}lt.prototype.interrupt=_i;lt.prototype.transition=$o;function rt(t,e,n){this.k=t,this.x=e,this.y=n}rt.prototype={constructor:rt,scale:function(t){return t===1?this:new rt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new rt(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+")"}};rt.prototype;let B=[],it=[],Wt=[],Z=new Map,Dt="",V=1,Jt={};async function Eo(){const t=await window.gitopo.git.exec("rev-parse --show-toplevel");if(t.success){const e=t.output.trim();return e.split("/").pop()||e}return"Unknown Repository"}async function So(){const t=await window.gitopo.config.get();return t.success?t.config:(console.error("Failed to fetch config:",t.error),{})}async function No(){const t=await window.gitopo.gh.exec("pr list --state open --json number,title,headRefName,headRefOid");if(!t.success)return console.error("Failed to fetch pull requests:",t.error),[];try{return JSON.parse(t.output).map(n=>({number:n.number,title:n.title,branch:n.headRefName,headCommit:n.headRefOid}))}catch(e){return console.error("Failed to parse PR data:",e),[]}}async function Co(){const t=await window.gitopo.git.exec('log --all --format="%H|%P|%ct|%s" --date-order -1000');if(!t.success)return console.error("Failed to fetch commits:",t.error),[];const e=[],n=t.output.trim().split(`
2
+ `);for(const r of n){const i=r.split("|");if(i.length>=4){const o=i[0],s=i[1],a=parseInt(i[2],10),c=i.slice(3).join("|"),l=s.trim()?s.trim().split(" "):[];e.push({hash:o,parents:l,timestamp:a,message:c})}}return e.sort((r,i)=>i.timestamp-r.timestamp),e}async function Ao(){const t=await window.gitopo.git.exec('branch -a --format="%(refname:short) %(objectname)"');if(!t.success)return console.error("Failed to fetch branches:",t.error),[];const e=[],n=t.output.trim().split(`
3
+ `);for(const r of n){const i=r.trim().split(" ");if(i.length>=2){const o=i[0],s=i[1];e.push({name:o,hash:s})}}return e}function ko(t){const e=["branch1","branch2","branch3"],n=Jt.keyBranches||[],r=t.find(i=>i.name==="main"||i.name==="master");e.forEach((i,o)=>{const s=document.getElementById(i);s.innerHTML="";const a=document.createElement("option");if(a.value="",a.textContent="----",s.appendChild(a),t.forEach(c=>{const l=document.createElement("option");l.value=c.name,l.textContent=c.name,s.appendChild(l)}),n[o]){const c=t.find(l=>l.name===n[o]);c&&(s.value=c.name)}else o===0&&r&&(s.value=r.name);s.addEventListener("change",()=>Qt())})}function Bo(t){const e=it.find(i=>i.name===t);if(!e)return new Set;const n=new Set;let r=e.hash;for(;r;){n.add(r);const i=Z.get(r);if(i&&i.parents.length>0)r=i.parents[0];else break}return n}function Ro(t,e=new Set){const n=[],r=new Set,i=new Map;for(const c of B)for(const l of c.parents)i.has(l)||i.set(l,[]),i.get(l).push(c.hash);function o(c){const l=new Set,u=[c];for(;u.length>0;){const p=u.pop();if(l.has(p)||t.has(p)||e.has(p)||r.has(p))continue;const d=Z.get(p);if(!d)continue;l.add(p);for(const m of d.parents)!t.has(m)&&!e.has(m)&&!l.has(m)&&u.push(m);const g=i.get(p)||[];for(const m of g)!t.has(m)&&!e.has(m)&&!l.has(m)&&u.push(m)}return l}function s(c){for(const l of c){const u=Z.get(l);if(u){for(const p of u.parents)if(!t.has(p)&&!c.has(p))return!1}}return!0}function a(c){for(const l of t){const u=Z.get(l);if(!(!u||u.parents.length<2)){for(let p=1;p<u.parents.length;p++)if(c.has(u.parents[p]))return l}}return null}for(const c of B){if(t.has(c.hash)||e.has(c.hash)||r.has(c.hash))continue;const l=o(c.hash);l.size>0&&s(l)&&(l.forEach(u=>r.add(u)),n.push({mergeCommit:a(l),commits:l}))}return n}function Mo(){const t=[];return["branch1","branch2","branch3"].forEach(e=>{const n=document.getElementById(e);n&&n.value&&t.push(n.value)}),t}function Qt(){const t=Lt("#graph");t.selectAll("*").remove();const e=Lt("#app");e.selectAll(".tooltip").remove();const n=document.getElementById("controls").offsetHeight,r=window.innerWidth,i=window.innerHeight-n;t.attr("width",r).attr("height",i);const o=6,s=30,a=150,c=30,l=50,u=50,d=Mo().map(f=>({name:f,lineage:Bo(f)})),g=new Set;d.forEach(({lineage:f})=>{f.forEach(h=>g.add(h))});const m=d.map(({name:f,lineage:h})=>{const w=new Set;d.forEach(_=>{_.name!==f&&_.lineage.forEach(y=>w.add(y))});const x=Ro(h,w);return{name:f,lineage:h,subBranches:x}}),E=new Map;it.forEach(f=>{E.has(f.hash)||E.set(f.hash,[]),E.get(f.hash).push(f.name)});const N=new Map;B.forEach(f=>{N.set(f.hash,{mainCol:m.length,subOffset:0,isSubBranch:!1})}),m.forEach((f,h)=>{for(const w of f.lineage)N.set(w,{mainCol:h,subOffset:0,isSubBranch:!1})});let Mt=0;m.forEach((f,h)=>{const w=new Map;f.subBranches.forEach(x=>{const _=`sb-${Mt++}`,y=[];x.commits.forEach(b=>{const k=B.findIndex(F=>F.hash===b);k>=0&&y.push(k)});let $=1,v=!0;for(;v;){v=!1;for(const b of y)if((w.get(b)||new Set).has($)){v=!0,$++;break}}for(const b of y)w.has(b)||w.set(b,new Set),w.get(b).add($);x.commits.forEach(b=>{N.set(b,{mainCol:h,subOffset:$,isSubBranch:!0,subBranchId:_})})})});const T=new Map;let D=u;for(let f=0;f<=m.length;f++)if(T.set(f,D),f<m.length){let h=0;B.forEach(w=>{const x=N.get(w.hash);x.mainCol===f&&x.subOffset>h&&(h=x.subOffset)}),D+=a+h*c}const S=new Map;B.forEach((f,h)=>{const w=N.get(f.hash),_=T.get(w.mainCol)+w.subOffset*c;S.set(f.hash,{col:w.mainCol,subOffset:w.subOffset,row:h,x:_,y:l+h*s,isSubBranch:w.isSubBranch,subBranchId:w.subBranchId||null})});const ft=Array.from(N.values()).some(f=>f.mainCol===m.length),P=t.append("g").attr("class","main-group"),Tt=t.append("g").attr("class","header-group"),It=e.append("div").attr("class","tooltip").style("opacity",0),ht=["#4CAF50","#2196F3","#FF9800"],oe=20;m.forEach((f,h)=>{Tt.append("text").attr("x",T.get(h)).attr("y",oe).attr("text-anchor","middle").attr("fill",ht[h]||"#888").attr("font-size","14px").attr("font-weight","bold").text(f.name)}),ft&&Tt.append("text").attr("x",T.get(m.length)).attr("y",oe).attr("text-anchor","middle").attr("fill","#888").attr("font-size","14px").text("Other");const pt=new Map;B.forEach(f=>{f.parents.forEach(h=>{pt.has(h)||pt.set(h,[]),pt.get(h).push(f.hash)})});const rn=new Set;m.forEach(f=>{f.lineage.forEach(h=>rn.add(h))});function se(f){const h=[],w=new Set;function x(y){if(w.has(y))return;w.add(y);const $=Z.get(y);$&&$.parents.forEach(v=>{h.push({source:y,target:v});const b=S.get(v);b&&b.col===m.length&&!b.isSubBranch&&x(v)})}function _(y){if(w.has(y))return;w.add(y),(pt.get(y)||[]).forEach(v=>{h.push({source:v,target:y});const b=S.get(v);b&&b.col===m.length&&!b.isSubBranch&&_(v)})}return x(f),w.delete(f),_(f),h}B.forEach(f=>{const h=S.get(f.hash);h&&f.parents.forEach(w=>{const x=S.get(w);if(x){const _=h.col===m.length||x.col===m.length,y=h.x,$=h.y*V,v=x.x,b=x.y*V;let k;if(y===v)k=`M ${y} ${$} L ${v} ${b}`;else{const mt=($+b)/2;k=`M ${y} ${$} C ${y} ${mt}, ${v} ${mt}, ${v} ${b}`}const F=h.subBranchId||x.subBranchId||null,Ft=h.isSubBranch||x.isSubBranch,sn=!Ft&&!_&&h.col<m.length;let Xt="#666";_?Xt="#444":h.col<m.length&&(Xt=ht[h.col]||"#666");let j=1.5;_?j=1:sn?j=3:Ft&&(j=1.5);const an=P.append("path").attr("d",k).attr("fill","none").attr("stroke",Xt).attr("stroke-width",j).attr("stroke-opacity",_?.4:Ft?.5:.8).attr("stroke-dasharray",_?"4,4":"none").attr("class",F?`edge edge-${F}`:"edge").attr("data-source",f.hash).attr("data-target",w);if(F){const mt=j;an.style("cursor","pointer").on("mouseenter",()=>{P.selectAll(`.edge-${F}`).attr("stroke-width",3).attr("stroke-opacity",.9)}).on("mouseleave",()=>{P.selectAll(`.edge-${F}`).attr("stroke-width",mt).attr("stroke-opacity",.5)})}}})});const Q=new Map;Wt.forEach(f=>{Q.set(f.headCommit,f)});const Ot=P.selectAll("g.node").data(B).enter().append("g").attr("class","node").attr("transform",f=>{const h=S.get(f.hash);return h?`translate(${h.x}, ${h.y*V})`:"translate(-100, -100)"});Ot.filter(f=>Q.has(f.hash)).append("circle").attr("r",o+6).attr("fill","none").attr("stroke","#888").attr("stroke-width",2).attr("stroke-dasharray","3,2"),Ot.append("circle").attr("r",f=>{const h=S.get(f.hash);return h.isSubBranch?o*.6:h.col<m.length?o:o*.7}).attr("fill",f=>{const h=S.get(f.hash);return h.col<m.length?ht[h.col]||"#fff":h.isSubBranch?"#a0a0a0":"#888"}).attr("stroke",f=>{const h=S.get(f.hash);return h.col<m.length&&ht[h.col]||"#333"}).attr("stroke-width",f=>{const h=S.get(f.hash);return h.isSubBranch?1:h.col<m.length?2:1}).style("cursor","pointer").on("mouseenter",(f,h)=>{const w=E.get(h.hash),x=w?`[${w.join(", ")}]<br/>`:"",_=Q.get(h.hash),y=_?`<span class="pr-info">PR #${_.number}: ${_.title}</span><br/>`:"",$=new Date(h.timestamp*1e3).toLocaleString();It.html(`<strong>${h.hash.substring(0,7)}</strong><br/>${y}${x}${h.message}<br/><span class="date">${$}</span>`).style("left",f.pageX+15+"px").style("top",f.pageY-10+"px").style("opacity",1);const v=S.get(h.hash);v&&v.col===m.length&&!v.isSubBranch&&se(h.hash).forEach(({source:k,target:F})=>{P.selectAll(`path.edge[data-source="${k}"][data-target="${F}"]`).attr("stroke-width",3).attr("stroke-opacity",.9)})}).on("mousemove",f=>{It.style("left",f.pageX+15+"px").style("top",f.pageY-10+"px")}).on("mouseleave",(f,h)=>{It.style("opacity",0);const w=S.get(h.hash);w&&w.col===m.length&&!w.isSubBranch&&se(h.hash).forEach(({source:_,target:y})=>{P.selectAll(`path.edge[data-source="${_}"][data-target="${y}"]`).attr("stroke-width",1).attr("stroke-opacity",.4)})}),Ot.filter(f=>Q.has(f.hash)).append("text").attr("x",o+10).attr("y",4).attr("fill","#ccc").attr("font-size","11px").text(f=>{const h=Q.get(f.hash);return`PR #${h.number}: ${h.title.substring(0,30)}${h.title.length>30?"...":""}`});let q=0,Y=0,dt=!1,ae=0,ce=0,le=0,ue=0;function Pt(f){return f*V}function gt(){P.attr("transform",`translate(${q}, ${Y})`),Tt.attr("transform",`translate(${q}, 0)`)}function on(){P.selectAll("g.node").attr("transform",f=>{const h=S.get(f.hash);return h?`translate(${h.x}, ${Pt(h.y)})`:"translate(-100, -100)"}),P.selectAll("path.edge").attr("d",function(){const f=Lt(this),h=f.attr("data-source"),w=f.attr("data-target"),x=S.get(h),_=S.get(w);if(!x||!_)return"";const y=x.x,$=Pt(x.y),v=_.x,b=Pt(_.y);if(y===v)return`M ${y} ${$} L ${v} ${b}`;{const k=($+b)/2;return`M ${y} ${$} C ${y} ${k}, ${v} ${k}, ${v} ${b}`}})}t.on("wheel",f=>{if(f.preventDefault(),f.ctrlKey||f.metaKey){const h=f.deltaY>0?.9:1.1,_=Math.max(.1,Math.min(5,V*h)),y=t.node().getBoundingClientRect(),$=f.clientY-y.top,v=$-Y;Y=$-v*(_/V),V=_,on(),gt()}else q-=f.deltaX,Y-=f.deltaY,gt()}),t.on("mousedown",f=>{f.button===0&&(dt=!0,ae=f.clientX,ce=f.clientY,le=q,ue=Y,f.preventDefault())}),t.on("mousemove",f=>{dt&&(q=le+(f.clientX-ae),Y=ue+(f.clientY-ce),gt())}),t.on("mouseup",f=>{f.button===0&&(dt=!1)}),t.on("mouseleave",()=>{dt=!1});let fe=0,he=0,pe=0,de=0;t.on("touchstart",f=>{if(f.touches.length===1){const h=f.touches[0];fe=h.clientX,he=h.clientY,pe=q,de=Y}}),t.on("touchmove",f=>{if(f.touches.length===1){f.preventDefault();const h=f.touches[0];q=pe+(h.clientX-fe),Y=de+(h.clientY-he),gt()}}),t.on("contextmenu",f=>{f.preventDefault()})}async function To(){[B,it,Dt,Wt,Jt]=await Promise.all([Co(),Ao(),Eo(),No(),So()]),document.getElementById("repo-name").textContent=Dt,Z.clear(),B.forEach(t=>Z.set(t.hash,t)),console.log("Repository:",Dt),console.log("Commits:",B.length),console.log("Branches:",it.length),console.log("Open PRs:",Wt.length),console.log("Config:",Jt),ko(it),Qt(),window.addEventListener("resize",()=>{Qt()})}To();
@@ -0,0 +1,3 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var hn={value:()=>{}};function Ie(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new bt(n)}function bt(t){this._=t}function dn(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}bt.prototype=Ie.prototype={constructor:bt,on:function(t,e){var n=this._,r=dn(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=pn(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(t=r[o]).type)n[i]=me(n[i],t.name,e);else if(e==null)for(i in n)n[i]=me(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new bt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function pn(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function me(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=hn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var zt="http://www.w3.org/1999/xhtml";const we={svg:"http://www.w3.org/2000/svg",xhtml:zt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function It(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),we.hasOwnProperty(e)?{space:we[e],local:t}:t}function gn(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===zt&&e.documentElement.namespaceURI===zt?e.createElement(t):e.createElementNS(n,t)}}function mn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Me(t){var e=It(t);return(e.local?mn:gn)(e)}function wn(){}function te(t){return t==null?wn:function(){return this.querySelector(t)}}function yn(t){typeof t!="function"&&(t=te(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=new Array(s),c,l,u=0;u<s;++u)(c=o[u])&&(l=t.call(c,c.__data__,u,o))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new R(r,this._parents)}function _n(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function xn(){return[]}function Te(t){return t==null?xn:function(){return this.querySelectorAll(t)}}function vn(t){return function(){return _n(t.apply(this,arguments))}}function bn(t){typeof t=="function"?t=vn(t):t=Te(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s=e[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(r.push(t.call(c,c.__data__,l,s)),i.push(c));return new R(r,i)}function Le(t){return function(){return this.matches(t)}}function Oe(t){return function(e){return e.matches(t)}}var $n=Array.prototype.find;function En(t){return function(){return $n.call(this.children,t)}}function Sn(){return this.firstElementChild}function Nn(t){return this.select(t==null?Sn:En(typeof t=="function"?t:Oe(t)))}var Cn=Array.prototype.filter;function An(){return Array.from(this.children)}function kn(t){return function(){return Cn.call(this.children,t)}}function Bn(t){return this.selectAll(t==null?An:kn(typeof t=="function"?t:Oe(t)))}function Rn(t){typeof t!="function"&&(t=Le(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new R(r,this._parents)}function Pe(t){return new Array(t.length)}function In(){return new R(this._enter||this._groups.map(Pe),this._parents)}function St(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}St.prototype={constructor:St,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 Mn(t){return function(){return t}}function Tn(t,e,n,r,i,o){for(var s=0,a,c=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new St(t,o[s]);for(;s<c;++s)(a=e[s])&&(i[s]=a)}function Ln(t,e,n,r,i,o,s){var a,c,l=new Map,u=e.length,d=o.length,p=new Array(u),g;for(a=0;a<u;++a)(c=e[a])&&(p[a]=g=s.call(c,c.__data__,a,e)+"",l.has(g)?i[a]=c:l.set(g,c));for(a=0;a<d;++a)g=s.call(t,o[a],a,o)+"",(c=l.get(g))?(r[a]=c,c.__data__=o[a],l.delete(g)):n[a]=new St(t,o[a]);for(a=0;a<u;++a)(c=e[a])&&l.get(p[a])===c&&(i[a]=c)}function On(t){return t.__data__}function Pn(t,e){if(!arguments.length)return Array.from(this,On);var n=e?Ln:Tn,r=this._parents,i=this._groups;typeof t!="function"&&(t=Mn(t));for(var o=i.length,s=new Array(o),a=new Array(o),c=new Array(o),l=0;l<o;++l){var u=r[l],d=i[l],p=d.length,g=Fn(t.call(u,u&&u.__data__,l,r)),m=g.length,E=a[l]=new Array(m),k=s[l]=new Array(m),Lt=c[l]=new Array(p);n(u,d,E,k,Lt,g,e);for(var T=0,V=0,N,dt;T<m;++T)if(N=E[T]){for(T>=V&&(V=T+1);!(dt=k[V])&&++V<m;);N._next=dt||null}}return s=new R(s,r),s._enter=a,s._exit=c,s}function Fn(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Xn(){return new R(this._exit||this._groups.map(Pe),this._parents)}function Yn(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Hn(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var l=n[c],u=r[c],d=l.length,p=a[c]=new Array(d),g,m=0;m<d;++m)(g=l[m]||u[m])&&(p[m]=g);for(;c<i;++c)a[c]=n[c];return new R(a,this._parents)}function qn(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function Dn(t){t||(t=Vn);function e(d,p){return d&&p?t(d.__data__,p.__data__):!d-!p}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,c=i[o]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(e)}return new R(i,this._parents).order()}function Vn(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function zn(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Un(){return Array.from(this)}function Zn(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function Kn(){let t=0;for(const e of this)++t;return t}function Gn(){return!this.node()}function Wn(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function Jn(t){return function(){this.removeAttribute(t)}}function Qn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function jn(t,e){return function(){this.setAttribute(t,e)}}function tr(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function er(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function nr(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function rr(t,e){var n=It(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Qn:Jn:typeof e=="function"?n.local?nr:er:n.local?tr:jn)(n,e))}function Fe(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ir(t){return function(){this.style.removeProperty(t)}}function or(t,e,n){return function(){this.style.setProperty(t,e,n)}}function sr(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function ar(t,e,n){return arguments.length>1?this.each((e==null?ir:typeof e=="function"?sr:or)(t,e,n??"")):J(this.node(),t)}function J(t,e){return t.style.getPropertyValue(e)||Fe(t).getComputedStyle(t,null).getPropertyValue(e)}function cr(t){return function(){delete this[t]}}function lr(t,e){return function(){this[t]=e}}function ur(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function fr(t,e){return arguments.length>1?this.each((e==null?cr:typeof e=="function"?ur:lr)(t,e)):this.node()[t]}function Xe(t){return t.trim().split(/^|\s+/)}function ee(t){return t.classList||new Ye(t)}function Ye(t){this._node=t,this._names=Xe(t.getAttribute("class")||"")}Ye.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 He(t,e){for(var n=ee(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function qe(t,e){for(var n=ee(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function hr(t){return function(){He(this,t)}}function dr(t){return function(){qe(this,t)}}function pr(t,e){return function(){(e.apply(this,arguments)?He:qe)(this,t)}}function gr(t,e){var n=Xe(t+"");if(arguments.length<2){for(var r=ee(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?pr:e?hr:dr)(n,e))}function mr(){this.textContent=""}function wr(t){return function(){this.textContent=t}}function yr(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function _r(t){return arguments.length?this.each(t==null?mr:(typeof t=="function"?yr:wr)(t)):this.node().textContent}function xr(){this.innerHTML=""}function vr(t){return function(){this.innerHTML=t}}function br(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function $r(t){return arguments.length?this.each(t==null?xr:(typeof t=="function"?br:vr)(t)):this.node().innerHTML}function Er(){this.nextSibling&&this.parentNode.appendChild(this)}function Sr(){return this.each(Er)}function Nr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Cr(){return this.each(Nr)}function Ar(t){var e=typeof t=="function"?t:Me(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function kr(){return null}function Br(t,e){var n=typeof t=="function"?t:Me(t),r=e==null?kr:typeof e=="function"?e:te(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Rr(){var t=this.parentNode;t&&t.removeChild(this)}function Ir(){return this.each(Rr)}function Mr(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Tr(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Lr(t){return this.select(t?Tr:Mr)}function Or(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Pr(t){return function(e){t.call(this,e,this.__data__)}}function Fr(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Xr(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function Yr(t,e,n){return function(){var r=this.__on,i,o=Pr(e);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Hr(t,e,n){var r=Fr(t+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(i=0,u=a[c];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?Yr:Xr,i=0;i<o;++i)this.each(a(r[i],e,n));return this}function De(t,e,n){var r=Fe(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function qr(t,e){return function(){return De(this,t,e)}}function Dr(t,e){return function(){return De(this,t,e.apply(this,arguments))}}function Vr(t,e){return this.each((typeof e=="function"?Dr:qr)(t,e))}function*zr(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var Ve=[null];function R(t,e){this._groups=t,this._parents=e}function ft(){return new R([[document.documentElement]],Ve)}function Ur(){return this}R.prototype=ft.prototype={constructor:R,select:yn,selectAll:bn,selectChild:Nn,selectChildren:Bn,filter:Rn,data:Pn,enter:In,exit:Xn,join:Yn,merge:Hn,selection:Ur,order:qn,sort:Dn,call:zn,nodes:Un,node:Zn,size:Kn,empty:Gn,each:Wn,attr:rr,style:ar,property:fr,classed:gr,text:_r,html:$r,raise:Sr,lower:Cr,append:Ar,insert:Br,remove:Ir,clone:Lr,datum:Or,on:Hr,dispatch:Vr,[Symbol.iterator]:zr};function Ht(t){return typeof t=="string"?new R([[document.querySelector(t)]],[document.documentElement]):new R([[t]],Ve)}function ne(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ze(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ht(){}var at=.7,Nt=1/at,W="\\s*([+-]?\\d+)\\s*",ct="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",L="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zr=/^#([0-9a-f]{3,8})$/,Kr=new RegExp(`^rgb\\(${W},${W},${W}\\)$`),Gr=new RegExp(`^rgb\\(${L},${L},${L}\\)$`),Wr=new RegExp(`^rgba\\(${W},${W},${W},${ct}\\)$`),Jr=new RegExp(`^rgba\\(${L},${L},${L},${ct}\\)$`),Qr=new RegExp(`^hsl\\(${ct},${L},${L}\\)$`),jr=new RegExp(`^hsla\\(${ct},${L},${L},${ct}\\)$`),ye={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};ne(ht,lt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:_e,formatHex:_e,formatHex8:ti,formatHsl:ei,formatRgb:xe,toString:xe});function _e(){return this.rgb().formatHex()}function ti(){return this.rgb().formatHex8()}function ei(){return Ue(this).formatHsl()}function xe(){return this.rgb().formatRgb()}function lt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Zr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?ve(e):n===3?new B(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?_t(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?_t(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=Kr.exec(t))?new B(e[1],e[2],e[3],1):(e=Gr.exec(t))?new B(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Wr.exec(t))?_t(e[1],e[2],e[3],e[4]):(e=Jr.exec(t))?_t(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Qr.exec(t))?Ee(e[1],e[2]/100,e[3]/100,1):(e=jr.exec(t))?Ee(e[1],e[2]/100,e[3]/100,e[4]):ye.hasOwnProperty(t)?ve(ye[t]):t==="transparent"?new B(NaN,NaN,NaN,0):null}function ve(t){return new B(t>>16&255,t>>8&255,t&255,1)}function _t(t,e,n,r){return r<=0&&(t=e=n=NaN),new B(t,e,n,r)}function ni(t){return t instanceof ht||(t=lt(t)),t?(t=t.rgb(),new B(t.r,t.g,t.b,t.opacity)):new B}function Ut(t,e,n,r){return arguments.length===1?ni(t):new B(t,e,n,r??1)}function B(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}ne(B,Ut,ze(ht,{brighter(t){return t=t==null?Nt:Math.pow(Nt,t),new B(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?at:Math.pow(at,t),new B(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new B(K(this.r),K(this.g),K(this.b),Ct(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:be,formatHex:be,formatHex8:ri,formatRgb:$e,toString:$e}));function be(){return`#${Z(this.r)}${Z(this.g)}${Z(this.b)}`}function ri(){return`#${Z(this.r)}${Z(this.g)}${Z(this.b)}${Z((isNaN(this.opacity)?1:this.opacity)*255)}`}function $e(){const t=Ct(this.opacity);return`${t===1?"rgb(":"rgba("}${K(this.r)}, ${K(this.g)}, ${K(this.b)}${t===1?")":`, ${t})`}`}function Ct(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function K(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Z(t){return t=K(t),(t<16?"0":"")+t.toString(16)}function Ee(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new I(t,e,n,r)}function Ue(t){if(t instanceof I)return new I(t.h,t.s,t.l,t.opacity);if(t instanceof ht||(t=lt(t)),!t)return new I;if(t instanceof I)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,c=(o+i)/2;return a?(e===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-e)/a+2:s=(e-n)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new I(s,a,c,t.opacity)}function ii(t,e,n,r){return arguments.length===1?Ue(t):new I(t,e,n,r??1)}function I(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ne(I,ii,ze(ht,{brighter(t){return t=t==null?Nt:Math.pow(Nt,t),new I(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?at:Math.pow(at,t),new I(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,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new B(qt(t>=240?t-240:t+120,i,r),qt(t,i,r),qt(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new I(Se(this.h),xt(this.s),xt(this.l),Ct(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=Ct(this.opacity);return`${t===1?"hsl(":"hsla("}${Se(this.h)}, ${xt(this.s)*100}%, ${xt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Se(t){return t=(t||0)%360,t<0?t+360:t}function xt(t){return Math.max(0,Math.min(1,t||0))}function qt(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Ze=t=>()=>t;function oi(t,e){return function(n){return t+n*e}}function si(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function ai(t){return(t=+t)==1?Ke:function(e,n){return n-e?si(e,n,t):Ze(isNaN(e)?n:e)}}function Ke(t,e){var n=e-t;return n?oi(t,n):Ze(isNaN(t)?e:t)}const Ne=(function t(e){var n=ai(e);function r(i,o){var s=n((i=Ut(i)).r,(o=Ut(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),l=Ke(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=t,r})(1);function q(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Zt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Dt=new RegExp(Zt.source,"g");function ci(t){return function(){return t}}function li(t){return function(e){return t(e)+""}}function ui(t,e){var n=Zt.lastIndex=Dt.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(r=Zt.exec(t))&&(i=Dt.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:q(r,i)})),n=Dt.lastIndex;return n<e.length&&(o=e.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?li(c[0].x):ci(e):(e=c.length,function(l){for(var u=0,d;u<e;++u)a[(d=c[u]).i]=d.x(l);return a.join("")})}var Ce=180/Math.PI,Kt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ge(t,e,n,r,i,o){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),t*r<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*Ce,skewX:Math.atan(c)*Ce,scaleX:s,scaleY:a}}var vt;function fi(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Kt:Ge(e.a,e.b,e.c,e.d,e.e,e.f)}function hi(t){return t==null||(vt||(vt=document.createElementNS("http://www.w3.org/2000/svg","g")),vt.setAttribute("transform",t),!(t=vt.transform.baseVal.consolidate()))?Kt:(t=t.matrix,Ge(t.a,t.b,t.c,t.d,t.e,t.f))}function We(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,d,p,g,m){if(l!==d||u!==p){var E=g.push("translate(",null,e,null,n);m.push({i:E-4,x:q(l,d)},{i:E-2,x:q(u,p)})}else(d||p)&&g.push("translate("+d+e+p+n)}function s(l,u,d,p){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),p.push({i:d.push(i(d)+"rotate(",null,r)-2,x:q(l,u)})):u&&d.push(i(d)+"rotate("+u+r)}function a(l,u,d,p){l!==u?p.push({i:d.push(i(d)+"skewX(",null,r)-2,x:q(l,u)}):u&&d.push(i(d)+"skewX("+u+r)}function c(l,u,d,p,g,m){if(l!==d||u!==p){var E=g.push(i(g)+"scale(",null,",",null,")");m.push({i:E-4,x:q(l,d)},{i:E-2,x:q(u,p)})}else(d!==1||p!==1)&&g.push(i(g)+"scale("+d+","+p+")")}return function(l,u){var d=[],p=[];return l=t(l),u=t(u),o(l.translateX,l.translateY,u.translateX,u.translateY,d,p),s(l.rotate,u.rotate,d,p),a(l.skewX,u.skewX,d,p),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,d,p),l=u=null,function(g){for(var m=-1,E=p.length,k;++m<E;)d[(k=p[m]).i]=k.x(g);return d.join("")}}}var di=We(fi,"px, ","px)","deg)"),pi=We(hi,", ",")",")"),Q=0,rt=0,nt=0,Je=1e3,At,it,kt=0,G=0,Mt=0,ut=typeof performance=="object"&&performance.now?performance:Date,Qe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function re(){return G||(Qe(gi),G=ut.now()+Mt)}function gi(){G=0}function Bt(){this._call=this._time=this._next=null}Bt.prototype=je.prototype={constructor:Bt,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?re():+n)+(e==null?0:+e),!this._next&&it!==this&&(it?it._next=this:At=this,it=this),this._call=t,this._time=n,Gt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Gt())}};function je(t,e,n){var r=new Bt;return r.restart(t,e,n),r}function mi(){re(),++Q;for(var t=At,e;t;)(e=G-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Q}function Ae(){G=(kt=ut.now())+Mt,Q=rt=0;try{mi()}finally{Q=0,yi(),G=0}}function wi(){var t=ut.now(),e=t-kt;e>Je&&(Mt-=e,kt=t)}function yi(){for(var t,e=At,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:At=n);it=t,Gt(r)}function Gt(t){if(!Q){rt&&(rt=clearTimeout(rt));var e=t-G;e>24?(t<1/0&&(rt=setTimeout(Ae,t-ut.now()-Mt)),nt&&(nt=clearInterval(nt))):(nt||(kt=ut.now(),nt=setInterval(wi,Je)),Q=1,Qe(Ae))}}function ke(t,e,n){var r=new Bt;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var _i=Ie("start","end","cancel","interrupt"),xi=[],tn=0,Be=1,Wt=2,$t=3,Re=4,Jt=5,Et=6;function Tt(t,e,n,r,i,o){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;vi(t,n,{name:e,index:r,group:i,on:_i,tween:xi,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:tn})}function ie(t,e){var n=M(t,e);if(n.state>tn)throw new Error("too late; already scheduled");return n}function P(t,e){var n=M(t,e);if(n.state>$t)throw new Error("too late; already running");return n}function M(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function vi(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=je(o,0,n.time);function o(l){n.state=Be,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,d,p,g;if(n.state!==Be)return c();for(u in r)if(g=r[u],g.name===n.name){if(g.state===$t)return ke(s);g.state===Re?(g.state=Et,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete r[u]):+u<e&&(g.state=Et,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete r[u])}if(ke(function(){n.state===$t&&(n.state=Re,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Wt,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Wt){for(n.state=$t,i=new Array(p=n.tween.length),u=0,d=-1;u<p;++u)(g=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++d]=g);i.length=d+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Jt,1),d=-1,p=i.length;++d<p;)i[d].call(t,u);n.state===Jt&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=Et,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function bi(t,e){var n=t.__transition,r,i,o=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((r=n[s]).name!==e){o=!1;continue}i=r.state>Wt&&r.state<Jt,r.state=Et,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}o&&delete t.__transition}}function $i(t){return this.each(function(){bi(this,t)})}function Ei(t,e){var n,r;return function(){var i=P(this,t),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function Si(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=P(this,t),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:e,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===e){i[c]=a;break}c===l&&i.push(a)}o.tween=i}}function Ni(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=M(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===t)return s.value;return null}return this.each((e==null?Ei:Si)(n,t,e))}function oe(t,e,n){var r=t._id;return t.each(function(){var i=P(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return M(i,r).value[e]}}function en(t,e){var n;return(typeof e=="number"?q:e instanceof lt?Ne:(n=lt(e))?(e=n,Ne):ui)(t,e)}function Ci(t){return function(){this.removeAttribute(t)}}function Ai(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ki(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttribute(t);return s===i?null:s===r?o:o=e(r=s,n)}}function Bi(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===r?o:o=e(r=s,n)}}function Ri(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function Ii(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function Mi(t,e){var n=It(t),r=n==="transform"?pi:en;return this.attrTween(t,typeof e=="function"?(n.local?Ii:Ri)(n,r,oe(this,"attr."+t,e)):e==null?(n.local?Ai:Ci)(n):(n.local?Bi:ki)(n,r,e))}function Ti(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Li(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Oi(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Li(t,o)),n}return i._value=e,i}function Pi(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Ti(t,o)),n}return i._value=e,i}function Fi(t,e){var n="attr."+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;var r=It(t);return this.tween(n,(r.local?Oi:Pi)(r,e))}function Xi(t,e){return function(){ie(this,t).delay=+e.apply(this,arguments)}}function Yi(t,e){return e=+e,function(){ie(this,t).delay=e}}function Hi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Xi:Yi)(e,t)):M(this.node(),e).delay}function qi(t,e){return function(){P(this,t).duration=+e.apply(this,arguments)}}function Di(t,e){return e=+e,function(){P(this,t).duration=e}}function Vi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?qi:Di)(e,t)):M(this.node(),e).duration}function zi(t,e){if(typeof e!="function")throw new Error;return function(){P(this,t).ease=e}}function Ui(t){var e=this._id;return arguments.length?this.each(zi(e,t)):M(this.node(),e).ease}function Zi(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;P(this,t).ease=n}}function Ki(t){if(typeof t!="function")throw new Error;return this.each(Zi(this._id,t))}function Gi(t){typeof t!="function"&&(t=Le(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new Y(r,this._parents,this._name,this._id)}function Wi(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var c=e[a],l=n[a],u=c.length,d=s[a]=new Array(u),p,g=0;g<u;++g)(p=c[g]||l[g])&&(d[g]=p);for(;a<r;++a)s[a]=e[a];return new Y(s,this._parents,this._name,this._id)}function Ji(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Qi(t,e,n){var r,i,o=Ji(e)?ie:P;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}function ji(t,e){var n=this._id;return arguments.length<2?M(this.node(),n).on.on(t):this.each(Qi(n,t,e))}function to(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function eo(){return this.on("end.remove",to(this._id))}function no(t){var e=this._name,n=this._id;typeof t!="function"&&(t=te(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],c=a.length,l=o[s]=new Array(c),u,d,p=0;p<c;++p)(u=a[p])&&(d=t.call(u,u.__data__,p,a))&&("__data__"in u&&(d.__data__=u.__data__),l[p]=d,Tt(l[p],e,n,p,l,M(u,n)));return new Y(o,this._parents,e,n)}function ro(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Te(t));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var c=r[a],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var p=t.call(u,u.__data__,d,c),g,m=M(u,n),E=0,k=p.length;E<k;++E)(g=p[E])&&Tt(g,e,n,E,p,m);o.push(p),s.push(u)}return new Y(o,s,e,n)}var io=ft.prototype.constructor;function oo(){return new io(this._groups,this._parents)}function so(t,e){var n,r,i;return function(){var o=J(this,t),s=(this.style.removeProperty(t),J(this,t));return o===s?null:o===n&&s===r?i:i=e(n=o,r=s)}}function nn(t){return function(){this.style.removeProperty(t)}}function ao(t,e,n){var r,i=n+"",o;return function(){var s=J(this,t);return s===i?null:s===r?o:o=e(r=s,n)}}function co(t,e,n){var r,i,o;return function(){var s=J(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),J(this,t))),s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a))}}function lo(t,e){var n,r,i,o="style."+e,s="end."+o,a;return function(){var c=P(this,t),l=c.on,u=c.value[o]==null?a||(a=nn(e)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function uo(t,e,n){var r=(t+="")=="transform"?di:en;return e==null?this.styleTween(t,so(t,r)).on("end.style."+t,nn(t)):typeof e=="function"?this.styleTween(t,co(t,r,oe(this,"style."+t,e))).each(lo(this._id,t)):this.styleTween(t,ao(t,r,e),n).on("end.style."+t,null)}function fo(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function ho(t,e,n){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&fo(t,s,n)),r}return o._value=e,o}function po(t,e,n){var r="style."+(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;return this.tween(r,ho(t,e,n??""))}function go(t){return function(){this.textContent=t}}function mo(t){return function(){var e=t(this);this.textContent=e??""}}function wo(t){return this.tween("text",typeof t=="function"?mo(oe(this,"text",t)):go(t==null?"":t+""))}function yo(t){return function(e){this.textContent=t.call(this,e)}}function _o(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&yo(i)),e}return r._value=t,r}function xo(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,_o(t))}function vo(){for(var t=this._name,e=this._id,n=rn(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=M(c,e);Tt(c,t,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Y(r,this._parents,t,n)}function bo(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},c={value:function(){--i===0&&o()}};n.each(function(){var l=P(this,r),u=l.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),l.on=e}),i===0&&o()})}var $o=0;function Y(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function rn(){return++$o}var X=ft.prototype;Y.prototype={constructor:Y,select:no,selectAll:ro,selectChild:X.selectChild,selectChildren:X.selectChildren,filter:Gi,merge:Wi,selection:oo,transition:vo,call:X.call,nodes:X.nodes,node:X.node,size:X.size,empty:X.empty,each:X.each,on:ji,attr:Mi,attrTween:Fi,style:uo,styleTween:po,text:wo,textTween:xo,remove:eo,tween:Ni,delay:Hi,duration:Vi,ease:Ui,easeVarying:Ki,end:bo,[Symbol.iterator]:X[Symbol.iterator]};function Eo(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var So={time:null,delay:0,duration:250,ease:Eo};function No(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Co(t){var e,n;t instanceof Y?(e=t._id,t=t._name):(e=rn(),(n=So).time=re(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&Tt(c,t,e,l,s,n||No(c,e));return new Y(r,this._parents,t,e)}ft.prototype.interrupt=$i;ft.prototype.transition=Co;function ot(t,e,n){this.k=t,this.x=e,this.y=n}ot.prototype={constructor:ot,scale:function(t){return t===1?this:new ot(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new ot(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+")"}};ot.prototype;let A=[],st=[],Qt=[],O=new Map,Vt="",U=1,jt={};function D(t){const e=document.getElementById("loading"),n=document.getElementById("loading-status");e.classList.remove("hidden"),n.textContent=t}function on(){document.getElementById("loading").classList.add("hidden")}async function Ao(){const t=await window.gitopo.git.exec("rev-parse --show-toplevel");if(t.success){const e=t.output.trim();return e.split("/").pop()||e}return"Unknown Repository"}async function ko(){const t=await window.gitopo.config.get();return t.success?t.config:(console.error("Failed to fetch config:",t.error),{})}async function Bo(){const t=await window.gitopo.gh.exec("pr list --state open --json number,title,headRefName,headRefOid");if(!t.success)return console.error("Failed to fetch pull requests:",t.error),[];try{return JSON.parse(t.output).map(n=>({number:n.number,title:n.title,branch:n.headRefName,headCommit:n.headRefOid}))}catch(e){return console.error("Failed to parse PR data:",e),[]}}function sn(){const t=document.getElementById("commit-limit"),e=parseInt(t.value,10);return isNaN(e)||e<1||e>1e8?1e3:e}async function an(t=1e3){const e=await window.gitopo.git.exec(`log --all --format="%H|%P|%ct|%s" --date-order -${t}`);if(!e.success)return console.error("Failed to fetch commits:",e.error),[];const n=[],r=e.output.trim().split(`
2
+ `);for(const i of r){const o=i.split("|");if(o.length>=4){const s=o[0],a=o[1],c=parseInt(o[2],10),l=o.slice(3).join("|"),u=a.trim()?a.trim().split(" "):[];n.push({hash:s,parents:u,timestamp:c,message:l})}}return n.sort((i,o)=>o.timestamp-i.timestamp),n}async function Ro(){const t=await window.gitopo.git.exec('branch -a --format="%(refname:short) %(objectname)"');if(!t.success)return console.error("Failed to fetch branches:",t.error),[];const e=[],n=t.output.trim().split(`
3
+ `);for(const r of n){const i=r.trim().split(" ");if(i.length>=2){const o=i[0],s=i[1];e.push({name:o,hash:s})}}return e}function Io(t){const e=["branch1","branch2","branch3"],n=jt.keyBranches||[],r=t.find(i=>i.name==="main"||i.name==="master");e.forEach((i,o)=>{const s=document.getElementById(i);s.innerHTML="";const a=document.createElement("option");if(a.value="",a.textContent="----",s.appendChild(a),t.forEach(c=>{const l=document.createElement("option");l.value=c.name,l.textContent=c.name,s.appendChild(l)}),n[o]){const c=t.find(l=>l.name===n[o]);c&&(s.value=c.name)}else o===0&&r&&(s.value=r.name);s.addEventListener("change",()=>Rt())})}function Mo(t){const e=st.find(i=>i.name===t);if(!e)return new Set;const n=new Set;let r=e.hash;for(;r;){n.add(r);const i=O.get(r);if(i&&i.parents.length>0)r=i.parents[0];else break}return n}function To(t,e=new Set){const n=[],r=new Set,i=new Map;for(const c of A)for(const l of c.parents)i.has(l)||i.set(l,[]),i.get(l).push(c.hash);function o(c){const l=new Set,u=[c];for(;u.length>0;){const d=u.pop();if(l.has(d)||t.has(d)||e.has(d)||r.has(d))continue;const p=O.get(d);if(!p)continue;l.add(d);for(const m of p.parents)!t.has(m)&&!e.has(m)&&!l.has(m)&&u.push(m);const g=i.get(d)||[];for(const m of g)!t.has(m)&&!e.has(m)&&!l.has(m)&&u.push(m)}return l}function s(c){for(const l of c){const u=O.get(l);if(u){for(const d of u.parents)if(!t.has(d)&&!c.has(d))return!1}}return!0}function a(c){for(const l of t){const u=O.get(l);if(!(!u||u.parents.length<2)){for(let d=1;d<u.parents.length;d++)if(c.has(u.parents[d]))return l}}return null}for(const c of A){if(t.has(c.hash)||e.has(c.hash)||r.has(c.hash))continue;const l=o(c.hash);l.size>0&&s(l)&&(l.forEach(u=>r.add(u)),n.push({mergeCommit:a(l),commits:l}))}return n}function Lo(){const t=[];return["branch1","branch2","branch3"].forEach(e=>{const n=document.getElementById(e);n&&n.value&&t.push(n.value)}),t}function Rt(){const t=Ht("#graph");t.selectAll("*").remove();const e=Ht("#app");e.selectAll(".tooltip").remove();const n=document.getElementById("controls").offsetHeight,r=window.innerWidth,i=window.innerHeight-n;t.attr("width",r).attr("height",i);const o=6,s=30,a=150,c=30,l=50,u=50,p=Lo().map(f=>({name:f,lineage:Mo(f)})),g=new Set;p.forEach(({lineage:f})=>{f.forEach(h=>g.add(h))});const m=p.map(({name:f,lineage:h})=>{const w=new Set;p.forEach(y=>{y.name!==f&&y.lineage.forEach(_=>w.add(_))});const v=To(h,w);return{name:f,lineage:h,subBranches:v}}),E=new Map;st.forEach(f=>{E.has(f.hash)||E.set(f.hash,[]),E.get(f.hash).push(f.name)});const k=new Map;A.forEach(f=>{k.set(f.hash,{mainCol:m.length,subOffset:0,isSubBranch:!1})}),m.forEach((f,h)=>{for(const w of f.lineage)k.set(w,{mainCol:h,subOffset:0,isSubBranch:!1})});let Lt=0;m.forEach((f,h)=>{const w=new Map;[...f.subBranches].sort((y,_)=>{const $=x=>{let b=1/0;return x.commits.forEach(S=>{const C=O.get(S);C&&C.timestamp<b&&(b=C.timestamp)}),b};return $(y)-$(_)}).forEach(y=>{const _=`sb-${Lt++}`,$=[];y.commits.forEach(S=>{const C=A.findIndex(tt=>tt.hash===S);C>=0&&$.push(C)});let x=1,b=!0;for(;b;){b=!1;for(const S of $)if((w.get(S)||new Set).has(x)){b=!0,x++;break}}for(const S of $)w.has(S)||w.set(S,new Set),w.get(S).add(x);y.commits.forEach(S=>{k.set(S,{mainCol:h,subOffset:x,isSubBranch:!0,subBranchId:_})})})});const T=new Map;let V=u;for(let f=0;f<=m.length;f++)if(T.set(f,V),f<m.length){let h=0;A.forEach(w=>{const v=k.get(w.hash);v.mainCol===f&&v.subOffset>h&&(h=v.subOffset)}),V+=a+h*c}const N=new Map;A.forEach((f,h)=>{const w=k.get(f.hash),y=T.get(w.mainCol)+w.subOffset*c;N.set(f.hash,{col:w.mainCol,subOffset:w.subOffset,row:h,x:y,y:l+h*s,isSubBranch:w.isSubBranch,subBranchId:w.subBranchId||null})});const dt=Array.from(k.values()).some(f=>f.mainCol===m.length),F=t.append("g").attr("class","main-group"),Ot=t.append("g").attr("class","header-group"),Pt=e.append("div").attr("class","tooltip").style("opacity",0),pt=["#4CAF50","#2196F3","#FF9800"],se=20;m.forEach((f,h)=>{Ot.append("text").attr("x",T.get(h)).attr("y",se).attr("text-anchor","middle").attr("fill",pt[h]||"#888").attr("font-size","14px").attr("font-weight","bold").text(f.name)}),dt&&Ot.append("text").attr("x",T.get(m.length)).attr("y",se).attr("text-anchor","middle").attr("fill","#888").attr("font-size","14px").text("Other");const gt=new Map;A.forEach(f=>{f.parents.forEach(h=>{gt.has(h)||gt.set(h,[]),gt.get(h).push(f.hash)})});const cn=new Set;m.forEach(f=>{f.lineage.forEach(h=>cn.add(h))});function ae(f){const h=[],w=new Set;function v(_){if(w.has(_))return;w.add(_);const $=O.get(_);$&&$.parents.forEach(x=>{h.push({source:_,target:x});const b=N.get(x);b&&b.col===m.length&&!b.isSubBranch&&v(x)})}function y(_){if(w.has(_))return;w.add(_),(gt.get(_)||[]).forEach(x=>{h.push({source:x,target:_});const b=N.get(x);b&&b.col===m.length&&!b.isSubBranch&&y(x)})}return v(f),w.delete(f),y(f),h}A.forEach(f=>{const h=N.get(f.hash);h&&f.parents.forEach(w=>{const v=N.get(w);if(v){const y=h.col===m.length||v.col===m.length,_=h.x,$=h.y*U,x=v.x,b=v.y*U;let S;if(_===x)S=`M ${_} ${$} L ${x} ${b}`;else{const yt=($+b)/2;S=`M ${_} ${$} C ${_} ${yt}, ${x} ${yt}, ${x} ${b}`}const C=h.subBranchId||v.subBranchId||null,tt=h.isSubBranch||v.isSubBranch,un=!tt&&!y&&h.col<m.length;let Yt="#666";y?Yt="#444":h.col<m.length&&(Yt=pt[h.col]||"#666");let et=1.5;y?et=1:un?et=3:tt&&(et=1.5);const fn=F.append("path").attr("d",S).attr("fill","none").attr("stroke",Yt).attr("stroke-width",et).attr("stroke-opacity",y?.4:tt?.5:.8).attr("stroke-dasharray",y?"4,4":"none").attr("class",C?`edge edge-${C}`:"edge").attr("data-source",f.hash).attr("data-target",w);if(C){const yt=et;fn.style("cursor","pointer").on("mouseenter",()=>{F.selectAll(`.edge-${C}`).attr("stroke-width",3).attr("stroke-opacity",.9)}).on("mouseleave",()=>{F.selectAll(`.edge-${C}`).attr("stroke-width",yt).attr("stroke-opacity",.5)})}}})});const j=new Map;Qt.forEach(f=>{j.set(f.headCommit,f)});const Ft=F.selectAll("g.node").data(A).enter().append("g").attr("class","node").attr("transform",f=>{const h=N.get(f.hash);return h?`translate(${h.x}, ${h.y*U})`:"translate(-100, -100)"});Ft.filter(f=>j.has(f.hash)).append("circle").attr("r",o+6).attr("fill","none").attr("stroke","#888").attr("stroke-width",2).attr("stroke-dasharray","3,2"),Ft.append("circle").attr("r",f=>{const h=N.get(f.hash);return h.isSubBranch?o*.6:h.col<m.length?o:o*.7}).attr("fill",f=>{const h=N.get(f.hash);return h.col<m.length?pt[h.col]||"#fff":h.isSubBranch?"#a0a0a0":"#888"}).attr("stroke",f=>{const h=N.get(f.hash);return h.col<m.length&&pt[h.col]||"#333"}).attr("stroke-width",f=>{const h=N.get(f.hash);return h.isSubBranch?1:h.col<m.length?2:1}).style("cursor","pointer").on("mouseenter",(f,h)=>{const w=E.get(h.hash),v=w?`[${w.join(", ")}]<br/>`:"",y=j.get(h.hash),_=y?`<span class="pr-info">PR #${y.number}: ${y.title}</span><br/>`:"",$=new Date(h.timestamp*1e3).toLocaleString();Pt.html(`<strong>${h.hash.substring(0,7)}</strong><br/>${_}${v}${h.message}<br/><span class="date">${$}</span>`).style("left",f.pageX+15+"px").style("top",f.pageY-10+"px").style("opacity",1);const x=N.get(h.hash);x&&x.col===m.length&&!x.isSubBranch&&ae(h.hash).forEach(({source:S,target:C})=>{F.selectAll(`path.edge[data-source="${S}"][data-target="${C}"]`).attr("stroke-width",3).attr("stroke-opacity",.9)})}).on("mousemove",f=>{Pt.style("left",f.pageX+15+"px").style("top",f.pageY-10+"px")}).on("mouseleave",(f,h)=>{Pt.style("opacity",0);const w=N.get(h.hash);w&&w.col===m.length&&!w.isSubBranch&&ae(h.hash).forEach(({source:y,target:_})=>{F.selectAll(`path.edge[data-source="${y}"][data-target="${_}"]`).attr("stroke-width",1).attr("stroke-opacity",.4)})}),Ft.filter(f=>j.has(f.hash)).append("text").attr("x",o+10).attr("y",4).attr("fill","#ccc").attr("font-size","11px").text(f=>{const h=j.get(f.hash);return`PR #${h.number}: ${h.title.substring(0,30)}${h.title.length>30?"...":""}`});let z=0,H=0,mt=!1,ce=0,le=0,ue=0,fe=0;function Xt(f){return f*U}function wt(){F.attr("transform",`translate(${z}, ${H})`),Ot.attr("transform",`translate(${z}, 0)`)}function ln(){F.selectAll("g.node").attr("transform",f=>{const h=N.get(f.hash);return h?`translate(${h.x}, ${Xt(h.y)})`:"translate(-100, -100)"}),F.selectAll("path.edge").attr("d",function(){const f=Ht(this),h=f.attr("data-source"),w=f.attr("data-target"),v=N.get(h),y=N.get(w);if(!v||!y)return"";const _=v.x,$=Xt(v.y),x=y.x,b=Xt(y.y);if(_===x)return`M ${_} ${$} L ${x} ${b}`;{const S=($+b)/2;return`M ${_} ${$} C ${_} ${S}, ${x} ${S}, ${x} ${b}`}})}t.on("wheel",f=>{if(f.preventDefault(),f.ctrlKey||f.metaKey){const h=f.deltaY>0?.9:1.1,y=Math.max(.1,Math.min(5,U*h)),_=t.node().getBoundingClientRect(),$=f.clientY-_.top,x=$-H;H=$-x*(y/U),U=y,ln(),wt()}else z-=f.deltaX,H-=f.deltaY,wt()}),t.on("mousedown",f=>{f.button===0&&(mt=!0,ce=f.clientX,le=f.clientY,ue=z,fe=H,f.preventDefault())}),t.on("mousemove",f=>{mt&&(z=ue+(f.clientX-ce),H=fe+(f.clientY-le),wt())}),t.on("mouseup",f=>{f.button===0&&(mt=!1)}),t.on("mouseleave",()=>{mt=!1});let he=0,de=0,pe=0,ge=0;t.on("touchstart",f=>{if(f.touches.length===1){const h=f.touches[0];he=h.clientX,de=h.clientY,pe=z,ge=H}}),t.on("touchmove",f=>{if(f.touches.length===1){f.preventDefault();const h=f.touches[0];z=pe+(h.clientX-he),H=ge+(h.clientY-de),wt()}}),t.on("contextmenu",f=>{f.preventDefault()})}async function Oo(){D("Loading commits...");const t=sn();A=await an(t),O.clear(),A.forEach(e=>O.set(e.hash,e)),console.log("Commits reloaded:",A.length),D("Rendering graph..."),Rt(),on()}async function Po(){const t=sn(),e=await window.gitopo.app.getVersion();e.success&&(document.title=`gitopo ${e.version}`),D("Loading repository info..."),Vt=await Ao(),D("Loading configuration..."),jt=await ko(),D("Loading commits..."),A=await an(t),D("Loading branches..."),st=await Ro(),D("Loading pull requests..."),Qt=await Bo(),document.getElementById("repo-name").textContent=Vt,O.clear(),A.forEach(r=>O.set(r.hash,r)),console.log("Repository:",Vt),console.log("Commits:",A.length),console.log("Branches:",st.length),console.log("Open PRs:",Qt.length),console.log("Config:",jt),Io(st),D("Rendering graph..."),Rt(),on(),window.addEventListener("resize",()=>{Rt()});const n=document.getElementById("commit-limit");n.addEventListener("change",()=>{const r=parseInt(n.value,10);(isNaN(r)||r<1||r>1e8)&&(n.value=1e3),Oo()})}Po();