import{r as p,j as d,R as s}from"./app-BGey7YPf.js";import{P as D,u as v,e as M}from"./button-D5r5edT8.js";import{c as O}from"./index-BFyaOBDQ.js";var j=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),L="VisuallyHidden",E=p.forwardRef((t,n)=>d.jsx(D.span,{...t,ref:n,style:{...j,...t.style}}));E.displayName=L;var H=E;function Y(t){const n=t+"CollectionProvider",[N,y]=O(n),[A,u]=N(n,{collectionRef:{current:null},itemMap:new Map}),C=c=>{const{scope:e,children:i}=c,o=s.useRef(null),r=s.useRef(new Map).current;return d.jsx(A,{scope:e,itemMap:r,collectionRef:o,children:i})};C.displayName=n;const f=t+"CollectionSlot",w=M(f),R=s.forwardRef((c,e)=>{const{scope:i,children:o}=c,r=u(f,i),l=v(e,r.collectionRef);return d.jsx(w,{ref:l,children:o})});R.displayName=f;const m=t+"CollectionItemSlot",x="data-radix-collection-item",T=M(m),S=s.forwardRef((c,e)=>{const{scope:i,children:o,...r}=c,l=s.useRef(null),I=v(e,l),a=u(m,i);return s.useEffect(()=>(a.itemMap.set(l,{ref:l,...r}),()=>void a.itemMap.delete(l))),d.jsx(T,{[x]:"",ref:I,children:o})});S.displayName=m;function _(c){const e=u(t+"CollectionConsumer",c);return s.useCallback(()=>{const o=e.collectionRef.current;if(!o)return[];const r=Array.from(o.querySelectorAll(`[${x}]`));return Array.from(e.itemMap.values()).sort((a,h)=>r.indexOf(a.ref.current)-r.indexOf(h.ref.current))},[e.collectionRef,e.itemMap])}return[{Provider:C,Slot:R,ItemSlot:S},_,y]}var P=p.createContext(void 0);function k(t){const n=p.useContext(P);return t||n||"ltr"}export{H as R,E as V,j as a,Y as c,k as u};
