import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{r as n}from"./index-CqIc3cxq.js";import{a as d}from"./index-CdzVFL-Z.js";import{c as f}from"./misc-W4055b-0.js";function j({className:r,children:t="Loading"}){const{reducedMotion:s}=d();return s==="reduce"?e.jsx("div",{className:"animate-pulse",children:t}):e.jsxs("div",{className:f("flex items-center gap-2 font-mono text-sm font-medium uppercase",r),role:"status",children:[e.jsx("div",{"aria-hidden":"true",children:e.jsx(i,{})}),t,e.jsx("div",{"aria-hidden":"true",children:e.jsx(i,{})})]})}const a="█<▓█ ▒░/▒░ █░>▒▓/ █▒▒ ▓▒▓/█<░▒ ▓/░>",c=()=>a[Math.floor(Math.random()*a.length)];function i(){const[r,t]=n.useState(a[0]),[s,o]=n.useState(a[1]);return m(()=>{t(c()),o(c())},80),e.jsxs("span",{children:[r,s]})}function m(r,t=1e3){const s=n.useRef(null);n.useEffect(()=>{s.current=r},[r]),n.useEffect(()=>{function o(){s.current?.()}if(t!==null){const u=setInterval(o,t);return()=>clearInterval(u)}},[t])}export{j as L};
//# sourceMappingURL=loading-CDNzW5oO.js.map
