var T=Object.defineProperty;var u=(e,r)=>T(e,"name",{value:r,configurable:!0});import{x as t,aa as k,a7 as z,n as L}from"../packem_chunks/bin.js";import{$ as N}from"./spinners-f91Rbo99-Bjf3NcO0.js";var q=Object.defineProperty,y=u((e,r)=>q(e,"name",{value:r,configurable:!0}),"c$1"),w=Object.defineProperty,d=y((e,r)=>w(e,"name",{value:r,configurable:!0}),"c"),B=Object.defineProperty,E=d((e,r)=>B(e,"name",{value:r,configurable:!0}),"l");const I=100,D=2147483647,p={delta:0,frame:0,time:0};function f(e){const{interval:r=I,isActive:n=!0}=e??{},a=l(r),{renderThrottleMs:o,subscribe:x}=t.useContext(k),[i,S]=t.useState(0),[$,g]=t.useState(p),m=t.useRef(0),v=t.useRef(0),h=t.useRef({isActive:n,resetKey:i,safeInterval:a}),b=h.current,C=n&&(a!==b.safeInterval||!b.isActive||i!==b.resetKey),A=t.useCallback(()=>{S(c=>c+1)},[]);return t.useLayoutEffect(()=>{if(!n)return;g(p);let c=0;const{startTime:O,unsubscribe:F}=x(s=>{if(o>0&&s<m.current)return;const P=s-c,K=s-v.current;v.current=s,m.current=s+o,g({delta:K,frame:Math.floor(P/a),time:P})},a);return c=O,v.current=O,m.current=c+o,F},[a,n,x,o,i]),t.useLayoutEffect(()=>{h.current={isActive:n,resetKey:i,safeInterval:a}},[n,a,i]),C?{...p,reset:A}:{...$,reset:A}}u(f,"o");y(f,"N");d(f,"S");E(f,"useAnimation");function l(e){return Number.isFinite(e)?Math.min(D,Math.max(1,e)):I}u(l,"d");y(l,"C");d(l,"F");E(l,"normalizeAnimationInterval");var G=Object.defineProperty,M=u((e,r)=>G(e,"name",{value:r,configurable:!0}),"t"),H=Object.defineProperty,R=M((e,r)=>H(e,"name",{value:r,configurable:!0}),"t"),J=Object.defineProperty,Q=R((e,r)=>J(e,"name",{value:r,configurable:!0}),"t");function j({type:e="dots"}){const r=N(e),{frame:n}=f({interval:r.interval});return z.jsx(L,{children:r.frames[n%r.frames.length]})}u(j,"n");M(j,"l");R(j,"n");Q(j,"Spinner");export{j as n};
