git-truck 4.1.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/build/client/assets/ChevronButton-DMAgHXfP.js +1 -0
  2. package/build/client/assets/{CollapsibleHeader-CowQ8BBC.js → CollapsibleHeader-D64_oUaZ.js} +1 -1
  3. package/build/client/assets/Tooltip-DD8MeSQ5.js +5 -0
  4. package/build/client/assets/api.commits-B87eK7HE.js +1 -0
  5. package/build/client/assets/api.commits-C8MoPAnE.js +1 -0
  6. package/build/client/assets/api.progress-BjsGOmGF.js +1 -0
  7. package/build/client/assets/api.progress-ClQ--CbT.js +1 -0
  8. package/build/client/assets/browse-Dt072k2G.js +1 -0
  9. package/build/client/assets/browse-NZo8Wkxj.js +1 -0
  10. package/build/client/assets/clear-cache-BdOk-5Hg.js +1 -0
  11. package/build/client/assets/clear-cache-Dpk-kNlJ.js +1 -0
  12. package/build/client/assets/{manifest-27f3fdf9.js → manifest-fcb52500.js} +1 -1
  13. package/build/client/assets/{root-CBAhjBmF.js → root-Bw7JpNPD.js} +1 -1
  14. package/build/client/assets/root-ulNnm43y.css +2 -0
  15. package/build/client/assets/{ui-apdBVMs3.js → ui-BlLnrEiL.js} +1 -1
  16. package/build/client/assets/util-DXfdT-4_.js +44 -0
  17. package/build/client/assets/view-BO8_n49o.js +4 -0
  18. package/build/client/assets/{viewParams-BGn6CoZr.js → viewParams-CYa4lbK3.js} +1 -1
  19. package/build/server/assets/{server-build-CZoDK47O.js → server-build-ChRJnQIf.js} +525 -197
  20. package/build/server/index.js +1 -1
  21. package/cli.mjs +190 -43
  22. package/package.json +1 -1
  23. package/build/client/assets/ChevronButton-DK6ES4LI.js +0 -1
  24. package/build/client/assets/Tooltip-4EXAWNsE.js +0 -5
  25. package/build/client/assets/api.commits-B4POWHc4.js +0 -1
  26. package/build/client/assets/api.commits-BwXLd7eY.js +0 -1
  27. package/build/client/assets/api.progress-9Sjpquqz.js +0 -1
  28. package/build/client/assets/api.progress-PbuJDh_8.js +0 -1
  29. package/build/client/assets/browse-D4C7blMn.js +0 -1
  30. package/build/client/assets/browse-f4khjgf7.js +0 -1
  31. package/build/client/assets/clear-cache-BzRoZVxS.js +0 -1
  32. package/build/client/assets/clear-cache-_qCibnyW.js +0 -1
  33. package/build/client/assets/root-C1A3dI8J.css +0 -2
  34. package/build/client/assets/util-Cy1DhIdh.js +0 -44
  35. package/build/client/assets/view-xdV5WFuZ.js +0 -4
@@ -1,4 +0,0 @@
1
- import{r as e,t}from"./react-YTRJEZSD.js";import{A as n,D as r,F as i,I as a,M as o,a as s,c,i as l,j as u,o as d,t as f}from"./jsx-runtime-GK6fC0y1.js";import{t as p}from"./react-dom-QjzVRb79.js";import{$ as m,A as h,B as g,E as _,F as v,G as y,I as b,M as x,P as S,Q as C,R as w,U as T,W as E,X as D,Y as O,Z as k,_ as A,a as j,b as M,bt as N,c as P,ct as F,et as I,gt as L,j as R,k as ee,l as te,n as z,nt as B,o as ne,r as V,rt as H,s as re,t as U,tt as W,u as G,ut as K,vt as q,yt as J,z as ie}from"./clear-cache-_qCibnyW.js";import{$ as Y,$t as ae,Bt as X,C as oe,Ct as se,D as ce,E as le,F as ue,Gt as de,H as fe,Ht as pe,J as me,Jt as he,K as ge,L as _e,N as ve,O as ye,P as be,Qt as xe,R as Se,St as Ce,U as we,Ut as Te,V as Ee,W as De,Wt as Oe,X as ke,Xt as Ae,Y as je,Yt as Me,Zt as Ne,_ as Pe,_t as Fe,a as Ie,at as Le,b as Re,bt as ze,c as Be,d as Ve,dt as He,en as Ue,ft as We,g as Ge,gt as Ke,h as qe,i as Je,in as Ye,it as Xe,j as Ze,k as Qe,l as $e,lt as et,m as tt,mt as nt,n as rt,nn as it,nt as at,o as ot,on as st,pt as ct,q as lt,qt as ut,r as dt,rt as ft,st as pt,t as mt,u as ht,ut as gt,v as _t,vt,x as yt,xt as bt,y as xt,yt as St,z as Ct}from"./util-Cy1DhIdh.js";import{c as wt,s as Tt}from"./dist-Q88wN5JZ.js";import{i as Et,n as Dt,t as Ot}from"./viewParams-BGn6CoZr.js";import{t as kt}from"./CollapsibleHeader-CowQ8BBC.js";import{t as At}from"./api.commits-BwXLd7eY.js";import{t as jt}from"./api.abort-D0XxKxsc.js";import{a as Mt,i as Nt,o as Pt,t as Ft}from"./browse-D4C7blMn.js";import{i as It,n as Lt,o as Rt,r as zt,s as Bt,t as Vt}from"./Tooltip-4EXAWNsE.js";function Ht(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Ut(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function Wt(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function Gt(){return this.eachAfter(Wt)}function Kt(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function qt(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function Jt(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function Yt(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function Xt(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function Zt(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Qt(e){for(var t=this,n=$t(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function $t(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function en(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function tn(){return Array.from(this)}function nn(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function rn(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*an(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function on(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=ln)):t===void 0&&(t=cn);for(var n=new fn(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new fn(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(dn)}function sn(){return on(this).eachBefore(un)}function cn(e){return e.children}function ln(e){return Array.isArray(e)?e[1]:null}function un(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function dn(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function fn(e){this.data=e,this.depth=this.height=0,this.parent=null}fn.prototype=on.prototype={constructor:fn,count:Gt,each:Kt,eachAfter:Jt,eachBefore:qt,find:Yt,sum:Xt,sort:Zt,path:Qt,ancestors:en,descendants:tn,leaves:nn,links:rn,copy:sn,[Symbol.iterator]:an};function pn(e){return e==null?null:mn(e)}function mn(e){if(typeof e!=`function`)throw Error();return e}function hn(){return 0}function gn(e){return function(){return e}}var _n=1664525,vn=1013904223,yn=4294967296;function bn(){let e=1;return()=>(e=(_n*e+vn)%yn)/yn}function xn(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Sn(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function Cn(e,t){for(var n=0,r=(e=Sn(Array.from(e),t)).length,i=[],a,o;n<r;)a=e[n],o&&En(o,a)?++n:(o=On(i=wn(i,a)),n=0);return o}function wn(e,t){var n,r;if(Dn(t,e))return[t];for(n=0;n<e.length;++n)if(Tn(t,e[n])&&Dn(An(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(Tn(An(e[n],e[r]),t)&&Tn(An(e[n],t),e[r])&&Tn(An(e[r],t),e[n])&&Dn(jn(e[n],e[r],t),e))return[e[n],e[r],t];throw Error()}function Tn(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function En(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Dn(e,t){for(var n=0;n<t.length;++n)if(!En(e,t[n]))return!1;return!0}function On(e){switch(e.length){case 1:return kn(e[0]);case 2:return An(e[0],e[1]);case 3:return jn(e[0],e[1],e[2])}}function kn(e){return{x:e.x,y:e.y,r:e.r}}function An(e,t){var n=e.x,r=e.y,i=e.r,a=t.x,o=t.y,s=t.r,c=a-n,l=o-r,u=s-i,d=Math.sqrt(c*c+l*l);return{x:(n+a+c/d*u)/2,y:(r+o+l/d*u)/2,r:(d+i+s)/2}}function jn(e,t,n){var r=e.x,i=e.y,a=e.r,o=t.x,s=t.y,c=t.r,l=n.x,u=n.y,d=n.r,f=r-o,p=r-l,m=i-s,h=i-u,g=c-a,_=d-a,v=r*r+i*i-a*a,y=v-o*o-s*s+c*c,b=v-l*l-u*u+d*d,x=p*m-f*h,S=(m*b-h*y)/(x*2)-r,C=(h*g-m*_)/x,w=(p*y-f*b)/(x*2)-i,T=(f*_-p*g)/x,E=C*C+T*T-1,D=2*(a+S*C+w*T),O=S*S+w*w-a*a,k=-(Math.abs(E)>1e-6?(D+Math.sqrt(D*D-4*E*O))/(2*E):O/D);return{x:r+S+C*k,y:i+w+T*k,r:k}}function Mn(e,t,n){var r=e.x-t.x,i,a,o=e.y-t.y,s,c,l=r*r+o*o;l?(a=t.r+n.r,a*=a,c=e.r+n.r,c*=c,a>c?(i=(l+c-a)/(2*l),s=Math.sqrt(Math.max(0,c/l-i*i)),n.x=e.x-i*r-s*o,n.y=e.y-i*o+s*r):(i=(l+a-c)/(2*l),s=Math.sqrt(Math.max(0,a/l-i*i)),n.x=t.x+i*r-s*o,n.y=t.y+i*o+s*r)):(n.x=t.x+n.r,n.y=t.y)}function Nn(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Pn(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,a=(t.y*n.r+n.y*t.r)/r;return i*i+a*a}function Fn(e){this._=e,this.next=null,this.previous=null}function In(e,t){if(!(a=(e=xn(e)).length))return 0;var n=e[0],r,i,a,o,s,c,l,u,d,f;if(n.x=0,n.y=0,!(a>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(a>2))return n.r+r.r;Mn(r,n,i=e[2]),n=new Fn(n),r=new Fn(r),i=new Fn(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;pack:for(c=3;c<a;++c){Mn(n._,r._,i=e[c]),i=new Fn(i),l=r.next,u=n.previous,d=r._.r,f=n._.r;do if(d<=f){if(Nn(l._,i._)){r=l,n.next=r,r.previous=n,--c;continue pack}d+=l._.r,l=l.next}else{if(Nn(u._,i._)){n=u,n.next=r,r.previous=n,--c;continue pack}f+=u._.r,u=u.previous}while(l!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,o=Pn(n);(i=i.next)!==r;)(s=Pn(i))<o&&(n=i,o=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=Cn(n,t),c=0;c<a;++c)n=e[c],n.x-=i.x,n.y-=i.y;return i.r}function Ln(e){return Math.sqrt(e.value)}function Rn(){var e=null,t=1,n=1,r=hn;function i(i){let a=bn();return i.x=t/2,i.y=n/2,e?i.eachBefore(zn(e)).eachAfter(Bn(r,.5,a)).eachBefore(Vn(1)):i.eachBefore(zn(Ln)).eachAfter(Bn(hn,1,a)).eachAfter(Bn(r,i.r/Math.min(t,n),a)).eachBefore(Vn(Math.min(t,n)/(2*i.r))),i}return i.radius=function(t){return arguments.length?(e=pn(t),i):e},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(e){return arguments.length?(r=typeof e==`function`?e:gn(+e),i):r},i}function zn(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Bn(e,t,n){return function(r){if(i=r.children){var i,a,o=i.length,s=e(r)*t||0,c;if(s)for(a=0;a<o;++a)i[a].r+=s;if(c=In(i,n),s)for(a=0;a<o;++a)i[a].r-=s;r.r=c+s}}}function Vn(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function Hn(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Un(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function Wn(){var e=1,t=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=e,i.y1=t/o,i.eachBefore(a(t,o)),r&&i.eachBefore(Hn),i}function a(e,t){return function(r){r.children&&Un(r,r.x0,e*(r.depth+1)/t,r.x1,e*(r.depth+2)/t);var i=r.x0,a=r.y0,o=r.x1-n,s=r.y1-n;o<i&&(i=o=(i+o)/2),s<a&&(a=s=(a+s)/2),r.x0=i,r.y0=a,r.x1=o,r.y1=s}}return i.round=function(e){return arguments.length?(r=!!e,i):r},i.size=function(n){return arguments.length?(e=+n[0],t=+n[1],i):[e,t]},i.padding=function(e){return arguments.length?(n=+e,i):n},i}function Gn(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var Kn=(1+Math.sqrt(5))/2;function qn(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?Un(c,n,r,i,h?r+=m*g/h:a):Gn(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var Jn=(function e(t){function n(e,n,r,i,a){qn(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(Kn);function Yn(){var e=Jn,t=!1,n=1,r=1,i=[0],a=hn,o=hn,s=hn,c=hn,l=hn;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(Hn),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=mn(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:gn(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:gn(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:gn(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:gn(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:gn(+e),u):l},u}var Xn=(function e(t){function n(e,n,r,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,c,l,u=-1,d,f=o.length,p=e.value;++u<f;){for(s=o[u],c=s.children,l=s.value=0,d=c.length;l<d;++l)s.value+=c[l].value;s.dice?Un(s,n,r,i,p?r+=(a-r)*s.value/p:a):Gn(s,n,r,p?n+=(i-n)*s.value/p:i,a),p-=s.value}else e._squarify=o=qn(t,e,n,r,i,a),o.ratio=t}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(Kn);function Zn(){var e=Me().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=Ut(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return Zn(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},Ae.apply(d(),arguments)}var Qn=e(p(),1),Z=N(),Q=e(t(),1),$=f();function $n(e){let t=(0,Q.useId)(),n=`url('#${t}')`;return{linearGradient:(0,Q.useMemo)(()=>e.length>0?(0,$.jsx)(`linearGradient`,{id:t,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`,children:Array.from(new Set(e)).toSorted().slice(0,de.length).map((e,t,n)=>(0,$.jsx)(`stop`,{offset:`${t/Math.max(n.length-1,1)*100}%`,stopColor:e},t))}):null,[e,t]),fill:n}}function er(){let e=(0,Z.c)(114),t=le(),n=ye(),[r,i]=be(),{searchResults:a,hasSearchResults:o}=Bt(),s=(0,Q.useDeferredValue)(i),{databaseInfo:c}=Ye(),[l]=it(),{chartType:u,sizeMetric:d,hierarchyType:f,labelsVisible:p,renderCutOff:m,metricType:h,showFilesWithoutChanges:g,showOnlySearchMatches:_}=ot(),v=ae(),y=Ne(),b=xe(),x;if(e[0]!==h||e[1]!==v){let t;e[3]===h?t=e[4]:(t=e=>e.slice(h.length+1),e[3]=h,e[4]=t),x=new Set(v.map(t)),e[0]=h,e[1]=v,e[2]=x}else x=e[2];let S=x,C=Ke(),w=Fe(),T=nt(),[E,D]=Tt(`zoomPath`,Ot.zoomPath),O;e[5]!==c.repo||e[6]!==D?(O=e=>D(e&&e!==c.repo?et(e):null),e[5]=c.repo,e[6]=D,e[7]=O):O=e[7];let k=O,A=De(),j;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(j={key:`Escape`},e[8]=j):j=e[8];let M;e[9]===w?M=e[10]:(M=()=>{w(null)},e[9]=w,e[10]=M),Se(j,M);let N;if(e[11]!==c.commitCounts||e[12]!==c.fileTree||e[13]!==o||e[14]!==f||e[15]!==a||e[16]!==g||e[17]!==_){bb0:{let t;e[19]!==c.commitCounts||e[20]!==o||e[21]!==a||e[22]!==g||e[23]!==_?(t=e=>!(o&&!a[e.path]&&_||!g&&!c.commitCounts[e.path]),e[19]=c.commitCounts,e[20]=o,e[21]=a,e[22]=g,e[23]=_,e[24]=t):t=e[24];let n=Ze(c.fileTree,t);if(f===`NESTED`){N=n;break bb0}N={...n,children:ve(n)}}e[11]=c.commitCounts,e[12]=c.fileTree,e[13]=o,e[14]=f,e[15]=a,e[16]=g,e[17]=_,e[18]=N}else N=e[18];let P=N,F;e[25]===l?F=e[26]:(F=l.get(`LAST_CHANGED`)?.buckets,e[25]=l,e[26]=F);let I=F,L;bb1:{if(s.width===0||s.height===0){let t;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[27]=t):t=e[27],L=t;break bb1}let t;e[28]!==u||e[29]!==c||e[30]!==P||e[31]!==I||e[32]!==m||e[33]!==s.height||e[34]!==s.width||e[35]!==d?(t=or({databaseInfo:c,tree:P,size:{height:s.height,width:s.width},chartType:u,sizeMetricType:d,renderCutOff:m,lastChangedBuckets:I}).descendants(),e[28]=u,e[29]=c,e[30]=P,e[31]=I,e[32]=m,e[33]=s.height,e[34]=s.width,e[35]=d,e[36]=t):t=e[36],L=t}let R=L,ee;e[37]===n?ee=e[38]:(ee=()=>{n(null)},e[37]=n,e[38]=ee);let te;e[39]!==u||e[40]!==n||e[41]!==s?(te=[u,s,n],e[39]=u,e[40]=n,e[41]=s,e[42]=te):te=e[42],(0,Q.useEffect)(ee,te);let B;e[43]===c.fileTree?B=e[44]:(B=ft(c.fileTree),e[43]=c.fileTree,e[44]=B);let ne=B,H=(0,Q.useRef)(0),re=(0,Q.useRef)(null),U=tr,W;if(e[45]!==P||e[46]!==y||e[47]!==b||e[48]!==h||e[49]!==l){bb2:{let e=new Set,t=l.get(h)?.categoriesMap;if(!y||!t){W=e;break bb2}let n=r=>{let i=t.get(r.path)?.some(e=>{let{category:t}=e;return b(t)})??!1,a=!1;if(Xe(r))for(let e of r.children)n(e)&&(a=!0);let o=i||a;return o&&e.add(r.path),o};n(P),W=e}e[45]=P,e[46]=y,e[47]=b,e[48]=h,e[49]=l,e[50]=W}else W=e[50];let G=W,K;if(e[51]!==h||e[52]!==l||e[53]!==R||e[54]!==S){K=new Map;let t=l.get(h)?.categoriesMap,n=S.size===0;for(let e of R)K.set(e.data.path,ar(e.data,t,S,n));e[51]=h,e[52]=l,e[53]=R,e[54]=S,e[55]=K}else K=e[55];let q=K,J=u===`BUBBLE_CHART`,ie;e[56]===J?ie=e[57]:(ie=z(`relative grid overflow-hidden`,{"pb-4":J}),e[56]=J,e[57]=ie);let Y=T&&!ne,X;e[58]===Y?X=e[59]:(X=V(`stroke-border dark:stroke-border-dark absolute inset-0 fill-gray-900 text-xs select-none dark:fill-gray-100`,{"cursor-zoom-out":Y}),e[58]=Y,e[59]=X);let oe=`0 0 ${s.width} ${s.height}`,se;e[60]!==T||e[61]!==C||e[62]!==w||e[63]!==ne||e[64]!==A?(se=e=>{let t=U(e.target);if(!t){if(!T){w(null);return}T&&!ne&&A();return}e.stopPropagation(),!re.current&&(re.current=window.setTimeout(()=>{if(re.current=null,t&&C===t){w(null);return}if(!t)throw Error(`Clicked object not found on node`);w(t)},300))},e[60]=T,e[61]=C,e[62]=w,e[63]=ne,e[64]=A,e[65]=se):se=e[65];let ce;e[66]!==w||e[67]!==k||e[68]!==E?(ce=e=>{let t=U(e.target);if(!t){w(null);return}if(k(null),e.stopPropagation(),re.current){if(window.clearTimeout(re.current),re.current=null,E&&E===t){k(``);return}k(t??null)}},e[66]=w,e[67]=k,e[68]=E,e[69]=ce):ce=e[69];let ue;e[70]!==c||e[71]!==t?.path||e[72]!==n?(ue=e=>{let r=U(e.target);if(!r)return;e.stopPropagation();let i=c.objectPathMap[r];i&&t?.path!==i.path&&n(i)},e[70]=c,e[71]=t?.path,e[72]=n,e[73]=ue):ue=e[73];let de;e[74]===n?de=e[75]:(de=()=>n(null),e[74]=n,e[75]=de);let fe;e[76]!==t||e[77]!==k||e[78]!==A?(fe=e=>{H.current+=e.deltaY,H.current<=-50&&t?((0,Q.startTransition)(()=>{k(t.path)}),H.current=0):H.current>=50&&t&&((0,Q.startTransition)(()=>{A()}),H.current=0)},e[76]=t,e[77]=k,e[78]=A,e[79]=fe):fe=e[79];let pe;if(e[80]!==T||e[81]!==C||e[82]!==q||e[83]!==o||e[84]!==p||e[85]!==G||e[86]!==R||e[87]!==a||e[88]!==v){let t;e[90]!==T||e[91]!==C||e[92]!==q||e[93]!==o||e[94]!==p||e[95]!==G||e[96]!==a||e[97]!==v?(t=(e,t)=>{let n=!!a[e.data.path],r=Xe(e.data)?Object.keys(a).some(t=>t.startsWith(`${e.data.path}/`)):n,i=v.length===0||G.has(e.data.path),s=e.data.path===C,c=C?s||e.data.path.startsWith(C+`/`)&&i:i,l=o&&!(n||r)||!c;return(0,$.jsxs)(`g`,{"data-path":e.data.path,className:z(`cursor-pointer duration-400`,{"hover:opacity-80":at(e.data)&&!T,"hover:stroke-border-highlight dark:hover:stroke-border-highlight-dark":Xe(e.data)&&!C,"opacity-10 grayscale hover:opacity-100 hover:grayscale-0":l}),children:[(0,$.jsx)(nr,{d:e,isRoot:t===0,colors:q.get(e.data.path)??[`#c0c0c0`],clickedObjectPath:C}),p?(0,$.jsx)(rr,{isSearchMatch:n,d:e,colors:q.get(e.data.path)??[`#c0c0c0`],children:e.data.name}):null]},e.data.path)},e[90]=T,e[91]=C,e[92]=q,e[93]=o,e[94]=p,e[95]=G,e[96]=a,e[97]=v,e[98]=t):t=e[98],pe=R.map(t),e[80]=T,e[81]=C,e[82]=q,e[83]=o,e[84]=p,e[85]=G,e[86]=R,e[87]=a,e[88]=v,e[89]=pe}else pe=e[89];let me;e[99]!==X||e[100]!==oe||e[101]!==se||e[102]!==ce||e[103]!==ue||e[104]!==de||e[105]!==fe||e[106]!==pe?(me=(0,$.jsx)(`svg`,{className:X,xmlns:`http://www.w3.org/2000/svg`,viewBox:oe,onClick:se,onDoubleClick:ce,onMouseOver:ue,onMouseOut:de,onWheel:fe,children:pe}),e[99]=X,e[100]=oe,e[101]=se,e[102]=ce,e[103]=ue,e[104]=de,e[105]=fe,e[106]=pe,e[107]=me):me=e[107];let he;e[108]!==r||e[109]!==me?(he=(0,$.jsx)(`div`,{ref:r,className:`relative`,children:me}),e[108]=r,e[109]=me,e[110]=he):he=e[110];let ge;return e[111]!==ie||e[112]!==he?(ge=(0,$.jsx)(`div`,{className:ie,children:he}),e[111]=ie,e[112]=he,e[113]=ge):ge=e[113],ge}function tr(e){return e instanceof Element?e.closest(`[data-path]`)?.dataset.path:void 0}function nr(e){let t=(0,Z.c)(41),{d:n,isRoot:r,colors:i,clickedObjectPath:a}=e,{chartType:o,transitionsEnabled:s}=ot(),{linearGradient:c,fill:l}=$n(i),u=i.length>1,d=n.data.path===a,f=r?12:8,p;t[0]!==i[0]||t[1]!==n.data||t[2]!==l||t[3]!==d||t[4]!==u?(p=at(n.data)?{fill:u?l:i[0],stroke:`transparent`}:{strokeWidth:d?`2px`:`1px`},t[0]=i[0],t[1]=n.data,t[2]=l,t[3]=d,t[4]=u,t[5]=p):p=t[5];let m=p;if(o===`BUBBLE_CHART`){let e=n,r=e.x-e.r,i=e.y-e.r+16-1,a=e.r*2,o=e.r*2,s;t[6]!==e.r||t[7]!==m||t[8]!==r||t[9]!==i||t[10]!==a||t[11]!==o?(s={...m,x:r,y:i,width:a,height:o,rx:e.r,ry:e.r},t[6]=e.r,t[7]=m,t[8]=r,t[9]=i,t[10]=a,t[11]=o,t[12]=s):s=t[12],m=s}else{let e=n,r=e.x0+.5,i=e.y0+.5,a=e.x1-e.x0-1,o=e.y1-e.y0-1,s;t[13]!==f||t[14]!==n.data?(s=Xe(n.data)?{rx:f,ry:f}:{rx:4,ry:4},t[13]=f,t[14]=n.data,t[15]=s):s=t[15];let c;t[16]!==m||t[17]!==r||t[18]!==i||t[19]!==a||t[20]!==o||t[21]!==s?(c={...m,x:r,y:i,width:a,height:o,...s},t[16]=m,t[17]=r,t[18]=i,t[19]=a,t[20]=o,t[21]=s,t[22]=c):c=t[22],m=c}let h=m,g;t[23]!==c||t[24]!==u?(g=u?(0,$.jsx)(`defs`,{children:c}):null,t[23]=c,t[24]=u,t[25]=g):g=t[25];let _=n.data.path,v;t[26]!==o||t[27]!==n.data||t[28]!==r?(v=Xe(n.data)&&(o===`BUBBLE_CHART`||!r)?`stroke-inherit`:`stroke-transparent stroke-0`,t[26]=o,t[27]=n.data,t[28]=r,t[29]=v):v=t[29];let y;t[30]!==n.data||t[31]!==v||t[32]!==s?(y=z(v,{"fill-primary-bg dark:fill-primary-bg-dark":Xe(n.data),"transition-[x,y,rx,ry,width,height,fill] duration-500 ease-in-out":s}),t[30]=n.data,t[31]=v,t[32]=s,t[33]=y):y=t[33];let b;t[34]!==h||t[35]!==n.data.path||t[36]!==y?(b=(0,$.jsx)(`rect`,{...h,"data-path":_,className:y}),t[34]=h,t[35]=n.data.path,t[36]=y,t[37]=b):b=t[37];let x;return t[38]!==g||t[39]!==b?(x=(0,$.jsxs)($.Fragment,{children:[g,b]}),t[38]=g,t[39]=b,t[40]=x):x=t[40],x}function rr(e){let t=(0,Z.c)(47),{d:n,isSearchMatch:r,colors:i,children:a}=e,o=a===void 0?null:a,s=ir(n);if(o===null)return null;let c=s?`50%`:void 0,l=s&&Xe(n.data)?`central`:`hanging`,u=s?`middle`:`start`,d=`#path-${n.data.hash}`,f;t[0]!==c||t[1]!==l||t[2]!==u||t[3]!==d?(f={startOffset:c,dominantBaseline:l,textAnchor:u,href:d,className:`font-bold tracking-widest`},t[0]=c,t[1]=l,t[2]=u,t[3]=d,t[4]=f):f=t[4];let p=f,m=ir(n)?n.r*2-10/2:0,h=!1;if(ir(n)){if(at(n.data)){if(m>n.data.name.length*7&&(h=!0),m<16)return null}else if(n.r<(Xe(n.data),16)*2||n.r*Math.PI*.6666666666666666<n.data.name.length*7.3)return null}else{let e=n;if(at(n.data)&&e.y1-e.y0-10<16)return null}let g;t[5]===n?g=t[6]:(g=ir(n)?cr(n.x,n.y+(Xe(n.data)?15:16),n.r):void 0,t[5]=n,t[6]=g);let _=`path-${n.data.hash}`,v;t[7]!==g||t[8]!==_?(v=(0,$.jsx)(`path`,{d:g,id:_}),t[7]=g,t[8]=_,t[9]=v):v=t[9];let y=`clip-path-${n.data.hash}`,b;t[10]!==n||t[11]!==m?(b=(0,$.jsx)(`rect`,{stroke:`red`,fill:`transparent`,...ir(n)?{x:n.x-n.r+10/4+.5,y:n.y-n.r+16-1+10/4+.5,width:Math.max(m-1,0),height:Math.max(n.r*2-10/2-1,0),rx:n.r,ry:n.r}:{x:n.x0+10/2,y:n.y0,width:Math.max(n.x1-n.x0-10,0),height:Math.max(n.y1-n.y0-10,0),...Xe(n.data)?{rx:8,ry:8}:{rx:4,ry:4}}}),t[10]=n,t[11]=m,t[12]=b):b=t[12];let x;t[13]!==y||t[14]!==b?(x=(0,$.jsx)(`clipPath`,{id:y,children:b}),t[13]=y,t[14]=b,t[15]=x):x=t[15];let S;t[16]!==x||t[17]!==v?(S=(0,$.jsxs)(`defs`,{children:[v,x]}),t[16]=x,t[17]=v,t[18]=S):S=t[18];let C;t[19]!==o||t[20]!==n||t[21]!==p?(C=Xe(n.data)&&ir(n)?(0,$.jsx)(`text`,{className:z(`stroke-primary-bg dark:stroke-primary-bg-dark pointer-events-none fill-none stroke-5`),strokeLinecap:`round`,children:(0,$.jsx)(`textPath`,{...p,children:o})}):null,t[19]=o,t[20]=n,t[21]=p,t[22]=C):C=t[22];let w=h?`middle`:void 0,T;t[23]===n?T=t[24]:(T=!ir(n)||at(n.data)?{clipPath:`url(#clip-path-${n.data.hash})`}:{},t[23]=n,t[24]=T);let E=ir(n)?Xe(n.data)?0:n.x-(h?0:n.r-10/2):n.x0+10/2,D=ir(n)?Xe(n.data)?0:n.y+16/2:n.y0+10/2,O;t[25]!==n.data||t[26]!==r?(O=z(`pointer-events-none stroke-none transition-all`,{"font-bold underline":r,"font-bold":Xe(n.data)}),t[25]=n.data,t[26]=r,t[27]=O):O=t[27];let k;t[28]!==i||t[29]!==n.data?(k=at(n.data)?{fill:`contrast-color(${i.length>1||i.length===0?`#ffffff`:i[0]})`}:void 0,t[28]=i,t[29]=n.data,t[30]=k):k=t[30];let A;t[31]!==o||t[32]!==n||t[33]!==p?(A=Xe(n.data)&&ir(n)?(0,$.jsx)(`textPath`,{...p,children:o}):o,t[31]=o,t[32]=n,t[33]=p,t[34]=A):A=t[34];let j;t[35]!==w||t[36]!==T||t[37]!==E||t[38]!==D||t[39]!==O||t[40]!==k||t[41]!==A?(j=(0,$.jsx)(`text`,{textAnchor:w,alignmentBaseline:`hanging`,...T,x:E,y:D,className:O,style:k,children:A}),t[35]=w,t[36]=T,t[37]=E,t[38]=D,t[39]=O,t[40]=k,t[41]=A,t[42]=j):j=t[42];let M;return t[43]!==S||t[44]!==C||t[45]!==j?(M=(0,$.jsxs)(`g`,{children:[S,C,j]}),t[43]=S,t[44]=C,t[45]=j,t[46]=M):M=t[46],M}function ir(e){return typeof e.r==`number`}function ar(e,t,n,r){let i=t?.get(e.path)?.filter(({category:e})=>r||n.has(e)).map(({color:e})=>e)??[];return i.length>0?i:[ut]}function or({databaseInfo:e,tree:t,size:n,chartType:r,sizeMetricType:i,renderCutOff:a,lastChangedBuckets:o}){let s=i===`LAST_CHANGED`?o??yt.getBuckets(e):void 0,c=on(t).sum(t=>{if(Xe(t))return 0;switch(i){case`FILE_SIZE`:return t.byteSize??1;case`MOST_COMMITS`:return e.commitCounts[t.path]??1;case`EQUAL_SIZE`:return 1;case`LAST_CHANGED`:return 2**((s?.length??0)-yt.getBucketIndex(t,e,s));case`MOST_CONTRIBUTIONS`:return e.contribSumPerFile[t.path]??1}}).sort((e,t)=>(t.value??1)-(e.value??1)),l=Number.isNaN(a)?2:a;if(r===`TREE_MAP`||r===`PARTITION`){let e=(r===`TREE_MAP`?Yn().size([n.width,n.height]).round(!0).tile(Xn).paddingInner(2).paddingOuter(4).paddingTop(21):Wn().size([n.width,n.height]).padding(0))(c);return sr(e,e=>{let t=e;return t.x1-t.x0>=l&&t.y1-t.y0>=l}),e}if(r===`BUBBLE_CHART`){let e=Rn().size([n.width,n.height-16]).padding(10)(c);return sr(e,e=>e.r>=l),e}else throw Error(`Unknown chart type: `+r)}function sr(e,t){e.children&&=e.children.filter(e=>t(e));for(let n of e.children??[])(n.children?.length??0)>0&&sr(n,t)}function cr(e,t,n){return`M${e},${t}
2
- m0,${n}
3
- a${n},${n} 0 1,1 0,${-n*2}
4
- a${n},${n} 0 1,1 0,${n*2}`}function lr(e){let t=(0,Z.c)(23),{open:n,onClose:r,children:i,title:a,icon:o}=e,s=(0,Q.useRef)(null),c,l;t[0]===n?(c=t[1],l=t[2]):(c=()=>{let e=s.current;if(e)return n?(document.body.style.setProperty(`overflow`,`hidden`),e.open||e.showModal()):(document.body.style.setProperty(`overflow`,null),e.open&&e.close()),ur},l=[n],t[0]=n,t[1]=c,t[2]=l),(0,Q.useEffect)(c,l);let u=n?`visible`:`hidden`,d;t[3]===o?d=t[4]:(d=(0,$.jsx)(J,{path:o,size:`1.75em`}),t[3]=o,t[4]=d);let f;t[5]===a?f=t[6]:(f=(0,$.jsx)(`h2`,{className:`text-2xl font-semibold`,children:a}),t[5]=a,t[6]=f);let p;t[7]!==d||t[8]!==f?(p=(0,$.jsxs)(`div`,{className:`flex flex-row items-center gap-2`,children:[d,f]}),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(rt,{absolute:!1,className:`justify-self-end px-1`,onClick:()=>s.current?.close()}),t[10]=m):m=t[10];let h;t[11]===p?h=t[12]:(h=(0,$.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[p,m]}),t[11]=p,t[12]=h);let g;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`span`,{className:`w-full border-b-3 border-gray-500 px-20`}),t[13]=g):g=t[13];let _;t[14]!==i||t[15]!==h?(_=(0,$.jsxs)(`div`,{className:`card flex min-h-0 max-w-(--breakpoint-2xl) gap-2 rounded-xl p-4 shadow-sm`,children:[h,g,i]}),t[14]=i,t[15]=h,t[16]=_):_=t[16];let v;t[17]!==r||t[18]!==_?(v=(0,$.jsx)(`dialog`,{ref:s,"aria-modal":!0,open:!1,closedby:`any`,className:`z-10 m-auto flex flex-col bg-transparent text-inherit backdrop:bg-gray-400/75 backdrop:backdrop-blur-xs dark:backdrop:bg-gray-800/75`,onClose:r,children:_}),t[17]=r,t[18]=_,t[19]=v):v=t[19];let y;return t[20]!==v||t[21]!==u?(y=(0,$.jsx)(Q.Activity,{mode:u,children:v}),t[20]=v,t[21]=u,t[22]=y):y=t[22],y}function ur(){document.body.style.setProperty(`overflow`,null)}function dr(e){let t=(0,Z.c)(7),{open:n,onClose:r}=e,{databaseInfo:i}=Ye(),a;t[0]===n?a=t[1]:(a=n.toString(),t[0]=n,t[1]=a);let o;return t[2]!==i.hiddenFiles||t[3]!==r||t[4]!==n||t[5]!==a?(o=(0,$.jsx)(fr,{open:n,initialHiddenFiles:i.hiddenFiles,onClose:r},a),t[2]=i.hiddenFiles,t[3]=r,t[4]=n,t[5]=a,t[6]=o):o=t[6],o}function fr(e){let t=(0,Z.c)(37),{open:n,initialHiddenFiles:r,onClose:i}=e,a=(0,Q.useRef)(null),o=we(),[s,c]=(0,Q.useState)(r),l;t[0]===r?l=t[1]:(l=JSON.stringify(r),t[0]=r,t[1]=l);let u;t[2]===s?u=t[3]:(u=JSON.stringify(s),t[2]=s,t[3]=u);let d=l!==u,f,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{a.current?.focus()},p=[],t[4]=f,t[5]=p):(f=t[4],p=t[5]),(0,Q.useEffect)(f,p);let m;t[6]!==d||t[7]!==s||t[8]!==i||t[9]!==o?(m=()=>{if(d){let e=new FormData;e.append(`replaceHiddenFiles`,`true`);for(let t of s)e.append(`hidePath`,t);o(e,{method:`post`})}i()},t[6]=d,t[7]=s,t[8]=i,t[9]=o,t[10]=m):m=t[10];let h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`p`,{className:`text-sm`,children:`Pattern-matched files are hidden from the file tree and excluded from metric computations.`}),t[11]=h):h=t[11];let g;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`p`,{className:`text-sm`,children:[`Hidden files behave like entries in a `,(0,$.jsx)(dt,{inline:!0,children:`.gitignore`}),` file.`]}),t[12]=g):g=t[12];let _;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{e.preventDefault();let t=new FormData(e.currentTarget).get(`hide`);typeof t!=`string`||t.length===0||(c(e=>e.includes(t)?e:[t,...e]),e.currentTarget.reset(),a.current?.setCustomValidity(``))},t[13]=_):_=t[13];let y;t[14]===s?y=t[15]:(y=(0,$.jsxs)(`label`,{className:`label flex min-w-0 flex-1 flex-col gap-2`,children:[`Path or glob`,(0,$.jsx)(`input`,{ref:a,required:!0,type:`text`,className:`input`,name:`hide`,placeholder:`Enter pattern...`,onChange:e=>{let t=s.includes(e.target.value);e.target.setCustomValidity(t?`Pattern already exists`:``)}})]}),t[14]=s,t[15]=y);let b;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(`button`,{className:`btn btn--primary whitespace-nowrap`,children:`Hide`}),t[16]=b):b=t[16];let S;t[17]===y?S=t[18]:(S=(0,$.jsxs)(`form`,{method:`post`,className:`flex w-full flex-wrap items-end gap-2`,onSubmit:_,children:[y,b]}),t[17]=y,t[18]=S);let C;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`h3`,{className:`text-tertiary-text dark:text-tertiary-text-dark text-sm font-bold tracking-wide uppercase`,children:`Hidden files/patterns`}),t[19]=C):C=t[19];let w=s.length===0,T;t[20]===w?T=t[21]:(T=z(`btn btn--danger btn--text`,{hidden:w}),t[20]=w,t[21]=T);let E;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{c([])},t[22]=E):E=t[22];let D;t[23]===T?D=t[24]:(D=(0,$.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[C,(0,$.jsx)(`button`,{type:`button`,className:T,onClick:E,children:`Reset`})]}),t[23]=T,t[24]=D);let O;t[25]===s?O=t[26]:(O=s.length>0?s.map(e=>(0,$.jsxs)(`div`,{className:`secondary grid grid-cols-[1fr_auto] items-center gap-x-2 gap-y-0 rounded-md px-2 py-1 text-sm`,title:e,children:[(0,$.jsx)(`span`,{className:`truncate text-sm`,title:e,children:pr(e)}),(0,$.jsxs)(`button`,{className:`btn btn--text btn--hover-swap h-6`,title:`Unhide ${e}`,onClick:()=>{c(t=>t.filter(t=>t!==e))},children:[(0,$.jsx)(J,{path:R,className:`inline-block h-full`}),(0,$.jsx)(J,{path:x,className:`hover-swap inline-block h-full`})]})]},e)):(0,$.jsx)(`div`,{className:`text-secondary-text dark:text-secondary-text-dark text-sm opacity-70`,children:`No hidden files`}),t[25]=s,t[26]=O);let k;t[27]===O?k=t[28]:(k=(0,$.jsx)(`div`,{className:`flex max-h-96 min-h-0 w-full flex-col gap-2 overflow-y-auto`,children:O}),t[27]=O,t[28]=k);let A;t[29]!==S||t[30]!==D||t[31]!==k?(A=(0,$.jsxs)(`div`,{className:`flex min-h-0 max-w-[40ch] flex-col items-start justify-center gap-3 overflow-y-auto p-2 pl-0`,children:[h,g,S,D,k]}),t[29]=S,t[30]=D,t[31]=k,t[32]=A):A=t[32];let j;return t[33]!==n||t[34]!==A||t[35]!==m?(j=(0,$.jsx)(lr,{open:n,title:`Hide files`,icon:v,onClose:m,children:A}),t[33]=n,t[34]=A,t[35]=m,t[36]=j):j=t[36],j}function pr(e){if(!e.includes(Y(e)))return e;let t=e.split(Y(e));return t[t.length-1]}function mr(){let e=(0,Z.c)(10),t=o(),[n,r]=(0,Q.useState)(!1),i=t.state!==`idle`,a,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>r(!0),s=(0,$.jsx)(J,{path:v}),e[0]=a,e[1]=s):(a=e[0],s=e[1]);let c;e[2]===i?c=e[3]:(c=(0,$.jsx)(`button`,{className:`btn btn--icon btn--text`,title:`Hidden files`,"aria-label":`Hidden files`,disabled:i,onClick:a,children:s}),e[2]=i,e[3]=c);let l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>r(!1),e[4]=l):l=e[4];let u;e[5]===n?u=e[6]:(u=(0,$.jsx)(dr,{open:n,onClose:l}),e[5]=n,e[6]=u);let d;return e[7]!==c||e[8]!==u?(d=(0,$.jsxs)($.Fragment,{children:[c,u]}),e[7]=c,e[8]=u,e[9]=d):d=e[9],d}function hr(e,t){let n={};for(let r in e)n[r]=e[r][t];return n}var gr={FILE_TYPE:`FILE_SIZE`,FILE_SIZE:`FILE_SIZE`,TOP_CONTRIBUTOR:`MOST_CONTRIBUTIONS`,MOST_COMMITS:`MOST_COMMITS`,LAST_CHANGED:`LAST_CHANGED`,MOST_CONTRIBUTIONS:`MOST_CONTRIBUTIONS`,CONTRIBUTORS:`EQUAL_SIZE`};function _r(){let e=(0,Z.c)(29),{metricType:t,chartType:n,sizeMetric:r,linkMetricAndSizeMetric:i,setMetricType:a,setChartType:o,setSizeMetricType:s}=ot(),c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=hr(Ve,`icon`),e[0]=c):c=e[0];let l=c,u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=hr(Ve,`description`),e[1]=u):u=e[1];let d=u,f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=hr($e,`icon`),e[2]=f):f=e[2];let p=f,m;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(m=hr({FILE_SIZE:Pe,MOST_COMMITS:Re,MOST_CONTRIBUTIONS:xt,EQUAL_SIZE:{icon:K},LAST_CHANGED:yt},`icon`),e[3]=m):m=e[3];let h=m,g;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`label`,{htmlFor:`layout`,className:`text-tertiary-text dark:text-tertiary-text-dark ml-8 text-xs font-bold whitespace-nowrap`,children:`Layout`}),e[4]=g):g=e[4];let _;e[5]===o?_=e[6]:(_=e=>o(e),e[5]=o,e[6]=_);let v;e[7]!==n||e[8]!==_?(v=(0,$.jsx)(It,{group:Be,defaultValue:n,iconMap:p,ariaLabel:`Select layout`,onChange:_}),e[7]=n,e[8]=_,e[9]=v):v=e[9];let y;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`h3`,{className:`text-tertiary-text dark:text-tertiary-text-dark ml-8 text-xs font-bold whitespace-nowrap`,title:`Select the metric used to size the visualization`,children:`Node Size`}),e[10]=y):y=e[10];let b;e[11]===s?b=e[12]:(b=e=>{s(e)},e[11]=s,e[12]=b);let x;e[13]!==r||e[14]!==b?(x=(0,$.jsx)(It,{titleMap:qe,group:ht,defaultValue:r,iconMap:h,ariaLabel:`Select size metric`,onChange:b}),e[13]=r,e[14]=b,e[15]=x):x=e[15];let S;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`h3`,{className:`text-tertiary-text dark:text-tertiary-text-dark ml-8 text-xs font-bold whitespace-nowrap`,title:`Select the metric used to color the visualization`,children:`Node Color`}),e[16]=S):S=e[16];let C;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(C=Object.fromEntries(Object.entries(Ve).map(vr)),e[17]=C):C=e[17];let w;e[18]!==i||e[19]!==a||e[20]!==s?(w=e=>{if(a(e),!i)return;let t=gr[e];t&&s(t)},e[18]=i,e[19]=a,e[20]=s,e[21]=w):w=e[21];let T;e[22]!==t||e[23]!==w?(T=(0,$.jsx)(It,{titleMap:d,group:C,defaultValue:t,iconMap:l,ariaLabel:`Select color metric`,onChange:w}),e[22]=t,e[23]=w,e[24]=T):T=e[24];let E;return e[25]!==T||e[26]!==v||e[27]!==x?(E=(0,$.jsxs)(`div`,{className:`grid grid-flow-col grid-cols-3 grid-rows-[auto_auto] items-start gap-0`,children:[g,v,y,x,S,T]}),e[25]=T,e[26]=v,e[27]=x,e[28]=E):E=e[28],E}function vr(e){let[t,n]=e;return[t,n.name]}var yr=2,br=70,xr=10,Sr=7,Cr=40;function wr(e){let t=new Date(e*1e3),n=new Date(t);n.setUTCDate(n.getUTCDate()+4-(n.getUTCDay()||7));let r=new Date(Date.UTC(n.getUTCFullYear(),0,1)),i=Math.ceil(((n.getTime()-r.getTime())/864e5+1)/7);return`Week ${i<10?`0`:``}${i}, ${n.getUTCFullYear()}`}function Tr(e,t){switch(t){case`week`:return wr(e);case`month`:return new Date(e*1e3).toLocaleString(`en-gb`,{month:`long`,year:`numeric`,timeZone:`UTC`});case`year`:return new Date(e*1e3).getUTCFullYear().toString();case`day`:return me(e*1e3,{weekday:`short`})}}function Er(e){let t=(0,Z.c)(37),{scale:n,intervals:r,className:i}=e,{databaseInfo:a}=Ye(),o;t[0]===a.timerange[0]?o=t[1]:(o=Ot.start.withDefault(a.timerange[0]),t[0]=a.timerange[0],t[1]=o);let s;t[2]===a.timerange[1]?s=t[3]:(s=Ot.end.withDefault(a.timerange[1]),t[2]=a.timerange[1],t[3]=s);let c;t[4]!==o||t[5]!==s?(c={start:o,end:s},t[4]=o,t[5]=s,t[6]=c):c=t[6];let[l,u]=wt(c),{start:d,end:f}=l,{metricType:p}=ot(),m;t[7]===p?m=t[8]:(m=tt(p),t[7]=p,t[8]=m);let h=m,g=ae(),_;t[9]===g?_=t[10]:(_=new Set(g),t[9]=g,t[10]=_);let v=_,[,y]=it(),b=ct(),x=ce(),S=He(b),C=He(a.fileTree)??`#c0c0c0`,w=S?{fill:S}:{fill:ut},T=(0,Q.useRef)(null),[E,D]=be(),O=(0,Q.useDeferredValue)(D),k;t[11]===n?k=t[12]:(k=e=>({...e,countLogged:n===`log`?Math.log10(e.count+1):e.count}),t[11]=n,t[12]=k);let A=a.commitCountPerTimeInterval.map(k),j=O.width,M=b.path===a.repo,N=r.length>0?r:null,P=M?N??a.commitCountPerTimeInterval:r,F=a.commitCountPerTimeIntervalUnit,I=Zn().domain(A.map(Ar)).range([0,j]),L=he().domain([0,Ht(A,kr)||0]).range([br,0]),R=Math.max(1,I.bandwidth()-yr*2),ee=Math.max(1,Math.ceil(Cr/2/I.step()))*2,te=ee/2,B;t[13]===u?B=t[14]:(B=function(e){u(t=>({...t,start:e[0],end:e[1]}))},t[13]=u,t[14]=B);let ne=B,V;t[15]===F?V=t[16]:(V=e=>[e.timestamp.toString(),ke(e.timestamp,F)],t[15]=F,t[16]=V);let H=Object.fromEntries(A.map(V)),re=new Map,U;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(U=function(e){return e instanceof SVGRectElement?e.dataset.id:void 0},t[17]=U):U=t[17];let W=U,G;t[18]===i?G=t[19]:(G=z(`flex flex-col justify-center`,i),t[18]=i,t[19]=G);let K;t[20]!==H||t[21]!==ne?(K=e=>{let t=W(e.target);if(!t)return;let[n,r]=H[t];ne([n+1,r-1])},t[20]=H,t[21]=ne,t[22]=K):K=t[22];let q=e=>{let t=W(e.target),n=t?re.get(t):void 0;n&&(e.stopPropagation(),x(n))},J;t[23]===x?J=t[24]:(J=()=>x(null),t[23]=x,t[24]=J);let ie=A.map((e,t)=>{let r=t%ee===0,i=t%te===0,o=I(e.timestamp.toString())??0,s=o+yr,c=br-L(e.countLogged),l=L(e.countLogged),[u,p]=H[e.timestamp.toString()],m=p>d&&u<f,_=P.find(e=>e.timestamp>=u&&e.timestamp<p),x=Object.entries(_?.contributors??{}).sort(Or),S=_&&g.length>0&&h?x.filter(e=>{let[t]=e;return v.has(t)}):[],T=S.reduce(Dr,0),E=g.length>0&&h?T:_?.count??0,D=E>0,O=n===`log`?Math.log10(E+1):E,k=br-L(O),A=L(O),j=Tr(u,F),N=A+k,z=S.map(e=>{let[t,n]=e,r=n/E*k,i=N-r;return N=i,{author:t,y:i,height:r,fill:y.get(t)??`#c0c0c0`}}),B=_&&g.length===0?x.map(e=>{let[t]=e;return y.get(t)??`#c0c0c0`}):[],ne=(g.length>0&&h?S:x).map(e=>{let[t,n]=e;return{name:t,color:y.get(t)??`#c0c0c0`,commitCount:n}}),V={label:j,totalCommitCount:e.count,totalObjectName:a.repo,clickedObjectName:M?null:b.name,clickedCommitCount:_?.count??null,contributors:h?ne:[]},U={id:e.timestamp.toString(),x:s,y:l,hitX:o,width:R,hitWidth:I.bandwidth(),height:c,clickedY:A,clickedHeight:k,date:e.date,tooltip:V,shouldDrawLabel:r,shouldDrawTick:i,isInRange:m,hasFileActivity:D,clickedObjectIsRepo:M,clickedFill:w.fill,stackedSlices:z,gradientColors:B,rootColor:C,interval:[u,p]};return re.set(U.id,U.tooltip),(0,$.jsx)(jr,{node:U},U.id)}),Y=`M0,71 L${j},71`,X;t[25]===Y?X=t[26]:(X=(0,$.jsx)(`path`,{d:Y,className:`stroke-gray-500`,strokeWidth:1}),t[25]=Y,t[26]=X);let oe;t[27]!==K||t[28]!==q||t[29]!==J||t[30]!==ie||t[31]!==X?(oe=(0,$.jsxs)(`svg`,{ref:T,width:`100%`,height:100,className:`fill-transparent`,onClick:K,onMouseOver:q,onMouseOut:J,children:[ie,X]}),t[27]=K,t[28]=q,t[29]=J,t[30]=ie,t[31]=X,t[32]=oe):oe=t[32];let se;return t[33]!==E||t[34]!==G||t[35]!==oe?(se=(0,$.jsx)(`div`,{ref:E,className:G,children:oe}),t[33]=E,t[34]=G,t[35]=oe,t[36]=se):se=t[36],se}function Dr(e,t){let[,n]=t;return e+n}function Or(e,t){return t[1]-e[1]}function kr(e){return e.countLogged}function Ar(e){return e.timestamp.toString()}function jr(e){let t=(0,Z.c)(66),{node:n}=e,{metricType:r}=ot(),i;t[0]===r?i=t[1]:(i=tt(r),t[0]=r,t[1]=i);let a=i,{fill:o,linearGradient:s}=$n(We(ct())),{fill:c,linearGradient:l}=$n(n.gradientColors),u=n.gradientColors.length>1,d;t[2]!==o||t[3]!==c||t[4]!==u||t[5]!==a||t[6]!==n.clickedFill||t[7]!==n.gradientColors[0]||t[8]!==n.gradientColors.length?(d=a?u?{fill:c}:n.gradientColors.length===1?{fill:n.gradientColors[0]}:n.clickedFill?{fill:n.clickedFill}:{}:{fill:o},t[2]=o,t[3]=c,t[4]=u,t[5]=a,t[6]=n.clickedFill,t[7]=n.gradientColors[0],t[8]=n.gradientColors.length,t[9]=d):d=t[9];let f=d,p=n.hasFileActivity&&n.stackedSlices.length===0,m=n.isInRange?``:`opacity-30`,h=u?l:null,g=a?null:s,_=n.hitX,v=n.hitWidth,y=n.id,b;t[10]===n.tooltip?b=t[11]:(b=oe(n.tooltip),t[10]=n.tooltip,t[11]=b);let x;t[12]!==n.hitWidth||t[13]!==n.hitX||t[14]!==n.id||t[15]!==b?(x=(0,$.jsx)(`rect`,{x:_,y:0,width:v,height:100,rx:4,ry:4,className:`peer cursor-pointer fill-transparent stroke-transparent stroke-1`,"data-id":y,"aria-label":b}),t[12]=n.hitWidth,t[13]=n.hitX,t[14]=n.id,t[15]=b,t[16]=x):x=t[16];let S=n.x,C=n.y,w=n.width,T=n.height,E=n.rootColor,D=!n.clickedObjectIsRepo||!p?`opacity-40`:``,O;t[17]===D?O=t[18]:(O=z(`pointer-events-none stroke-transparent stroke-2 opacity-100 transition-[height,width,x,y,fill,opacity] duration-300 ease-out peer-hover:stroke-black`,D),t[17]=D,t[18]=O);let k;t[19]!==n.height||t[20]!==n.rootColor||t[21]!==n.width||t[22]!==n.x||t[23]!==n.y||t[24]!==O?(k=(0,$.jsx)(`rect`,{x:S,y:C,width:w,height:T,rx:4,ry:4,fill:E,className:O}),t[19]=n.height,t[20]=n.rootColor,t[21]=n.width,t[22]=n.x,t[23]=n.y,t[24]=O,t[25]=k):k=t[25];let A;t[26]!==f||t[27]!==n.clickedHeight||t[28]!==n.clickedY||t[29]!==n.isInRange||t[30]!==n.width||t[31]!==n.x||t[32]!==p?(A=p?(0,$.jsx)(`rect`,{x:n.x,y:n.clickedY,width:n.width,height:n.clickedHeight,rx:4,ry:4,className:z(`pointer-events-none opacity-100 transition-[height,width,x,y,fill,opacity] duration-300 ease-out`,n.isInRange?`fill-blue-primary`:`fill-blue-primary/50`,{"opacity-0":n.x===0}),style:f}):null,t[26]=f,t[27]=n.clickedHeight,t[28]=n.clickedY,t[29]=n.isInRange,t[30]=n.width,t[31]=n.x,t[32]=p,t[33]=A):A=t[33];let j;if(t[34]!==n.isInRange||t[35]!==n.stackedSlices||t[36]!==n.width||t[37]!==n.x){let e;t[39]!==n.isInRange||t[40]!==n.stackedSlices.length||t[41]!==n.width||t[42]!==n.x?(e=(e,t)=>{let r=t===0,i=t===n.stackedSlices.length-1;return(0,$.jsx)(`rect`,{x:n.x,y:e.y,width:n.width,height:e.height,rx:i||r?4:0,ry:i||r?4:0,className:z(`pointer-events-none opacity-100 transition-[height,width,x,y,fill,opacity] duration-300 ease-out`,{"opacity-50":!n.isInRange}),style:{fill:e.fill}},e.author)},t[39]=n.isInRange,t[40]=n.stackedSlices.length,t[41]=n.width,t[42]=n.x,t[43]=e):e=t[43],j=n.stackedSlices.map(e),t[34]=n.isInRange,t[35]=n.stackedSlices,t[36]=n.width,t[37]=n.x,t[38]=j}else j=t[38];let M;t[44]!==n.isInRange||t[45]!==n.shouldDrawLabel||t[46]!==n.shouldDrawTick||t[47]!==n.width||t[48]!==n.x?(M=n.shouldDrawTick?(0,$.jsx)(`path`,{d:`M${n.x+n.width/2},71 L${n.x+n.width/2},${br+(n.shouldDrawLabel?xr:Sr)-2}`,className:z(`peer-hover:stroke-blue-primary pointer-events-none`,n.isInRange?`stroke-gray-500`:`stroke-gray-500/30`),strokeWidth:1}):null,t[44]=n.isInRange,t[45]=n.shouldDrawLabel,t[46]=n.shouldDrawTick,t[47]=n.width,t[48]=n.x,t[49]=M):M=t[49];let N;t[50]!==n.date||t[51]!==n.isInRange||t[52]!==n.shouldDrawLabel||t[53]!==n.width||t[54]!==n.x?(N=n.shouldDrawLabel?(0,$.jsx)(`text`,{textAnchor:`middle`,dominantBaseline:`central`,x:n.x+n.width/2,y:90,className:z(`peer-hover:fill-blue-primary pointer-events-none text-xs transition-[x]`,n.isInRange?`fill-primary-text dark:fill-primary-text-dark`:`fill-tertiary-text dark:fill-tertiary-text-dark`),children:n.date}):null,t[50]=n.date,t[51]=n.isInRange,t[52]=n.shouldDrawLabel,t[53]=n.width,t[54]=n.x,t[55]=N):N=t[55];let P;return t[56]!==x||t[57]!==k||t[58]!==A||t[59]!==j||t[60]!==M||t[61]!==N||t[62]!==m||t[63]!==h||t[64]!==g?(P=(0,$.jsxs)(`g`,{className:m,children:[h,g,x,k,A,j,M,N]}),t[56]=x,t[57]=k,t[58]=A,t[59]=j,t[60]=M,t[61]=N,t[62]=m,t[63]=h,t[64]=g,t[65]=P):P=t[65],P}var Mr=[{label:`1d`,durationSecs:1440*60,title:`Last 24 hours`,visibleForUnits:[`day`]},{label:`7d`,durationSecs:10080*60,title:`Last 7 days`,visibleForUnits:[`day`,`week`]},{label:`1m`,durationSecs:720*60*60,durationMonths:1,title:`Last 1 month`,visibleForUnits:[`day`,`week`,`month`]},{label:`3m`,durationSecs:2160*60*60,durationMonths:3,title:`Last 3 months`,visibleForUnits:[`day`,`week`,`month`]},{label:`6m`,durationSecs:4320*60*60,durationMonths:6,title:`Last 6 months`,visibleForUnits:[`day`,`week`,`month`]},{label:`YTD`,durationSecs:null,visibleForUnits:[`day`,`week`,`month`],title:`Year to last change date`},{label:`1yr`,durationSecs:1*365*24*60*60,durationMonths:12,title:`Last 1 year`,visibleForUnits:[`day`,`week`,`month`]},{label:`All`,durationSecs:1/0,title:`Entire project history`,visibleForUnits:[`day`,`week`,`month`,`year`]}];function Nr(e){let t=(0,Z.c)(27),{unit:n}=e,{timerange:r}=Ye().databaseInfo,i;t[0]===r[0]?i=t[1]:(i=Ot.start.withDefault(r[0]),t[0]=r[0],t[1]=i);let a;t[2]===r[1]?a=t[3]:(a=Ot.end.withDefault(r[1]),t[2]=r[1],t[3]=a);let o;t[4]!==i||t[5]!==a?(o={...Ot,start:i,end:a},t[4]=i,t[5]=a,t[6]=o):o=t[6];let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s={clearOnDefault:!1},t[7]=s):s=t[7];let[c,l]=wt(o,s),[,u]=(0,Q.useTransition)(),d;t[8]!==c.end||t[9]!==c.start?(d=[c.start,c.end],t[8]=c.end,t[9]=c.start,t[10]=d):d=t[10];let[f,p]=(0,Q.useOptimistic)(d,Pr),m=r[1]-r[0],h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=function(e,t){let n=new Date(e*1e3);return n.setUTCDate(1),n.setUTCHours(0,0,0,0),n.setUTCMonth(n.getUTCMonth()-t+1),Math.floor(n.getTime()/1e3)},t[11]=h):h=t[11];let g=h,_;t[12]!==r[0]||t[13]!==r[1]||t[14]!==n?(_=function(e){let{duration:t,durationMonths:i}=e,a=r[1];return[n===`month`&&i?g(a,i):t===1/0?r[0]:a-Math.floor(t),a]},t[12]=r[0],t[13]=r[1],t[14]=n,t[15]=_):_=t[15];let v=_,y;t[16]!==v||t[17]!==f||t[18]!==m||t[19]!==p||t[20]!==l||t[21]!==u||t[22]!==r[1]||t[23]!==n?(y=Mr.map(e=>{if(!e.visibleForUnits.includes(n))return null;let t=new Date(r[1]*1e3);t.setMonth(0,1);let i=e.durationSecs??r[1]-t.getTime()/1e3,a=v({duration:i,durationMonths:e.durationMonths}),o=e.durationSecs===1/0&&f[1]-f[0]>=m||f[0]===a[0]&&f[1]===a[1];return i<=m||i===1/0?(0,$.jsx)(`button`,{className:z(`cursor-pointer rounded-full p-1 text-sm transition-opacity hover:opacity-80`,o?`bg-secondary-bg dark:bg-secondary-bg-dark text-primary-text dark:text-primary-text-dark`:`text-tertiary-text dark:text-tertiary-text-dark`),title:e.title,onClick:()=>{u(async()=>{p(a),await l(e=>({...e,start:a[0],end:a[1]}))})},children:e.label},e.label):null}),t[16]=v,t[17]=f,t[18]=m,t[19]=p,t[20]=l,t[21]=u,t[22]=r[1],t[23]=n,t[24]=y):y=t[24];let b;return t[25]===y?b=t[26]:(b=(0,$.jsx)(`div`,{className:`bg-primary-bg dark:bg-primary-bg-dark flex justify-end gap-0.5 rounded-full p-1`,children:y}),t[25]=y,t[26]=b),b}function Pr(e,t){return t}function Fr(){let e=(0,Z.c)(8),t=Ye(),n;e[0]===t.databaseInfo.commitCountPerTimeIntervalUnit?n=e[1]:(n=Ot.timeUnit.withDefault(t.databaseInfo.commitCountPerTimeIntervalUnit),e[0]=t.databaseInfo.commitCountPerTimeIntervalUnit,e[1]=n);let[r,i]=Tt(`timeUnit`,n),a;e[2]===i?a=e[3]:(a=e=>i(e.target.value),e[2]=i,e[3]=a);let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=Et.map(Ir),e[4]=o):o=e[4];let s;return e[5]!==a||e[6]!==r?(s=(0,$.jsx)(`select`,{className:`uppercase`,name:`timeUnit`,value:r,onChange:a,children:o}),e[5]=a,e[6]=r,e[7]=s):s=e[7],s}function Ir(e){return(0,$.jsxs)(`option`,{value:e,children:[`Per `,e]},e)}function Lr(e){let t=(0,Z.c)(15),{dropdownButtons:n}=e,r=ct(),i=Ye(),a=Xe(r)?`Commits that changed this folder`:`Commits that changed this file`,o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(`div`,{className:`truncate`,children:`Commit activity`}),s=(0,$.jsx)(Mt,{}),t[0]=o,t[1]=s):(o=t[0],s=t[1]);let c;t[2]===a?c=t[3]:(c=(0,$.jsxs)(`h2`,{className:`flex items-center gap-2`,title:a,children:[o,s]}),t[2]=a,t[3]=c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(Fr,{}),t[4]=l):l=t[4];let u;t[5]===i.databaseInfo.commitCountPerTimeIntervalUnit?u=t[6]:(u=(0,$.jsx)(Nr,{unit:i.databaseInfo.commitCountPerTimeIntervalUnit}),t[5]=i.databaseInfo.commitCountPerTimeIntervalUnit,t[6]=u);let d;t[7]===n?d=t[8]:(d=(0,$.jsx)(Rr,{metricMenuItems:n}),t[7]=n,t[8]=d);let f;t[9]!==u||t[10]!==d?(f=(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-4`,children:[l,u,d]}),t[9]=u,t[10]=d,t[11]=f):f=t[11];let p;return t[12]!==c||t[13]!==f?(p=(0,$.jsxs)(`div`,{className:`card__title flex w-full items-center justify-between gap-4`,children:[c,f]}),t[12]=c,t[13]=f,t[14]=p):p=t[14],p}function Rr(e){let t=(0,Z.c)(16),{metricMenuItems:n}=e,r=n.length===0,i=n.length===0,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(J,{path:S,size:`1em`}),t[0]=a):a=t[0];let o;t[1]===i?o=t[2]:(o=(0,$.jsx)(`button`,{disabled:i,"aria-label":`Panel options`,title:`Panel options`,className:`btn btn--text btn--icon flex items-center`,children:a}),t[1]=i,t[2]=o);let s;t[3]!==r||t[4]!==o?(s=(0,$.jsx)(se,{asChild:!0,disabled:r,children:o}),t[3]=r,t[4]=o,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(St,{className:`fill-border dark:fill-border-dark`}),t[6]=c):c=t[6];let l;if(t[7]!==n){let e;t[9]===n.length?e=t[10]:(e=(e,t)=>(0,$.jsxs)(bt,{className:z(`btn -mt-0.5 flex cursor-pointer flex-row items-center justify-start rounded-none px-2 py-1 text-sm hover:bg-gray-200 dark:hover:bg-gray-700`,{"rounded-t-lg":t===0,"rounded-b-lg":t===n.length-1}),onSelect:e.onClick,children:[(0,$.jsx)(J,{path:e.icon,size:`1em`}),e.label]},t),t[9]=n.length,t[10]=e),l=n.map(e),t[7]=n,t[8]=l}else l=t[8];let u;t[11]===l?u=t[12]:(u=(0,$.jsxs)(ze,{align:`end`,alignOffset:5,className:`bg-primary-bg dark:bg-primary-bg-dark z-1 -mt-0.5 normal-case`,children:[c,l]}),t[11]=l,t[12]=u);let d;return t[13]!==s||t[14]!==u?(d=(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(Ce,{children:[s,u]})}),t[13]=s,t[14]=u,t[15]=d):d=t[15],d}function zr(e,t,n,r){if(t.length===0)return 0;for(let i=0;i<t.length;i++){let[,a]=ke(t[i].timestamp,n);if(r===`end`){if(e<=a)return i+1}else if(e<a)return i}return t.length}function Br({startIndex:e,endIndex:t,intervals:n,unit:r,minSecs:i,maxSecs:a}){if(n.length===0)return[i,a];let o=Math.max(0,Math.min(e,n.length-1)),s=Math.max(0,Math.min(t-1,n.length-1)),[c]=ke(n[o].timestamp,r),[,l]=ke(n[s].timestamp,r);return[Math.max(i,c),Math.min(a,l)]}function Vr(e){let t=(0,Z.c)(70),{className:n}=e,[i,a]=Tt(`includeCoauthors`,Ot.includeCoauthors),[s,c]=(0,Q.useState)(`log`),{databaseInfo:u}=Ye(),{timerange:d}=u,[f,p]=d,h;t[0]===f?h=t[1]:(h=Ot.start.withDefault(f),t[0]=f,t[1]=h);let g;t[2]===p?g=t[3]:(g=Ot.end.withDefault(p),t[2]=p,t[3]=g);let _;t[4]!==h||t[5]!==g?(_={start:h,end:g},t[4]=h,t[5]=g,t[6]=_):_=t[6];let[v]=wt(_),{start:y,end:b}=v,x=u.commitCountPerTimeIntervalUnit,S=o().state!==`idle`,{data:C,load:w}=r(),T=Ke(),E;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(E={start:Ot.start,end:Ot.end,objectPath:Ot.objectPath,path:Ot.path,branch:Ot.branch},t[7]=E):E=t[7];let[D]=wt(E),{path:O,branch:k,start:N,end:P}=D,F,I;t[8]!==k||t[9]!==T||t[10]!==P||t[11]!==i||t[12]!==w||t[13]!==O||t[14]!==p||t[15]!==f||t[16]!==N||t[17]!==x?(F=()=>{w(l(`/api/commit-intervals`)+Dt({objectPath:T,path:O,branch:k,start:N??f,end:P??p,timeUnit:x,includeCoauthors:i}))},I=[k,T,P,i,w,O,p,f,N,x],t[8]=k,t[9]=T,t[10]=P,t[11]=i,t[12]=w,t[13]=O,t[14]=p,t[15]=f,t[16]=N,t[17]=x,t[18]=F,t[19]=I):(F=t[18],I=t[19]),(0,Q.useEffect)(F,I);let L=u.commitCountPerTimeInterval,R=L.length,ee;t[20]!==y||t[21]!==L||t[22]!==x?(ee=zr(y,L,x,`start`),t[20]=y,t[21]=L,t[22]=x,t[23]=ee):ee=t[23];let te=ee,B;t[24]!==b||t[25]!==L||t[26]!==x?(B=zr(b,L,x,`end`),t[24]=b,t[25]=L,t[26]=x,t[27]=B):B=t[27];let ne=B,V;t[28]===n?V=t[29]:(V=z(`card group/card flex flex-col px-4 text-center select-none`,n),t[28]=n,t[29]=V);let H=s===`log`?M:A,re;t[30]===H?re=t[31]:(re=(0,$.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[`Use log scale`,(0,$.jsx)(J,{path:H})]}),t[30]=H,t[31]=re);let U;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(U=()=>c(Ur),t[32]=U):U=t[32];let W;t[33]===re?W=t[34]:(W={icon:m,label:re,onClick:U},t[33]=re,t[34]=W);let G=i?M:A,K;t[35]===G?K=t[36]:(K=(0,$.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[`Include co-authors `,(0,$.jsx)(J,{path:G})]}),t[35]=G,t[36]=K);let q;t[37]===a?q=t[38]:(q=()=>a(Hr),t[37]=a,t[38]=q);let ie;t[39]!==K||t[40]!==q?(ie={icon:j,label:K,onClick:q},t[39]=K,t[40]=q,t[41]=ie):ie=t[41];let Y;t[42]!==W||t[43]!==ie?(Y=(0,$.jsx)(Lr,{dropdownButtons:[W,ie]}),t[42]=W,t[43]=ie,t[44]=Y):Y=t[44];let ae;t[45]===C?.commitCountPerTimeIntervalForClickedObject?ae=t[46]:(ae=C?.commitCountPerTimeIntervalForClickedObject??[],t[45]=C?.commitCountPerTimeIntervalForClickedObject,t[46]=ae);let X;t[47]!==s||t[48]!==ae?(X=(0,$.jsx)(Er,{scale:s,className:`grid-full`,intervals:ae}),t[47]=s,t[48]=ae,t[49]=X):X=t[49];let oe;t[50]!==b||t[51]!==y?(oe=[y,b],t[50]=b,t[51]=y,t[52]=oe):oe=t[52];let se=oe.join(`-`),ce=f*1e3,le=p*1e3,ue;t[53]!==S||t[54]!==R||t[55]!==ne||t[56]!==te||t[57]!==se||t[58]!==ce||t[59]!==le||t[60]!==L||t[61]!==x?(ue=(0,$.jsx)(Wr,{startUnits:te,endUnits:ne,minMs:ce,maxMs:le,unit:x,domainInUnits:R,disabled:S,intervals:L},se),t[53]=S,t[54]=R,t[55]=ne,t[56]=te,t[57]=se,t[58]=ce,t[59]=le,t[60]=L,t[61]=x,t[62]=ue):ue=t[62];let de;t[63]!==X||t[64]!==ue?(de=(0,$.jsxs)(`div`,{className:`group grid`,children:[X,ue]}),t[63]=X,t[64]=ue,t[65]=de):de=t[65];let fe;return t[66]!==V||t[67]!==Y||t[68]!==de?(fe=(0,$.jsxs)(`div`,{className:V,children:[Y,de]}),t[66]=V,t[67]=Y,t[68]=de,t[69]=fe):fe=t[69],fe}function Hr(e){return!e}function Ur(e){return e===`log`?`linear`:`log`}function Wr(e){let t=(0,Z.c)(24),{startUnits:n,endUnits:r,minMs:i,maxMs:a,domainInUnits:o,unit:s,disabled:c,intervals:l}=e,[u,d]=(0,Q.useTransition)(),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={start:Ot.start.withOptions({limitUrlUpdates:{method:`throttle`,timeMs:1e3}}),end:Ot.end.withOptions({limitUrlUpdates:{method:`throttle`,timeMs:1e3}})},t[0]=f):f=t[0];let[,p]=wt(f),m;t[1]!==l||t[2]!==a||t[3]!==i||t[4]!==p||t[5]!==s?(m=e=>{e[0]===0&&e[1]===0||d(async()=>{let[t,n]=Br({startIndex:e[0],endIndex:e[1],intervals:l,unit:s,minSecs:i/1e3,maxSecs:a/1e3});await p({start:t,end:n})})},t[1]=l,t[2]=a,t[3]=i,t[4]=p,t[5]=s,t[6]=m):m=t[6];let h=m,g;t[7]===o?g=t[8]:(g=[0,o],t[7]=o,t[8]=g);let _;t[9]!==r||t[10]!==n?(_=[n,r],t[9]=r,t[10]=n,t[11]=_):_=t[11];let v;t[12]!==c||t[13]!==o?(v=(0,$.jsx)(X,{children:e=>{let{handles:t,getHandleProps:n}=e;return(0,$.jsx)(Q.Fragment,{children:t.map(e=>(0,$.jsx)(Q.Fragment,{children:(0,$.jsx)(`button`,{className:z(`pointer-events-auto absolute bottom-0 z-10 flex h-6 -translate-x-1/2 place-content-center opacity-0 transition-opacity group-hover/card:opacity-100 disabled:grayscale`,{"size-5 rounded-full":!1},c?`cursor-progress`:`cursor-col-resize`),role:`slider`,"aria-disabled":c,"aria-valuemin":0,"aria-valuemax":o,"aria-valuenow":e.value,title:`Drag to adjust interval`,style:{left:`${e.percent}%`},...n(e.id),children:(0,$.jsx)(`div`,{className:z(`bg-blue-primary text-primary-text-dark flex h-full w-min items-center rounded-full`),children:(0,$.jsx)(J,{path:S,size:.5})})},e.id)},e.id))})}}),t[12]=c,t[13]=o,t[14]=v):v=t[14];let y;t[15]===u?y=t[16]:(y=(0,$.jsx)(Te,{left:!1,right:!1,children:e=>{let{tracks:t,getTrackProps:n}=e;return(0,$.jsx)(`div`,{children:t.map(e=>{let{id:t,source:r,target:i}=e;return(0,$.jsx)(`div`,{className:z(`bg-blue-primary/20 pointer-events-none absolute right-0 bottom-0 left-0 h-5 cursor-pointer rounded opacity-0 transition-[backdrop-filter]`,{"backdrop-blur-2xl":u}),style:{left:`${r.percent}%`,width:`${i.percent-r.percent}%`},...n()},t)})})}}),t[15]=u,t[16]=y);let b;return t[17]!==c||t[18]!==h||t[19]!==g||t[20]!==_||t[21]!==v||t[22]!==y?(b=(0,$.jsxs)(pe,{className:`grid-full pointer-events-none relative`,mode:3,step:1,domain:g,values:_,disabled:c,onChange:h,children:[v,y]}),t[17]=c,t[18]=h,t[19]=g,t[20]=_,t[21]=v,t[22]=y,t[23]=b):b=t[23],b}function Gr(){let e=(0,Z.c)(13),t=o(),n;e[0]===t.formData?n=e[1]:(n=t.formData?.get(`refresh`),e[0]=t.formData,e[1]=n);let r=n===`true`,i=fe(),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`input`,{type:`hidden`,name:`refresh`,value:`true`}),e[2]=a):a=e[2];let s;e[3]===r?s=e[4]:(s=z({"animate-spin":r}),e[3]=r,e[4]=s);let c;e[5]===s?c=e[6]:(c=(0,$.jsx)(J,{path:F,size:`1.25em`,className:s}),e[5]=s,e[6]=c);let l;e[7]!==r||e[8]!==c?(l=(0,$.jsx)(`button`,{className:`btn btn--icon btn--text`,disabled:r,title:`Refresh analysis`,"aria-label":`Refresh analysis`,children:c}),e[7]=r,e[8]=c,e[9]=l):l=e[9];let u;return e[10]!==l||e[11]!==i?(u=(0,$.jsxs)(d,{method:`post`,action:i,className:`contents`,children:[a,l]}),e[10]=l,e[11]=i,e[12]=u):u=e[12],u}function Kr(){let e=(0,Z.c)(10),{isFullscreen:t,toggleFullscreen:n}=ue(qr),r;e[0]===t?r=e[1]:(r=z(`btn btn--icon btn--text`,{"btn--primary":t}),e[0]=t,e[1]=r);let i=t?`Exit fullscreen`:`Enter fullscreen`,a=t?`Exit fullscreen`:`Enter fullscreen`,o=t?y:E,s;e[2]===o?s=e[3]:(s=(0,$.jsx)(J,{path:o,size:1}),e[2]=o,e[3]=s);let c;return e[4]!==r||e[5]!==i||e[6]!==a||e[7]!==s||e[8]!==n?(c=(0,$.jsx)(`button`,{className:r,title:i,"aria-label":a,onClick:n,children:s}),e[4]=r,e[5]=i,e[6]=a,e[7]=s,e[8]=n,e[9]=c):c=e[9],c}function qr(){return document.documentElement}function Jr(e){let t=(0,Z.c)(57),{open:n,onClose:r}=e,{metricType:i,hierarchyType:a,transitionsEnabled:o,showFilesWithoutChanges:s,linkMetricAndSizeMetric:c,showOnlySearchMatches:l,setLinkMetricAndSizeMetric:u,setTransitionsEnabled:d,labelsVisible:f,setLabelsVisible:p,setHierarchyType:m,setSizeMetricType:h,setShowFilesWithoutChanges:v,setShowOnlySearchMatches:y}=ot(),b=!!c,x;t[0]!==i||t[1]!==u||t[2]!==h?(x=e=>{u(e.target.checked),e.target.checked&&h(gr[i])},t[0]=i,t[1]=u,t[2]=h,t[3]=x):x=t[3];let S,C;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(J,{className:`ml-1.5`,path:D,size:`1.25em`}),C=(0,$.jsx)(`span`,{className:`flex-1`,children:`Link size and color option`}),t[4]=S,t[5]=C):(S=t[4],C=t[5]);let w;t[6]!==b||t[7]!==x?(w=(0,$.jsxs)(Ue,{className:`group w-full text-sm hover:text-blue-500 hover:opacity-100`,checked:b,title:`Enable to sync size metric with color metric`,onChange:x,children:[S,C]}),t[6]=b,t[7]=x,t[8]=w):w=t[8];let T;t[9]===d?T=t[10]:(T=e=>d(e.target.checked),t[9]=d,t[10]=T);let E,k;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(J,{className:`ml-1.5`,path:q,size:`1.25em`}),k=(0,$.jsx)(`span`,{className:`flex-1`,children:`Transitions`}),t[11]=E,t[12]=k):(E=t[11],k=t[12]);let A;t[13]!==T||t[14]!==o?(A=(0,$.jsxs)(Ue,{className:`group w-full text-sm hover:text-blue-500 hover:opacity-100`,checked:o,title:`Disable to improve performance when zooming`,onChange:T,children:[E,k]}),t[13]=T,t[14]=o,t[15]=A):A=t[15];let j;t[16]===p?j=t[17]:(j=e=>p(e.target.checked),t[16]=p,t[17]=j);let M,N;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(J,{className:`ml-1.5`,path:O,size:`1.25em`}),N=(0,$.jsx)(`span`,{className:`flex-1`,children:`Labels`}),t[18]=M,t[19]=N):(M=t[18],N=t[19]);let P;t[20]!==f||t[21]!==j?(P=(0,$.jsxs)(Ue,{className:`group w-full text-sm hover:text-blue-500 hover:opacity-100`,checked:f,title:`Disable to improve performance`,onChange:j,children:[M,N]}),t[20]=f,t[21]=j,t[22]=P):P=t[22];let F;t[23]===v?F=t[24]:(F=e=>v(e.target.checked),t[23]=v,t[24]=F);let I,L;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(J,{className:`ml-1.5`,path:_,size:`1.25em`}),L=(0,$.jsx)(`span`,{className:`flex-1`,children:`Show files with no activity`}),t[25]=I,t[26]=L):(I=t[25],L=t[26]);let R;t[27]!==s||t[28]!==F?(R=(0,$.jsxs)(Ue,{className:`group w-full text-sm hover:text-blue-500 hover:opacity-100`,checked:s,title:`Show files that have had no changes in the selected time range`,onChange:F,children:[I,L]}),t[27]=s,t[28]=F,t[29]=R):R=t[29];let te=a===`FLAT`,z;t[30]!==a||t[31]!==m?(z=()=>{m(a===`FLAT`?`NESTED`:`FLAT`)},t[30]=a,t[31]=m,t[32]=z):z=t[32];let B,ne;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(J,{className:`ml-1.5`,path:ie,size:`1.25em`}),ne=(0,$.jsx)(`span`,{className:`flex-1`,children:`Flatten file tree`}),t[33]=B,t[34]=ne):(B=t[33],ne=t[34]);let V;t[35]!==te||t[36]!==z?(V=(0,$.jsxs)(Ue,{className:`group w-full text-sm hover:text-blue-500 hover:opacity-100`,checked:te,title:`Show all files on the same level, instead of as a file tree`,onChange:z,children:[B,ne]}),t[35]=te,t[36]=z,t[37]=V):V=t[37];let H;t[38]===y?H=t[39]:(H=e=>y(e.target.checked),t[38]=y,t[39]=H);let re;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(J,{className:`ml-1.5`,path:g,size:`1.25em`}),t[40]=re):re=t[40];let W;t[41]!==l||t[42]!==H?(W=(0,$.jsxs)(Ue,{className:`group w-full text-sm hover:text-blue-500 hover:opacity-100`,checked:l,title:`When searching, hide files that do not match the search query`,onChange:H,children:[re,`Show only search matches`]}),t[41]=l,t[42]=H,t[43]=W):W=t[43];let G,K;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(Yr,{}),K=(0,$.jsx)(U,{}),t[44]=G,t[45]=K):(G=t[44],K=t[45]);let Y;t[46]!==P||t[47]!==R||t[48]!==V||t[49]!==W||t[50]!==w||t[51]!==A?(Y=(0,$.jsxs)(`div`,{className:`flex min-h-0 max-w-max flex-col items-start gap-3 overflow-y-auto p-2 pl-0`,children:[w,A,P,R,V,W,G,K]}),t[46]=P,t[47]=R,t[48]=V,t[49]=W,t[50]=w,t[51]=A,t[52]=Y):Y=t[52];let ae;return t[53]!==r||t[54]!==n||t[55]!==Y?(ae=(0,$.jsx)(lr,{open:n,title:`Settings`,icon:ee,onClose:r,children:Y}),t[53]=r,t[54]=n,t[55]=Y,t[56]=ae):ae=t[56],ae}function Yr(){let e=(0,Z.c)(7),{renderCutOff:t,setRenderCutOff:n}=ot(),[r,i]=(0,Q.useState)(t),[,a]=(0,Q.useTransition)(),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`span`,{className:`group flex grow items-center gap-2`,children:[(0,$.jsx)(J,{className:`ml-1.5`,path:h,size:`1.25em`}),`Pixel render cut-off`]}),e[0]=o):o=e[0];let s;e[1]!==n||e[2]!==a?(s=e=>{let t=Number.isNaN(e.target.valueAsNumber)?Ie().renderCutOff:e.target.valueAsNumber;i(t),a(()=>n(t))},e[1]=n,e[2]=a,e[3]=s):s=e[3];let c;return e[4]!==s||e[5]!==r?(c=(0,$.jsxs)(`label`,{className:`label group flex w-full items-center justify-start gap-2 text-sm hover:text-blue-500 hover:opacity-100`,title:`Increase to improve render performance, decrease it to get higher level of detail`,children:[o,(0,$.jsx)(`input`,{type:`number`,min:0,value:r,className:`mr-1 w-12 place-self-end border-b-2`,onChange:s})]}),e[4]=s,e[5]=r,e[6]=c):c=e[6],c}function Xr(){let e=(0,Z.c)(4),[t,n]=(0,Q.useState)(!1),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`button`,{className:`btn btn--icon btn--text`,title:`Settings`,"aria-label":`Settings`,onClick:()=>n(!0),children:(0,$.jsx)(J,{path:ee})}),e[0]=r):r=e[0];let i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>n(!1),e[1]=i):i=e[1];let a;return e[2]===t?a=e[3]:(a=(0,$.jsxs)($.Fragment,{children:[r,(0,$.jsx)(Jr,{open:t,onClose:i})]}),e[2]=t,e[3]=a),a}function Zr(e){let t=e.trim(),n=t.length===0?[]:t.split(/\s+/),r=Math.max(n.length-2,0);return{startsWithCapital:+!!/^\p{Lu}/u.test(t),middleNames:r,words:n.length,length:t.length,name:t}}function Qr(e,t){return e.startsWithCapital===t.startsWithCapital?e.middleNames===t.middleNames?e.words===t.words?e.length===t.length?e.name.toLowerCase().localeCompare(t.name.toLowerCase()):t.length-e.length:t.words-e.words:t.middleNames-e.middleNames:t.startsWithCapital-e.startsWithCapital}function $r(e){return e.length===0?`Group`:e.map(e=>Zr(e.name)).filter(e=>e.name.length>0).sort(Qr)[0]?.name??`Group`}var ei=e=>e.match(/^(\d+)-[^@]+@users\.noreply\.github\.com$/i)?.[1]??null;function ti(e){if(e.length<2)return[];let t=Array.from({length:e.length},(e,t)=>t),n=Array(e.length).fill(0),r=e=>(t[e]!==e&&(t[e]=r(t[e])),t[e]),i=(e,i)=>{let a=r(e),o=r(i);a!==o&&(n[a]<n[o]?t[a]=o:n[a]>n[o]?t[o]=a:(t[o]=a,n[a]++))},a=new Map,o=new Map,s=new Map;for(let[t,{name:n,email:r}]of e.entries())if(n&&(a.has(n)?i(t,a.get(n)):a.set(n,t)),r){o.has(r)?i(t,o.get(r)):o.set(r,t);let e=ei(r);e&&(s.has(e)?i(t,s.get(e)):s.set(e,t))}let c=new Map;for(let[t,n]of e.entries()){let e=r(t),i=c.get(e)??[];i.push(n),c.set(e,i)}return Array.from(c.values()).filter(e=>e.length>1).map(e=>({displayName:$r(e),members:e}))}function ni(e){let t=(0,Z.c)(9),{open:n,onClose:r}=e,{databaseInfo:i}=Ye(),[,a]=it(),{contributorGroups:o,contributors:s}=i,c;t[0]===n?c=t[1]:(c=n.toString(),t[0]=n,t[1]=c);let l;return t[2]!==a||t[3]!==o||t[4]!==s||t[5]!==r||t[6]!==n||t[7]!==c?(l=(0,$.jsx)(ri,{open:n,contributorGroups:o,contributors:s,contributorColors:a,onClose:r},c),t[2]=a,t[3]=o,t[4]=s,t[5]=r,t[6]=n,t[7]=c,t[8]=l):l=t[8],l}function ri(e){let t=(0,Z.c)(116),{open:n,contributorGroups:r,contributors:i,contributorColors:a,onClose:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[0]=s):s=t[0];let[c,l]=(0,Q.useState)(s),[u,d]=(0,Q.useState)(r),[f,p]=(0,Q.useState)(``),[,m]=(0,Q.useTransition)(),h=we(),g;t[1]!==r||t[2]!==u||t[3]!==h?(g=()=>{let e=JSON.stringify(u);if(e===JSON.stringify(r))return;let t=new FormData;t.append(`groupedContributors`,e),h(t,{method:`post`})},t[1]=r,t[2]=u,t[3]=h,t[4]=g):g=t[4];let _=g,v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=function(e,t){d(n=>{let r=n[t];return!r||r.displayName===e?n:n.map((n,r)=>r===t?{...n,displayName:e}:n)})},t[5]=v):v=t[5];let y=v,b;t[6]===u?b=t[7]:(b=new Set(u.flatMap(di).map(pi)),t[6]=u,t[7]=b);let x=b,S;if(t[8]!==i||t[9]!==x){let e;t[11]===x?e=t[12]:(e=e=>!x.has(pi(e)),t[11]=x,t[12]=e),S=i.filter(e).toSorted(ui),t[8]=i,t[9]=x,t[10]=S}else S=t[10];let C=S,w;if(t[13]!==f||t[14]!==C){let e;t[16]===f?e=t[17]:(e=e=>e.name.toLowerCase().includes(f.toLowerCase()),t[16]=f,t[17]=e),w=C.filter(e),t[13]=f,t[14]=C,t[15]=w}else w=t[15];let T=w,E;t[18]===C?E=t[19]:(E=ti(C),t[18]=C,t[19]=E);let D=E,O=D.reduce(li,0),k;t[20]===c?k=t[21]:(k=new Set(c.map(pi)),t[20]=c,t[21]=k);let A=k,M;t[22]!==A||t[23]!==T?(M=T.length>0&&T.every(e=>A.has(pi(e))),t[22]=A,t[23]=T,t[24]=M):M=t[24];let N=M,F;t[25]===a?F=t[26]:(F=e=>a.get(e)??`#333`,t[25]=a,t[26]=F);let I=F,L;if(t[27]!==I||t[28]!==c||t[29]!==T){let e;t[31]!==I||t[32]!==c?(e=e=>{let t=c.some(t=>pi(t)===pi(e));return(0,$.jsx)(Ue,{className:`contents`,checkBoxClassName:`ml-auto`,checked:t,onChange:t=>{l(n=>t.target?.checked?[...n,e]:n.filter(t=>pi(t)!==pi(e)))},children:(0,$.jsxs)(`div`,{className:`contents`,children:[(0,$.jsx)(Je,{dotColor:I(e.name)}),(0,$.jsx)(`span`,{className:`truncate font-bold`,title:e.name,children:e.name}),(0,$.jsx)(`p`,{className:`text-secondary-text dark:text-secondary-text-dark truncate text-xs leading-tight`,title:e.email,children:e.email})]})},pi(e)+t)},t[31]=I,t[32]=c,t[33]=e):e=t[33],L=T.map(e),t[27]=I,t[28]=c,t[29]=T,t[30]=L}else L=t[30];let R=L,ee;if(t[34]!==I||t[35]!==u||t[36]!==c){let e;t[38]!==I||t[39]!==c?(e=(e,t)=>{let{displayName:n,members:r}=e;return(0,$.jsxs)(`div`,{className:`card bg-primary-bg dark:bg-primary-bg-dark group m-0 flex h-full flex-col justify-between p-2`,title:n,children:[(0,$.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex w-full justify-between gap-0`,children:[(0,$.jsxs)(`div`,{className:`bg-primary-bg dark:bg-primary-bg-dark hover:bg-secondary-bg focus-within:bg-secondary-bg focus-within:dark:bg-secondary-bg-dark hover:dark:bg-secondary-bg-dark focus-within:ring-blue-primary flex items-center gap-1 rounded-md px-2 py-1 transition-colors focus-within:ring-2`,children:[(0,$.jsx)(Je,{dotColor:I(n)}),(0,$.jsx)(`select`,{className:`input h-fit w-full truncate border-0 bg-transparent px-0 text-sm font-bold ring-0!`,value:n,onChange:e=>y(e.target.value,t),children:Array.from(new Set([n,...r.map(si)])).map(oi)})]}),(0,$.jsx)(`button`,{className:`btn btn--text hover:btn--danger transition-colors`,title:`Ungroup`,"aria-label":`Ungroup`,onClick:()=>d(e=>e.filter((e,n)=>n!==t)),children:(0,$.jsx)(J,{path:te,size:1})})]}),(0,$.jsx)(`ul`,{className:`list-disc pl-6`,children:r.filter(ii).map(e=>(0,$.jsx)(fi,{contributor:e,onClick:()=>d(n=>n.flatMap((n,r)=>{if(r!==t)return[n];let i=n.members.filter(t=>t.email!==e.email);return i.length>0?[{...n,members:i}]:[]}))},pi(e)))})]}),(0,$.jsx)(`div`,{className:z(`relative flex h-full w-full origin-top items-end justify-end transition-all delay-50 duration-100`,c.length===0?`max-h-0 scale-y-0 opacity-0`:`max-h-10 scale-y-100 opacity-100`),children:(0,$.jsxs)(`button`,{className:`btn btn--primary right bottom absolute h-fit w-fit px-2 py-1 text-xs shadow-lg`,title:`Add selected contributors to this group`,disabled:c.length===0,onClick:()=>{d(e=>e.map((e,n)=>n===t?{...e,members:e.members.concat(c)}:e)),l([])},children:[(0,$.jsx)(J,{path:P,size:.75}),`Add contributor`]})})]},t)},t[38]=I,t[39]=c,t[40]=e):e=t[40],ee=u.toSorted(ci).map(e),t[34]=I,t[35]=u,t[36]=c,t[37]=ee}else ee=t[37];let B=ee,V;t[41]!==_||t[42]!==o?(V=()=>{_(),o()},t[41]=_,t[42]=o,t[43]=V):V=t[43];let H;t[44]===C.length?H=t[45]:(H=(0,$.jsxs)(`h3`,{className:`text-center text-lg font-bold`,children:[`Ungrouped Contributors (`,C.length,`)`]}),t[44]=C.length,t[45]=H);let U;t[46]===B.length?U=t[47]:(U=(0,$.jsxs)(`h3`,{className:`text-center text-lg font-bold`,children:[`Contributor Groups (`,B.length,`)`]}),t[46]=B.length,t[47]=U);let W;t[48]!==H||t[49]!==U?(W=(0,$.jsxs)(`div`,{className:`grid grid-cols-[1fr_1fr] gap-2`,children:[H,U]}),t[48]=H,t[49]=U,t[50]=W):W=t[50];let G=C.length===0,K;t[51]===m?K=t[52]:(K=e=>m(()=>p(e.target.value)),t[51]=m,t[52]=K);let q;t[53]!==G||t[54]!==K?(q=(0,$.jsx)(`input`,{className:`input min-w-0`,type:`search`,placeholder:`Filter...`,disabled:G,onChange:K}),t[53]=G,t[54]=K,t[55]=q):q=t[55];let ie=c.length===0,Y;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(Y=()=>l([]),t[56]=Y):Y=t[56];let ae;t[57]===ie?ae=t[58]:(ae=(0,$.jsx)(`button`,{disabled:ie,className:`btn w-max grow`,title:`Clear selection`,onClick:Y,children:`Clear`}),t[57]=ie,t[58]=ae);let X=T.length===0,oe=N?`Deselect selected contributors`:`Select all contributors from list`,se;t[59]!==N||t[60]!==T?(se=()=>l(e=>N?e.filter(e=>!T.some(t=>pi(t)===pi(e))):[...e,...T.filter(t=>!e.some(e=>pi(e)===pi(t)))]),t[59]=N,t[60]=T,t[61]=se):se=t[61];let ce=N?`Deselect all`:`Select all`,le;t[62]!==X||t[63]!==oe||t[64]!==se||t[65]!==ce?(le=(0,$.jsx)(`button`,{disabled:X,className:`btn w-max grow`,title:oe,onClick:se,children:ce}),t[62]=X,t[63]=oe,t[64]=se,t[65]=ce,t[66]=le):le=t[66];let ue;t[67]!==q||t[68]!==ae||t[69]!==le?(ue=(0,$.jsxs)(`div`,{className:`flex gap-2 p-2`,children:[q,ae,le]}),t[67]=q,t[68]=ae,t[69]=le,t[70]=ue):ue=t[70];let de;t[71]!==f||t[72]!==R||t[73]!==T.length?(de=T.length>0?R:(0,$.jsx)(`p`,{className:`col-span-full place-self-center text-sm`,children:f.length>0?`No contributors found`:`All contributors have been grouped`}),t[71]=f,t[72]=R,t[73]=T.length,t[74]=de):de=t[74];let fe;t[75]===de?fe=t[76]:(fe=(0,$.jsx)(`div`,{className:`bg-primary-bg dark:bg-primary-bg-dark grid min-h-0 w-full grid-cols-[min-content_3fr_3fr_min-content] items-center gap-x-4 gap-y-1 overflow-y-auto rounded-lg p-2`,children:de}),t[75]=de,t[76]=fe);let pe;t[77]!==ue||t[78]!==fe?(pe=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-col rounded-md`,children:[ue,fe]}),t[77]=ue,t[78]=fe,t[79]=pe):pe=t[79];let me;t[80]!==B||t[81]!==u.length?(me=u.length>0?B:(0,$.jsx)(`p`,{className:`col-span-2 text-center text-sm`,children:`No contributors have been grouped yet`}),t[80]=B,t[81]=u.length,t[82]=me):me=t[82];let he;t[83]===me?he=t[84]:(he=(0,$.jsx)(`div`,{className:`min-h-0 overflow-y-auto`,children:(0,$.jsx)(`div`,{className:`grid h-min min-h-0 grid-cols-1 gap-4 rounded-md p-2 lg:grid-cols-1 xl:grid-cols-2`,children:me})}),t[83]=me,t[84]=he);let ge;t[85]!==pe||t[86]!==he?(ge=(0,$.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[1fr_1fr] gap-2`,children:[pe,he]}),t[85]=pe,t[86]=he,t[87]=ge):ge=t[87];let _e;t[88]!==O||t[89]!==D?(_e=O>0?(0,$.jsxs)(`button`,{className:`btn btn--primary w-fit transition-all duration-100`,title:D.length===0?`No ungrouped contributors share the same name or email`:`Create ${D.length} inferred group${D.length>1?`s`:``} containing ${O} author${O>1?`s`:``}`,disabled:D.length===0,onClick:()=>{d(e=>{let t=e.slice();for(let e of D)t.push(e);return t}),l([])},children:[(0,$.jsx)(J,{path:ne,size:1}),`Auto group (`,O,`)`]}):null,t[88]=O,t[89]=D,t[90]=_e):_e=t[90];let ve=c.length<2?`Select at least 2 contributors to group them`:`Group the selected contributors`,ye=c.length<2,be;t[91]===c?be=t[92]:(be=()=>{d(e=>[...e,{displayName:$r(c),members:c}]),l([])},t[91]=c,t[92]=be);let xe;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,$.jsx)(J,{path:P,size:1}),t[93]=xe):xe=t[93];let Se;t[94]!==ve||t[95]!==ye||t[96]!==be?(Se=(0,$.jsxs)(`button`,{className:`btn btn--primary w-fit transition-all duration-100`,title:ve,disabled:ye,onClick:be,children:[xe,`Create new group`]}),t[94]=ve,t[95]=ye,t[96]=be,t[97]=Se):Se=t[97];let Ce;t[98]!==_e||t[99]!==Se?(Ce=(0,$.jsxs)(`div`,{className:`flex w-full flex-row justify-end gap-2`,children:[_e,Se]}),t[98]=_e,t[99]=Se,t[100]=Ce):Ce=t[100];let Te=u.length===0,Ee,De;t[101]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=()=>{confirm(`Are you sure you want to ungroup all grouped contributors?`)&&d([])},De=(0,$.jsx)(J,{path:re,size:1}),t[101]=Ee,t[102]=De):(Ee=t[101],De=t[102]);let Oe;t[103]===Te?Oe=t[104]:(Oe=(0,$.jsx)(`div`,{className:`flex w-full flex-row justify-end gap-2`,children:(0,$.jsxs)(`button`,{className:`btn btn--danger w-fit transition-all duration-100`,disabled:Te,onClick:Ee,children:[De,`Ungroup all`]})}),t[103]=Te,t[104]=Oe);let ke;t[105]!==Ce||t[106]!==Oe?(ke=(0,$.jsxs)(`div`,{className:`grid grid-cols-[1fr_1fr] gap-2`,children:[Ce,Oe]}),t[105]=Ce,t[106]=Oe,t[107]=ke):ke=t[107];let Ae;t[108]!==W||t[109]!==ge||t[110]!==ke?(Ae=(0,$.jsxs)(`div`,{className:`flex min-h-0 w-auto max-w-(--breakpoint-lg) min-w-0 flex-col gap-2 p-4`,children:[W,ge,ke]}),t[108]=W,t[109]=ge,t[110]=ke,t[111]=Ae):Ae=t[111];let je;return t[112]!==n||t[113]!==V||t[114]!==Ae?(je=(0,$.jsx)(lr,{open:n,title:`Group contributors`,icon:j,onClose:V,children:Ae}),t[112]=n,t[113]=V,t[114]=Ae,t[115]=je):je=t[115],je}function ii(e,t,n){return n.map(ai).indexOf(e.email)===t}function ai(e){return e.email}function oi(e){return(0,$.jsx)(`option`,{value:e,children:e},e)}function si(e){return e.name}function ci(e,t){return e.displayName.localeCompare(t.displayName)}function li(e,t){return e+t.members.length}function ui(e,t){return e.name.localeCompare(t.name)}function di(e){return e.members}function fi(e){let t=(0,Z.c)(9),{contributor:n,onClick:r,disabled:i}=e,a=`Remove `+n.email,o=`Remove `+n.email,s;t[0]===n.email?s=t[1]:(s=(0,$.jsx)(`span`,{className:`label truncate text-xs`,children:n.email}),t[0]=n.email,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(`div`,{className:`flex opacity-0 transition-opacity duration-200 group-hover/alias:opacity-100`,children:(0,$.jsx)(J,{path:G,size:.75})}),t[2]=c):c=t[2];let l;return t[3]!==i||t[4]!==r||t[5]!==a||t[6]!==o||t[7]!==s?(l=(0,$.jsx)(`li`,{className:`list-item w-full items-center gap-2`,children:(0,$.jsxs)(`button`,{className:`group/alias grid w-full cursor-pointer grid-cols-[minmax(0,1fr)_1rem] items-center gap-1 text-start hover:text-red-500`,disabled:i,title:a,"aria-label":o,onClick:r,children:[s,c]})}),t[3]=i,t[4]=r,t[5]=a,t[6]=o,t[7]=s,t[8]=l):l=t[8],l}function pi(e){return`${e.name}\u0000${e.email??``}`}function mi(e){let t=(0,Z.c)(19),{compact:n}=e,r=n===void 0?!1:n,i=_e(),[a,s]=(0,Q.useState)(!1),{formData:c}=o(),l;t[0]===c?l=t[1]:(l=c?.has(`contributorGroups`),t[0]=c,t[1]=l);let u=l===!0,d;t[2]===r?d=t[3]:(d=z(`btn`,{"btn--icon btn--text":r}),t[2]=r,t[3]=d);let f=u?`Grouping contributors... `:`Group contributors`,p=u||i,m,h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>s(!0),h=(0,$.jsx)(J,{path:j}),t[4]=m,t[5]=h):(m=t[4],h=t[5]);let g;t[6]===r?g=t[7]:(g=r?null:(0,$.jsx)(`span`,{children:`Group contributors`}),t[6]=r,t[7]=g);let _;t[8]!==d||t[9]!==f||t[10]!==p||t[11]!==g?(_=(0,$.jsxs)(`button`,{className:d,title:f,"aria-label":`Group contributors`,disabled:p,onClick:m,children:[h,g]}),t[8]=d,t[9]=f,t[10]=p,t[11]=g,t[12]=_):_=t[12];let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>s(!1),t[13]=v):v=t[13];let y;t[14]===a?y=t[15]:(y=(0,$.jsx)(ni,{open:a,onClose:v}),t[14]=a,t[15]=y);let b;return t[16]!==y||t[17]!==_?(b=(0,$.jsxs)($.Fragment,{children:[_,y]}),t[16]=y,t[17]=_,t[18]=b):b=t[18],b}function hi(e){let t=(0,Z.c)(5),n;t[0]===e.keyString?n=t[1]:(n=(0,$.jsx)(`div`,{className:`text-secondary-text dark:text-secondary-text-dark flex grow overflow-hidden text-sm font-bold text-ellipsis whitespace-pre`,children:e.keyString}),t[0]=e.keyString,t[1]=n);let r;return t[2]!==e.children||t[3]!==n?(r=(0,$.jsxs)($.Fragment,{children:[n,e.children]}),t[2]=e.children,t[3]=n,t[4]=r):r=t[4],r}function gi(e){let t=(0,Z.c)(7),n;t[0]===e.keyString?n=t[1]:(n=(0,$.jsx)(`div`,{className:`text-secondary-text dark:text-secondary-text-dark flex grow overflow-hidden text-sm font-bold text-ellipsis whitespace-pre`,children:e.keyString}),t[0]=e.keyString,t[1]=n);let r;t[2]===e.value?r=t[3]:(r=(0,$.jsx)(`p`,{className:`text-sm text-ellipsis`,children:e.value}),t[2]=e.value,t[3]=r);let i;return t[4]!==n||t[5]!==r?(i=(0,$.jsxs)($.Fragment,{children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6],i}function _i(e){let t=(0,Z.c)(4),n;t[0]===e.fileChanges?n=t[1]:(n=e.fileChanges.map(vi),t[0]=e.fileChanges,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,$.jsx)(`div`,{className:`overflow-auto`,children:(0,$.jsx)(`div`,{className:`grid max-h-64 max-w-lg grid-cols-[auto_auto_1fr] gap-x-2 gap-y-1 overflow-auto`,children:n})}),t[2]=n,t[3]=r),r}function vi(e){return(0,$.jsxs)(Q.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex grow overflow-hidden text-sm font-semibold text-ellipsis whitespace-pre text-green-600`,children:[`+`,e.insertions.toLocaleString()]}),(0,$.jsxs)(`div`,{className:`flex grow overflow-hidden text-sm font-semibold text-ellipsis whitespace-pre text-red-600`,children:[`-`,e.deletions.toLocaleString()]}),(0,$.jsxs)(`div`,{className:`flex grow flex-row overflow-hidden text-sm text-ellipsis whitespace-nowrap`,title:e.path,children:[(0,$.jsx)(`p`,{className:`text-tertiary-text dark:text-tertiary-text-dark`,children:e.path.split(`/`).slice(0,-1).join(`/`)+`/`}),(0,$.jsx)(`p`,{className:`text-secondary-text dark:text-secondary-text-dark font-semibold`,children:e.path.split(`/`).pop()})]})]},e.path)}function yi(e){let t=(0,Z.c)(75),[,n]=it(),r;t[0]!==n||t[1]!==e.value.author.name?(r=n.get(e.value.author.name)??`#c0c0c0`,t[0]=n,t[1]=e.value.author.name,t[2]=r):r=t[2];let i=r,a;t[3]!==n||t[4]!==e.value.author.name||t[5]!==e.value.coauthors||t[6]!==e.value.hash?(a=e.value.coauthors.length>0?e.value.coauthors.filter(t=>t.name!=e.value.author.name).slice(0,2).map(t=>{let r=n.get(t.name)??`#c0c0c0`;return(0,$.jsx)(Je,{title:t.name,dotColor:r,className:`z-0 -ml-2.5`},e.value.hash+t.email+r)}):null,t[3]=n,t[4]=e.value.author.name,t[5]=e.value.coauthors,t[6]=e.value.hash,t[7]=a):a=t[7];let o=e.value.hash+e.value.author.email+i,s;t[8]!==i||t[9]!==e.value.author.name||t[10]!==o?(s=(0,$.jsx)(Je,{dotColor:i,title:e.value.author.name,className:`z-0`},o),t[8]=i,t[9]=e.value.author.name,t[10]=o,t[11]=s):s=t[11];let c;t[12]!==a||t[13]!==s?(c=(0,$.jsx)(`div`,{className:`flex w-min min-w-5.5 items-start`,children:(0,$.jsxs)(`div`,{className:`flex-end flex flex-row-reverse items-center`,children:[a,s]})}),t[12]=a,t[13]=s,t[14]=c):c=t[14];let l=e.value.committerTime*1e3,u;t[15]===l?u=t[16]:(u=ge(l),t[15]=l,t[16]=u);let d;t[17]===u?d=t[18]:(d=(0,$.jsx)(`p`,{className:`text-secondary-text dark:text-secondary-text-dark font-mono text-xs`,children:u}),t[17]=u,t[18]=d);let f;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(f=[`right`,`bottom`,`top`,`left`],t[19]=f):f=t[19];let p;t[20]===e.value.message?p=t[21]:(p=t=>{let{onClick:n}=t;return(0,$.jsx)(`button`,{className:`text-tertiary-text dark:text-tertiary-text-dark h-full w-full min-w-0 cursor-pointer truncate pl-1.5 text-start text-xs font-bold`,onClick:n,children:e.value.message})},t[20]=e.value.message,t[21]=p);let m;t[22]===e.value.hash?m=t[23]:(m=(0,$.jsx)(gi,{keyString:`Hash`,value:e.value.hash}),t[22]=e.value.hash,t[23]=m);let h;t[24]!==n||t[25]!==e.value.author.name?(h=n.get(e.value.author.name)??`grey`,t[24]=n,t[25]=e.value.author.name,t[26]=h):h=t[26];let g;t[27]===h?g=t[28]:(g=(0,$.jsx)(Je,{dotColor:h}),t[27]=h,t[28]=g);let _;t[29]===e.value.author.name?_=t[30]:(_=(0,$.jsx)(`span`,{title:e.value.author.name,className:`text-ellipsis`,children:e.value.author.name}),t[29]=e.value.author.name,t[30]=_);let v=`<${e.value.author.email}>`,y;t[31]===v?y=t[32]:(y=(0,$.jsxs)(`span`,{className:`text-tertiary-text dark:text-tertiary-text-dark truncate`,children:[`\xA0`,v]}),t[31]=v,t[32]=y);let b;t[33]!==g||t[34]!==_||t[35]!==y?(b=(0,$.jsx)(hi,{keyString:`Author`,children:(0,$.jsxs)(`div`,{className:`grid grid-cols-[max-content_max-content_auto] items-center gap-1 text-sm`,children:[g,_,y]})}),t[33]=g,t[34]=_,t[35]=y,t[36]=b):b=t[36];let x;t[37]!==n||t[38]!==e.value.coauthors?(x=e.value.coauthors.length>0?(0,$.jsx)(hi,{keyString:`Co-authors`,children:(0,$.jsx)(`div`,{className:`flex flex-col gap-y-1`,children:e.value.coauthors.map(e=>(0,$.jsxs)(`div`,{className:`grid grid-cols-[max-content_max-content_auto] items-center gap-1 text-sm`,children:[(0,$.jsx)(Je,{dotColor:n.get(e.name)??`grey`}),(0,$.jsx)(`span`,{title:e.name,className:`text-ellipsis`,children:e.name}),(0,$.jsxs)(`span`,{title:e.email,className:`text-tertiary-text dark:text-tertiary-text-dark truncate`,children:[`\xA0`,`<${e.email}>`]})]},e.email))})}):null,t[37]=n,t[38]=e.value.coauthors,t[39]=x):x=t[39];let S;t[40]!==e.value.authorTime||t[41]!==e.value.committerTime?(S=e.value.committerTime===e.value.authorTime?(0,$.jsx)(hi,{keyString:`Date`,children:(0,$.jsxs)(`div`,{className:`text-sm`,children:[je(e.value.committerTime*1e3),(0,$.jsx)(`span`,{className:`text-tertiary-text dark:text-tertiary-text-dark`,children:` (`+lt(e.value.committerTime)+` ago)`})]})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(hi,{keyString:`Date committed`,children:(0,$.jsxs)(`div`,{className:`text-sm`,children:[je(e.value.committerTime*1e3),(0,$.jsx)(`span`,{className:`text-tertiary-text dark:text-tertiary-text-dark`,children:` (`+lt(e.value.committerTime)+` ago)`})]})}),(0,$.jsx)(hi,{keyString:`Date authored`,children:(0,$.jsxs)(`div`,{className:`text-sm`,children:[je(e.value.authorTime*1e3),(0,$.jsx)(`span`,{className:`text-tertiary-text dark:text-tertiary-text-dark`,children:` (`+lt(e.value.authorTime)+` ago)`})]})})]}),t[40]=e.value.authorTime,t[41]=e.value.committerTime,t[42]=S):S=t[42];let C;t[43]===e.value.message?C=t[44]:(C=(0,$.jsx)(hi,{keyString:`Message`,children:(0,$.jsx)(`div`,{className:`flex h-full items-center text-sm text-ellipsis`,children:e.value.message})}),t[43]=e.value.message,t[44]=C);let w=e.value.body.length>0?e.value.body:`<none>`,T;t[45]===w?T=t[46]:(T=(0,$.jsx)(hi,{keyString:`Body`,children:(0,$.jsx)(`div`,{className:`text-tertiary-text dark:text-tertiary-text-dark flex max-h-64 items-start overflow-auto text-xs font-semibold text-ellipsis whitespace-pre-wrap`,children:w})}),t[45]=w,t[46]=T);let E;t[47]===e.value.fileChanges.length?E=t[48]:(E=(0,$.jsx)(`b`,{children:e.value.fileChanges.length}),t[47]=e.value.fileChanges.length,t[48]=E);let D=`+`+e.value.fileChanges.reduce(xi,0),O;t[49]===D?O=t[50]:(O=(0,$.jsx)(`b`,{className:`font-bold text-green-600`,children:D}),t[49]=D,t[50]=O);let k=`-`+e.value.fileChanges.reduce(bi,0),A;t[51]===k?A=t[52]:(A=(0,$.jsx)(`b`,{className:`font-bold text-red-600`,children:k}),t[51]=k,t[52]=A);let j;t[53]!==E||t[54]!==O||t[55]!==A?(j=(0,$.jsx)(hi,{keyString:`File changes`,children:(0,$.jsx)(`div`,{className:`flex flex-row gap-0 text-sm`,children:(0,$.jsxs)(`p`,{children:[E,` files `,`(`,O,`,\xA0`,A,`)`]})})}),t[53]=E,t[54]=O,t[55]=A,t[56]=j):j=t[56];let M;t[57]!==m||t[58]!==b||t[59]!==x||t[60]!==S||t[61]!==C||t[62]!==T||t[63]!==j?(M=(0,$.jsxs)(`div`,{className:`grid max-w-lg grid-cols-[max-content_auto] gap-x-3 gap-y-1`,children:[m,b,x,S,C,T,j]}),t[57]=m,t[58]=b,t[59]=x,t[60]=S,t[61]=C,t[62]=T,t[63]=j,t[64]=M):M=t[64];let N;t[65]===e.value.fileChanges?N=t[66]:(N=(0,$.jsx)(_i,{fileChanges:e.value.fileChanges}),t[65]=e.value.fileChanges,t[66]=N);let P;t[67]!==M||t[68]!==N||t[69]!==p?(P=(0,$.jsxs)(st,{triggerClassName:`flex min-w-0 w-full h-full items-center truncate hover:opacity-60`,positions:f,popoverTitle:`Commit Details`,trigger:p,children:[M,N]}),t[67]=M,t[68]=N,t[69]=p,t[70]=P):P=t[70];let F;return t[71]!==P||t[72]!==c||t[73]!==d?(F=(0,$.jsxs)($.Fragment,{children:[c,d,P]}),t[71]=P,t[72]=c,t[73]=d,t[74]=F):F=t[74],F}function bi(e,t){return e+t.deletions}function xi(e,t){return e+t.insertions}function Si(e){let t=(0,Z.c)(12),{commits:n,loadedCommitCount:r,totalCommitCount:i,isLoading:a,onShowMoreCommits:o}=e,s=ct(),c=Math.ceil(i/15),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=[],t[0]=l):l=t[0];let u=`Shows the commit history for `+s.path+`. Click on a commit to see details.`,d=a?`opacity-60`:``,f=a?`pointer-events-none`:``,p;t[1]===n?p=t[2]:(p=n??[],t[1]=n,t[2]=p);let m=r<i?o:void 0,h;t[3]!==d||t[4]!==f||t[5]!==p||t[6]!==m||t[7]!==c?(h=(0,$.jsx)(gt,{className:d,navClassName:f,items:p,itemsPerPage:15,totalPages:c,itemHeight:20,originalItemsCount:15,onNextFunc:m,children:Ci}),t[3]=d,t[4]=f,t[5]=p,t[6]=m,t[7]=c,t[8]=h):h=t[8];let g;return t[9]!==u||t[10]!==h?(g=(0,$.jsx)($.Fragment,{children:(0,$.jsx)(vt,{className:`mt-0`,metricMenuItems:l,description:u,children:h})}),t[9]=u,t[10]=h,t[11]=g):g=t[11],g}function Ci(e){return(0,$.jsx)(`div`,{className:`grid grid-cols-[max-content_max-content_1fr] items-center justify-start gap-x-1 gap-y-1.5`,children:e.map(wi)})}function wi(e){return(0,$.jsx)(yi,{value:e},e.hash)}function Ti(e){let t=(0,Z.c)(40),{className:n}=e,i=n===void 0?``:n,[a,o]=(0,Q.useState)(!0),s=Ke(),{load:c,data:u,state:d,reset:f}=r(),[p]=wt(Ot),{path:m,branch:h,start:g,end:_}=p,{databaseInfo:v}=Ye(),[y,b]=v.timerange,x=g??y,S=_??b,{metricType:C}=ot(),w=ae(),T;t[0]!==C||t[1]!==w?(T=C===`TOP_CONTRIBUTOR`||C===`CONTRIBUTORS`?w:[],t[0]=C,t[1]=w,t[2]=T):T=t[2];let E=T,D;t[3]!==h||t[4]!==c||t[5]!==a||t[6]!==m||t[7]!==S||t[8]!==x?(D=e=>{let{objectPath:t,contributors:n,count:r}=e,i=l(`/api/commits`)+At({objectPath:t,path:m,branch:h,count:r,contributors:n,start:x,end:S});a&&c(i)},t[3]=h,t[4]=c,t[5]=a,t[6]=m,t[7]=S,t[8]=x,t[9]=D):D=t[9];let O=D,k,A;t[10]!==s||t[11]!==O||t[12]!==f||t[13]!==E?(k=()=>(O({objectPath:s,contributors:E,count:15}),()=>f()),A=[s,O,f,E],t[10]=s,t[11]=O,t[12]=f,t[13]=E,t[14]=k,t[15]=A):(k=t[14],A=t[15]),(0,Q.useEffect)(k,A);let j;t[16]!==s||t[17]!==O||t[18]!==f||t[19]!==E||t[20]!==d?(j=e=>{o(e),e?d===`idle`&&O({objectPath:s,contributors:E,count:15}):f()},t[16]=s,t[17]=O,t[18]=f,t[19]=E,t[20]=d,t[21]=j):j=t[21];let M;t[22]===u?.commits?M=t[23]:(M=u?.commits??[],t[22]=u?.commits,t[23]=M);let N=u?.currentCommitCount??15,P=u?.totalCommitCount??0,F=d!==`idle`,I;t[24]!==s||t[25]!==u?.currentCommitCount||t[26]!==O||t[27]!==E?(I=()=>{O({objectPath:s,contributors:E,count:(u?.currentCommitCount??15)+15})},t[24]=s,t[25]=u?.currentCommitCount,t[26]=O,t[27]=E,t[28]=I):I=t[28];let L;t[29]!==P||t[30]!==F||t[31]!==I||t[32]!==M||t[33]!==N?(L=(0,$.jsx)(Si,{commits:M,loadedCommitCount:N,totalCommitCount:P,isLoading:F,onShowMoreCommits:I}),t[29]=P,t[30]=F,t[31]=I,t[32]=M,t[33]=N,t[34]=L):L=t[34];let R;return t[35]!==i||t[36]!==a||t[37]!==L||t[38]!==j?(R=(0,$.jsx)(kt,{className:i,title:Ei,contentClassName:`flex flex-col gap-2`,open:a,onToggle:j,children:L}),t[35]=i,t[36]=a,t[37]=L,t[38]=j,t[39]=R):R=t[39],R}function Ei(){return(0,$.jsxs)($.Fragment,{children:[`Commits`,(0,$.jsx)(Mt,{})]})}function Di(){let e=(0,Z.c)(67),t=ct(),{databaseInfo:n}=Ye(),{metricType:i,setMetricType:a}=ot(),[o,s]=(0,Q.useState)(!1),c=t?.type===`blob`,{data:u,load:d,reset:f}=r(),p=He(t)??`#c0c0c0`,m=Ke(),h=Ee(m),[g]=wt(Ot),[_,v]=n.timerange,y,b;e[0]!==m||e[1]!==d||e[2]!==g||e[3]!==v||e[4]!==_||e[5]!==f?(y=()=>(d(l(`/api/metrics`)+Dt({...g,objectPath:m,start:g.start??_,end:g.end??v})),()=>f()),b=[m,d,g,v,_,f],e[0]=m,e[1]=d,e[2]=g,e[3]=v,e[4]=_,e[5]=f,e[6]=y,e[7]=b):(y=e[6],b=e[7]),(0,Q.useEffect)(y,b);let x=u,S=c||x!==void 0,C=c?n.contribSumPerFile[t.path]??0:x?.contributions,E=c?n.commitCounts[t.path]??0:x?.amountOfCommits,D=c?n.lastChanged[t.path]:x?.lastChanged,O=x?.contributors?.length,k=Xe(t)?`Folder type`:`File type`,A=h?L:c?w:T,j;e[8]!==t.name||e[9]!==c||e[10]!==h?(j=h?`Repository`:c?`.`+Le(t.name.split(`.`)):`Directory`,e[8]=t.name,e[9]=c,e[10]=h,e[11]=j):j=e[11];let M;e[12]!==k||e[13]!==A||e[14]!==j?(M={description:k,icon:A,data:j},e[12]=k,e[13]=A,e[14]=j,e[15]=M):M=e[15];let N=t.type===`tree`?`Folder size`:`File size`,P;e[16]===t.byteSize?P=e[17]:(P=_t(t.byteSize),e[16]=t.byteSize,e[17]=P);let F;e[18]===t.byteSize?F=e[19]:(F=_t(t.byteSize),e[18]=t.byteSize,e[19]=F);let I=P.value+` `+F.unit,R;e[20]!==N||e[21]!==I?(R={description:N,icon:Pe.icon,data:I},e[20]=N,e[21]=I,e[22]=R):R=e[22];let ee=E===1?`Commit`:`Commits`,te;e[23]===E?te=e[24]:(te=Mi(E),e[23]=E,e[24]=te);let z;e[25]!==ee||e[26]!==te?(z={description:ee,icon:Re.icon,data:te},e[25]=ee,e[26]=te,e[27]=z):z=e[27];let B;e[28]===C?B=e[29]:(B=Mi(C),e[28]=C,e[29]=B);let ne;e[30]===B?ne=e[31]:(ne={description:`Line Changes`,icon:xt.icon,data:B},e[30]=B,e[31]=ne);let V;e[32]===O?V=e[33]:(V=Mi(O),e[32]=O,e[33]=V);let H;e[34]===V?H=e[35]:(H={icon:Ge.icon,description:`Contributors`,data:V},e[34]=V,e[35]=H);let re=x?.multiTopContributors?`Top Churners`:`Top Churner`,U;e[36]===x?U=e[37]:(U=ji(x),e[36]=x,e[37]=U);let W;e[38]!==re||e[39]!==U?(W={description:re,icon:Qe.icon,data:U},e[38]=re,e[39]=U,e[40]=W):W=e[40];let G;e[41]!==D||e[42]!==S?(G=Ni(D,S),e[41]=D,e[42]=S,e[43]=G):G=e[43];let K;e[44]===G?K=e[45]:(K={description:`Last change`,icon:yt.icon,data:G},e[44]=G,e[45]=K);let q;e[46]!==R||e[47]!==z||e[48]!==ne||e[49]!==H||e[50]!==W||e[51]!==K||e[52]!==M?(q={FILE_TYPE:M,FILE_SIZE:R,MOST_COMMITS:z,MOST_CONTRIBUTIONS:ne,CONTRIBUTORS:H,TOP_CONTRIBUTOR:W,LAST_CHANGED:K},e[46]=R,e[47]=z,e[48]=ne,e[49]=H,e[50]=W,e[51]=K,e[52]=M,e[53]=q):q=e[53];let J=q,ie;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>s(!1),e[54]=ie):ie=e[54];let Y;e[55]===o?Y=e[56]:(Y=(0,$.jsx)(ni,{open:o,onClose:ie}),e[55]=o,e[56]=Y);let ae;e[57]===J?ae=e[58]:(ae=Object.entries(J),e[57]=J,e[58]=ae);let X=ae,oe;e[59]!==i||e[60]!==p||e[61]!==a||e[62]!==X?(oe=(0,$.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:X.map(e=>{let[t,n]=e,{icon:r,data:o,description:s}=n;return(0,$.jsxs)(Oi,{icon:r,isCurrentMetric:t===i,color:p&&t===i?p:void 0,onClick:()=>void a(t),children:[(0,$.jsx)(`p`,{className:`truncate text-xs font-normal opacity-70`,children:s}),(0,$.jsx)(`p`,{className:`w-full truncate text-sm font-bold`,title:o,children:o})]},t)})}),e[59]=i,e[60]=p,e[61]=a,e[62]=X,e[63]=oe):oe=e[63];let se;return e[64]!==Y||e[65]!==oe?(se=(0,$.jsxs)($.Fragment,{children:[Y,oe]}),e[64]=Y,e[65]=oe,e[66]=se):se=e[66],se}function Oi(e){let t=(0,Z.c)(14),{icon:n,isCurrentMetric:r,children:i,color:a,onClick:o}=e,s;t[0]===r?s=t[1]:(s=z(`border-border flex h-full w-full cursor-pointer flex-row items-center justify-between gap-5 rounded border bg-(--bg) px-2 py-1 shadow-sm transition-colors [--brightness:1] [--metric-button-bg:var(--color-secondary-bg)] hover:[--brightness:0.6] dark:[--metric-button-bg:var(--color-secondary-bg-dark)]`,{"ring-primary ring-1":r}),t[0]=r,t[1]=s);let c;t[2]===a?c=t[3]:(c={"--color":a,"--bg":`hsl(from var(--color, var(--metric-button-bg)) h s l / var(--brightness))`,color:`contrast-color(var(--bg))`},t[2]=a,t[3]=c);let l=c,u;t[4]===n?u=t[5]:(u=(0,$.jsx)(J,{path:n,size:.75}),t[4]=n,t[5]=u);let d;t[6]===i?d=t[7]:(d=(0,$.jsx)(`div`,{className:`flex flex-col overflow-hidden text-right`,children:i}),t[6]=i,t[7]=d);let f;return t[8]!==o||t[9]!==s||t[10]!==l||t[11]!==u||t[12]!==d?(f=(0,$.jsxs)(`button`,{type:`button`,className:s,style:l,onClick:o,children:[u,d]}),t[8]=o,t[9]=s,t[10]=l,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}var ki=`loading...`,Ai=`No activity`;function ji(e){return e?e.multiTopContributors?`Multiple people`:e.topContributor[0]?.contributor??`No contributors`:ki}function Mi(e){return e==null?ki:e.toLocaleString()}function Ni(e,t){if(e==null||e<=0)return t?Ai:ki;let n=lt(e);return n?`${n} ago`:Oe}function Pi(){let e=(0,Z.c)(20),t=ct(),r=Ye(),[i]=wt(Ot),[a,o]=Tt(`zoomPath`,Ot.zoomPath),s=n(),l=t.type===`blob`,u,d,f,p;e[0]!==t.path||e[1]!==r||e[2]!==l||e[3]!==s.pathname||e[4]!==i?(p=l?pt(t.path):t.path,u=(i.zoomPath??r.databaseInfo.repo)===p,d=s.pathname,f=Dt({...i,zoomPath:p??void 0}),e[0]=t.path,e[1]=r,e[2]=l,e[3]=s.pathname,e[4]=i,e[5]=u,e[6]=d,e[7]=f,e[8]=p):(u=e[5],d=e[6],f=e[7],p=e[8]);let m=d+f,h;e[9]!==u||e[10]!==p||e[11]!==m?(h=u?null:(0,$.jsxs)(c,{className:`btn btn--text`,"aria-disabled":u,to:u?``:m,title:`Zoom to ${p}`,children:[(0,$.jsx)(J,{path:k}),`Zoom in`]}),e[9]=u,e[10]=p,e[11]=m,e[12]=h):h=e[12];let g;e[13]!==r||e[14]!==o||e[15]!==a?(g=a&&a!==r.databaseInfo.repo?(0,$.jsxs)(`button`,{className:`btn btn--text`,title:`Zoom out to repository root`,onClick:()=>o(r.databaseInfo.repo),children:[(0,$.jsx)(J,{path:C}),`Zoom out`]}):null,e[13]=r,e[14]=o,e[15]=a,e[16]=g):g=e[16];let _;return e[17]!==h||e[18]!==g?(_=(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[h,g]})}),e[17]=h,e[18]=g,e[19]=_):_=e[19],_}function Fi(){let e=(0,Z.c)(43),t=ct(),n=Fe(),r=fe(),{state:i}=o(),[,a]=Tt(`zoomPath`,Ot.zoomPath);if(!t)return null;let s;e[0]===t?s=e[1]:(s=ft(t),e[0]=t,e[1]=s);let c=s,l=t.type===`blob`,u;e[2]===t.name?u=e[3]:(u=Le(t.name.split(`.`)),e[2]=t.name,e[3]=u);let f=u,p;e[4]===t.path?p=e[5]:(p=(0,$.jsx)(`input`,{type:`hidden`,name:`open`,value:t.path}),e[4]=t.path,e[5]=p);let m=i!==`idle`,h=t.type===`blob`?`Open ${t.name} in default app`:`Browse ${t.name} in system explorer`,g;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(J,{path:H,size:`1.25em`,className:`w-max`}),e[6]=g):g=e[6];let _=t.type===`blob`?`Open`:`Browse`,v;e[7]!==m||e[8]!==h||e[9]!==_?(v=(0,$.jsxs)(`button`,{className:`btn btn--text`,disabled:m,title:h,children:[g,_]}),e[7]=m,e[8]=h,e[9]=_,e[10]=v):v=e[10];let y;e[11]!==p||e[12]!==v||e[13]!==r?(y=(0,$.jsxs)(d,{method:`post`,action:r,children:[p,v]}),e[11]=p,e[12]=v,e[13]=r,e[14]=y):y=e[14];let x;e[15]!==t.path||e[16]!==l||e[17]!==n||e[18]!==a?(x=()=>{l||a(pt(t.path)),n(null)},e[15]=t.path,e[16]=l,e[17]=n,e[18]=a,e[19]=x):x=e[19];let S;e[20]===t.path?S=e[21]:(S=(0,$.jsx)(`input`,{type:`hidden`,name:`hide`,value:t.path}),e[20]=t.path,e[21]=S);let C;e[22]!==t.name||e[23]!==l||e[24]!==c||e[25]!==i?(C=!c&&l?(0,$.jsxs)(`button`,{className:`btn btn--text`,disabled:i!==`idle`,title:`Hide ${t.name} from visualization`,children:[(0,$.jsx)(J,{path:b}),`Hide`]}):null,e[22]=t.name,e[23]=l,e[24]=c,e[25]=i,e[26]=C):C=e[26];let w;e[27]!==S||e[28]!==C||e[29]!==x||e[30]!==r?(w=(0,$.jsxs)(d,{className:`w-max`,method:`post`,action:r,onSubmit:x,children:[S,C]}),e[27]=S,e[28]=C,e[29]=x,e[30]=r,e[31]=w):w=e[31];let T;e[32]!==t.name||e[33]!==f||e[34]!==l||e[35]!==i||e[36]!==r?(T=l?(0,$.jsx)($.Fragment,{children:t.name.includes(`.`)?(0,$.jsxs)(d,{className:`w-max`,method:`post`,action:r,children:[(0,$.jsx)(`input`,{type:`hidden`,name:`hide`,value:`*.${f}`}),(0,$.jsxs)(`button`,{className:`btn btn--text`,disabled:i!==`idle`,title:`Hide all files with .${f} extension`,children:[(0,$.jsx)(J,{path:b}),(0,$.jsxs)(`span`,{children:[`Hide *.`,f]})]})]}):null}):null,e[32]=t.name,e[33]=f,e[34]=l,e[35]=i,e[36]=r,e[37]=T):T=e[37];let E;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(Pi,{}),e[38]=E):E=e[38];let D;return e[39]!==w||e[40]!==T||e[41]!==y?(D=(0,$.jsxs)(`div`,{className:`flex flex-wrap`,children:[y,w,T,E]}),e[39]=w,e[40]=T,e[41]=y,e[42]=D):D=e[42],D}var Ii=`/assets/drivingTruck_32x-C9OqTj6H.gif`;function Li(){let e=(0,Z.c)(6),t=!_e(),n;e[0]===t?n=e[1]:(n=z(`flex gap-2`,`transition-opacity`,{"opacity-0":t}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`span`,{className:`font-bold`,children:`Loading...`}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`div`,{className:`relative flex w-24 items-center`,children:(0,$.jsx)(`img`,{src:Ii,alt:`Loading...`,className:z(`pixelated absolute size-24 translate-y-0.75`)})}),e[3]=i):i=e[3];let a;return e[4]===n?a=e[5]:(a=(0,$.jsxs)(`div`,{className:n,children:[r,i]}),e[4]=n,e[5]=a),a}function Ri(){let e=(0,Z.c)(18),t=i(),{metricType:n,showTopContributorSlider:r,setShowTopContributorSlider:a}=ot(),o=fe(),[s,c]=(0,Q.useState)(!1),l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>c(!0),e[0]=l):l=e[0];let u;e[1]!==t||e[2]!==o?(u=()=>t({rerollColors:``},{method:`post`,action:o}),e[1]=t,e[2]=o,e[3]=u):u=e[3];let d;e[4]!==a||e[5]!==r?(d=()=>a(!r),e[4]=a,e[5]=r,e[6]=d):d=e[6];let f;if(e[7]!==n||e[8]!==s||e[9]!==r||e[10]!==u||e[11]!==d){let t={"group-contributors":l,"shuffle-colors":u,"toggle-top-contributor-slider":d},i=e=>(e===void 0?[]:e).map(e=>({icon:e.icon,label:e.label,onClick:t[e.actionId]})),{icon:a,inspectionPanels:o}=Ve[n],p;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>c(!1),e[13]=p):p=e[13];let m;e[14]===s?m=e[15]:(m=(0,$.jsx)(ni,{open:s,onClose:p}),e[14]=s,e[15]=m);let h;e[16]===r?h=e[17]:(h=e=>!(e.id===`top-contributor-slider`&&!r),e[16]=r,e[17]=h),f=(0,$.jsxs)($.Fragment,{children:[m,o.filter(h).map((e,t)=>(0,$.jsx)(vt,{actions:e.actions,metricMenuItems:i(e.menuItems),title:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t===0?(0,$.jsx)(J,{path:a}):null,e.title]}),description:e.description??`Description not provided.`,children:(0,$.jsx)(e.content,{})},e.id??`panel-${t}`))]}),e[7]=n,e[8]=s,e[9]=r,e[10]=u,e[11]=d,e[12]=f}else f=e[12];return f}var zi=({loaderData:e})=>[{title:`${e.repositoryName} - Git Truck`}],Bi=a(function({loaderData:{parentDirectoryPath:e,versionInfo:t,dataPromise:n}}){let[{leftExpanded:i,rightExpanded:a,optionsRevision:o},d]=(0,Q.useReducer)((e,t)=>{switch(t){case`toggleLeft`:return{leftExpanded:!e.leftExpanded,rightExpanded:e.rightExpanded,optionsRevision:e.optionsRevision+1};case`toggleRight`:{let t=!e.rightExpanded;return{leftExpanded:e.leftExpanded,rightExpanded:t,optionsRevision:e.optionsRevision+1}}}},{leftExpanded:!0,rightExpanded:!0,optionsRevision:0}),f=()=>d(`toggleLeft`),p=()=>d(`toggleRight`),m=u(),h=r(),g=h.state!==`idle`,_=l(`/browse`)+Ft({path:e}),[v]=wt(Ot),y=(0,Q.useCallback)(()=>{(0,Q.startTransition)(async()=>{if(g||!v.branch||!v.path)return;let e=l(`/api/abort`)+jt({branch:v.branch,path:v.path});await h.submit(null,{action:e,method:`post`}),m(_)})},[g,v.branch,v.path,h,m,_]),b=Ct(`(min-width: var(--breakpoint-large))`);return(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(`div`,{className:`grid h-screen place-items-center bg-slate-200 dark:bg-stone-800`,children:(0,$.jsx)(Rt,{showProgress:!g,loadingText:({status:e})=>(0,$.jsx)(`div`,{className:`flex flex-col items-center gap-2`,children:(0,$.jsx)(`div`,{className:`flex gap-2`,children:e!==`Aborted`&&e!==`CommitHistoryProcessed`?(0,$.jsx)(`button`,{className:`btn btn--text btn--danger`,disabled:g,onClick:y,children:g?`Aborting...`:`Abort`}):(0,$.jsx)(c,{to:_,className:`btn btn--text`,children:`Go back`})})})})}),children:(0,$.jsx)(s,{resolve:n,children:e=>(0,$.jsx)(zt,{data:e,children:(0,$.jsxs)(`div`,{className:z(`min-h-100dvh bg-secondary-bg dark:bg-secondary-bg-dark grid grid-cols-2 grid-rows-[auto_100dvh_auto_auto] gap-x-1 gap-y-2 p-2 transition-all [grid-template-areas:"lheader_cheader_rheader"_"left_left_left"_"chart_chart_chart"_"barchart_barchart_barchart"] lg:h-screen lg:grid-cols-[var(--spacing-sidepanel)_1fr_var(--spacing-sidepanel)] lg:grid-rows-[auto_1fr_auto] lg:overflow-hidden lg:pr-2 lg:[grid-template-areas:"rheader_rheader"_"chart_chart"_"barchart_barchart"]`,{'lg:[grid-template-areas:"lheader_cheader_rheader"_"left_chart_chart"_"left_barchart_barchart"]':i&&!a,'lg:[grid-template-areas:"cheader_cheader_rheader"_"chart_chart_right"_"barchart_barchart_right"]':a&&!i,'lg:[grid-template-areas:"lheader_cheader_rheader"_"left_chart_right"_"left_barchart_right"]':i&&a,'lg:[grid-template-areas:"cheader_cheader_rheader"_"chart_chart_chart"_"barchart_barchart_barchart"]':!i&&!a}),children:[(0,$.jsxs)(`header`,{className:z(`bg-secondary-bg dark:bg-secondary-bg-dark flex grid-cols-3 items-center justify-between gap-2 pr-2 [grid-area:lheader]`,{hidden:!i}),children:[b?(0,$.jsx)(`button`,{title:`Hide left panel`,className:`btn btn--text aspect-square`,onClick:f,children:(0,$.jsx)(J,{path:B,size:1})}):(0,$.jsx)(`div`,{}),(0,$.jsx)(`div`,{className:z(`flex items-end gap-2`,{hidden:!i}),children:(0,$.jsx)(Pt,{installedVersion:t.installedVersion,latestVersion:t.latestVersion})}),(0,$.jsx)(`div`,{})]}),(0,$.jsxs)(`nav`,{className:`grid grid-cols-[1fr_auto_1fr] items-center justify-between gap-2 [grid-area:cheader]`,children:[(0,$.jsxs)(`div`,{className:z(`flex items-center`),children:[b&&!i?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{title:`Show left panel`,className:`btn btn--text aspect-square`,onClick:f,children:(0,$.jsx)(J,{path:I,size:1})}),(0,$.jsx)(J,{"aria-hidden":!0,path:`M11,2 H13 V22 H11 Z`,size:1,className:`fill-primary-text dark:fill-primary-text-dark mx-0 align-middle opacity-20`})]}):null,(0,$.jsx)(Nt,{zoom:!0})]}),(0,$.jsx)(Li,{})]}),(0,$.jsxs)(`div`,{className:`flex justify-end [grid-area:rheader]`,children:[(0,$.jsx)(Lt,{}),(0,$.jsx)(Gr,{}),(0,$.jsx)(mr,{}),(0,$.jsx)(mi,{compact:!0}),(0,$.jsx)(Xr,{}),(0,$.jsx)(Kr,{}),b&&!a?(0,$.jsx)(`button`,{title:`Show Right panel`,className:`btn btn--text aspect-square`,onClick:p,children:(0,$.jsx)(J,{path:I,size:1})}):null,b&&a?(0,$.jsx)(`div`,{className:`flex items-center`,children:(0,$.jsx)(`button`,{title:`Hide right panel`,className:`btn btn--text aspect-square`,onClick:p,children:(0,$.jsx)(J,{path:W,size:1})})}):(0,$.jsx)(`div`,{})]}),(0,$.jsx)(Q.Activity,{mode:i||!b?`visible`:`hidden`,children:(0,$.jsxs)(`aside`,{className:V(`hover:scrollbar-thumb-primary-bg-dark/50 hover:dark:scrollbar-thumb-primary-bg/50 flex scrollbar-thin scrollbar-thumb-transparent scrollbar-track-transparent scrollbar-gutter-stable flex-col gap-4 overflow-y-auto lg:transition-transform`,i?`[grid-area:left]`:`lg:-translate-x-sidepanel`),children:[(0,$.jsx)(kt,{className:`card`,title:()=>`Visualization options`,children:(0,$.jsx)(_r,{},o)}),(0,$.jsx)(kt,{className:`card`,contentClassName:`flex flex-col gap-8`,title:()=>(0,$.jsxs)($.Fragment,{children:[`Legend`,(0,$.jsx)(Mt,{})]}),children:(0,$.jsx)(Ri,{})})]})}),(0,$.jsx)(`div`,{className:z(`bg-primary-bg dark:bg-primary-bg-dark relative grid h-full rounded-xl shadow-md [grid-area:chart] lg:transition-transform`),children:(0,$.jsx)(mt,{children:()=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(er,{}),(0,Qn.createPortal)((0,$.jsx)(Vt,{}),document.body)]})})}),(0,$.jsx)(Vr,{className:`[grid-area:barchart]`}),(0,$.jsx)(Q.Activity,{mode:a||!b?`visible`:`hidden`,children:(0,$.jsxs)(`aside`,{className:V(`hover:scrollbar-thumb-primary-bg-dark/50 hover:dark:scrollbar-thumb-primary-bg/50 flex scrollbar-thin scrollbar-thumb-transparent scrollbar-track-transparent scrollbar-gutter-stable flex-col gap-4 overflow-y-auto pl-2 lg:transition-transform`,a?`[grid-area:right]`:`lg:translate-x-sidepanel`),children:[(0,$.jsx)(kt,{title:()=>(0,$.jsxs)($.Fragment,{children:[`Actions `,(0,$.jsx)(Mt,{})]}),className:`card`,children:(0,$.jsx)(Fi,{})}),(0,$.jsx)(kt,{className:`card`,title:()=>(0,$.jsxs)($.Fragment,{children:[`Details`,(0,$.jsx)(Mt,{})]}),children:(0,$.jsx)(Di,{})}),(0,$.jsx)(Ti,{className:`card`})]})})]})})})})});export{Bi as default,zi as meta};