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