import{r as o,R as f}from"./components-tSF29mDa.js";import{Y as m,y as v,n as x,a as C,K as g,o as h}from"./focus-management-CC5qaTLR.js";let E=o.createContext(void 0);function $(){return o.useContext(E)}let c=o.createContext(null);c.displayName="DescriptionContext";function p(){let r=o.useContext(c);if(r===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,p),e}return r}function S(){var r,e;return(e=(r=o.useContext(c))==null?void 0:r.value)!=null?e:void 0}function T(){let[r,e]=o.useState([]);return[r.length>0?r.join(" "):void 0,o.useMemo(()=>function(t){let i=h(l=>(e(n=>[...n,l]),()=>e(n=>{let a=n.slice(),u=a.indexOf(l);return u!==-1&&a.splice(u,1),a}))),s=o.useMemo(()=>({register:i,slot:t.slot,name:t.name,props:t.props,value:t.value}),[i,t.slot,t.name,t.props,t.value]);return f.createElement(c.Provider,{value:s},t.children)},[e])]}let b="p";function w(r,e){let t=o.useId(),i=$(),{id:s=`headlessui-description-${t}`,...l}=r,n=p(),a=v(e);x(()=>n.register(s),[s,n.register]);let u=C({...n.slot,disabled:i||!1}),d={ref:a,...n.props,id:s};return g()({ourProps:d,theirProps:l,slot:u,defaultTag:b,name:n.name||"Description"})}let D=m(w),j=Object.assign(D,{});export{T as H,j as M,$ as a,S as w};
