import{s as b,q as x,v as N,x as C,o as h,h as y,w as v,r as g,i as e,P as q,y as T,A,N as u,W as I,a0 as $,U as D,a4 as F,b as M,J as P,I as H,a5 as V,k as R}from"./B96cjQS3.js";const[O,E]=T("CollapsibleRoot");var S=b({__name:"CollapsibleRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:open"],setup(l,{expose:i,emit:n}){const o=l,s=x(o,"open",n,{defaultValue:o.defaultOpen,passive:o.open===void 0}),{disabled:d,unmountOnHide:p}=N(o);return E({contentId:"",disabled:d,open:s,unmountOnHide:p,onOpenToggle:()=>{d.value||(s.value=!s.value)}}),i({open:s}),C(),(r,f)=>(h(),y(e(q),{as:r.as,"as-child":o.asChild,"data-state":e(s)?"open":"closed","data-disabled":e(d)?"":void 0},{default:v(()=>[g(r.$slots,"default",{open:e(s)})]),_:3},8,["as","as-child","data-state","data-disabled"]))}}),U=S,j=b({inheritAttrs:!1,__name:"CollapsibleContent",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["contentFound"],setup(l,{emit:i}){const n=l,o=i,t=O();t.contentId||=A(void 0,"reka-collapsible-content");const s=u(),{forwardRef:d,currentElement:p}=C(),r=u(0),f=u(0),k=R(()=>t.open.value),m=u(k.value),c=u();I(()=>[k.value,s.value?.present],async()=>{await $();const a=p.value;if(!a)return;c.value=c.value||{transitionDuration:a.style.transitionDuration,animationName:a.style.animationName},a.style.transitionDuration="0s",a.style.animationName="none";const _=a.getBoundingClientRect();f.value=_.height,r.value=_.width,m.value||(a.style.transitionDuration=c.value.transitionDuration,a.style.animationName=c.value.animationName)},{immediate:!0});const w=R(()=>m.value&&t.open.value);return D(()=>{requestAnimationFrame(()=>{m.value=!1})}),F(p,"beforematch",a=>{requestAnimationFrame(()=>{t.onOpenToggle(),o("contentFound")})}),(a,_)=>(h(),y(e(V),{ref_key:"presentRef",ref:s,present:a.forceMount||e(t).open.value,"force-mount":!0},{default:v(({present:B})=>[M(e(q),P(a.$attrs,{id:e(t).contentId,ref:e(d),"as-child":n.asChild,as:a.as,hidden:B?void 0:e(t).unmountOnHide.value?"":"until-found","data-state":w.value?void 0:e(t).open.value?"open":"closed","data-disabled":e(t).disabled?.value?"":void 0,style:{"--reka-collapsible-content-height":`${f.value}px`,"--reka-collapsible-content-width":`${r.value}px`}}),{default:v(()=>[!e(t).unmountOnHide.value||B?g(a.$slots,"default",{key:0}):H("v-if",!0)]),_:2},1040,["id","as-child","as","hidden","data-state","data-disabled","style"])]),_:3},8,["present"]))}}),W=j,J=b({__name:"CollapsibleTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(l){const i=l;C();const n=O();return(o,t)=>(h(),y(e(q),{type:o.as==="button"?"button":void 0,as:o.as,"as-child":i.asChild,"aria-controls":e(n).contentId,"aria-expanded":e(n).open.value,"data-state":e(n).open.value?"open":"closed","data-disabled":e(n).disabled?.value?"":void 0,disabled:e(n).disabled?.value,onClick:e(n).onOpenToggle},{default:v(()=>[g(o.$slots,"default")]),_:3},8,["type","as","as-child","aria-controls","aria-expanded","data-state","data-disabled","disabled","onClick"]))}}),z=J;export{U as C,W as a,z as b};
