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