import{c as e,A as a,m as t,ba as s}from"./index-ltw-H9qF.js";import{r as n,j as r,v as i,c as l,D as o,i as c}from"./vendor-react-LhvuxEgB.js";import{b as d}from"./node-types-fLU1dB-W.js";import{C as m}from"./chevron-right-myprvFMS.js";const u=e("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),p=n.memo(function({ranges:e,selectedIndex:u,onSelect:p,isPending:x,size:f="default"}){var h;const y=n.useRef(null),b=u>0,g=u<e.length-1,v=(null==(h=e[u])?void 0:h.label)??"—",j="sm"===f,w=(e,a)=>{var t;const s="left"===e?6:-6;null==(t=y.current)||t.animate([{opacity:1,transform:"translateX(0)"},{opacity:0,transform:`translateX(${s}px)`}],{duration:80,easing:"ease-out"}),setTimeout(()=>{var e;a(),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)),k=()=>g&&w("right",()=>p(u+1));return r.jsx(i,{className:"relative inline-flex",children:({open:n,close:i})=>r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:l("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:[r.jsx("button",{type:"button",onClick:N,disabled:!b,"aria-label":"Previous",className:l("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:r.jsx(d,{className:j?"w-3 h-3":"w-3.5 h-3.5"})}),r.jsx(o,{className:l("rounded-full cursor-pointer transition-all","bg-surface shadow-[var(--neo-toggle-raised)]",j?"px-2.5 py-1":"px-3 py-1.5"),children:r.jsx("span",{ref:y,className:l("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:v})}),r.jsx("button",{type:"button",onClick:k,disabled:!g,"aria-label":"Next",className:l("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:r.jsx(m,{className:j?"w-3 h-3":"w-3.5 h-3.5"})})]}),r.jsx(a,{children:n&&r.jsx(c,{static:!0,anchor:"bottom",className:"z-50 mt-2",children:r.jsx(t.div,{initial:{opacity:0,y:-4,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:s.dropdown,className:l("surface-elevated radius-inset p-1","shadow-[var(--neo-outer)]"),children:r.jsx("div",{className:"grid grid-cols-4 gap-0.5",children:e.map((e,a)=>r.jsx("button",{type:"button",onClick:()=>{a!==u&&p(a),i()},className:l("px-2.5 py-1.5 radius-control text-xs font-medium transition-colors",a===u?"bg-sys-blue text-white":"text-fg-secondary hover:bg-overlay-soft"),children:e.label},e.label))})})})})]})})});export{u as M,p as T};
