import{r as e,j as t,v as a,c as s,D as n,i as r}from"./vendor-react-Co0R0q1H.js";import{c as i,A as l,m as o,bn as c}from"./index-nE6cslhy.js";import{C as d}from"./chevron-right-DeJGgnwG.js";const m=i("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),u=e.memo(function({ranges:i,selectedIndex:u,onSelect:p,isPending:x,size:f="default"}){var h;const y=e.useRef(null),b=u>0,v=u<i.length-1,g=(null==(h=i[u])?void 0:h.label)??"—",j="sm"===f,w=(e,t)=>{var a;const s="left"===e?6:-6;null==(a=y.current)||a.animate([{opacity:1,transform:"translateX(0)"},{opacity:0,transform:`translateX(${s}px)`}],{duration:80,easing:"ease-out"}),setTimeout(()=>{var e;t(),null==(e=y.current)||e.animate([{opacity:0,transform:`translateX(${-s}px)`},{opacity:1,transform:"translateX(0)"}],{duration:80,easing:"ease-out"})},80)},N=()=>b&&w("left",()=>p(u-1)),_=()=>v&&w("right",()=>p(u+1));return t.jsx(a,{className:"relative inline-flex",children:({open:e,close:a})=>t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:s("inline-flex items-center rounded-full bg-surface","shadow-[var(--neo-outer-sm)]",j?"gap-0.5 p-0.5":"gap-0.5 p-1",x&&"opacity-70"),children:[t.jsx("button",{type:"button",onClick:N,disabled:!b,"aria-label":"Previous",className:s("flex items-center justify-center rounded-full transition-all duration-100","text-fg-muted hover:text-fg-primary active:scale-90","disabled:opacity-25 disabled:pointer-events-none",j?"w-5 h-5":"w-6 h-6"),children:t.jsx(m,{className:j?"w-3 h-3":"w-3.5 h-3.5"})}),t.jsx(n,{className:s("rounded-full cursor-pointer transition-all","bg-surface shadow-[inset_0_0_0_1.5px_var(--sys-blue)]",j?"px-2.5 py-1":"px-3 py-1.5"),children:t.jsx("span",{ref:y,className:s("block font-semibold text-fg-primary tabular-nums select-none",j?"min-w-[1.5rem] text-[11px]":"min-w-[2rem] text-xs","text-center"),children:g})}),t.jsx("button",{type:"button",onClick:_,disabled:!v,"aria-label":"Next",className:s("flex items-center justify-center rounded-full transition-all duration-100","text-fg-muted hover:text-fg-primary active:scale-90","disabled:opacity-25 disabled:pointer-events-none",j?"w-5 h-5":"w-6 h-6"),children:t.jsx(d,{className:j?"w-3 h-3":"w-3.5 h-3.5"})})]}),t.jsx(l,{children:e&&t.jsx(r,{static:!0,anchor:"bottom",className:"z-50 mt-2",children:t.jsx(o.div,{initial:{opacity:0,y:-4,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:c.dropdown,className:s("surface-elevated radius-inset p-1","shadow-[var(--neo-outer)]"),children:t.jsx("div",{className:"grid grid-cols-4 gap-0.5",children:i.map((e,n)=>t.jsx("button",{type:"button",onClick:()=>{n!==u&&p(n),a()},className:s("px-2.5 py-1.5 radius-control text-xs font-medium transition-colors",n===u?"shadow-[inset_0_0_0_1.5px_var(--sys-blue)] text-fg-primary":"text-fg-secondary hover:bg-overlay-soft"),children:e.label},e.label))})})})})]})})});export{m as C,u as T};
