import e from"../_util/classNames.mjs";import t from"../_util/props-util/initDefaultProps.mjs";import n from"../config-provider/hooks/useConfigInject.mjs";import r from"../vc-util/devWarning.mjs";import{collapsePanelProps as i}from"./commonProps.mjs";import a from"./PanelContent.mjs";import{Transition as o,createVNode as s,defineComponent as c,vShow as l,withDirectives as u}from"vue";var d=c({compatConfig:{MODE:3},name:`ACollapsePanel`,inheritAttrs:!1,props:t(i(),{showArrow:!0,isActive:!1,onItemClick(){},headerClass:``,forceRender:!1}),slots:Object,setup(t,{slots:i,emit:c,attrs:d}){r(t.disabled===void 0,`Collapse.Panel`,'`disabled` is deprecated. Please use `collapsible="disabled"` instead.');let{prefixCls:f}=n(`collapse`,t),p=()=>{c(`itemClick`,t.panelKey)},m=e=>{(e.key===`Enter`||e.keyCode===13||e.which===13)&&p()};return()=>{let{header:n=i.header?.(),headerClass:r,isActive:c,showArrow:h,destroyInactivePanel:g,accordion:_,forceRender:v,openAnimation:y,expandIcon:b=i.expandIcon,extra:x=i.extra?.(),collapsible:S}=t,C=S===`disabled`,w=f.value,T=e(`${w}-header`,{[r]:r,[`${w}-header-collapsible-only`]:S===`header`,[`${w}-icon-collapsible-only`]:S===`icon`}),E=e({[`${w}-item`]:!0,[`${w}-item-active`]:c,[`${w}-item-disabled`]:C,[`${w}-no-arrow`]:!h,[`${d.class}`]:!!d.class}),D=s(`i`,{class:`arrow`},null);h&&typeof b==`function`&&(D=b(t));let O=u(s(a,{prefixCls:w,isActive:c,forceRender:v,role:_?`tabpanel`:null},{default:i.default}),[[l,c]]),k={appear:!1,css:!1,...y};return s(`div`,{...d,class:E},[s(`div`,{class:T,onClick:()=>![`header`,`icon`].includes(S)&&p(),role:_?`tab`:`button`,tabindex:C?-1:0,"aria-expanded":c,onKeypress:m},[h&&D,s(`span`,{onClick:()=>S===`header`&&p(),class:`${w}-header-text`},[n]),x&&s(`div`,{class:`${w}-extra`},[x])]),s(o,k,{default:()=>[!g||c?O:null]})])}}});export{i as collapsePanelProps,d as default};