1import{r as t,j as e}from"./vendor-react-BfgFmtGS.js";import{s as n}from"./windowResizeSubscriptions-C3xwW4pN.js";import{s as r}from"./documentVisibilitySubscriptions-CqVNm4Da.js";import{g as i}from"./mediaQueryStore-tM2KFt8V.js";import{s as a,g as o}from"./nativeAppStateSubscriptions-Cv_2m-ZS.js";import{a as s}from"./startup-platform-OWIpYyjW.js";function c(){const c=t.useRef(null),m=t.useRef([]),h=t.useRef(0);return t.useEffect(()=>{const t=c.current;if(!t)return;const e=t.getContext("2d");if(!e)return;const u=i("(prefers-reduced-motion: reduce)"),d=i("(max-width: 767px)"),l=navigator.connection,f="number"==typeof navigator.hardwareConcurrency&&navigator.hardwareConcurrency<=4,p=!(u||d||s()||(null==l?void 0:l.saveData)||f);let w=0,g=!1;const v=n=>{e.clearRect(0,0,t.width,t.height);for(const t of m.current){const r=p?Math.sin(n*t.twinkleSpeed+t.twinkleOffset):0,i=t.opacity+.3*r;e.beginPath(),e.arc(t.x,t.y,t.size,0,2*Math.PI),e.fillStyle=`rgba(255, 255, 255, ${Math.max(.1,Math.min(1,i))})`,e.fill()}},M=()=>{t.width=window.innerWidth,t.height=window.innerHeight,(()=>{const e=[],n=Math.min(220,Math.floor(t.width*t.height/1e4));for(let r=0;r<n;r++)e.push({x:Math.random()*t.width,y:Math.random()*t.height,size:2*Math.random()+.5,opacity:.5*Math.random()+.3,twinkleSpeed:.002*Math.random()+.001,twinkleOffset:Math.random()*Math.PI*2});m.current=e})(),v(performance.now())},y=t=>{g&&(h.current=requestAnimationFrame(y),t-w<50||(w=t,v(t)))},x=()=>{const t=p&&"visible"===document.visibilityState&&o();t!==g&&(g=t,g?(w=0,h.current=requestAnimationFrame(y)):cancelAnimationFrame(h.current))};M();const b=n(M),j=r(x),S=a(x);return x(),()=>{g=!1,b(),j(),S(),cancelAnimationFrame(h.current)}},[]),e.jsx("div",{className:"fixed inset-0 pointer-events-none overflow-hidden",style:{zIndex:-1,height:"100dvh"},children:e.jsx("canvas",{ref:c,className:"absolute inset-0 w-full h-full"})})}export{c as StarryBackground};
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.