import{aA as F,aB as H,aK as ae,cl as V,d2 as T,bq as se,r as y,cA as W,L as le,aV as te,aC as P,K as d,d as _,o as q,c as D,aD as N,$ as m,a as e,aE as J,ds as L,aP as ie,g as I,n as oe,t as ne,f as w,w as O,bS as de,aT as ce,S as re,aS as ue,x as pe,a5 as me,dt as ve,aF as be,aJ as he,__tla as fe}from"./index-04f8d540.js";let j,z,Ce=Promise.all([(()=>{try{return fe}catch{}})()]).then(async()=>{const E=v=>typeof se(v),G=F({accordion:Boolean,modelValue:{type:H([Array,String,Number]),default:()=>ae([])}}),M={[V]:E,[T]:E},S=Symbol("collapseContextKey"),Q=_({name:"ElCollapse"});var R=J(_({...Q,props:G,emits:M,setup(v,{expose:k,emit:h}){const f=v,{activeNames:g,setActiveNames:r}=((t,u)=>{const o=y(W(t.modelValue)),b=c=>{o.value=c;const n=t.accordion?o.value[0]:o.value;u(V,n),u(T,n)};return le(()=>t.modelValue,()=>o.value=W(t.modelValue),{deep:!0}),te(S,{activeNames:o,handleItemClick:c=>{if(t.accordion)b([o.value[0]===c?"":c]);else{const n=[...o.value],K=n.indexOf(c);K>-1?n.splice(K,1):n.push(c),b(n)}}}),{activeNames:o,setActiveNames:b}})(f,h),{rootKls:C}=(()=>{const t=P("collapse");return{rootKls:d(()=>t.b())}})();return k({activeNames:g,setActiveNames:r}),(t,u)=>(q(),D("div",{class:m(e(C))},[N(t.$slots,"default")],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse.vue"]]);const U=F({title:{type:String,default:""},name:{type:H([String,Number]),default:()=>L()},disabled:Boolean}),X=["id","aria-expanded","aria-controls","aria-describedby","tabindex"],Y=["id","aria-hidden","aria-labelledby"],Z=_({name:"ElCollapseItem"});var $=J(_({...Z,props:U,setup(v,{expose:k}){const h=v,{focusing:f,id:g,isActive:r,handleFocus:C,handleHeaderClick:t,handleEnterClick:u}=(i=>{const a=ie(S),s=y(!1),p=y(!1),l=y(L()),x=d(()=>a==null?void 0:a.activeNames.value.includes(i.name));return{focusing:s,id:l,isActive:x,handleFocus:()=>{setTimeout(()=>{p.value?p.value=!1:s.value=!0},50)},handleHeaderClick:()=>{i.disabled||(a==null||a.handleItemClick(i.name),s.value=!1,p.value=!0)},handleEnterClick:()=>{a==null||a.handleItemClick(i.name)}}})(h),{arrowKls:o,headKls:b,rootKls:c,itemWrapperKls:n,itemContentKls:K,scopedContentId:A,scopedHeadId:B}=((i,{focusing:a,isActive:s,id:p})=>{const l=P("collapse"),x=d(()=>[l.b("item"),l.is("active",e(s)),l.is("disabled",i.disabled)]),ee=d(()=>[l.be("item","header"),l.is("active",e(s)),{focusing:e(a)&&!i.disabled}]);return{arrowKls:d(()=>[l.be("item","arrow"),l.is("active",e(s))]),headKls:ee,rootKls:x,itemWrapperKls:d(()=>l.be("item","wrap")),itemContentKls:d(()=>l.be("item","content")),scopedContentId:d(()=>l.b(`content-${e(p)}`)),scopedHeadId:d(()=>l.b(`head-${e(p)}`))}})(h,{focusing:f,isActive:r,id:g});return k({isActive:r}),(i,a)=>(q(),D("div",{class:m(e(c))},[I("button",{id:e(B),class:m(e(b)),"aria-expanded":e(r),"aria-controls":e(A),"aria-describedby":e(A),tabindex:i.disabled?-1:0,type:"button",onClick:a[0]||(a[0]=(...s)=>e(t)&&e(t)(...s)),onKeydown:a[1]||(a[1]=re(ue((...s)=>e(u)&&e(u)(...s),["stop","prevent"]),["space","enter"])),onFocus:a[2]||(a[2]=(...s)=>e(C)&&e(C)(...s)),onBlur:a[3]||(a[3]=s=>f.value=!1)},[N(i.$slots,"title",{},()=>[oe(ne(i.title),1)]),w(e(ce),{class:m(e(o))},{default:O(()=>[w(e(de))]),_:1},8,["class"])],42,X),w(e(ve),null,{default:O(()=>[pe(I("div",{id:e(A),role:"region",class:m(e(n)),"aria-hidden":!e(r),"aria-labelledby":e(B)},[I("div",{class:m(e(K))},[N(i.$slots,"default")],2)],10,Y),[[me,e(r)]])]),_:3})],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse-item.vue"]]);z=be(R,{CollapseItem:$}),j=he($)});export{j as E,Ce as __tla,z as a};
