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 n=document.createElement("link").relList;if(n&&n.supports&&n.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 e(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=e(i);fetch(i.href,o)}})();var Fn={value:()=>{}};function hn(){for(var t=0,n=arguments.length,e={},r;t<n;++t){if(!(r=arguments[t]+"")||r in e||/[\s.]/.test(r))throw new Error("illegal type: "+r);e[r]=[]}return new ct(e)}function ct(t){this._=t}function Ln(t,n){return t.trim().split(/^|\s+/).map(function(e){var r="",i=e.indexOf(".");if(i>=0&&(r=e.slice(i+1),e=e.slice(0,i)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}})}ct.prototype=hn.prototype={constructor:ct,on:function(t,n){var e=this._,r=Ln(t+"",e),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=Dn(e[i],t.name)))return i;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++o<s;)if(i=(t=r[o]).type)e[i]=Kt(e[i],t.name,n);else if(n==null)for(i in e)e[i]=Kt(e[i],t.name,null);return this},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new ct(t)},call:function(t,n){if((i=arguments.length-2)>0)for(var e=new Array(i),r=0,i,o;r<i;++r)e[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(n,e)},apply:function(t,n,e){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(n,e)}};function Dn(t,n){for(var e=0,r=t.length,i;e<r;++e)if((i=t[e]).name===n)return i.value}function Kt(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=Fn,t=t.slice(0,r).concat(t.slice(r+1));break}return e!=null&&t.push({name:n,value:e}),t}var At="http://www.w3.org/1999/xhtml";const Wt={svg:"http://www.w3.org/2000/svg",xhtml:At,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _t(t){var n=t+="",e=n.indexOf(":");return e>=0&&(n=t.slice(0,e))!=="xmlns"&&(t=t.slice(e+1)),Wt.hasOwnProperty(n)?{space:Wt[n],local:t}:t}function Yn(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===At&&n.documentElement.namespaceURI===At?n.createElement(t):n.createElementNS(e,t)}}function qn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function pn(t){var n=_t(t);return(n.local?qn:Yn)(n)}function Vn(){}function Ot(t){return t==null?Vn:function(){return this.querySelector(t)}}function zn(t){typeof t!="function"&&(t=Ot(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o=n[i],s=o.length,a=r[i]=new Array(s),c,u,f=0;f<s;++f)(c=o[f])&&(u=t.call(c,c.__data__,f,o))&&("__data__"in c&&(u.__data__=c.__data__),a[f]=u);return new v(r,this._parents)}function Un(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Gn(){return[]}function dn(t){return t==null?Gn:function(){return this.querySelectorAll(t)}}function Kn(t){return function(){return Un(t.apply(this,arguments))}}function Wn(t){typeof t=="function"?t=Kn(t):t=dn(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var s=n[o],a=s.length,c,u=0;u<a;++u)(c=s[u])&&(r.push(t.call(c,c.__data__,u,s)),i.push(c));return new v(r,i)}function gn(t){return function(){return this.matches(t)}}function mn(t){return function(n){return n.matches(t)}}var Jn=Array.prototype.find;function Qn(t){return function(){return Jn.call(this.children,t)}}function Zn(){return this.firstElementChild}function jn(t){return this.select(t==null?Zn:Qn(typeof t=="function"?t:mn(t)))}var te=Array.prototype.filter;function ne(){return Array.from(this.children)}function ee(t){return function(){return te.call(this.children,t)}}function re(t){return this.selectAll(t==null?ne:ee(typeof t=="function"?t:mn(t)))}function ie(t){typeof t!="function"&&(t=gn(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o=n[i],s=o.length,a=r[i]=[],c,u=0;u<s;++u)(c=o[u])&&t.call(c,c.__data__,u,o)&&a.push(c);return new v(r,this._parents)}function _n(t){return new Array(t.length)}function oe(){return new v(this._enter||this._groups.map(_n),this._parents)}function lt(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}lt.prototype={constructor:lt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function se(t){return function(){return t}}function ae(t,n,e,r,i,o){for(var s=0,a,c=n.length,u=o.length;s<u;++s)(a=n[s])?(a.__data__=o[s],r[s]=a):e[s]=new lt(t,o[s]);for(;s<c;++s)(a=n[s])&&(i[s]=a)}function ce(t,n,e,r,i,o,s){var a,c,u=new Map,f=n.length,l=o.length,h=new Array(f),d;for(a=0;a<f;++a)(c=n[a])&&(h[a]=d=s.call(c,c.__data__,a,n)+"",u.has(d)?i[a]=c:u.set(d,c));for(a=0;a<l;++a)d=s.call(t,o[a],a,o)+"",(c=u.get(d))?(r[a]=c,c.__data__=o[a],u.delete(d)):e[a]=new lt(t,o[a]);for(a=0;a<f;++a)(c=n[a])&&u.get(h[a])===c&&(i[a]=c)}function ue(t){return t.__data__}function fe(t,n){if(!arguments.length)return Array.from(this,ue);var e=n?ce:ae,r=this._parents,i=this._groups;typeof t!="function"&&(t=se(t));for(var o=i.length,s=new Array(o),a=new Array(o),c=new Array(o),u=0;u<o;++u){var f=r[u],l=i[u],h=l.length,d=le(t.call(f,f&&f.__data__,u,r)),m=d.length,w=a[u]=new Array(m),N=s[u]=new Array(m),C=c[u]=new Array(h);e(f,l,w,N,C,d,n);for(var O=0,E=0,F,xt;O<m;++O)if(F=w[O]){for(O>=E&&(E=O+1);!(xt=N[E])&&++E<m;);F._next=xt||null}}return s=new v(s,r),s._enter=a,s._exit=c,s}function le(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function he(){return new v(this._exit||this._groups.map(_n),this._parents)}function pe(t,n,e){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),n!=null&&(i=n(i),i&&(i=i.selection())),e==null?o.remove():e(o),r&&i?r.merge(i).order():i}function de(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var u=e[c],f=r[c],l=u.length,h=a[c]=new Array(l),d,m=0;m<l;++m)(d=u[m]||f[m])&&(h[m]=d);for(;c<i;++c)a[c]=e[c];return new v(a,this._parents)}function ge(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r=t[n],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 me(t){t||(t=_e);function n(l,h){return l&&h?t(l.__data__,h.__data__):!l-!h}for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var s=e[o],a=s.length,c=i[o]=new Array(a),u,f=0;f<a;++f)(u=s[f])&&(c[f]=u);c.sort(n)}return new v(i,this._parents).order()}function _e(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function we(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ye(){return Array.from(this)}function xe(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function ve(){let t=0;for(const n of this)++t;return t}function be(){return!this.node()}function Se(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i=n[e],o=0,s=i.length,a;o<s;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function Ne(t){return function(){this.removeAttribute(t)}}function Ee(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ae(t,n){return function(){this.setAttribute(t,n)}}function $e(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Ce(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}}function ke(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function Te(t,n){var e=_t(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((n==null?e.local?Ee:Ne:typeof n=="function"?e.local?ke:Ce:e.local?$e:Ae)(e,n))}function wn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Me(t){return function(){this.style.removeProperty(t)}}function Be(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Re(t,n,e){return function(){var r=n.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function Oe(t,n,e){return arguments.length>1?this.each((n==null?Me:typeof n=="function"?Re:Be)(t,n,e??"")):V(this.node(),t)}function V(t,n){return t.style.getPropertyValue(n)||wn(t).getComputedStyle(t,null).getPropertyValue(n)}function Xe(t){return function(){delete this[t]}}function Ie(t,n){return function(){this[t]=n}}function He(t,n){return function(){var e=n.apply(this,arguments);e==null?delete this[t]:this[t]=e}}function Pe(t,n){return arguments.length>1?this.each((n==null?Xe:typeof n=="function"?He:Ie)(t,n)):this.node()[t]}function yn(t){return t.trim().split(/^|\s+/)}function Xt(t){return t.classList||new xn(t)}function xn(t){this._node=t,this._names=yn(t.getAttribute("class")||"")}xn.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function vn(t,n){for(var e=Xt(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function bn(t,n){for(var e=Xt(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function Fe(t){return function(){vn(this,t)}}function Le(t){return function(){bn(this,t)}}function De(t,n){return function(){(n.apply(this,arguments)?vn:bn)(this,t)}}function Ye(t,n){var e=yn(t+"");if(arguments.length<2){for(var r=Xt(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each((typeof n=="function"?De:n?Fe:Le)(e,n))}function qe(){this.textContent=""}function Ve(t){return function(){this.textContent=t}}function ze(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function Ue(t){return arguments.length?this.each(t==null?qe:(typeof t=="function"?ze:Ve)(t)):this.node().textContent}function Ge(){this.innerHTML=""}function Ke(t){return function(){this.innerHTML=t}}function We(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function Je(t){return arguments.length?this.each(t==null?Ge:(typeof t=="function"?We:Ke)(t)):this.node().innerHTML}function Qe(){this.nextSibling&&this.parentNode.appendChild(this)}function Ze(){return this.each(Qe)}function je(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function tr(){return this.each(je)}function nr(t){var n=typeof t=="function"?t:pn(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function er(){return null}function rr(t,n){var e=typeof t=="function"?t:pn(t),r=n==null?er:typeof n=="function"?n:Ot(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function ir(){var t=this.parentNode;t&&t.removeChild(this)}function or(){return this.each(ir)}function sr(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ar(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function cr(t){return this.select(t?ar:sr)}function ur(t){return arguments.length?this.property("__data__",t):this.node().__data__}function fr(t){return function(n){t.call(this,n,this.__data__)}}function lr(t){return t.trim().split(/^|\s+/).map(function(n){var e="",r=n.indexOf(".");return r>=0&&(e=n.slice(r+1),n=n.slice(0,r)),{type:n,name:e}})}function hr(t){return function(){var n=this.__on;if(n){for(var e=0,r=-1,i=n.length,o;e<i;++e)o=n[e],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):n[++r]=o;++r?n.length=r:delete this.__on}}}function pr(t,n,e){return function(){var r=this.__on,i,o=fr(n);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=e),i.value=n;return}}this.addEventListener(t.type,o,e),i={type:t.type,name:t.name,value:n,listener:o,options:e},r?r.push(i):this.__on=[i]}}function dr(t,n,e){var r=lr(t+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,u=a.length,f;c<u;++c)for(i=0,f=a[c];i<o;++i)if((s=r[i]).type===f.type&&s.name===f.name)return f.value}return}for(a=n?pr:hr,i=0;i<o;++i)this.each(a(r[i],n,e));return this}function Sn(t,n,e){var r=wn(t),i=r.CustomEvent;typeof i=="function"?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function gr(t,n){return function(){return Sn(this,t,n)}}function mr(t,n){return function(){return Sn(this,t,n.apply(this,arguments))}}function _r(t,n){return this.each((typeof n=="function"?mr:gr)(t,n))}function*wr(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var Nn=[null];function v(t,n){this._groups=t,this._parents=n}function nt(){return new v([[document.documentElement]],Nn)}function yr(){return this}v.prototype=nt.prototype={constructor:v,select:zn,selectAll:Wn,selectChild:jn,selectChildren:re,filter:ie,data:fe,enter:oe,exit:he,join:pe,merge:de,selection:yr,order:ge,sort:me,call:we,nodes:ye,node:xe,size:ve,empty:be,each:Se,attr:Te,style:Oe,property:Pe,classed:Ye,text:Ue,html:Je,raise:Ze,lower:tr,append:nr,insert:rr,remove:or,clone:cr,datum:ur,on:dr,dispatch:_r,[Symbol.iterator]:wr};function Jt(t){return typeof t=="string"?new v([[document.querySelector(t)]],[document.documentElement]):new v([[t]],Nn)}function It(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function En(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function et(){}var Q=.7,ht=1/Q,Y="\\s*([+-]?\\d+)\\s*",Z="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",A="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xr=/^#([0-9a-f]{3,8})$/,vr=new RegExp(`^rgb\\(${Y},${Y},${Y}\\)$`),br=new RegExp(`^rgb\\(${A},${A},${A}\\)$`),Sr=new RegExp(`^rgba\\(${Y},${Y},${Y},${Z}\\)$`),Nr=new RegExp(`^rgba\\(${A},${A},${A},${Z}\\)$`),Er=new RegExp(`^hsl\\(${Z},${A},${A}\\)$`),Ar=new RegExp(`^hsla\\(${Z},${A},${A},${Z}\\)$`),Qt={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};It(et,j,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Zt,formatHex:Zt,formatHex8:$r,formatHsl:Cr,formatRgb:jt,toString:jt});function Zt(){return this.rgb().formatHex()}function $r(){return this.rgb().formatHex8()}function Cr(){return An(this).formatHsl()}function jt(){return this.rgb().formatRgb()}function j(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=xr.exec(t))?(e=n[1].length,n=parseInt(n[1],16),e===6?tn(n):e===3?new x(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):e===8?ot(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):e===4?ot(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=vr.exec(t))?new x(n[1],n[2],n[3],1):(n=br.exec(t))?new x(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=Sr.exec(t))?ot(n[1],n[2],n[3],n[4]):(n=Nr.exec(t))?ot(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=Er.exec(t))?rn(n[1],n[2]/100,n[3]/100,1):(n=Ar.exec(t))?rn(n[1],n[2]/100,n[3]/100,n[4]):Qt.hasOwnProperty(t)?tn(Qt[t]):t==="transparent"?new x(NaN,NaN,NaN,0):null}function tn(t){return new x(t>>16&255,t>>8&255,t&255,1)}function ot(t,n,e,r){return r<=0&&(t=n=e=NaN),new x(t,n,e,r)}function kr(t){return t instanceof et||(t=j(t)),t?(t=t.rgb(),new x(t.r,t.g,t.b,t.opacity)):new x}function $t(t,n,e,r){return arguments.length===1?kr(t):new x(t,n,e,r??1)}function x(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}It(x,$t,En(et,{brighter(t){return t=t==null?ht:Math.pow(ht,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Q:Math.pow(Q,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new x(H(this.r),H(this.g),H(this.b),pt(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:nn,formatHex:nn,formatHex8:Tr,formatRgb:en,toString:en}));function nn(){return`#${I(this.r)}${I(this.g)}${I(this.b)}`}function Tr(){return`#${I(this.r)}${I(this.g)}${I(this.b)}${I((isNaN(this.opacity)?1:this.opacity)*255)}`}function en(){const t=pt(this.opacity);return`${t===1?"rgb(":"rgba("}${H(this.r)}, ${H(this.g)}, ${H(this.b)}${t===1?")":`, ${t})`}`}function pt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function H(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function I(t){return t=H(t),(t<16?"0":"")+t.toString(16)}function rn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new b(t,n,e,r)}function An(t){if(t instanceof b)return new b(t.h,t.s,t.l,t.opacity);if(t instanceof et||(t=j(t)),!t)return new b;if(t instanceof b)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),s=NaN,a=o-i,c=(o+i)/2;return a?(n===o?s=(e-r)/a+(e<r)*6:e===o?s=(r-n)/a+2:s=(n-e)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new b(s,a,c,t.opacity)}function Mr(t,n,e,r){return arguments.length===1?An(t):new b(t,n,e,r??1)}function b(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}It(b,Mr,En(et,{brighter(t){return t=t==null?ht:Math.pow(ht,t),new b(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Q:Math.pow(Q,t),new b(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new x(Nt(t>=240?t-240:t+120,i,r),Nt(t,i,r),Nt(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new b(on(this.h),st(this.s),st(this.l),pt(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=pt(this.opacity);return`${t===1?"hsl(":"hsla("}${on(this.h)}, ${st(this.s)*100}%, ${st(this.l)*100}%${t===1?")":`, ${t})`}`}}));function on(t){return t=(t||0)%360,t<0?t+360:t}function st(t){return Math.max(0,Math.min(1,t||0))}function Nt(t,n,e){return(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)*255}const $n=t=>()=>t;function Br(t,n){return function(e){return t+e*n}}function Rr(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function Or(t){return(t=+t)==1?Cn:function(n,e){return e-n?Rr(n,e,t):$n(isNaN(n)?e:n)}}function Cn(t,n){var e=n-t;return e?Br(t,e):$n(isNaN(t)?n:t)}const sn=(function t(n){var e=Or(n);function r(i,o){var s=e((i=$t(i)).r,(o=$t(o)).r),a=e(i.g,o.g),c=e(i.b,o.b),u=Cn(i.opacity,o.opacity);return function(f){return i.r=s(f),i.g=a(f),i.b=c(f),i.opacity=u(f),i+""}}return r.gamma=t,r})(1);function R(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var Ct=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Et=new RegExp(Ct.source,"g");function Xr(t){return function(){return t}}function Ir(t){return function(n){return t(n)+""}}function Hr(t,n){var e=Ct.lastIndex=Et.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(t=t+"",n=n+"";(r=Ct.exec(t))&&(i=Et.exec(n));)(o=i.index)>e&&(o=n.slice(e,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:R(r,i)})),e=Et.lastIndex;return e<n.length&&(o=n.slice(e),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?Ir(c[0].x):Xr(n):(n=c.length,function(u){for(var f=0,l;f<n;++f)a[(l=c[f]).i]=l.x(u);return a.join("")})}var an=180/Math.PI,kt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function kn(t,n,e,r,i,o){var s,a,c;return(s=Math.sqrt(t*t+n*n))&&(t/=s,n/=s),(c=t*e+n*r)&&(e-=t*c,r-=n*c),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,c/=a),t*r<n*e&&(t=-t,n=-n,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*an,skewX:Math.atan(c)*an,scaleX:s,scaleY:a}}var at;function Pr(t){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?kt:kn(n.a,n.b,n.c,n.d,n.e,n.f)}function Fr(t){return t==null||(at||(at=document.createElementNS("http://www.w3.org/2000/svg","g")),at.setAttribute("transform",t),!(t=at.transform.baseVal.consolidate()))?kt:(t=t.matrix,kn(t.a,t.b,t.c,t.d,t.e,t.f))}function Tn(t,n,e,r){function i(u){return u.length?u.pop()+" ":""}function o(u,f,l,h,d,m){if(u!==l||f!==h){var w=d.push("translate(",null,n,null,e);m.push({i:w-4,x:R(u,l)},{i:w-2,x:R(f,h)})}else(l||h)&&d.push("translate("+l+n+h+e)}function s(u,f,l,h){u!==f?(u-f>180?f+=360:f-u>180&&(u+=360),h.push({i:l.push(i(l)+"rotate(",null,r)-2,x:R(u,f)})):f&&l.push(i(l)+"rotate("+f+r)}function a(u,f,l,h){u!==f?h.push({i:l.push(i(l)+"skewX(",null,r)-2,x:R(u,f)}):f&&l.push(i(l)+"skewX("+f+r)}function c(u,f,l,h,d,m){if(u!==l||f!==h){var w=d.push(i(d)+"scale(",null,",",null,")");m.push({i:w-4,x:R(u,l)},{i:w-2,x:R(f,h)})}else(l!==1||h!==1)&&d.push(i(d)+"scale("+l+","+h+")")}return function(u,f){var l=[],h=[];return u=t(u),f=t(f),o(u.translateX,u.translateY,f.translateX,f.translateY,l,h),s(u.rotate,f.rotate,l,h),a(u.skewX,f.skewX,l,h),c(u.scaleX,u.scaleY,f.scaleX,f.scaleY,l,h),u=f=null,function(d){for(var m=-1,w=h.length,N;++m<w;)l[(N=h[m]).i]=N.x(d);return l.join("")}}}var Lr=Tn(Pr,"px, ","px)","deg)"),Dr=Tn(Fr,", ",")",")"),z=0,G=0,U=0,Mn=1e3,dt,K,gt=0,P=0,wt=0,tt=typeof performance=="object"&&performance.now?performance:Date,Bn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ht(){return P||(Bn(Yr),P=tt.now()+wt)}function Yr(){P=0}function mt(){this._call=this._time=this._next=null}mt.prototype=Rn.prototype={constructor:mt,restart:function(t,n,e){if(typeof t!="function")throw new TypeError("callback is not a function");e=(e==null?Ht():+e)+(n==null?0:+n),!this._next&&K!==this&&(K?K._next=this:dt=this,K=this),this._call=t,this._time=e,Tt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tt())}};function Rn(t,n,e){var r=new mt;return r.restart(t,n,e),r}function qr(){Ht(),++z;for(var t=dt,n;t;)(n=P-t._time)>=0&&t._call.call(void 0,n),t=t._next;--z}function cn(){P=(gt=tt.now())+wt,z=G=0;try{qr()}finally{z=0,zr(),P=0}}function Vr(){var t=tt.now(),n=t-gt;n>Mn&&(wt-=n,gt=t)}function zr(){for(var t,n=dt,e,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:dt=e);K=t,Tt(r)}function Tt(t){if(!z){G&&(G=clearTimeout(G));var n=t-P;n>24?(t<1/0&&(G=setTimeout(cn,t-tt.now()-wt)),U&&(U=clearInterval(U))):(U||(gt=tt.now(),U=setInterval(Vr,Mn)),z=1,Bn(cn))}}function un(t,n,e){var r=new mt;return n=n==null?0:+n,r.restart(i=>{r.stop(),t(i+n)},n,e),r}var Ur=hn("start","end","cancel","interrupt"),Gr=[],On=0,fn=1,Mt=2,ut=3,ln=4,Bt=5,ft=6;function yt(t,n,e,r,i,o){var s=t.__transition;if(!s)t.__transition={};else if(e in s)return;Kr(t,e,{name:n,index:r,group:i,on:Ur,tween:Gr,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:On})}function Pt(t,n){var e=S(t,n);if(e.state>On)throw new Error("too late; already scheduled");return e}function $(t,n){var e=S(t,n);if(e.state>ut)throw new Error("too late; already running");return e}function S(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Kr(t,n,e){var r=t.__transition,i;r[n]=e,e.timer=Rn(o,0,e.time);function o(u){e.state=fn,e.timer.restart(s,e.delay,e.time),e.delay<=u&&s(u-e.delay)}function s(u){var f,l,h,d;if(e.state!==fn)return c();for(f in r)if(d=r[f],d.name===e.name){if(d.state===ut)return un(s);d.state===ln?(d.state=ft,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<n&&(d.state=ft,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(un(function(){e.state===ut&&(e.state=ln,e.timer.restart(a,e.delay,e.time),a(u))}),e.state=Mt,e.on.call("start",t,t.__data__,e.index,e.group),e.state===Mt){for(e.state=ut,i=new Array(h=e.tween.length),f=0,l=-1;f<h;++f)(d=e.tween[f].value.call(t,t.__data__,e.index,e.group))&&(i[++l]=d);i.length=l+1}}function a(u){for(var f=u<e.duration?e.ease.call(null,u/e.duration):(e.timer.restart(c),e.state=Bt,1),l=-1,h=i.length;++l<h;)i[l].call(t,f);e.state===Bt&&(e.on.call("end",t,t.__data__,e.index,e.group),c())}function c(){e.state=ft,e.timer.stop(),delete r[n];for(var u in r)return;delete t.__transition}}function Wr(t,n){var e=t.__transition,r,i,o=!0,s;if(e){n=n==null?null:n+"";for(s in e){if((r=e[s]).name!==n){o=!1;continue}i=r.state>Mt&&r.state<Bt,r.state=ft,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete e[s]}o&&delete t.__transition}}function Jr(t){return this.each(function(){Wr(this,t)})}function Qr(t,n){var e,r;return function(){var i=$(this,t),o=i.tween;if(o!==e){r=e=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===n){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function Zr(t,n,e){var r,i;if(typeof e!="function")throw new Error;return function(){var o=$(this,t),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:n,value:e},c=0,u=i.length;c<u;++c)if(i[c].name===n){i[c]=a;break}c===u&&i.push(a)}o.tween=i}}function jr(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r=S(this.node(),e).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===t)return s.value;return null}return this.each((n==null?Qr:Zr)(e,t,n))}function Ft(t,n,e){var r=t._id;return t.each(function(){var i=$(this,r);(i.value||(i.value={}))[n]=e.apply(this,arguments)}),function(i){return S(i,r).value[n]}}function Xn(t,n){var e;return(typeof n=="number"?R:n instanceof j?sn:(e=j(n))?(n=e,sn):Hr)(t,n)}function ti(t){return function(){this.removeAttribute(t)}}function ni(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ei(t,n,e){var r,i=e+"",o;return function(){var s=this.getAttribute(t);return s===i?null:s===r?o:o=n(r=s,e)}}function ri(t,n,e){var r,i=e+"",o;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===r?o:o=n(r=s,e)}}function ii(t,n,e){var r,i,o;return function(){var s,a=e(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=n(r=s,a)))}}function oi(t,n,e){var r,i,o;return function(){var s,a=e(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=n(r=s,a)))}}function si(t,n){var e=_t(t),r=e==="transform"?Dr:Xn;return this.attrTween(t,typeof n=="function"?(e.local?oi:ii)(e,r,Ft(this,"attr."+t,n)):n==null?(e.local?ni:ti)(e):(e.local?ri:ei)(e,r,n))}function ai(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function ci(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function ui(t,n){var e,r;function i(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&ci(t,o)),e}return i._value=n,i}function fi(t,n){var e,r;function i(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&ai(t,o)),e}return i._value=n,i}function li(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;var r=_t(t);return this.tween(e,(r.local?ui:fi)(r,n))}function hi(t,n){return function(){Pt(this,t).delay=+n.apply(this,arguments)}}function pi(t,n){return n=+n,function(){Pt(this,t).delay=n}}function di(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?hi:pi)(n,t)):S(this.node(),n).delay}function gi(t,n){return function(){$(this,t).duration=+n.apply(this,arguments)}}function mi(t,n){return n=+n,function(){$(this,t).duration=n}}function _i(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?gi:mi)(n,t)):S(this.node(),n).duration}function wi(t,n){if(typeof n!="function")throw new Error;return function(){$(this,t).ease=n}}function yi(t){var n=this._id;return arguments.length?this.each(wi(n,t)):S(this.node(),n).ease}function xi(t,n){return function(){var e=n.apply(this,arguments);if(typeof e!="function")throw new Error;$(this,t).ease=e}}function vi(t){if(typeof t!="function")throw new Error;return this.each(xi(this._id,t))}function bi(t){typeof t!="function"&&(t=gn(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o=n[i],s=o.length,a=r[i]=[],c,u=0;u<s;++u)(c=o[u])&&t.call(c,c.__data__,u,o)&&a.push(c);return new B(r,this._parents,this._name,this._id)}function Si(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var c=n[a],u=e[a],f=c.length,l=s[a]=new Array(f),h,d=0;d<f;++d)(h=c[d]||u[d])&&(l[d]=h);for(;a<r;++a)s[a]=n[a];return new B(s,this._parents,this._name,this._id)}function Ni(t){return(t+"").trim().split(/^|\s+/).every(function(n){var e=n.indexOf(".");return e>=0&&(n=n.slice(0,e)),!n||n==="start"})}function Ei(t,n,e){var r,i,o=Ni(n)?Pt:$;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(n,e),s.on=i}}function Ai(t,n){var e=this._id;return arguments.length<2?S(this.node(),e).on.on(t):this.each(Ei(e,t,n))}function $i(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function Ci(){return this.on("end.remove",$i(this._id))}function ki(t){var n=this._name,e=this._id;typeof t!="function"&&(t=Ot(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,u=o[s]=new Array(c),f,l,h=0;h<c;++h)(f=a[h])&&(l=t.call(f,f.__data__,h,a))&&("__data__"in f&&(l.__data__=f.__data__),u[h]=l,yt(u[h],n,e,h,u,S(f,e)));return new B(o,this._parents,n,e)}function Ti(t){var n=this._name,e=this._id;typeof t!="function"&&(t=dn(t));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var c=r[a],u=c.length,f,l=0;l<u;++l)if(f=c[l]){for(var h=t.call(f,f.__data__,l,c),d,m=S(f,e),w=0,N=h.length;w<N;++w)(d=h[w])&&yt(d,n,e,w,h,m);o.push(h),s.push(f)}return new B(o,s,n,e)}var Mi=nt.prototype.constructor;function Bi(){return new Mi(this._groups,this._parents)}function Ri(t,n){var e,r,i;return function(){var o=V(this,t),s=(this.style.removeProperty(t),V(this,t));return o===s?null:o===e&&s===r?i:i=n(e=o,r=s)}}function In(t){return function(){this.style.removeProperty(t)}}function Oi(t,n,e){var r,i=e+"",o;return function(){var s=V(this,t);return s===i?null:s===r?o:o=n(r=s,e)}}function Xi(t,n,e){var r,i,o;return function(){var s=V(this,t),a=e(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),V(this,t))),s===c?null:s===r&&c===i?o:(i=c,o=n(r=s,a))}}function Ii(t,n){var e,r,i,o="style."+n,s="end."+o,a;return function(){var c=$(this,t),u=c.on,f=c.value[o]==null?a||(a=In(n)):void 0;(u!==e||i!==f)&&(r=(e=u).copy()).on(s,i=f),c.on=r}}function Hi(t,n,e){var r=(t+="")=="transform"?Lr:Xn;return n==null?this.styleTween(t,Ri(t,r)).on("end.style."+t,In(t)):typeof n=="function"?this.styleTween(t,Xi(t,r,Ft(this,"style."+t,n))).each(Ii(this._id,t)):this.styleTween(t,Oi(t,r,n),e).on("end.style."+t,null)}function Pi(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function Fi(t,n,e){var r,i;function o(){var s=n.apply(this,arguments);return s!==i&&(r=(i=s)&&Pi(t,s,e)),r}return o._value=n,o}function Li(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;return this.tween(r,Fi(t,n,e??""))}function Di(t){return function(){this.textContent=t}}function Yi(t){return function(){var n=t(this);this.textContent=n??""}}function qi(t){return this.tween("text",typeof t=="function"?Yi(Ft(this,"text",t)):Di(t==null?"":t+""))}function Vi(t){return function(n){this.textContent=t.call(this,n)}}function zi(t){var n,e;function r(){var i=t.apply(this,arguments);return i!==e&&(n=(e=i)&&Vi(i)),n}return r._value=t,r}function Ui(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,zi(t))}function Gi(){for(var t=this._name,n=this._id,e=Hn(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,u=0;u<a;++u)if(c=s[u]){var f=S(c,n);yt(c,t,e,u,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new B(r,this._parents,t,e)}function Ki(){var t,n,e=this,r=e._id,i=e.size();return new Promise(function(o,s){var a={value:s},c={value:function(){--i===0&&o()}};e.each(function(){var u=$(this,r),f=u.on;f!==t&&(n=(t=f).copy(),n._.cancel.push(a),n._.interrupt.push(a),n._.end.push(c)),u.on=n}),i===0&&o()})}var Wi=0;function B(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Hn(){return++Wi}var T=nt.prototype;B.prototype={constructor:B,select:ki,selectAll:Ti,selectChild:T.selectChild,selectChildren:T.selectChildren,filter:bi,merge:Si,selection:Bi,transition:Gi,call:T.call,nodes:T.nodes,node:T.node,size:T.size,empty:T.empty,each:T.each,on:Ai,attr:si,attrTween:li,style:Hi,styleTween:Li,text:qi,textTween:Ui,remove:Ci,tween:jr,delay:di,duration:_i,ease:yi,easeVarying:vi,end:Ki,[Symbol.iterator]:T[Symbol.iterator]};function Ji(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Qi={time:null,delay:0,duration:250,ease:Ji};function Zi(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}function ji(t){var n,e;t instanceof B?(n=t._id,t=t._name):(n=Hn(),(e=Qi).time=Ht(),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,u=0;u<a;++u)(c=s[u])&&yt(c,t,n,u,s,e||Zi(c,n));return new B(r,this._parents,t,n)}nt.prototype.interrupt=Jr;nt.prototype.transition=ji;function W(t,n,e){this.k=t,this.x=n,this.y=e}W.prototype={constructor:W,scale:function(t){return t===1?this:new W(this.k*t,this.x,this.y)},translate:function(t,n){return t===0&n===0?this:new W(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};W.prototype;let M=[],J=[],q=new Map;async function to(){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 n=[],e=t.output.trim().split(`
2
+ `);for(const r of e){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("|"),u=s.trim()?s.trim().split(" "):[];n.push({hash:o,parents:u,timestamp:a,message:c})}}return n.sort((r,i)=>i.timestamp-r.timestamp),n}async function no(){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 n=[],e=t.output.trim().split(`
3
+ `);for(const r of e){const i=r.trim().split(" ");if(i.length>=2){const o=i[0],s=i[1];n.push({name:o,hash:s})}}return n}function eo(t){const n=["branch1","branch2","branch3"],e=t.find(r=>r.name==="main"||r.name==="master");n.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&&e&&(o.value=e.name),o.addEventListener("change",()=>Rt())})}function ro(t){const n=J.find(i=>i.name===t);if(!n)return new Set;const e=new Set;let r=n.hash;for(;r;){e.add(r);const i=q.get(r);if(i&&i.parents.length>0)r=i.parents[0];else break}return e}function io(t){const n=[],e=new Set;for(const r of t){const i=q.get(r);if(!(!i||i.parents.length<2))for(let o=1;o<i.parents.length;o++){const s=i.parents[o];if(e.has(s))continue;const a=new Set,c=[s];for(;c.length>0;){const u=c.pop();if(a.has(u)||t.has(u)||e.has(u))continue;const f=q.get(u);if(f){a.add(u),e.add(u);for(const l of f.parents)!t.has(l)&&!a.has(l)&&c.push(l)}}if(a.size>0){let u=!0;for(const f of a){const l=q.get(f);if(l){for(const h of l.parents)if(!t.has(h)&&!a.has(h)){u=!1;break}if(!u)break}}u&&n.push({mergeCommit:r,commits:a})}}}return n}function oo(){const t=[];return["branch1","branch2","branch3"].forEach(n=>{const e=document.getElementById(n);e&&e.value&&t.push(e.value)}),t}function Rt(){const t=Jt("#graph");t.selectAll("*").remove();const n=Jt("#app");n.selectAll(".tooltip").remove();const e=document.getElementById("controls").offsetHeight,r=window.innerWidth,i=window.innerHeight-e;t.attr("width",r).attr("height",i);const o=6,s=30,a=150,c=30,u=50,f=50,h=oo().map(p=>{const g=ro(p),_=io(g);return{name:p,lineage:g,subBranches:_}}),d=new Map;J.forEach(p=>{d.has(p.hash)||d.set(p.hash,[]),d.get(p.hash).push(p.name)});const m=new Map;M.forEach(p=>{m.set(p.hash,{mainCol:h.length,subOffset:0,isSubBranch:!1})}),h.forEach((p,g)=>{for(const _ of p.lineage)m.set(_,{mainCol:g,subOffset:0,isSubBranch:!1})}),h.forEach((p,g)=>{const _=new Map;p.subBranches.forEach(y=>{const X=[];y.commits.forEach(k=>{const St=M.findIndex(Pn=>Pn.hash===k);St>=0&&X.push(St)});let it=1,bt=!0;for(;bt;){bt=!1;for(const k of X)if((_.get(k)||new Set).has(it)){bt=!0,it++;break}}for(const k of X)_.has(k)||_.set(k,new Set),_.get(k).add(it);y.commits.forEach(k=>{m.set(k,{mainCol:g,subOffset:it,isSubBranch:!0})})})});const w=new Map;let N=f;for(let p=0;p<=h.length;p++)if(w.set(p,N),p<h.length){let g=0;M.forEach(_=>{const y=m.get(_.hash);y.mainCol===p&&y.subOffset>g&&(g=y.subOffset)}),N+=a+g*c}const C=new Map;M.forEach((p,g)=>{const _=m.get(p.hash),X=w.get(_.mainCol)+_.subOffset*c;C.set(p.hash,{col:_.mainCol,subOffset:_.subOffset,row:g,x:X,y:u+g*s,isSubBranch:_.isSubBranch})});const O=Array.from(m.values()).some(p=>p.mainCol===h.length),E=t.append("g").attr("class","main-group"),F=n.append("div").attr("class","tooltip").style("opacity",0);h.forEach((p,g)=>{E.append("text").attr("x",w.get(g)).attr("y",25).attr("fill","#4fc3f7").attr("font-size","14px").attr("font-weight","bold").text(p.name)}),O&&E.append("text").attr("x",w.get(h.length)).attr("y",25).attr("fill","#888").attr("font-size","14px").text("Other"),M.forEach(p=>{const g=C.get(p.hash);g&&p.parents.forEach(_=>{const y=C.get(_);y&&E.append("line").attr("x1",g.x).attr("y1",g.y).attr("x2",y.x).attr("y2",y.y).attr("stroke",g.isSubBranch||y.isSubBranch?"#555":"#666").attr("stroke-width",g.isSubBranch&&y.isSubBranch?1:1.5).attr("stroke-opacity",.6)})}),E.selectAll("g.node").data(M).enter().append("g").attr("class","node").attr("transform",p=>{const g=C.get(p.hash);return g?`translate(${g.x}, ${g.y})`:"translate(-100, -100)"}).append("circle").attr("r",p=>{const g=C.get(p.hash);return g.isSubBranch?o*.6:g.col<h.length?o:o*.7}).attr("fill",p=>{const g=C.get(p.hash);return g.isSubBranch?"#a0a0a0":g.col<h.length?d.has(p.hash)?"#4fc3f7":"#fff":"#888"}).attr("stroke","#333").attr("stroke-width",p=>{const g=C.get(p.hash);return g.isSubBranch?1:g.col<h.length?2:1}).style("cursor","pointer").on("mouseenter",(p,g)=>{const _=d.get(g.hash),y=_?`[${_.join(", ")}]<br/>`:"",X=new Date(g.timestamp*1e3).toLocaleString();F.html(`<strong>${g.hash.substring(0,7)}</strong><br/>${y}${g.message}<br/><span class="date">${X}</span>`).style("left",p.pageX+15+"px").style("top",p.pageY-10+"px").style("opacity",1)}).on("mousemove",p=>{F.style("left",p.pageX+15+"px").style("top",p.pageY-10+"px")}).on("mouseleave",()=>{F.style("opacity",0)});let L=0,D=0,rt=!1,Lt=0,Dt=0,Yt=0,qt=0;function vt(){E.attr("transform",`translate(${L}, ${D})`)}t.on("wheel",p=>{p.preventDefault(),L-=p.deltaX,D-=p.deltaY,vt()}),t.on("mousedown",p=>{p.button===0&&(rt=!0,Lt=p.clientX,Dt=p.clientY,Yt=L,qt=D,p.preventDefault())}),t.on("mousemove",p=>{rt&&(L=Yt+(p.clientX-Lt),D=qt+(p.clientY-Dt),vt())}),t.on("mouseup",p=>{p.button===0&&(rt=!1)}),t.on("mouseleave",()=>{rt=!1});let Vt=0,zt=0,Ut=0,Gt=0;t.on("touchstart",p=>{if(p.touches.length===1){const g=p.touches[0];Vt=g.clientX,zt=g.clientY,Ut=L,Gt=D}}),t.on("touchmove",p=>{if(p.touches.length===1){p.preventDefault();const g=p.touches[0];L=Ut+(g.clientX-Vt),D=Gt+(g.clientY-zt),vt()}}),t.on("contextmenu",p=>{p.preventDefault()})}async function so(){[M,J]=await Promise.all([to(),no()]),q.clear(),M.forEach(t=>q.set(t.hash,t)),console.log("Commits:",M.length),console.log("Branches:",J.length),eo(J),Rt(),window.addEventListener("resize",()=>{Rt()})}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 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 yn(t){return function(){return gn(t.apply(this,arguments))}}function wn(t){typeof t=="function"?t=yn(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 Pe(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:Pe(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:Pe(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 Oe(t){return new Array(t.length)}function An(){return new A(this._enter||this._groups.map(Oe),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,b=a[l]=new Array(m),N=s[l]=new Array(m),Mt=c[l]=new Array(d);n(u,p,b,N,Mt,g,e);for(var T=0,D=0,E,ft;T<m;++T)if(E=b[T]){for(T>=D&&(D=T+1);!(ft=N[D])&&++D<m;);E._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 Pn(){return new A(this._exit||this._groups.map(Oe),this._parents)}function On(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 yr(t){return function(){this.innerHTML=t}}function wr(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"?wr:yr)(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 Pr(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 Or(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?Or:Pr,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:wn,selectChild:bn,selectChildren:Nn,filter:Cn,data:Tn,enter:An,exit:Pn,join:On,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}\\)$`),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};ee(ut,at,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:we,formatHex:we,formatHex8:Wr,formatHsl:Jr,formatRgb:_e,toString:_e});function we(){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?yt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?yt(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))?yt(e[1],e[2],e[3],e[4]):(e=Zr.exec(t))?yt(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]):ye.hasOwnProperty(t)?xe(ye[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 yt(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(Z(this.r),Z(this.g),Z(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`#${U(this.r)}${U(this.g)}${U(this.b)}`}function jr(){return`#${U(this.r)}${U(this.g)}${U(this.b)}${U((isNaN(this.opacity)?1:this.opacity)*255)}`}function be(){const t=St(this.opacity);return`${t===1?"rgb(":"rgba("}${Z(this.r)}, ${Z(this.g)}, ${Z(this.b)}${t===1?")":`, ${t})`}`}function St(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Z(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function U(t){return t=Z(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),wt(this.s),wt(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)}, ${wt(this.s)*100}%, ${wt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ee(t){return t=(t||0)%360,t<0?t+360:t}function wt(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 Y(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:Y(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 b=g.push("translate(",null,e,null,n);m.push({i:b-4,x:Y(l,p)},{i:b-2,x:Y(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:Y(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:Y(l,u)}):u&&p.push(i(p)+"skewX("+u+r)}function c(l,u,p,d,g,m){if(l!==p||u!==d){var b=g.push(i(g)+"scale(",null,",",null,")");m.push({i:b-4,x:Y(l,p)},{i:b-2,x:Y(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,b=d.length,N;++m<b;)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;yi(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 P(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 yi(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 wi(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(){wi(this,t)})}function xi(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 vi(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 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=P(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"?Y: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 Pi(t,e){return function(){re(this,t).delay=+e.apply(this,arguments)}}function Oi(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"?Pi:Oi)(e,t)):M(this.node(),e).delay}function Xi(t,e){return function(){P(this,t).duration=+e.apply(this,arguments)}}function Li(t,e){return e=+e,function(){P(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(){P(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;P(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 X(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 X(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:P;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 X(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),b=0,N=d.length;b<N;++b)(g=d[b])&&Rt(g,e,n,b,d,m);o.push(d),s.push(u)}return new X(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=P(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 yo(){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 X(r,this._parents,t,n)}function wo(){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 X(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function nn(){return++_o}var F=lt.prototype;X.prototype={constructor:X,select:Qi,selectAll:ji,selectChild:F.selectChild,selectChildren:F.selectChildren,filter:zi,merge:Ui,selection:eo,transition:yo,call:F.call,nodes:F.nodes,node:F.node,size:F.size,empty:F.empty,each:F.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:wo,[Symbol.iterator]:F[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 X?(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 X(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=[],H=new Map,Dt="",z=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=H.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=H.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=H.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=H.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 y=new Set;d.forEach(_=>{_.name!==f&&_.lineage.forEach(w=>y.add(w))});const v=Ro(h,y);return{name:f,lineage:h,subBranches:v}}),b=new Map;it.forEach(f=>{b.has(f.hash)||b.set(f.hash,[]),b.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 y of f.lineage)N.set(y,{mainCol:h,subOffset:0,isSubBranch:!1})});let Mt=0;m.forEach((f,h)=>{[...f.subBranches].sort((v,_)=>{const w=$=>{let x=1/0;return $.commits.forEach(S=>{const k=H.get(S);k&&k.timestamp<x&&(x=k.timestamp)}),x};return w(v)-w(_)}).forEach((v,_)=>{const w=`sb-${Mt++}`,$=_+1;v.commits.forEach(x=>{N.set(x,{mainCol:h,subOffset:$,isSubBranch:!0,subBranchId:w})})})});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(y=>{const v=N.get(y.hash);v.mainCol===f&&v.subOffset>h&&(h=v.subOffset)}),D+=a+h*c}const E=new Map;B.forEach((f,h)=>{const y=N.get(f.hash),_=T.get(y.mainCol)+y.subOffset*c;E.set(f.hash,{col:y.mainCol,subOffset:y.subOffset,row:h,x:_,y:l+h*s,isSubBranch:y.isSubBranch,subBranchId:y.subBranchId||null})});const ft=Array.from(N.values()).some(f=>f.mainCol===m.length),O=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=[],y=new Set;function v(w){if(y.has(w))return;y.add(w);const $=H.get(w);$&&$.parents.forEach(x=>{h.push({source:w,target:x});const S=E.get(x);S&&S.col===m.length&&!S.isSubBranch&&v(x)})}function _(w){if(y.has(w))return;y.add(w),(pt.get(w)||[]).forEach(x=>{h.push({source:x,target:w});const S=E.get(x);S&&S.col===m.length&&!S.isSubBranch&&_(x)})}return v(f),y.delete(f),_(f),h}B.forEach(f=>{const h=E.get(f.hash);h&&f.parents.forEach(y=>{const v=E.get(y);if(v){const _=h.col===m.length||v.col===m.length,w=h.x,$=h.y*z,x=v.x,S=v.y*z;let k;if(w===x)k=`M ${w} ${$} L ${x} ${S}`;else{const mt=($+S)/2;k=`M ${w} ${$} C ${w} ${mt}, ${x} ${mt}, ${x} ${S}`}const V=h.subBranchId||v.subBranchId||null,Ft=h.isSubBranch||v.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=O.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",V?`edge edge-${V}`:"edge").attr("data-source",f.hash).attr("data-target",y);if(V){const mt=j;an.style("cursor","pointer").on("mouseenter",()=>{O.selectAll(`.edge-${V}`).attr("stroke-width",3).attr("stroke-opacity",.9)}).on("mouseleave",()=>{O.selectAll(`.edge-${V}`).attr("stroke-width",mt).attr("stroke-opacity",.5)})}}})});const Q=new Map;Wt.forEach(f=>{Q.set(f.headCommit,f)});const Pt=O.selectAll("g.node").data(B).enter().append("g").attr("class","node").attr("transform",f=>{const h=E.get(f.hash);return h?`translate(${h.x}, ${h.y*z})`:"translate(-100, -100)"});Pt.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"),Pt.append("circle").attr("r",f=>{const h=E.get(f.hash);return h.isSubBranch?o*.6:h.col<m.length?o:o*.7}).attr("fill",f=>{const h=E.get(f.hash);return h.col<m.length?ht[h.col]||"#fff":h.isSubBranch?"#a0a0a0":"#888"}).attr("stroke",f=>{const h=E.get(f.hash);return h.col<m.length&&ht[h.col]||"#333"}).attr("stroke-width",f=>{const h=E.get(f.hash);return h.isSubBranch?1:h.col<m.length?2:1}).style("cursor","pointer").on("mouseenter",(f,h)=>{const y=b.get(h.hash),v=y?`[${y.join(", ")}]<br/>`:"",_=Q.get(h.hash),w=_?`<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/>${w}${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=E.get(h.hash);x&&x.col===m.length&&!x.isSubBranch&&se(h.hash).forEach(({source:k,target:V})=>{O.selectAll(`path.edge[data-source="${k}"][data-target="${V}"]`).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 y=E.get(h.hash);y&&y.col===m.length&&!y.isSubBranch&&se(h.hash).forEach(({source:_,target:w})=>{O.selectAll(`path.edge[data-source="${_}"][data-target="${w}"]`).attr("stroke-width",1).attr("stroke-opacity",.4)})}),Pt.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,L=0,dt=!1,ae=0,ce=0,le=0,ue=0;function Ot(f){return f*z}function gt(){O.attr("transform",`translate(${q}, ${L})`),Tt.attr("transform",`translate(${q}, 0)`)}function on(){O.selectAll("g.node").attr("transform",f=>{const h=E.get(f.hash);return h?`translate(${h.x}, ${Ot(h.y)})`:"translate(-100, -100)"}),O.selectAll("path.edge").attr("d",function(){const f=Lt(this),h=f.attr("data-source"),y=f.attr("data-target"),v=E.get(h),_=E.get(y);if(!v||!_)return"";const w=v.x,$=Ot(v.y),x=_.x,S=Ot(_.y);if(w===x)return`M ${w} ${$} L ${x} ${S}`;{const k=($+S)/2;return`M ${w} ${$} C ${w} ${k}, ${x} ${k}, ${x} ${S}`}})}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,z*h)),w=t.node().getBoundingClientRect(),$=f.clientY-w.top,x=$-L;L=$-x*(_/z),z=_,on(),gt()}else q-=f.deltaX,L-=f.deltaY,gt()}),t.on("mousedown",f=>{f.button===0&&(dt=!0,ae=f.clientX,ce=f.clientY,le=q,ue=L,f.preventDefault())}),t.on("mousemove",f=>{dt&&(q=le+(f.clientX-ae),L=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=L}}),t.on("touchmove",f=>{if(f.touches.length===1){f.preventDefault();const h=f.touches[0];q=pe+(h.clientX-fe),L=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,H.clear(),B.forEach(t=>H.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 @@
1
+ *{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:#1a1a2e;color:#eee;overflow:hidden}#app{width:100vw;height:100vh;position:relative;display:flex;flex-direction:column}#controls{display:flex;align-items:center;gap:20px;padding:12px 20px;background:#16213e;border-bottom:1px solid #333;flex-shrink:0}#repo-name{font-size:16px;font-weight:700;color:#fff;margin-right:20px;padding-right:20px;border-right:1px solid #444}.branch-selector{display:flex;align-items:center;gap:8px}.branch-selector label{font-size:13px;color:#888}.branch-selector select{padding:6px 12px;font-size:13px;background:#1a1a2e;color:#eee;border:1px solid #444;border-radius:4px;min-width:150px;cursor:pointer}.branch-selector select:hover{border-color:#4fc3f7}.branch-selector select:focus{outline:none;border-color:#4fc3f7}#graph{flex:1;width:100%}.tooltip{position:absolute;background:#1e1e32f2;border:1px solid #4fc3f7;border-radius:6px;padding:10px 14px;font-size:13px;line-height:1.5;max-width:400px;pointer-events:none;z-index:1000;box-shadow:0 4px 12px #0006;transition:opacity .15s ease}.tooltip strong{color:#4fc3f7;font-family:SF Mono,Monaco,Courier New,monospace}.tooltip .date{color:#888;font-size:11px}.tooltip .pr-info{color:#81c784;font-weight:700}
@@ -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 Te={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 nt(n)}function nt(t){this._=t}function Me(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}})}nt.prototype=re.prototype={constructor:nt,on:function(t,e){var n=this._,r=Me(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=Re(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]=Dt(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Dt(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 nt(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 Re(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Dt(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Te,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var mt="http://www.w3.org/1999/xhtml";const Yt={svg:"http://www.w3.org/2000/svg",xhtml:mt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ft(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Yt.hasOwnProperty(e)?{space:Yt[e],local:t}:t}function Ie(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===mt&&e.documentElement.namespaceURI===mt?e.createElement(t):e.createElementNS(n,t)}}function Xe(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ie(t){var e=ft(t);return(e.local?Xe:Ie)(e)}function Fe(){}function Et(t){return t==null?Fe:function(){return this.querySelector(t)}}function He(t){typeof t!="function"&&(t=Et(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 x(r,this._parents)}function Pe(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Le(){return[]}function oe(t){return t==null?Le:function(){return this.querySelectorAll(t)}}function Oe(t){return function(){return Pe(t.apply(this,arguments))}}function De(t){typeof t=="function"?t=Oe(t):t=oe(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 x(r,i)}function se(t){return function(){return this.matches(t)}}function ae(t){return function(e){return e.matches(t)}}var Ye=Array.prototype.find;function qe(t){return function(){return Ye.call(this.children,t)}}function Be(){return this.firstElementChild}function Ve(t){return this.select(t==null?Be:qe(typeof t=="function"?t:ae(t)))}var ze=Array.prototype.filter;function Ue(){return Array.from(this.children)}function Ge(t){return function(){return ze.call(this.children,t)}}function Ke(t){return this.selectAll(t==null?Ue:Ge(typeof t=="function"?t:ae(t)))}function We(t){typeof t!="function"&&(t=se(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 x(r,this._parents)}function ce(t){return new Array(t.length)}function Je(){return new x(this._enter||this._groups.map(ce),this._parents)}function ot(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ot.prototype={constructor:ot,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 Qe(t){return function(){return t}}function Ze(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 ot(t,o[s]);for(;s<c;++s)(a=e[s])&&(i[s]=a)}function je(t,e,n,r,i,o,s){var a,c,l=new Map,u=e.length,f=o.length,h=new Array(u),d;for(a=0;a<u;++a)(c=e[a])&&(h[a]=d=s.call(c,c.__data__,a,e)+"",l.has(d)?i[a]=c:l.set(d,c));for(a=0;a<f;++a)d=s.call(t,o[a],a,o)+"",(c=l.get(d))?(r[a]=c,c.__data__=o[a],l.delete(d)):n[a]=new ot(t,o[a]);for(a=0;a<u;++a)(c=e[a])&&l.get(h[a])===c&&(i[a]=c)}function tn(t){return t.__data__}function en(t,e){if(!arguments.length)return Array.from(this,tn);var n=e?je:Ze,r=this._parents,i=this._groups;typeof t!="function"&&(t=Qe(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],f=i[l],h=f.length,d=nn(t.call(u,u&&u.__data__,l,r)),_=d.length,m=a[l]=new Array(_),w=s[l]=new Array(_),D=c[l]=new Array(h);n(u,f,m,w,D,d,e);for(var H=0,b=0,S,R;H<_;++H)if(S=m[H]){for(H>=b&&(b=H+1);!(R=w[b])&&++b<_;);S._next=R||null}}return s=new x(s,r),s._enter=a,s._exit=c,s}function nn(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function rn(){return new x(this._exit||this._groups.map(ce),this._parents)}function on(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 sn(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],f=l.length,h=a[c]=new Array(f),d,_=0;_<f;++_)(d=l[_]||u[_])&&(h[_]=d);for(;c<i;++c)a[c]=n[c];return new x(a,this._parents)}function an(){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 cn(t){t||(t=ln);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}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 x(i,this._parents).order()}function ln(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function un(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function fn(){return Array.from(this)}function hn(){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 dn(){return!this.node()}function gn(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 _n(t){return function(){this.removeAttribute(t)}}function mn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function yn(t,e){return function(){this.setAttribute(t,e)}}function wn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function xn(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 bn(t,e){var n=ft(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?mn:_n:typeof e=="function"?n.local?vn:xn:n.local?wn:yn)(n,e))}function le(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Nn(t){return function(){this.style.removeProperty(t)}}function An(t,e,n){return function(){this.style.setProperty(t,e,n)}}function $n(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function En(t,e,n){return arguments.length>1?this.each((e==null?Nn:typeof e=="function"?$n:An)(t,e,n??"")):L(this.node(),t)}function L(t,e){return t.style.getPropertyValue(e)||le(t).getComputedStyle(t,null).getPropertyValue(e)}function Sn(t){return function(){delete this[t]}}function kn(t,e){return function(){this[t]=e}}function Cn(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Tn(t,e){return arguments.length>1?this.each((e==null?Sn:typeof e=="function"?Cn:kn)(t,e)):this.node()[t]}function ue(t){return t.trim().split(/^|\s+/)}function St(t){return t.classList||new fe(t)}function fe(t){this._node=t,this._names=ue(t.getAttribute("class")||"")}fe.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=St(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function pe(t,e){for(var n=St(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Mn(t){return function(){he(this,t)}}function Rn(t){return function(){pe(this,t)}}function In(t,e){return function(){(e.apply(this,arguments)?he:pe)(this,t)}}function Xn(t,e){var n=ue(t+"");if(arguments.length<2){for(var r=St(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?In:e?Mn:Rn)(n,e))}function Fn(){this.textContent=""}function Hn(t){return function(){this.textContent=t}}function Pn(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Ln(t){return arguments.length?this.each(t==null?Fn:(typeof t=="function"?Pn:Hn)(t)):this.node().textContent}function On(){this.innerHTML=""}function Dn(t){return function(){this.innerHTML=t}}function Yn(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function qn(t){return arguments.length?this.each(t==null?On:(typeof t=="function"?Yn:Dn)(t)):this.node().innerHTML}function Bn(){this.nextSibling&&this.parentNode.appendChild(this)}function Vn(){return this.each(Bn)}function zn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Un(){return this.each(zn)}function Gn(t){var e=typeof t=="function"?t:ie(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Kn(){return null}function Wn(t,e){var n=typeof t=="function"?t:ie(t),r=e==null?Kn:typeof e=="function"?e:Et(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Jn(){var t=this.parentNode;t&&t.removeChild(this)}function Qn(){return this.each(Jn)}function Zn(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function jn(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function tr(t){return this.select(t?jn:Zn)}function er(t){return arguments.length?this.property("__data__",t):this.node().__data__}function nr(t){return function(e){t.call(this,e,this.__data__)}}function rr(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 ir(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 or(t,e,n){return function(){var r=this.__on,i,o=nr(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 sr(t,e,n){var r=rr(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?or:ir,i=0;i<o;++i)this.each(a(r[i],e,n));return this}function de(t,e,n){var r=le(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 ar(t,e){return function(){return de(this,t,e)}}function cr(t,e){return function(){return de(this,t,e.apply(this,arguments))}}function lr(t,e){return this.each((typeof e=="function"?cr:ar)(t,e))}function*ur(){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 ge=[null];function x(t,e){this._groups=t,this._parents=e}function Q(){return new x([[document.documentElement]],ge)}function fr(){return this}x.prototype=Q.prototype={constructor:x,select:He,selectAll:De,selectChild:Ve,selectChildren:Ke,filter:We,data:en,enter:Je,exit:rn,join:on,merge:sn,selection:fr,order:an,sort:cn,call:un,nodes:fn,node:hn,size:pn,empty:dn,each:gn,attr:bn,style:En,property:Tn,classed:Xn,text:Ln,html:qn,raise:Vn,lower:Un,append:Gn,insert:Wn,remove:Qn,clone:tr,datum:er,on:sr,dispatch:lr,[Symbol.iterator]:ur};function qt(t){return typeof t=="string"?new x([[document.querySelector(t)]],[document.documentElement]):new x([[t]],ge)}function kt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function _e(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Z(){}var G=.7,st=1/G,P="\\s*([+-]?\\d+)\\s*",K="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hr=/^#([0-9a-f]{3,8})$/,pr=new RegExp(`^rgb\\(${P},${P},${P}\\)$`),dr=new RegExp(`^rgb\\(${$},${$},${$}\\)$`),gr=new RegExp(`^rgba\\(${P},${P},${P},${K}\\)$`),_r=new RegExp(`^rgba\\(${$},${$},${$},${K}\\)$`),mr=new RegExp(`^hsl\\(${K},${$},${$}\\)$`),yr=new RegExp(`^hsla\\(${K},${$},${$},${K}\\)$`),Bt={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};kt(Z,W,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Vt,formatHex:Vt,formatHex8:wr,formatHsl:xr,formatRgb:zt,toString:zt});function Vt(){return this.rgb().formatHex()}function wr(){return this.rgb().formatHex8()}function xr(){return me(this).formatHsl()}function zt(){return this.rgb().formatRgb()}function W(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=hr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Ut(e):n===3?new y(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?j(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?j(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 y(e[1],e[2],e[3],1):(e=dr.exec(t))?new y(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=gr.exec(t))?j(e[1],e[2],e[3],e[4]):(e=_r.exec(t))?j(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=mr.exec(t))?Wt(e[1],e[2]/100,e[3]/100,1):(e=yr.exec(t))?Wt(e[1],e[2]/100,e[3]/100,e[4]):Bt.hasOwnProperty(t)?Ut(Bt[t]):t==="transparent"?new y(NaN,NaN,NaN,0):null}function Ut(t){return new y(t>>16&255,t>>8&255,t&255,1)}function j(t,e,n,r){return r<=0&&(t=e=n=NaN),new y(t,e,n,r)}function vr(t){return t instanceof Z||(t=W(t)),t?(t=t.rgb(),new y(t.r,t.g,t.b,t.opacity)):new y}function yt(t,e,n,r){return arguments.length===1?vr(t):new y(t,e,n,r??1)}function y(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}kt(y,yt,_e(Z,{brighter(t){return t=t==null?st:Math.pow(st,t),new y(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?G:Math.pow(G,t),new y(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new y(X(this.r),X(this.g),X(this.b),at(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:Gt,formatHex:Gt,formatHex8:br,formatRgb:Kt,toString:Kt}));function Gt(){return`#${I(this.r)}${I(this.g)}${I(this.b)}`}function br(){return`#${I(this.r)}${I(this.g)}${I(this.b)}${I((isNaN(this.opacity)?1:this.opacity)*255)}`}function Kt(){const t=at(this.opacity);return`${t===1?"rgb(":"rgba("}${X(this.r)}, ${X(this.g)}, ${X(this.b)}${t===1?")":`, ${t})`}`}function at(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function X(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function I(t){return t=X(t),(t<16?"0":"")+t.toString(16)}function Wt(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new N(t,e,n,r)}function me(t){if(t instanceof N)return new N(t.h,t.s,t.l,t.opacity);if(t instanceof Z||(t=W(t)),!t)return new N;if(t instanceof N)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 N(s,a,c,t.opacity)}function Nr(t,e,n,r){return arguments.length===1?me(t):new N(t,e,n,r??1)}function N(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}kt(N,Nr,_e(Z,{brighter(t){return t=t==null?st:Math.pow(st,t),new N(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?G:Math.pow(G,t),new N(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 y(gt(t>=240?t-240:t+120,i,r),gt(t,i,r),gt(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new N(Jt(this.h),tt(this.s),tt(this.l),at(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=at(this.opacity);return`${t===1?"hsl(":"hsla("}${Jt(this.h)}, ${tt(this.s)*100}%, ${tt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Jt(t){return t=(t||0)%360,t<0?t+360:t}function tt(t){return Math.max(0,Math.min(1,t||0))}function gt(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 ye=t=>()=>t;function Ar(t,e){return function(n){return t+n*e}}function $r(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 Er(t){return(t=+t)==1?we:function(e,n){return n-e?$r(e,n,t):ye(isNaN(e)?n:e)}}function we(t,e){var n=e-t;return n?Ar(t,n):ye(isNaN(t)?e:t)}const Qt=(function t(e){var n=Er(e);function r(i,o){var s=n((i=yt(i)).r,(o=yt(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),l=we(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 T(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var wt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_t=new RegExp(wt.source,"g");function Sr(t){return function(){return t}}function kr(t){return function(e){return t(e)+""}}function Cr(t,e){var n=wt.lastIndex=_t.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(r=wt.exec(t))&&(i=_t.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:T(r,i)})),n=_t.lastIndex;return n<e.length&&(o=e.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?kr(c[0].x):Sr(e):(e=c.length,function(l){for(var u=0,f;u<e;++u)a[(f=c[u]).i]=f.x(l);return a.join("")})}var Zt=180/Math.PI,xt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xe(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)*Zt,skewX:Math.atan(c)*Zt,scaleX:s,scaleY:a}}var et;function Tr(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?xt:xe(e.a,e.b,e.c,e.d,e.e,e.f)}function Mr(t){return t==null||(et||(et=document.createElementNS("http://www.w3.org/2000/svg","g")),et.setAttribute("transform",t),!(t=et.transform.baseVal.consolidate()))?xt:(t=t.matrix,xe(t.a,t.b,t.c,t.d,t.e,t.f))}function ve(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,f,h,d,_){if(l!==f||u!==h){var m=d.push("translate(",null,e,null,n);_.push({i:m-4,x:T(l,f)},{i:m-2,x:T(u,h)})}else(f||h)&&d.push("translate("+f+e+h+n)}function s(l,u,f,h){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:T(l,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(l,u,f,h){l!==u?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:T(l,u)}):u&&f.push(i(f)+"skewX("+u+r)}function c(l,u,f,h,d,_){if(l!==f||u!==h){var m=d.push(i(d)+"scale(",null,",",null,")");_.push({i:m-4,x:T(l,f)},{i:m-2,x:T(u,h)})}else(f!==1||h!==1)&&d.push(i(d)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=t(l),u=t(u),o(l.translateX,l.translateY,u.translateX,u.translateY,f,h),s(l.rotate,u.rotate,f,h),a(l.skewX,u.skewX,f,h),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(d){for(var _=-1,m=h.length,w;++_<m;)f[(w=h[_]).i]=w.x(d);return f.join("")}}}var Rr=ve(Tr,"px, ","px)","deg)"),Ir=ve(Mr,", ",")",")"),O=0,B=0,q=0,be=1e3,ct,V,lt=0,F=0,ht=0,J=typeof performance=="object"&&performance.now?performance:Date,Ne=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ct(){return F||(Ne(Xr),F=J.now()+ht)}function Xr(){F=0}function ut(){this._call=this._time=this._next=null}ut.prototype=Ae.prototype={constructor:ut,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ct():+n)+(e==null?0:+e),!this._next&&V!==this&&(V?V._next=this:ct=this,V=this),this._call=t,this._time=n,vt()},stop:function(){this._call&&(this._call=null,this._time=1/0,vt())}};function Ae(t,e,n){var r=new ut;return r.restart(t,e,n),r}function Fr(){Ct(),++O;for(var t=ct,e;t;)(e=F-t._time)>=0&&t._call.call(void 0,e),t=t._next;--O}function jt(){F=(lt=J.now())+ht,O=B=0;try{Fr()}finally{O=0,Pr(),F=0}}function Hr(){var t=J.now(),e=t-lt;e>be&&(ht-=e,lt=t)}function Pr(){for(var t,e=ct,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:ct=n);V=t,vt(r)}function vt(t){if(!O){B&&(B=clearTimeout(B));var e=t-F;e>24?(t<1/0&&(B=setTimeout(jt,t-J.now()-ht)),q&&(q=clearInterval(q))):(q||(lt=J.now(),q=setInterval(Hr,be)),O=1,Ne(jt))}}function te(t,e,n){var r=new ut;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Lr=re("start","end","cancel","interrupt"),Or=[],$e=0,ee=1,bt=2,rt=3,ne=4,Nt=5,it=6;function pt(t,e,n,r,i,o){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;Dr(t,n,{name:e,index:r,group:i,on:Lr,tween:Or,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:$e})}function Tt(t,e){var n=A(t,e);if(n.state>$e)throw new Error("too late; already scheduled");return n}function E(t,e){var n=A(t,e);if(n.state>rt)throw new Error("too late; already running");return n}function A(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Dr(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Ae(o,0,n.time);function o(l){n.state=ee,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,f,h,d;if(n.state!==ee)return c();for(u in r)if(d=r[u],d.name===n.name){if(d.state===rt)return te(s);d.state===ne?(d.state=it,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[u]):+u<e&&(d.state=it,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[u])}if(te(function(){n.state===rt&&(n.state=ne,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=bt,n.on.call("start",t,t.__data__,n.index,n.group),n.state===bt){for(n.state=rt,i=new Array(h=n.tween.length),u=0,f=-1;u<h;++u)(d=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=d);i.length=f+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Nt,1),f=-1,h=i.length;++f<h;)i[f].call(t,u);n.state===Nt&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=it,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Yr(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>bt&&r.state<Nt,r.state=it,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}o&&delete t.__transition}}function qr(t){return this.each(function(){Yr(this,t)})}function Br(t,e){var n,r;return function(){var i=E(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 Vr(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=E(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 zr(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=A(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?Br:Vr)(n,t,e))}function Mt(t,e,n){var r=t._id;return t.each(function(){var i=E(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return A(i,r).value[e]}}function Ee(t,e){var n;return(typeof e=="number"?T:e instanceof W?Qt:(n=W(e))?(e=n,Qt):Cr)(t,e)}function Ur(t){return function(){this.removeAttribute(t)}}function Gr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Kr(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 Wr(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 Jr(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 Qr(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 Zr(t,e){var n=ft(t),r=n==="transform"?Ir:Ee;return this.attrTween(t,typeof e=="function"?(n.local?Qr:Jr)(n,r,Mt(this,"attr."+t,e)):e==null?(n.local?Gr:Ur)(n):(n.local?Wr:Kr)(n,r,e))}function jr(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function ti(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function ei(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 ni(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&jr(t,o)),n}return i._value=e,i}function ri(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=ft(t);return this.tween(n,(r.local?ei:ni)(r,e))}function ii(t,e){return function(){Tt(this,t).delay=+e.apply(this,arguments)}}function oi(t,e){return e=+e,function(){Tt(this,t).delay=e}}function si(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?ii:oi)(e,t)):A(this.node(),e).delay}function ai(t,e){return function(){E(this,t).duration=+e.apply(this,arguments)}}function ci(t,e){return e=+e,function(){E(this,t).duration=e}}function li(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?ai:ci)(e,t)):A(this.node(),e).duration}function ui(t,e){if(typeof e!="function")throw new Error;return function(){E(this,t).ease=e}}function fi(t){var e=this._id;return arguments.length?this.each(ui(e,t)):A(this.node(),e).ease}function hi(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;E(this,t).ease=n}}function pi(t){if(typeof t!="function")throw new Error;return this.each(hi(this._id,t))}function di(t){typeof t!="function"&&(t=se(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 C(r,this._parents,this._name,this._id)}function gi(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,f=s[a]=new Array(u),h,d=0;d<u;++d)(h=c[d]||l[d])&&(f[d]=h);for(;a<r;++a)s[a]=e[a];return new C(s,this._parents,this._name,this._id)}function _i(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 mi(t,e,n){var r,i,o=_i(e)?Tt:E;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?A(this.node(),n).on.on(t):this.each(mi(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 xi(){return this.on("end.remove",wi(this._id))}function vi(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Et(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,f,h=0;h<c;++h)(u=a[h])&&(f=t.call(u,u.__data__,h,a))&&("__data__"in u&&(f.__data__=u.__data__),l[h]=f,pt(l[h],e,n,h,l,A(u,n)));return new C(o,this._parents,e,n)}function bi(t){var e=this._name,n=this._id;typeof t!="function"&&(t=oe(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,f=0;f<l;++f)if(u=c[f]){for(var h=t.call(u,u.__data__,f,c),d,_=A(u,n),m=0,w=h.length;m<w;++m)(d=h[m])&&pt(d,e,n,m,h,_);o.push(h),s.push(u)}return new C(o,s,e,n)}var Ni=Q.prototype.constructor;function Ai(){return new Ni(this._groups,this._parents)}function $i(t,e){var n,r,i;return function(){var o=L(this,t),s=(this.style.removeProperty(t),L(this,t));return o===s?null:o===n&&s===r?i:i=e(n=o,r=s)}}function Se(t){return function(){this.style.removeProperty(t)}}function Ei(t,e,n){var r,i=n+"",o;return function(){var s=L(this,t);return s===i?null:s===r?o:o=e(r=s,n)}}function Si(t,e,n){var r,i,o;return function(){var s=L(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),L(this,t))),s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a))}}function ki(t,e){var n,r,i,o="style."+e,s="end."+o,a;return function(){var c=E(this,t),l=c.on,u=c.value[o]==null?a||(a=Se(e)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function Ci(t,e,n){var r=(t+="")=="transform"?Rr:Ee;return e==null?this.styleTween(t,$i(t,r)).on("end.style."+t,Se(t)):typeof e=="function"?this.styleTween(t,Si(t,r,Mt(this,"style."+t,e))).each(ki(this._id,t)):this.styleTween(t,Ei(t,r,e),n).on("end.style."+t,null)}function Ti(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Mi(t,e,n){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&Ti(t,s,n)),r}return o._value=e,o}function Ri(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,Mi(t,e,n??""))}function Ii(t){return function(){this.textContent=t}}function Xi(t){return function(){var e=t(this);this.textContent=e??""}}function Fi(t){return this.tween("text",typeof t=="function"?Xi(Mt(this,"text",t)):Ii(t==null?"":t+""))}function Hi(t){return function(e){this.textContent=t.call(this,e)}}function Pi(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Hi(i)),e}return r._value=t,r}function Li(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,Pi(t))}function Oi(){for(var t=this._name,e=this._id,n=ke(),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=A(c,e);pt(c,t,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new C(r,this._parents,t,n)}function Di(){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=E(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 Yi=0;function C(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function ke(){return++Yi}var k=Q.prototype;C.prototype={constructor:C,select:vi,selectAll:bi,selectChild:k.selectChild,selectChildren:k.selectChildren,filter:di,merge:gi,selection:Ai,transition:Oi,call:k.call,nodes:k.nodes,node:k.node,size:k.size,empty:k.empty,each:k.each,on:yi,attr:Zr,attrTween:ri,style:Ci,styleTween:Ri,text:Fi,textTween:Li,remove:xi,tween:zr,delay:si,duration:li,ease:fi,easeVarying:pi,end:Di,[Symbol.iterator]:k[Symbol.iterator]};function qi(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Bi={time:null,delay:0,duration:250,ease:qi};function Vi(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 zi(t){var e,n;t instanceof C?(e=t._id,t=t._name):(e=ke(),(n=Bi).time=Ct(),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])&&pt(c,t,e,l,s,n||Vi(c,e));return new C(r,this._parents,t,e)}Q.prototype.interrupt=qr;Q.prototype.transition=zi;function z(t,e,n){this.k=t,this.x=e,this.y=n}z.prototype={constructor:z,scale:function(t){return t===1?this:new z(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new z(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+")"}};z.prototype;let M=[],U=[],At=new Map;async function Ui(){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 Gi(){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 Ki(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",()=>$t())})}function Wi(t){const e=U.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=At.get(r);if(i&&i.parents.length>0)r=i.parents[0];else break}return n}function Ji(){const t=[];return["branch1","branch2","branch3"].forEach(e=>{const n=document.getElementById(e);n&&n.value&&t.push(n.value)}),t}function $t(){const t=qt("#graph");t.selectAll("*").remove();const e=qt("#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=50,l=50,f=Ji().map(p=>({name:p,lineage:Wi(p)})),h=new Map;U.forEach(p=>{h.has(p.hash)||h.set(p.hash,[]),h.get(p.hash).push(p.name)});const d=new Map;M.forEach(p=>{let g=-1;for(let v=0;v<f.length;v++)if(f[v].lineage.has(p.hash)){g=v;break}g===-1&&(g=f.length),d.set(p.hash,g)});const _=new Map;M.forEach((p,g)=>{const v=d.get(p.hash);_.set(p.hash,{col:v,row:g,x:l+v*a,y:c+g*s})}),M.length*s+c*2;const m=Array.from(d.values()).some(p=>p===f.length),w=t.append("g").attr("class","main-group"),D=e.append("div").attr("class","tooltip").style("opacity",0);f.forEach((p,g)=>{w.append("text").attr("x",l+g*a).attr("y",25).attr("fill","#4fc3f7").attr("font-size","14px").attr("font-weight","bold").text(p.name)}),m&&w.append("text").attr("x",l+f.length*a).attr("y",25).attr("fill","#888").attr("font-size","14px").text("Other"),M.forEach(p=>{const g=_.get(p.hash);g&&p.parents.forEach(v=>{const Y=_.get(v);Y&&w.append("line").attr("x1",g.x).attr("y1",g.y).attr("x2",Y.x).attr("y2",Y.y).attr("stroke","#666").attr("stroke-width",1.5).attr("stroke-opacity",.6)})}),w.selectAll("g.node").data(M).enter().append("g").attr("class","node").attr("transform",p=>{const g=_.get(p.hash);return g?`translate(${g.x}, ${g.y})`:"translate(-100, -100)"}).append("circle").attr("r",p=>d.get(p.hash)<f.length?o:o*.7).attr("fill",p=>d.get(p.hash)<f.length?h.has(p.hash)?"#4fc3f7":"#fff":"#888").attr("stroke","#333").attr("stroke-width",p=>d.get(p.hash)<f.length?2:1).style("cursor","pointer").on("mouseenter",(p,g)=>{const v=h.get(g.hash),Y=v?`[${v.join(", ")}]<br/>`:"",Ce=new Date(g.timestamp*1e3).toLocaleString();D.html(`<strong>${g.hash.substring(0,7)}</strong><br/>${Y}${g.message}<br/><span class="date">${Ce}</span>`).style("left",p.pageX+15+"px").style("top",p.pageY-10+"px").style("opacity",1)}).on("mousemove",p=>{D.style("left",p.pageX+15+"px").style("top",p.pageY-10+"px")}).on("mouseleave",()=>{D.style("opacity",0)});let b=0,S=0,R=!1,Rt=0,It=0,Xt=0,Ft=0;function dt(){w.attr("transform",`translate(${b}, ${S})`)}t.on("wheel",p=>{p.preventDefault(),b-=p.deltaX,S-=p.deltaY,dt()}),t.on("mousedown",p=>{p.button===2&&(R=!0,Rt=p.clientX,It=p.clientY,Xt=b,Ft=S,p.preventDefault())}),t.on("mousemove",p=>{R&&(b=Xt+(p.clientX-Rt),S=Ft+(p.clientY-It),dt())}),t.on("mouseup",p=>{p.button===2&&(R=!1)}),t.on("mouseleave",()=>{R=!1});let Ht=0,Pt=0,Lt=0,Ot=0;t.on("touchstart",p=>{if(p.touches.length===1){const g=p.touches[0];Ht=g.clientX,Pt=g.clientY,Lt=b,Ot=S}}),t.on("touchmove",p=>{if(p.touches.length===1){p.preventDefault();const g=p.touches[0];b=Lt+(g.clientX-Ht),S=Ot+(g.clientY-Pt),dt()}}),t.on("contextmenu",p=>{p.preventDefault()})}async function Qi(){[M,U]=await Promise.all([Ui(),Gi()]),At.clear(),M.forEach(t=>At.set(t.hash,t)),console.log("Commits:",M.length),console.log("Branches:",U.length),Ki(U),$t(),window.addEventListener("resize",()=>{$t()})}Qi();
@@ -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 en={value:()=>{}};function Ne(){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 _t(n)}function _t(t){this._=t}function nn(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}})}_t.prototype=Ne.prototype={constructor:_t,on:function(t,e){var n=this._,r=nn(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=rn(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]=ue(n[i],t.name,e);else if(e==null)for(i in n)n[i]=ue(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 _t(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 rn(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function ue(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=en,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Yt="http://www.w3.org/1999/xhtml";const fe={svg:"http://www.w3.org/2000/svg",xhtml:Yt,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)),fe.hasOwnProperty(e)?{space:fe[e],local:t}:t}function on(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Yt&&e.documentElement.namespaceURI===Yt?e.createElement(t):e.createElementNS(n,t)}}function sn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ae(t){var e=Ct(t);return(e.local?sn:on)(e)}function an(){}function Gt(t){return t==null?an:function(){return this.querySelector(t)}}function cn(t){typeof t!="function"&&(t=Gt(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 ln(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function un(){return[]}function Ce(t){return t==null?un:function(){return this.querySelectorAll(t)}}function fn(t){return function(){return ln(t.apply(this,arguments))}}function hn(t){typeof t=="function"?t=fn(t):t=Ce(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 ke(t){return function(){return this.matches(t)}}function Re(t){return function(e){return e.matches(t)}}var pn=Array.prototype.find;function dn(t){return function(){return pn.call(this.children,t)}}function gn(){return this.firstElementChild}function mn(t){return this.select(t==null?gn:dn(typeof t=="function"?t:Re(t)))}var yn=Array.prototype.filter;function wn(){return Array.from(this.children)}function _n(t){return function(){return yn.call(this.children,t)}}function xn(t){return this.selectAll(t==null?wn:_n(typeof t=="function"?t:Re(t)))}function vn(t){typeof t!="function"&&(t=ke(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 Me(t){return new Array(t.length)}function bn(){return new A(this._enter||this._groups.map(Me),this._parents)}function bt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}bt.prototype={constructor:bt,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 En(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 bt(t,o[s]);for(;s<c;++s)(a=e[s])&&(i[s]=a)}function Sn(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 bt(t,o[a]);for(a=0;a<u;++a)(c=e[a])&&l.get(d[a])===c&&(i[a]=c)}function Nn(t){return t.__data__}function An(t,e){if(!arguments.length)return Array.from(this,Nn);var n=e?Sn:En,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),c=new Array(o),l=0;l<o;++l){var u=r[l],h=i[l],d=h.length,g=Cn(t.call(u,u&&u.__data__,l,r)),m=g.length,x=a[l]=new Array(m),S=s[l]=new Array(m),Mt=c[l]=new Array(d);n(u,h,x,S,Mt,g,e);for(var T=0,Y=0,C,ft;T<m;++T)if(C=x[T]){for(T>=Y&&(Y=T+1);!(ft=S[Y])&&++Y<m;);C._next=ft||null}}return s=new A(s,r),s._enter=a,s._exit=c,s}function Cn(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function kn(){return new A(this._exit||this._groups.map(Me),this._parents)}function Rn(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 Mn(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 A(a,this._parents)}function Tn(){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 Bn(t){t||(t=In);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 A(i,this._parents).order()}function In(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function On(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Pn(){return Array.from(this)}function Xn(){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 Fn(){let t=0;for(const e of this)++t;return t}function Hn(){return!this.node()}function Ln(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 Yn(t){return function(){this.removeAttribute(t)}}function Dn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function qn(t,e){return function(){this.setAttribute(t,e)}}function Vn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function zn(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Un(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=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?Dn:Yn:typeof e=="function"?n.local?Un:zn:n.local?Vn:qn)(n,e))}function Te(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Kn(t){return function(){this.style.removeProperty(t)}}function Wn(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Gn(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Jn(t,e,n){return arguments.length>1?this.each((e==null?Kn:typeof e=="function"?Gn:Wn)(t,e,n??"")):G(this.node(),t)}function G(t,e){return t.style.getPropertyValue(e)||Te(t).getComputedStyle(t,null).getPropertyValue(e)}function Qn(t){return function(){delete this[t]}}function jn(t,e){return function(){this[t]=e}}function tr(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function er(t,e){return arguments.length>1?this.each((e==null?Qn:typeof e=="function"?tr:jn)(t,e)):this.node()[t]}function Be(t){return t.trim().split(/^|\s+/)}function Jt(t){return t.classList||new Ie(t)}function Ie(t){this._node=t,this._names=Be(t.getAttribute("class")||"")}Ie.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 Oe(t,e){for(var n=Jt(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Pe(t,e){for(var n=Jt(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function nr(t){return function(){Oe(this,t)}}function rr(t){return function(){Pe(this,t)}}function ir(t,e){return function(){(e.apply(this,arguments)?Oe:Pe)(this,t)}}function or(t,e){var n=Be(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"?ir:e?nr:rr)(n,e))}function sr(){this.textContent=""}function ar(t){return function(){this.textContent=t}}function cr(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function lr(t){return arguments.length?this.each(t==null?sr:(typeof t=="function"?cr:ar)(t)):this.node().textContent}function ur(){this.innerHTML=""}function fr(t){return function(){this.innerHTML=t}}function hr(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function pr(t){return arguments.length?this.each(t==null?ur:(typeof t=="function"?hr:fr)(t)):this.node().innerHTML}function dr(){this.nextSibling&&this.parentNode.appendChild(this)}function gr(){return this.each(dr)}function mr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function yr(){return this.each(mr)}function wr(t){var e=typeof t=="function"?t:Ae(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function _r(){return null}function xr(t,e){var n=typeof t=="function"?t:Ae(t),r=e==null?_r:typeof e=="function"?e:Gt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function vr(){var t=this.parentNode;t&&t.removeChild(this)}function br(){return this.each(vr)}function $r(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Er(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Sr(t){return this.select(t?Er:$r)}function Nr(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ar(t){return function(e){t.call(this,e,this.__data__)}}function Cr(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 kr(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 Rr(t,e,n){return function(){var r=this.__on,i,o=Ar(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 Mr(t,e,n){var r=Cr(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?Rr:kr,i=0;i<o;++i)this.each(a(r[i],e,n));return this}function Xe(t,e,n){var r=Te(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 Tr(t,e){return function(){return Xe(this,t,e)}}function Br(t,e){return function(){return Xe(this,t,e.apply(this,arguments))}}function Ir(t,e){return this.each((typeof e=="function"?Br:Tr)(t,e))}function*Or(){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 Fe=[null];function A(t,e){this._groups=t,this._parents=e}function lt(){return new A([[document.documentElement]],Fe)}function Pr(){return this}A.prototype=lt.prototype={constructor:A,select:cn,selectAll:hn,selectChild:mn,selectChildren:xn,filter:vn,data:An,enter:bn,exit:kn,join:Rn,merge:Mn,selection:Pr,order:Tn,sort:Bn,call:On,nodes:Pn,node:Xn,size:Fn,empty:Hn,each:Ln,attr:Zn,style:Jn,property:er,classed:or,text:lr,html:pr,raise:gr,lower:yr,append:wr,insert:xr,remove:br,clone:Sr,datum:Nr,on:Mr,dispatch:Ir,[Symbol.iterator]:Or};function Xt(t){return typeof t=="string"?new A([[document.querySelector(t)]],[document.documentElement]):new A([[t]],Fe)}function Qt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function He(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ut(){}var ot=.7,$t=1/ot,K="\\s*([+-]?\\d+)\\s*",st="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",I="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xr=/^#([0-9a-f]{3,8})$/,Fr=new RegExp(`^rgb\\(${K},${K},${K}\\)$`),Hr=new RegExp(`^rgb\\(${I},${I},${I}\\)$`),Lr=new RegExp(`^rgba\\(${K},${K},${K},${st}\\)$`),Yr=new RegExp(`^rgba\\(${I},${I},${I},${st}\\)$`),Dr=new RegExp(`^hsl\\(${st},${I},${I}\\)$`),qr=new RegExp(`^hsla\\(${st},${I},${I},${st}\\)$`),he={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};Qt(ut,at,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:pe,formatHex:pe,formatHex8:Vr,formatHsl:zr,formatRgb:de,toString:de});function pe(){return this.rgb().formatHex()}function Vr(){return this.rgb().formatHex8()}function zr(){return Le(this).formatHsl()}function de(){return this.rgb().formatRgb()}function at(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Xr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?ge(e):n===3?new N(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?mt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?mt(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=Fr.exec(t))?new N(e[1],e[2],e[3],1):(e=Hr.exec(t))?new N(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Lr.exec(t))?mt(e[1],e[2],e[3],e[4]):(e=Yr.exec(t))?mt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Dr.exec(t))?we(e[1],e[2]/100,e[3]/100,1):(e=qr.exec(t))?we(e[1],e[2]/100,e[3]/100,e[4]):he.hasOwnProperty(t)?ge(he[t]):t==="transparent"?new N(NaN,NaN,NaN,0):null}function ge(t){return new N(t>>16&255,t>>8&255,t&255,1)}function mt(t,e,n,r){return r<=0&&(t=e=n=NaN),new N(t,e,n,r)}function Ur(t){return t instanceof ut||(t=at(t)),t?(t=t.rgb(),new N(t.r,t.g,t.b,t.opacity)):new N}function Dt(t,e,n,r){return arguments.length===1?Ur(t):new N(t,e,n,r??1)}function N(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Qt(N,Dt,He(ut,{brighter(t){return t=t==null?$t:Math.pow($t,t),new N(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ot:Math.pow(ot,t),new N(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new N(z(this.r),z(this.g),z(this.b),Et(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:me,formatHex:me,formatHex8:Zr,formatRgb:ye,toString:ye}));function me(){return`#${V(this.r)}${V(this.g)}${V(this.b)}`}function Zr(){return`#${V(this.r)}${V(this.g)}${V(this.b)}${V((isNaN(this.opacity)?1:this.opacity)*255)}`}function ye(){const t=Et(this.opacity);return`${t===1?"rgb(":"rgba("}${z(this.r)}, ${z(this.g)}, ${z(this.b)}${t===1?")":`, ${t})`}`}function Et(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function z(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function V(t){return t=z(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 R(t,e,n,r)}function Le(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 Kr(t,e,n,r){return arguments.length===1?Le(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}Qt(R,Kr,He(ut,{brighter(t){return t=t==null?$t:Math.pow($t,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 N(Ft(t>=240?t-240:t+120,i,r),Ft(t,i,r),Ft(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new R(_e(this.h),yt(this.s),yt(this.l),Et(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=Et(this.opacity);return`${t===1?"hsl(":"hsla("}${_e(this.h)}, ${yt(this.s)*100}%, ${yt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function _e(t){return t=(t||0)%360,t<0?t+360:t}function yt(t){return Math.max(0,Math.min(1,t||0))}function Ft(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 Ye=t=>()=>t;function Wr(t,e){return function(n){return t+n*e}}function Gr(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 Jr(t){return(t=+t)==1?De:function(e,n){return n-e?Gr(e,n,t):Ye(isNaN(e)?n:e)}}function De(t,e){var n=e-t;return n?Wr(t,n):Ye(isNaN(t)?e:t)}const xe=(function t(e){var n=Jr(e);function r(i,o){var s=n((i=Dt(i)).r,(o=Dt(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),l=De(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 L(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var qt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ht=new RegExp(qt.source,"g");function Qr(t){return function(){return t}}function jr(t){return function(e){return t(e)+""}}function ti(t,e){var n=qt.lastIndex=Ht.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(r=qt.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:L(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]?jr(c[0].x):Qr(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 ve=180/Math.PI,Vt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function qe(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)*ve,skewX:Math.atan(c)*ve,scaleX:s,scaleY:a}}var wt;function ei(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Vt:qe(e.a,e.b,e.c,e.d,e.e,e.f)}function ni(t){return t==null||(wt||(wt=document.createElementNS("http://www.w3.org/2000/svg","g")),wt.setAttribute("transform",t),!(t=wt.transform.baseVal.consolidate()))?Vt:(t=t.matrix,qe(t.a,t.b,t.c,t.d,t.e,t.f))}function Ve(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 x=g.push("translate(",null,e,null,n);m.push({i:x-4,x:L(l,h)},{i:x-2,x:L(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:L(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:L(l,u)}):u&&h.push(i(h)+"skewX("+u+r)}function c(l,u,h,d,g,m){if(l!==h||u!==d){var x=g.push(i(g)+"scale(",null,",",null,")");m.push({i:x-4,x:L(l,h)},{i:x-2,x:L(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,x=d.length,S;++m<x;)h[(S=d[m]).i]=S.x(g);return h.join("")}}}var ri=Ve(ei,"px, ","px)","deg)"),ii=Ve(ni,", ",")",")"),J=0,et=0,tt=0,ze=1e3,St,nt,Nt=0,U=0,kt=0,ct=typeof performance=="object"&&performance.now?performance:Date,Ue=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function jt(){return U||(Ue(oi),U=ct.now()+kt)}function oi(){U=0}function At(){this._call=this._time=this._next=null}At.prototype=Ze.prototype={constructor:At,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?jt():+n)+(e==null?0:+e),!this._next&&nt!==this&&(nt?nt._next=this:St=this,nt=this),this._call=t,this._time=n,zt()},stop:function(){this._call&&(this._call=null,this._time=1/0,zt())}};function Ze(t,e,n){var r=new At;return r.restart(t,e,n),r}function si(){jt(),++J;for(var t=St,e;t;)(e=U-t._time)>=0&&t._call.call(void 0,e),t=t._next;--J}function be(){U=(Nt=ct.now())+kt,J=et=0;try{si()}finally{J=0,ci(),U=0}}function ai(){var t=ct.now(),e=t-Nt;e>ze&&(kt-=e,Nt=t)}function ci(){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);nt=t,zt(r)}function zt(t){if(!J){et&&(et=clearTimeout(et));var e=t-U;e>24?(t<1/0&&(et=setTimeout(be,t-ct.now()-kt)),tt&&(tt=clearInterval(tt))):(tt||(Nt=ct.now(),tt=setInterval(ai,ze)),J=1,Ue(be))}}function $e(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 li=Ne("start","end","cancel","interrupt"),ui=[],Ke=0,Ee=1,Ut=2,xt=3,Se=4,Zt=5,vt=6;function Rt(t,e,n,r,i,o){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;fi(t,n,{name:e,index:r,group:i,on:li,tween:ui,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Ke})}function te(t,e){var n=M(t,e);if(n.state>Ke)throw new Error("too late; already scheduled");return n}function O(t,e){var n=M(t,e);if(n.state>xt)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 fi(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Ze(o,0,n.time);function o(l){n.state=Ee,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!==Ee)return c();for(u in r)if(g=r[u],g.name===n.name){if(g.state===xt)return $e(s);g.state===Se?(g.state=vt,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete r[u]):+u<e&&(g.state=vt,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete r[u])}if($e(function(){n.state===xt&&(n.state=Se,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Ut,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Ut){for(n.state=xt,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=vt,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function hi(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>Ut&&r.state<Zt,r.state=vt,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}o&&delete t.__transition}}function pi(t){return this.each(function(){hi(this,t)})}function di(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 gi(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 mi(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?di:gi)(n,t,e))}function ee(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 We(t,e){var n;return(typeof e=="number"?L:e instanceof at?xe:(n=at(e))?(e=n,xe):ti)(t,e)}function yi(t){return function(){this.removeAttribute(t)}}function wi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _i(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 vi(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 bi(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 $i(t,e){var n=Ct(t),r=n==="transform"?ii:We;return this.attrTween(t,typeof e=="function"?(n.local?bi:vi)(n,r,ee(this,"attr."+t,e)):e==null?(n.local?wi:yi)(n):(n.local?xi:_i)(n,r,e))}function Ei(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Si(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Ni(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Si(t,o)),n}return i._value=e,i}function Ai(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Ei(t,o)),n}return i._value=e,i}function Ci(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?Ni:Ai)(r,e))}function ki(t,e){return function(){te(this,t).delay=+e.apply(this,arguments)}}function Ri(t,e){return e=+e,function(){te(this,t).delay=e}}function Mi(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?ki:Ri)(e,t)):M(this.node(),e).delay}function Ti(t,e){return function(){O(this,t).duration=+e.apply(this,arguments)}}function Bi(t,e){return e=+e,function(){O(this,t).duration=e}}function Ii(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ti:Bi)(e,t)):M(this.node(),e).duration}function Oi(t,e){if(typeof e!="function")throw new Error;return function(){O(this,t).ease=e}}function Pi(t){var e=this._id;return arguments.length?this.each(Oi(e,t)):M(this.node(),e).ease}function Xi(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;O(this,t).ease=n}}function Fi(t){if(typeof t!="function")throw new Error;return this.each(Xi(this._id,t))}function Hi(t){typeof t!="function"&&(t=ke(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 F(r,this._parents,this._name,this._id)}function Li(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 F(s,this._parents,this._name,this._id)}function Yi(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 Di(t,e,n){var r,i,o=Yi(e)?te:O;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}function qi(t,e){var n=this._id;return arguments.length<2?M(this.node(),n).on.on(t):this.each(Di(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 zi(){return this.on("end.remove",Vi(this._id))}function Ui(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Gt(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,Rt(l[d],e,n,d,l,M(u,n)));return new F(o,this._parents,e,n)}function Zi(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ce(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=M(u,n),x=0,S=d.length;x<S;++x)(g=d[x])&&Rt(g,e,n,x,d,m);o.push(d),s.push(u)}return new F(o,s,e,n)}var Ki=lt.prototype.constructor;function Wi(){return new Ki(this._groups,this._parents)}function Gi(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 Ji(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 Qi(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 ji(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=Ge(e)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function to(t,e,n){var r=(t+="")=="transform"?ri:We;return e==null?this.styleTween(t,Gi(t,r)).on("end.style."+t,Ge(t)):typeof e=="function"?this.styleTween(t,Qi(t,r,ee(this,"style."+t,e))).each(ji(this._id,t)):this.styleTween(t,Ji(t,r,e),n).on("end.style."+t,null)}function eo(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function no(t,e,n){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&eo(t,s,n)),r}return o._value=e,o}function ro(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,no(t,e,n??""))}function io(t){return function(){this.textContent=t}}function oo(t){return function(){var e=t(this);this.textContent=e??""}}function so(t){return this.tween("text",typeof t=="function"?oo(ee(this,"text",t)):io(t==null?"":t+""))}function ao(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)&&ao(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 uo(){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=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 F(r,this._parents,t,n)}function fo(){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 ho=0;function F(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Je(){return++ho}var X=lt.prototype;F.prototype={constructor:F,select:Ui,selectAll:Zi,selectChild:X.selectChild,selectChildren:X.selectChildren,filter:Hi,merge:Li,selection:Wi,transition:uo,call:X.call,nodes:X.nodes,node:X.node,size:X.size,empty:X.empty,each:X.each,on:qi,attr:$i,attrTween:Ci,style:to,styleTween:ro,text:so,textTween:lo,remove:zi,tween:mi,delay:Mi,duration:Ii,ease:Pi,easeVarying:Fi,end:fo,[Symbol.iterator]:X[Symbol.iterator]};function po(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var go={time:null,delay:0,duration:250,ease:po};function mo(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 yo(t){var e,n;t instanceof F?(e=t._id,t=t._name):(e=Je(),(n=go).time=jt(),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||mo(c,e));return new F(r,this._parents,t,e)}lt.prototype.interrupt=pi;lt.prototype.transition=yo;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 k=[],it=[],Kt=[],W=new Map,Lt="",q=1;async function wo(){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 _o(){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 xo(){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 vo(){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 bo(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",()=>Wt())})}function $o(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=W.get(r);if(i&&i.parents.length>0)r=i.parents[0];else break}return n}function Eo(t,e=new Set){const n=[],r=new Set,i=new Map;for(const c of k)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 k){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 So(){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=Xt("#graph");t.selectAll("*").remove();const e=Xt("#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=So().map(f=>({name:f,lineage:$o(f)})),g=new Set;d.forEach(({lineage:f})=>{f.forEach(p=>g.add(p))});const m=d.map(({name:f,lineage:p})=>{const y=new Set;d.forEach(_=>{_.name!==f&&_.lineage.forEach(v=>y.add(v))});const w=Eo(p,y);return{name:f,lineage:p,subBranches:w}}),x=new Map;it.forEach(f=>{x.has(f.hash)||x.set(f.hash,[]),x.get(f.hash).push(f.name)});const S=new Map;k.forEach(f=>{S.set(f.hash,{mainCol:m.length,subOffset:0,isSubBranch:!1})}),m.forEach((f,p)=>{for(const y of f.lineage)S.set(y,{mainCol:p,subOffset:0,isSubBranch:!1})});let Mt=0;m.forEach((f,p)=>{const y=new Map;f.subBranches.forEach(w=>{const _=`sb-${Mt++}`,v=[];w.commits.forEach($=>{const B=k.findIndex(D=>D.hash===$);B>=0&&v.push(B)});let b=1,E=!0;for(;E;){E=!1;for(const $ of v)if((y.get($)||new Set).has(b)){E=!0,b++;break}}for(const $ of v)y.has($)||y.set($,new Set),y.get($).add(b);w.commits.forEach($=>{S.set($,{mainCol:p,subOffset:b,isSubBranch:!0,subBranchId:_})})})});const T=new Map;let Y=u;for(let f=0;f<=m.length;f++)if(T.set(f,Y),f<m.length){let p=0;k.forEach(y=>{const w=S.get(y.hash);w.mainCol===f&&w.subOffset>p&&(p=w.subOffset)}),Y+=a+p*c}const C=new Map;k.forEach((f,p)=>{const y=S.get(f.hash),_=T.get(y.mainCol)+y.subOffset*c;C.set(f.hash,{col:y.mainCol,subOffset:y.subOffset,row:p,x:_,y:l+p*s,isSubBranch:y.isSubBranch,subBranchId:y.subBranchId||null})});const ft=Array.from(S.values()).some(f=>f.mainCol===m.length),P=t.append("g").attr("class","main-group"),Tt=e.append("div").attr("class","tooltip").style("opacity",0),ht=["#4CAF50","#2196F3","#FF9800"];m.forEach((f,p)=>{P.append("text").attr("x",T.get(p)).attr("y",25).attr("fill",ht[p]||"#888").attr("font-size","14px").attr("font-weight","bold").text(f.name)}),ft&&P.append("text").attr("x",T.get(m.length)).attr("y",25).attr("fill","#888").attr("font-size","14px").text("Other"),k.forEach(f=>{const p=C.get(f.hash);p&&f.parents.forEach(y=>{const w=C.get(y);if(w){const _=p.col===m.length||w.col===m.length,v=p.x,b=p.y*q,E=w.x,$=w.y*q;let B;if(v===E)B=`M ${v} ${b} L ${E} ${$}`;else{const gt=(b+$)/2;B=`M ${v} ${b} C ${v} ${gt}, ${E} ${gt}, ${E} ${$}`}const D=p.subBranchId||w.subBranchId||null,Ot=p.isSubBranch||w.isSubBranch,je=!Ot&&!_&&p.col<m.length;let Pt="#666";_?Pt="#444":p.col<m.length&&(Pt=ht[p.col]||"#666");let j=1.5;_?j=1:je?j=3:Ot&&(j=1.5);const tn=P.append("path").attr("d",B).attr("fill","none").attr("stroke",Pt).attr("stroke-width",j).attr("stroke-opacity",_?.4:Ot?.5:.8).attr("stroke-dasharray",_?"4,4":"none").attr("class",D?`edge edge-${D}`:"edge").attr("data-source",f.hash).attr("data-target",y);if(D){const gt=j;tn.style("cursor","pointer").on("mouseenter",()=>{P.selectAll(`.edge-${D}`).attr("stroke-width",3).attr("stroke-opacity",.9)}).on("mouseleave",()=>{P.selectAll(`.edge-${D}`).attr("stroke-width",gt).attr("stroke-opacity",.5)})}}})});const Q=new Map;Kt.forEach(f=>{Q.set(f.headCommit,f)});const Bt=P.selectAll("g.node").data(k).enter().append("g").attr("class","node").attr("transform",f=>{const p=C.get(f.hash);return p?`translate(${p.x}, ${p.y*q})`:"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=C.get(f.hash);return p.isSubBranch?o*.6:p.col<m.length?o:o*.7}).attr("fill",f=>{const p=C.get(f.hash);return p.col<m.length?ht[p.col]||"#fff":p.isSubBranch?"#a0a0a0":"#888"}).attr("stroke",f=>{const p=C.get(f.hash);return p.col<m.length&&ht[p.col]||"#333"}).attr("stroke-width",f=>{const p=C.get(f.hash);return p.isSubBranch?1:p.col<m.length?2:1}).style("cursor","pointer").on("mouseenter",(f,p)=>{const y=x.get(p.hash),w=y?`[${y.join(", ")}]<br/>`:"",_=Q.get(p.hash),v=_?`<span class="pr-info">PR #${_.number}: ${_.title}</span><br/>`:"",b=new Date(p.timestamp*1e3).toLocaleString();Tt.html(`<strong>${p.hash.substring(0,7)}</strong><br/>${v}${w}${p.message}<br/><span class="date">${b}</span>`).style("left",f.pageX+15+"px").style("top",f.pageY-10+"px").style("opacity",1)}).on("mousemove",f=>{Tt.style("left",f.pageX+15+"px").style("top",f.pageY-10+"px")}).on("mouseleave",()=>{Tt.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 Z=0,H=0,pt=!1,ne=0,re=0,ie=0,oe=0;function It(f){return f*q}function dt(){P.attr("transform",`translate(${Z}, ${H})`)}function Qe(){P.selectAll("g.node").attr("transform",f=>{const p=hashToPosition.get(f.hash);return p?`translate(${p.x}, ${It(p.y)})`:"translate(-100, -100)"}),P.selectAll("path.edge").attr("d",function(){const f=Xt(this),p=f.attr("data-source"),y=f.attr("data-target"),w=hashToPosition.get(p),_=hashToPosition.get(y);if(!w||!_)return"";const v=w.x,b=It(w.y),E=_.x,$=It(_.y);if(v===E)return`M ${v} ${b} L ${E} ${$}`;{const B=(b+$)/2;return`M ${v} ${b} C ${v} ${B}, ${E} ${B}, ${E} ${$}`}})}t.on("wheel",f=>{if(f.preventDefault(),f.metaKey||f.ctrlKey){const p=f.deltaY>0?.9:1.1,_=Math.max(.1,Math.min(5,q*p)),v=t.node().getBoundingClientRect(),b=f.clientY-v.top,E=b-H;H=b-E*(_/q),q=_,Qe(),dt()}else Z-=f.deltaX,H-=f.deltaY,dt()}),t.on("mousedown",f=>{f.button===0&&(pt=!0,ne=f.clientX,re=f.clientY,ie=Z,oe=H,f.preventDefault())}),t.on("mousemove",f=>{pt&&(Z=ie+(f.clientX-ne),H=oe+(f.clientY-re),dt())}),t.on("mouseup",f=>{f.button===0&&(pt=!1)}),t.on("mouseleave",()=>{pt=!1});let se=0,ae=0,ce=0,le=0;t.on("touchstart",f=>{if(f.touches.length===1){const p=f.touches[0];se=p.clientX,ae=p.clientY,ce=Z,le=H}}),t.on("touchmove",f=>{if(f.touches.length===1){f.preventDefault();const p=f.touches[0];Z=ce+(p.clientX-se),H=le+(p.clientY-ae),dt()}}),t.on("contextmenu",f=>{f.preventDefault()})}async function No(){[k,it,Lt,Kt]=await Promise.all([xo(),vo(),wo(),_o()]),document.getElementById("repo-name").textContent=Lt,W.clear(),k.forEach(t=>W.set(t.hash,t)),console.log("Repository:",Lt),console.log("Commits:",k.length),console.log("Branches:",it.length),console.log("Open PRs:",Kt.length),bo(it),Wt(),window.addEventListener("resize",()=>{Wt()})}No();