PageSourceSearch

https://octocounts.com/assets/GrowthSection-CNi6WAhL.js

js octocounts.com collected 2026-10-02 00:32:19 UTC 29,487 bytes, 11 lines download raw bytes

1import{j as a,r as b}from"./vendor-react-DbFVZiS9.js";import{u as Dt}from"./vendor-query-qQWDno7u.js";import{c as Ht,g as F,n as Xt,_ as wt,u as ke,v as Ce,l as Se,L as yt,P as Te,R as Me,t as at,A as st,D as Re,s as _e,w as Ee,x as Le,y as Oe}from"./index-B9etCNLl.js";import{u as Ut}from"./vendor-i18n-k0TTF2pe.js";/**
2 * @license lucide-react v0.503.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Pe=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],Fe=Ht("pause",Pe);/**
7 * @license lucide-react v0.503.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Ie=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],De=Ht("x",Ie),$e=1e4,Ge={startTime:1.2,endTime:8.5,finalLock:8.5},Ye={startTime:8.55,endTime:9.3},ze={startTime:9.3,endTime:10,staticFrom:9.6},Be=.7,rt=10,He=6,gt="#57606a";function Xe(e){const{report:t,history:r,languageColors:o}=e,h=t.repository.owner,l=t.repository.name,c=`octocounts ${h}/${l}`,s=t.total.code,u=[...t.languages].sort((i,k)=>k.stats.code-i.stats.code),f=u.filter(i=>i.stats.code>0).map(i=>({name:i.name,color:o[i.name]??gt,currentCode:i.stats.code,currentShare:s>0?i.stats.code/s*100:0,entersAtSample:0})),v=f.length>0?f[0].name:"",m=[...r.slocPoints].sort((i,k)=>B(i.date)-B(k.date)),_=[...r.starPoints].sort((i,k)=>B(i.date)-B(k.date)),T=m.length>0?B(m[0].date):0,w=m.map(i=>{let k=null;for(const E of _)if(B(E.date)<=B(i.date))k=E.stars;else break;return{date:i.date,dayOffset:B(i.date)-T,code:i.totalLines,stars:k,languageCode:Ue(f,i.totalLines)}}),S=[];for(let i=1;i<w.length;i++){const k=w[i-1].code,E=w[i].code;E<k*Be&&S.push({sampleIndex:i,fromValue:k,toValue:E})}const y=f.slice(0,He),M=y.reduce((i,k)=>i+k.currentCode,0),O=y.map(i=>M>0?i.currentCode/M*100:100/y.length),A=Vt(O,100).map((i,k)=>({name:y[k].name,share:i,color:y[k].color})),N=u.slice(0,rt),C=u.slice(rt),P=N.map(i=>({name:i.name,color:o[i.name]??gt,...i.stats}));return t.languages.length>rt&&P.push({name:`Other (${C.length} more)`,color:gt,...Ve(C.map(i=>i.stats)),merged:!0}),{repoFullName:`${h}/${l}`,provider:r.provider,durationMs:$e,variant:w.length<3?"compact":"full",languages:f,samples:w,dips:S,starsNow:r.currentStars,leadingLanguage:v,modeledLanguageSplit:f.length>1,finaleDiverged:w.length>0&&w[w.length-1].code>0?Math.abs(t.total.code-w[w.length-1].code)/w[w.length-1].code>.05:!1,finale:{refName:t.refName,commitSha12:t.commitSha.slice(0,12),generatedDate:t.generatedAt.slice(0,10),metrics:{...t.total},tableCaption:`top ${Math.min(rt,t.languages.length)} of ${t.languages.length} languages`,tableRows:P,totalRow:{...t.total}},acts:{hook:{prompt:c},data:{...Ge},morph:{...Ye,stackOrder:y.map(i=>i.name),ringShares:A},finale:{...ze}}}}function Ue(e,t){const r=e.map(l=>l.currentShare/100*t),o=Vt(r,t),h={};return e.forEach((l,c)=>{h[l.name]=o[c]}),h}function Vt(e,t){const r=e.map(c=>Math.floor(c)),o=e.map((c,s)=>({i:s,fraction:c-Math.floor(c),value:c})).sort((c,s)=>s.fraction-c.fraction||s.value-c.value||c.i-s.i);let h=t-r.reduce((c,s)=>c+s,0),l=0;for(;h>0;)r[o[l%o.length].i]+=1,h-=1,l+=1;for(l=0;h<0;){const c=o[o.length-1-l%o.length];r[c.i]>0&&(r[c.i]-=1),h+=1,l+=1}return r}function Ve(e){return e.reduce((t,r)=>({files:t.files+r.files,lines:t.lines+r.lines,code:t.code+r.code,comments:t.comments+r.comments,blanks:t.blanks+r.blanks}),{files:0,lines:0,code:0,comments:0,blanks:0})}function B(e){const[t,r,o]=e.split("-").map(Number);return Date.UTC(t,r-1,o)/864e5}function qe(e){const t=b.useRef(null);return b.useEffect(()=>{const r=t.current;if(!r||typeof ResizeObserver>"u")return;const o=new ResizeObserver(h=>{var c;const l=(c=h[0])==null?void 0:c.contentRect.width;l&&r.style.setProperty("--growth-scale",String(l/e))});return o.observe(r),()=>o.disconnect()},[e]),t}const I=(e,t,r)=>e<t?t:e>r?r:e,H=(e,t,r)=>e+(t-e)*r,Ke=e=>{const t=I(e,0,1);return t*t*(3-2*t)},We=e=>{const t=I(e,0,1);return t<.5?2*t*t:1-2*(1-t)*(1-t)},lt=e=>{const t=I(e,0,1);return t*t*t},nt=e=>1-lt(1-e),ot=e=>{const t=I(e,0,1);return t<.5?4*t*t*t:1-4*(1-t)*(1-t)*(1-t)},D=e=>{const t=I(e,0,1);return 1-(1-t)*(1-t)*(1-t)*(1-t)},Qe=e=>{const t=I(e,0,1);return t<.5?8*t*t*t*t:1-8*(1-t)*(1-t)*(1-t)*(1-t)},g=(e,t,r)=>I((e-t)/(r-t||1),0,1),j=e=>({opacity:e,visibility:e<=0?"hidden":"visible"});function $t(e,t,r){const h=[];let l=0,c=0;for(;l<e.length;){const v=c%2===0?3:2;h.push(Math.min(v,e.length-l)),l+=v,c+=1}const s=(r-t-.025)/h.length,u=[{t,n:0}];let f=0;return h.forEach((v,m)=>{f+=v,u.push({t:t+.025+s*(m+1),n:f})}),u}function Gt(e,t){for(let r=e.length-1;r>=0;r-=1)if(t>=e[r].t-.001)return e[r].n;return 0}const qt=864e5,Nt=e=>Date.parse(`${e}T00:00:00Z`),Kt=(e,t)=>
11new Date(e+t*qt),Ze=(e,t)=>Kt(e,t).toISOString().slice(0,10),Je=(e,t)=>(Date.UTC(t,0,1)-e)/qt,ta=e=>new Intl.DateTimeFormat("en-US",{month:"short",year:"numeric",timeZone:"UTC"}).format(new Date(Nt(e))),X=1280,ea=720,L=64,aa=687,sa=200,ft=56,ra=113,xt=353,Wt=29,q=347,Qt=180,na=62,Zt=2*Math.PI*Qt,oa=37,la=(X-2*L-oa)*.38,Jt=225,ca=ea-L-Jt,te=L+la/2-q/2,ee=Jt+(ca-q)/2,ae=te+q/2,se=ee+q/2,jt=392,ia=Wt,ha=se-ia/2,da=ae-jt/2,ma=430,pa=.225,ua=.35;function ga(e,t){const r=e.acts,o=e.samples,h=o.length,l=h-1,c=e.variant==="compact",s=r.data.startTime,u=r.data.endTime,f=r.morph.startTime,v=r.morph.endTime,m=r.finale.startTime,_=r.finale.staticFrom,w=f+.3,S=Math.max(o[l].dayOffset,1),y=n=>s+o[n].dayOffset/S*(u-s),M=new Set(e.dips.map(n=>n.sampleIndex)),O=[];for(let n=0;n<l;n+=1){const d=y(n+1)-y(n);if(M.has(n+1)){const x=Math.max(0,1-pa/Math.max(d,1e-6));O.push(p=>p<x?0:lt((p-x)/(1-x)))}else O.push(d<.15?We:ot)}const N=(n=>{if(n<=y(0))return 0;if(n>=y(l))return l;let d=0;for(;d<l-1&&n>=y(d+1);)d+=1;const x=g(n,y(d),y(d+1));return d+O[d](x)})(t),C=h>1?I(Math.floor(N),0,h-2):0,P=Math.min(C+1,l),i=h>1?I(N-C,0,1):0,k=n=>H(n(o[C]),n(o[P]),i),E=k(n=>n.code),U=k(n=>n.dayOffset),Q=n=>H(o[C].languageCode[n]??0,o[P].languageCode[n]??0,i),ct=Nt(o[0].date),it=Kt(ct,0).getUTCFullYear(),ht=new Date(Nt(o[l].date)).getUTCFullYear(),dt=Math.max(ht-it,1),bt=`${it} → ${ht}`,$=r.morph.stackOrder,mt=n=>{const d=[...$].sort((p,R)=>(o[n].languageCode[R]??0)-(o[n].languageCode[p]??0)||$.indexOf(p)-$.indexOf(R)),x=new Map(d.map((p,R)=>[p,R]));return $.map(p=>x.get(p)??0)},vt=mt(C),ne=mt(P),oe=$.map((n,d)=>H(vt[d],ne[d],Ke(i))),le=mt(l),At=$.map(n=>Q(n)),kt=Math.max(...At,0),ce=new Map(e.languages.map(n=>[n.name,n.color])),ie=new Map(e.languages.map(n=>[n.name,n.entersAtSample])),he=$.map((n,d)=>{const x=ie.get(n)??0,p=x<=0?s+vt[d]*.055:y(x),R=x<=0?.275:.25,Y=D(g(t,p,p+R)),K=x<=0?-37:-27,z=At[d],tt=E>0?z/E*100:0,et=kt>0?z/kt*xt:0,Pt=`${F(Math.round(z))} · ${tt.toFixed(1)}%`,Ft=Pt.length*(.6*13),It=et+8+Ft>xt-4,Ae=It?Math.max(et-8-Ft,3):et+8;return{name:n,color:ce.get(n)??"var(--accent)",value:z,sharePct:tt,widthPx:et,valText:Pt,valX:Ae,valInside:It,top:oe[d]*ft,enterAlpha:Y,enterX:K*(1-Y),labelAlpha:1-g(t,f+d*.03,f+d*.03+.12),trackAlpha:1-g(t,f,f+.2)}}),Ct=e.dips.map(n=>{const d=y(n.sampleIndex),x=g(t,d,d+.11),p=g(t,d+.25,d+.35);return{amber:t>=d&&t<d+ua,alpha:x*(1-p),y:7*(1-D(x))-4*p,label:`↘ repo restructure · ${ta(o[n.sampleIndex].date)}`}}),de=Ct.some(n=>n.amber),St=r.hook.prompt,Tt=`scanning ${dt} years of commits · ${bt}`,G=s-.5,pt=s-.1,me=$t(St,0,G),pe=$t(Tt,G,pt),ue=e.repoFullName.split("/").flatMap((n,d)=>d>0?[{text:"/",own:!1},{text:n,own:!0}]:[{text:n,own:!0}]).map((n,d)=>{const x=s-.95+d*.06,p=D(g(t,x,x+.3));return{...n,alpha:p,y:24*(1-p)}}),ge={promptText:St.slice(0,Gt(me,t)),outputText:Tt.slice(0,Gt(pe,t)),caret1:t<G&&Math.sin(t/G*Math.PI*2)>=0?1:0,caret2Gate:g(t,G,G+.025),caret2:t>=pt||Math.sin((t-G)/(pt-G)*Math.PI*2)>=0?1:0,kickerAlpha:g(t,s-.675,s-.425),exitAlpha:1-g(t,s,s+.15),exitY:9*lt(g(t,s,s+.15)),exitScale:1-.03*lt(g(t,s,s+.15)),titleText:`${dt} years of code — ${bt}`},Mt=D(g(t,0,s)),fe=(()=>{const n=t-r.data.finalLock;return n<=0||n>=.19?1:n<.08?1+.04*nt(n/.08):1+.04*(1-ot((n-.08)/.11))})(),xe={value:t>=s?E:Mt*o[0].code,scale:t>=s?fe:.55+.45*Mt,amber:de,kickerAlpha:g(t,s,s+.2)*(1-g(t,m-.05,m+.1)),kickerY:-5*(1-D(g(t,s,s+.2)))},we=I(U/S,0,1),Z=[];for(let n=it;n<=ht;n+=1){const d=Je(ct,n);if(d<0)continue;const x=d/S*(X-2*L);Z.push({label:String(n),left:x,alpha:g(t,s+.1+Z.length*.015,s+.25+Z.length*.015)})}const ye={wipe:D(g(t,s,s+.25)),frac:we,date:Ze(ct,U),playheadAlpha:g(t,s+.175,s+.325),chipAlpha:g(t,s+.2,s+.35),exitAlpha:1-g(t,m-.05,m+.1),carets:e.dips.map(n=>({left:o[n.sampleIndex].dayOffset/S*(X-2*L),alpha:g(t,s+.175,s+.3)}))},Rt=Math.max(...$.map(n=>o[l].languageCode[n]??0),0),Ne=r.morph.ringShares.map((n,d)=>{const x=n.share/100,p=c?{left:L,top:ma,width:X-2*L}:{left:aa+ra,top:sa+le[d]*ft+(ft-Wt)/2,width:Rt>0?(o[l].languageCode[n.name]??0)/Rt*xt:0},R=r.morph.ringShares.slice(0,d).reduce((K,z)=>K+z.share/100*jt,0),Y=Qe(g(t,f,w));return{color:n.color,left:H(p.left,da+R,Y),top:H(p.top,ha,Y),width:H(p.width,x*jt,Y),alpha:1-g(t,w,w+.15)}}),ut=r.morph.ringShares.length,je=r.morph.ringShares.map((n,d)=>{const x=ut>1?d/(ut-1):0;let p=w+(v-.04-w)*(1-(1-x)*(1-x)),R=.2*(1-.8*x);R=Math.min(R,Math.max(v-p,.02)),d===ut-1&&(p=Math.min(p,v-R));const Y=ot(g(t,p,p+R)),K=r.morph.ringShares.slice(0,d).reduce((z,tt)=>z+tt.share,0)/100;return{color:n.color,dash:n.share/100*Zt*Y,rotate:-90+360*K}});let _t=null;if(e.starsNow!=null){const n=o.map((p,R)=>({t:y(R),v:p.stars})).filter(p=>p.v!=null);(n.length===0||n[n.length-1].v!==e.starsNow)&&n.push({t:u,v:e.starsNow});const d=n[0].t;let x=n[0].v;
11for(let p=0;p<n.length-1;p+=1)x=H(n[p].v,n[p+1].v,g(t,n[p].t,n[p+1].t));_t={alpha:g(t,d,d+.15),value:x,brackets:[0,1].map(p=>ot(g(t,d+.025+p*.04,d+.225+p*.04)))}}const J=(n,d=.2)=>{const x=nt(g(t,n,n+d));return{alpha:x,y:11*(1-x)}},Et=e.finale.tableRows.length+2,be=Math.min(.02,Math.max((_-.1-(m+.05))/Math.max(Et-1,1),.005)),ve={head:J(m),rule:J(m+.05),summary:J(m+.1),centerAlpha:g(t,m+.05,m+.2),caption:{...J(m+.05,.1),y:5*(1-nt(g(t,m+.05,m+.15)))},rows:Array.from({length:Et},(n,d)=>{const x=m+.05+d*be,p=nt(g(t,x,x+.1));return{alpha:p,y:5*(1-p)}})},Lt=o[0].code,Ot=o[l].code;return{isCompact:c,t,dataStart:s,mStart:f,raceRows:he,hero:xe,hook:ge,words:ue,dipBeats:Ct,stars:_t,tl:ye,ticks:Z,morphSegs:Ne,arcs:je,finale:ve,ringVisible:t>=w,heroExit:1-g(t,m-.05,m+.1),starsExit:1-g(t,m,m+.15),raceTitleAlpha:D(g(t,s,s+.25))*(1-g(t,f,f+.15)),raceTitleX:-16*(1-D(g(t,s,s+.25))),ariaLabel:`Growth animation: ${e.repoFullName} code lines ${F(Lt)}→${F(Ot)}, ${dt} years`,summary:`${e.repoFullName} grew from ${F(Lt)} code lines on ${o[0].date} to ${F(Ot)} code lines on ${o[l].date}.`}}function re({scene:e,progress:t,playing:r}){const o=qe(X),h=I(t,0,1)*(e.durationMs/1e3),l=ga(e,h);return a.jsxs("div",{className:"growth-wrap",ref:o,children:[a.jsx("p",{className:"visually-hidden",children:l.summary}),a.jsxs("div",{className:"growth-stage",role:"img","aria-label":l.ariaLabel,children:[a.jsx(xa,{scene:e,f:l}),a.jsx(Na,{scene:e,f:l}),a.jsx(ya,{scene:e,f:l}),a.jsx(wa,{f:l}),a.jsx(fa,{f:l}),r===!1?a.jsx("div",{className:"growth-paused","aria-hidden":"true",children:a.jsx("span",{children:"▶"})}):null]})]})}function fa({f:e}){const t=e.hook;return a.jsx("div",{className:"growth-layer",children:a.jsxs("div",{className:"growth-hook",style:{...j(t.exitAlpha),transform:`translateY(${t.exitY}px) scale(${t.exitScale})`},children:[a.jsxs("div",{className:"growth-term",children:[a.jsxs("div",{className:"growth-term-line",children:[a.jsx("span",{className:"growth-term-prompt",children:"$"}),a.jsx("span",{className:"growth-term-cmd",children:t.promptText}),a.jsx("span",{className:"growth-term-caret",style:j(t.caret1)})]}),a.jsxs("div",{className:"growth-term-line",children:[a.jsx("span",{className:"growth-term-out",children:t.outputText}),a.jsx("span",{className:"growth-term-caret-gate",style:j(t.caret2Gate),children:a.jsx("span",{className:"growth-term-caret",style:j(t.caret2)})})]})]}),a.jsx("h2",{className:"growth-repo-name",children:e.words.map((r,o)=>a.jsx("span",{style:{...j(r.alpha),transform:`translateY(${r.y}px)`},children:r.text},o))}),a.jsx("div",{className:"growth-title-kicker",style:j(t.kickerAlpha),children:t.titleText})]})})}function xa({scene:e,f:t}){var c;const r=X-2*L,o=t.tl.frac*r,h=X-L-100-(L-50),l=t.t>=t.mStart;return a.jsxs("div",{className:"growth-layer",children:[a.jsxs("div",{className:"growth-hero-zone",style:j(t.heroExit),children:[a.jsxs("div",{className:"growth-kicker",style:{...j(t.hero.kickerAlpha),transform:`translateY(${t.hero.kickerY}px)`},children:[e.repoFullName," · CODE LINES"]}),a.jsx("div",{className:"growth-hero-num growth-num",style:{color:t.hero.amber?"var(--warn)":"var(--fg)",transform:`scale(${t.hero.scale})`},children:F(Math.round(t.hero.value))}),a.jsx("div",{className:"growth-dip-row",children:t.dipBeats.map((s,u)=>a.jsx("span",{className:"growth-dip-note",style:{...j(s.alpha),transform:`translateY(${s.y}px)`},children:s.label},u))})]}),!t.isCompact&&a.jsxs("div",{className:"growth-race-zone",children:[a.jsx("div",{className:"growth-race-title",style:{...j(t.raceTitleAlpha),transform:`translateX(${t.raceTitleX}px)`},children:"CODE LINES BY LANGUAGE"}),a.jsx("div",{className:"growth-race-plot",children:t.raceRows.map(s=>
11a.jsxs("div",{className:"growth-race-row",style:{top:s.top,...j(s.enterAlpha),transform:`translateX(${s.enterX}px)`},children:[a.jsx("span",{className:"growth-race-name",style:j(s.labelAlpha),children:s.name}),a.jsxs("span",{className:"growth-race-track",style:j(s.trackAlpha),children:[a.jsx("span",{className:"growth-race-bar",style:{width:Math.max(s.widthPx,0),background:s.color,...j(l?0:1)}}),a.jsx("span",{className:"growth-race-val growth-num",style:{transform:`translate(${s.valX}px, -50%)`,color:s.valInside?"#0d1117":void 0,...j(s.labelAlpha)},children:s.valText})]})]},s.name))})]}),t.isCompact&&a.jsx("div",{className:"growth-compact-bar",style:{background:((c=e.acts.morph.ringShares[0])==null?void 0:c.color)??"var(--accent)",...j(D(g(t.t,t.dataStart,t.dataStart+.25))*(l?0:1))}}),!t.isCompact&&a.jsxs("div",{className:"growth-tl-zone",style:j(t.tl.exitAlpha),children:[a.jsx("div",{className:"growth-tl-track",style:{transform:`scaleX(${t.tl.wipe})`}}),a.jsx("div",{className:"growth-tl-fill",style:{width:`${t.tl.frac*100}%`}}),a.jsx("div",{className:"growth-tl-playhead",style:{left:L+o-1,...j(t.tl.playheadAlpha)}}),a.jsx("div",{className:"growth-tl-chip growth-num",style:{transform:`translateX(${Math.min(o,h)}px)`,...j(t.tl.chipAlpha)},children:t.tl.date}),t.ticks.map(s=>a.jsx("span",{className:"growth-tl-tick",style:{left:L+s.left,transform:"translateX(-50%)",...j(s.alpha)},children:s.label},s.label)),t.tl.carets.map((s,u)=>a.jsx("span",{className:"growth-tl-caret",style:{left:L+s.left,...j(s.alpha)}},u))]}),t.stars&&a.jsxs("div",{className:"growth-stars",style:j(t.stars.alpha*t.starsExit),children:[a.jsx("svg",{className:"growth-star-bracket growth-sb-tl",viewBox:"0 0 32 32","aria-hidden":"true",children:a.jsx("path",{d:"M 30 2 L 12 2 Q 2 2 2 12 L 2 30",pathLength:100,strokeDasharray:100,strokeDashoffset:100*(1-t.stars.brackets[0])})}),a.jsx("svg",{className:"growth-star-bracket growth-sb-br",viewBox:"0 0 32 32","aria-hidden":"true",children:a.jsx("path",{d:"M 2 30 L 20 30 Q 30 30 30 20 L 30 2",pathLength:100,strokeDasharray:100,strokeDashoffset:100*(1-t.stars.brackets[1])})}),a.jsx("span",{className:"growth-star-glyph",children:"★"}),a.jsx("span",{className:"growth-star-label",children:"STARS"}),a.jsx("span",{className:"growth-star-value growth-num",children:F(Math.round(t.stars.value))})]})]})}function wa({f:e}){return a.jsx("div",{className:"growth-layer",children:e.morphSegs.map((t,r)=>a.jsx("div",{className:"growth-stack-seg",style:{left:t.left,top:t.top,width:Math.max(t.width,0),background:t.color,...j(t.alpha)}},r))})}function ya({scene:e,f:t}){return a.jsxs(a.Fragment,{children:[a.jsx("svg",{className:"growth-ring",width:q,height:q,viewBox:"0 0 520 520",style:{left:te,top:ee,...j(t.ringVisible?1:0)},"aria-hidden":"true",children:t.arcs.map((r,o)=>a.jsx("circle",{cx:260,cy:260,r:Qt,fill:"none",stroke:r.color,strokeWidth:na,strokeDasharray:`${r.dash.toFixed(2)} ${Zt.toFixed(2)}`,transform:`rotate(${r.rotate.toFixed(3)} 260 260)`},o))}),a.jsxs("div",{className:"growth-ring-center",style:{left:ae,top:se,...j(t.finale.centerAlpha)},children:[a.jsx("span",{className:"lbl",children:"code"}),a.jsx("strong",{className:"growth-num",children:Xt(e.finale.metrics.code)})]})]})}function Na({scene:e,f:t}){const r=e.finale,o=c=>({...j(t.finale.rows[c].alpha),transform:`translateY(${t.finale.rows[c].y}px)`}),h=(c,s,u=!1)=>a.jsxs("div",{className:u?"growth-fin-metric accent":"growth-fin-metric",children:[a.jsx("span",{className:"lbl",children:c}),a.jsx("span",{className:"val growth-num",children:Xt(s)})]},c),l=(c,s)=>a.jsx("span",{className:s?`growth-fin-td growth-num ${s}`:"growth-fin-td growth-num",children:F(c)});return a.jsxs("div",{className:"growth-fin-card",children:[a.jsxs("div",{className:"growth-fin-head",style:{...j(t.finale.head.alpha),transform:`translateY(${t.finale.head.y}px)`},children:[a.jsx("h2",{className:"growth-fin-repo",children:e.repoFullName}),a.jsxs("span",{className:"growth-fin-meta growth-num",children:[r.refName," · ",r.commitSha12," · ",r.generatedDate]})]}),a.jsx("div",{className:"growth-fin-rule",style:{...j(t.finale.rule.alpha),transform:`translateY(${t.finale.rule.y}px)`}}),a.jsxs("div",{className:"growth-fin-summary",style:{...j(t.finale.summary.alpha),transform:`translateY(${t.finale.summary.y}px)`},children:[h("Code",r.metrics.code,!0),h("Files",r.metrics.files),h("Lines",r.metrics.lines),h("Comments",r.metrics.comments),h("Blanks",r.metrics.blanks)]}),a.jsxs("div",{className:"growth-fin-body",children:[a.jsx("div",{className:"growth-fin-donut-col"}),a.jsxs("div",{className:"growth-fin-table-col",children:[a.jsx("div",{className:"growth-fin-caption",style:{...j(t.finale.caption.alpha),transform:`translateY(${t.finale.caption.y}px)`},children:r.tableCaption}),a.jsxs("div",{className:"growth-fin-tr growth-fin-thead",style:o(0),children:[a.jsx("span",{className:"growth-fin-th lang",children:"Language"}),a.jsx("span",{className:"growth-fin-th",children:"Files"}),a.jsx("span",{className:"growth-fin-th",children:"Lines"}),a.jsx("span",{className:"growth-fin-th",children:"Code"}),a.jsx("span",{className:"growth-fin-th",children:"Comments"}),a.jsx("span",{className:"growth-fin-th",children:"Blanks"})]}),r.tableRows.map((c,s)=>
11a.jsxs("div",{className:c.merged?"growth-fin-tr other":"growth-fin-tr",style:o(s+1),children:[a.jsxs("span",{className:"growth-fin-lang",children:[a.jsx("span",{className:"growth-fin-swatch",style:{background:c.color}}),c.name]}),l(c.files),l(c.lines),l(c.code,"code"),l(c.comments),l(c.blanks)]},c.name)),a.jsxs("div",{className:"growth-fin-tr total",style:o(r.tableRows.length+1),children:[a.jsx("span",{className:"growth-fin-lang",children:"TOTAL"}),l(r.totalRow.files),l(r.totalRow.lines),l(r.totalRow.code,"code"),l(r.totalRow.comments),l(r.totalRow.blanks)]})]})]})]})}const ja={loadRasterizer:()=>wt(()=>import("./index-CgJtiJsK.js"),[]),loadEncoder:()=>wt(()=>import("./gifenc.esm-sOOlYEo8.js"),[])},V=640,W=360,ba=100,Yt=100,zt=60,va=1.2,Aa=8.8,ka=10,Ca=35,Sa=256;function Ta(e){return e==="compact"?Array.from({length:zt},(t,r)=>(va+r/(zt-1)*Aa)/ka):Array.from({length:Yt},(t,r)=>r/(Yt-1))}function Ma(){const e=document.createElement("div");return e.setAttribute("aria-hidden","true"),e.style.position="fixed",e.style.top="0",e.style.left="-99999px",e.style.width=`${V}px`,e.style.pointerEvents="none",e.style.setProperty("--growth-scale","0.5"),e}async function Ra(e,t,r,o={},h=ja){var f,v;const l=Ta(o.variant??e.variant),c=l.length,s=o.signal,u=Ma();document.body.appendChild(u);try{const m=()=>new DOMException("Aborted","AbortError");if(s!=null&&s.aborted)throw m();const[_,T,{renderToString:w}]=await Promise.all([h.loadRasterizer(),h.loadEncoder(),wt(()=>import("./vendor-react-DbFVZiS9.js").then(i=>i.s),[])]),S=document.createElement("canvas");S.width=V,S.height=W;const y=S.getContext("2d");if(!y)throw new Error("growth GIF export: no 2D canvas context");const M=T.GIFEncoder({auto:!0}),O=async i=>{u.setAttribute("data-frame",String(i)),u.setAttribute("data-progress",String(l[i])),u.innerHTML=w(b.createElement(re,{scene:e,progress:l[i]}));const k=await _.toCanvas(u,{pixelRatio:1,style:{position:"static",left:"0",top:"0"}});return y.clearRect(0,0,V,W),y.drawImage(k,0,0,V,W),y.getImageData(0,0,V,W)},A=Math.min(Ca,c-1),N=await O(A),C=T.quantize(N.data,Sa);for(let i=0;i<c;i+=1){if(s!=null&&s.aborted)throw m();const k=i===A?N:await O(i),E=T.applyPalette(k.data,C);M.writeFrame(E,V,W,{palette:C,delay:ba}),(f=o.onProgress)==null||f.call(o,i+1,c),await new Promise(U=>setTimeout(U,0))}return M.finish(),{blob:new Blob([new Uint8Array(M.bytes())],{type:"image/gif"}),filename:`octocounts-${t}-${r}-growth.gif`}}finally{(v=u.parentNode)==null||v.removeChild(u)}}const _a=600,Ea=.85,La=1e4,Oa=1e-9;function Pa(e,t=!1){return{durationMs:Number.isFinite(e)&&e>0?e:La,progress:t?1:Ea,playing:!1,holdMs:0}}function Fa(e,t,r){if(!e.playing||!Number.isFinite(t)||t<0||!(e.durationMs>0))return e;let{progress:o,holdMs:h}=e,l=t;for(let c=0;l>0&&c<1e3;c+=1){if(o>=1){if(!r.loop)return{...e,progress:1,playing:!1,holdMs:0};const f=Math.max(0,_a-h);l<f?(h+=l,l=0):(l-=f,o=0,h=0);continue}const s=(1-o)*e.durationMs,u=Math.min(l,s);if(o+=u/e.durationMs,l-=u,1-o<Oa&&(o=1),o>=1&&!r.loop)return{...e,progress:1,playing:!1,holdMs:0}}return{...e,progress:Math.min(o,1),holdMs:h,playing:!0}}function Ia(e,t){const r=Number.isFinite(t)?Math.min(1,Math.max(0,t)):e.progress;return{...e,progress:r,holdMs:0}}function Bt(e){return{...e,progress:0,playing:!0,holdMs:0}}function Da(e,t){const[r]=b.useState(()=>{const A=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;return Pa(e,A)}),o=b.useRef(r),[h,l]=b.useState({progress:r.progress,playing:r.playing}),c=b.useRef(t);c.current=t;const s=b.useRef(0),u=b.useRef(0),f=b.useRef(!1),v=b.useRef(!1),m=b.useCallback(()=>{if(!f.current)return;const{progress:A,playing:N}=o.current;l(C=>C.progress===A&&C.playing===N?C:{progress:A,playing:N})},[]),_=b.useCallback(()=>{s.current!==0&&(cancelAnimationFrame(s.current),s.current=0)},[]),T=b.useCallback(()=>{if(s.current!==0)return;u.current=performance.now();const A=N=>{var P;s.current=0;const C=Fa(o.current,N-u.current,{loop:((P=c.current)==null?void 0:P.loop)??!0});u.current=N,o.current=C,m(),C.playing&&(s.current=requestAnimationFrame(A))};s.current=requestAnimationFrame(A)},[m]),w=b.useCallback(()=>{o.current={...o.current,playing:!1},_(),m()},[_,m]),S=b.useCallback(()=>{const A=o.current;A.playing||(o.current=!v.current||A.progress>=1?Bt(A):{...A,playing:!0},v.current=!0,m(),T())},[T,m]),y=b.useCallback(()=>{o.current.playing?w():S()},[w,S]),M=b.useCallback(A=>{v.current=!0,o.current=Ia(o.current,A),m()},[m]),O=b.useCallback(()=>{v.current=!0,o.current=Bt(o.current),m(),T()},[T,m]);return b.useEffect(()=>{f.current=!0;const A=()=>{document.hidden&&w()};return document.addEventListener("visibilitychange",A),()=>{f.current=!1,document.removeEventListener("visibilitychange",A),_()}},[w,_]),{progress:h.progress,playing:h.playing,play:S,pause:w,toggle:y,seek:M,replay:O}}const $a=5e3;function Ga({scene:e}){const{t}=Ut(),[r,o]=b.useState(!0),h=Da(e.durationMs,{loop:r}),[l]=b.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches),c=b.useRef(!1),s=()=>{c.current||(c.current=!0,at(st.growthPlayed,{provider:e.provider,repo:e.repoFullName}))},[u,f]=b.useState("full"),[v,m]=b.useState(!1),[_,T]=b.useState(0),[w,S]=b.useState(null),y=b.useRef(null),M=async()=>
11{if(v)return;m(!0),S(null),T(0),h.pause();const N=new AbortController;y.current=N;const[C="repo",P=C]=e.repoFullName.split("/");try{const{blob:i,filename:k}=await Ra(e,C,P,{variant:u,signal:N.signal,onProgress:(U,Q)=>T(Q>0?U/Q:0)}),E=URL.createObjectURL(i);_e(E,k),window.setTimeout(()=>URL.revokeObjectURL(E),5e3),at(st.growthGifExported,{variant:u,provider:e.provider,repo:e.repoFullName})}catch(i){i instanceof DOMException&&i.name==="AbortError"?at(st.growthExportCancelled,{variant:u,provider:e.provider,repo:e.repoFullName}):S(t("growth.animation.exportFailed"))}finally{y.current=null,m(!1),T(0)}},O=t(h.playing?"growth.animation.pauseAria":"growth.animation.playAria"),A=e.samples.some(N=>typeof N.stars=="number");return a.jsxs(a.Fragment,{children:[a.jsx(re,{scene:e,progress:h.progress,playing:h.playing}),a.jsxs("div",{className:"growth-controls",children:[a.jsxs("button",{className:"copybtn",type:"button","aria-label":O,onClick:()=>{s(),h.toggle()},children:[h.playing?a.jsx(Fe,{size:13}):a.jsx(Te,{size:13})," ",t(h.playing?"growth.animation.pause":"growth.animation.play")]}),a.jsxs("button",{className:"copybtn",type:"button","aria-label":t("growth.animation.replayAria"),onClick:()=>{s(),h.replay()},children:[a.jsx(Me,{size:13})," ",t("growth.animation.replay")]}),a.jsxs("label",{className:"growth-loop",children:[a.jsx("input",{type:"checkbox",checked:r,onChange:N=>{const C=N.currentTarget.checked;o(C),at(st.growthLoopToggled,{loop:C,provider:e.provider,repo:e.repoFullName})}}),t("growth.animation.loop")]}),a.jsx("input",{className:"growth-seek",type:"range",min:0,max:1,step:.001,value:h.progress,onChange:N=>h.seek(Number(N.currentTarget.value)),"aria-label":t("growth.animation.seekAria")})]}),a.jsxs("div",{className:"growth-export",children:[a.jsxs("button",{className:"copybtn",type:"button",disabled:v,onClick:()=>void M(),children:[v?a.jsx(yt,{className:"spin",size:13}):a.jsx(Re,{size:13})," ",v?t("growth.animation.exporting",{percent:Math.round(_*100)}):t("growth.animation.exportGif")]}),a.jsxs("span",{className:"growth-variant",role:"group","aria-label":t("growth.animation.exportGif"),children:[a.jsx("button",{type:"button",className:u==="full"?"is-active":void 0,"aria-pressed":u==="full",disabled:v,onClick:()=>f("full"),children:t("growth.animation.exportFull")}),a.jsx("button",{type:"button",className:u==="compact"?"is-active":void 0,"aria-pressed":u==="compact",disabled:v,onClick:()=>f("compact"),children:t("growth.animation.exportCompact")})]}),v?a.jsxs("button",{className:"copybtn",type:"button",onClick:()=>{var N;return(N=y.current)==null?void 0:N.abort()},children:[a.jsx(De,{size:13})," ",t("growth.animation.cancelExport")]}):null,w?a.jsx("span",{className:"growth-export-error",role:"alert",children:w}):null]}),e.modeledLanguageSplit?a.jsx("p",{className:"growth-note",children:t("growth.animation.modeledNote")}):null,e.finaleDiverged?a.jsx("p",{className:"growth-note",children:t("growth.animation.divergedNote")}):null,l?a.jsx("p",{className:"growth-note",children:t("growth.animation.reducedMotionNote")}):null,a.jsxs("details",{className:"growth-history-data",children:[a.jsx("summary",{children:t("growth.animation.historyData")}),a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:t("growth.animation.historyDate")}),a.jsx("th",{children:t("growth.animation.historyCode")}),A?a.jsx("th",{children:t("growth.animation.historyStars")}):null]})}),a.jsx("tbody",{children:e.samples.map(N=>a.jsxs("tr",{children:[a.jsx("td",{children:N.date}),a.jsx("td",{children:F(N.code)}),A?a.jsx("td",{children:N.stars==null?"—":F(N.stars)}):null]},N.date))})]})]})]})}function Xa({report:e}){var S;const{t}=Ut(),r=ke(),o=Oe(),h=e.repository.owner,l=e.repository.name,c=Dt({queryKey:["repo-history",o,h,l],queryFn:()=>Ee(o,h,l),staleTime:60*1e3,retry:!1,refetchInterval:y=>{var M;return(M=y.state.data)!=null&&M.slocBackfillInProgress?$a:!1}}),s=c.data,f=Dt({queryKey:["canonical-report",o,h,l],queryFn:()=>Le(o,h,l),staleTime:60*1e3,retry:!1}).data??e,v=b.useMemo(()=>Object.fromEntries(f.languages.map(y=>[y.name,Ce(Se(y.name),r)])),[f.languages,r]),m=b.useMemo(()=>!s||s.slocPoints.length===0?null:Xe({report:f,history:s,languageColors:v}),[s,f,v]),_=(S=m==null?void 0:m.samples[m.samples.length-1])==null?void 0:S.code,T=m!==null&&e.total.code!==_,w=t("growth.animation.title");return a.jsxs("section",{className:"growth-section","aria-label":w,children:[a.jsxs("div",{className:"growth-head",children:[a.jsx("h2",{children:w}),a.jsxs("span",{children:[t("growth.animation.subtitle"),T?a.jsxs("span",{className:"growth-this-report",children:[" · ",t("growth.animation.thisReport",{count:F(e.total.code)})]}):null]})]}),c.isLoading?a.jsxs("div",{className:"growth-skeleton",role:"status",children:[a.jsx(yt,{className:"spin",size:16,"aria-hidden":"true"}),a.jsx("span",{className:"visually-hidden",children:t("growth.animation.loadingHistory")})]}):c.isError?a.jsxs("div",{className:"growth-empty",children:[a.jsx("p",{children:t("growth.animation.unavailable")}),a.jsx("button",{className:"copybtn",type:"button",onClick:()=>void c.refetch(),children:t("error.retry")})]}):!m||!s?a.jsxs("div",{className:"growth-empty",children:[a.jsx("p",{children:a.jsx("strong",{children:t("growth.animation.noHistory")})}),a.jsx("p",{className:"growth-note",children:t("growth.animation.noHistoryHint")})]}):a.jsxs(a.Fragment,{children:[s.slocBackfillInProgress?a.jsxs("p",{className:"growth-note growth-gathering",children:[a.jsx(yt,{className:"spin",size:13})," ",t("growth.animation.gatheringHistory")]}):null,a.jsx(Ga,{scene:m})]})]})}export{Xa as GrowthSection};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.