import{objectType as e,vNodeType as t,withInstall as n}from"../_util/type.mjs";import r from"../_util/classNames.mjs";import{filterEmpty as i,flattenChildren as a,isEmptyContent as o}from"../_util/props-util/index.mjs";import s from"../locale-provider/LocaleReceiver.mjs";import c from"../config-provider/hooks/useConfigInject.mjs";import l from"../vc-resize-observer/index.mjs";import u from"../_util/vue-types/index.mjs";import d from"../avatar/index.mjs";import f from"../breadcrumb/index.mjs";import p from"../_util/hooks/useDestroyed.mjs";import m from"../_util/transButton.mjs";import h from"../space/index.mjs";import g from"./style/index.mjs";import{computed as _,createVNode as v,defineComponent as y,shallowRef as b}from"vue";import{ArrowLeftOutlined as x,ArrowRightOutlined as S}from"@antsoo-lib/icons";var C=()=>({backIcon:t(),prefixCls:String,title:t(),subTitle:t(),breadcrumb:u.object,tags:t(),footer:t(),extra:t(),avatar:e(),ghost:{type:Boolean,default:void 0},onBack:Function}),w=n(y({compatConfig:{MODE:3},name:`APageHeader`,inheritAttrs:!1,props:C(),slots:Object,setup(e,{emit:t,slots:n,attrs:u}){let{prefixCls:y,direction:C,pageHeader:w}=c(`page-header`,e),[T,E]=g(y),D=b(!1),O=p(),k=({width:e})=>{O.value||(D.value=e<768)},A=_(()=>e.ghost??w?.value?.ghost??!0),j=()=>e.backIcon??n.backIcon?.()??(C.value===`rtl`?v(S,null,null):v(x,null,null)),M=n=>!n||!e.onBack?null:v(s,{componentName:`PageHeader`,children:({back:e})=>v(`div`,{class:`${y.value}-back`},[v(m,{onClick:e=>{t(`back`,e)},class:`${y.value}-back-button`,"aria-label":e},{default:()=>[n]})])},null),N=()=>e.breadcrumb?v(f,e.breadcrumb,null):n.breadcrumb?.(),P=()=>{let{avatar:t}=e,r=e.title??n.title?.(),i=e.subTitle??n.subTitle?.(),a=e.tags??n.tags?.(),o=e.extra??n.extra?.(),s=`${y.value}-heading`,c=r||i||a||o;if(!c)return null;let l=j(),u=M(l);return v(`div`,{class:s},[(u||t||c)&&v(`div`,{class:`${s}-left`},[u,t?v(d,t,null):n.avatar?.(),r&&v(`span`,{class:`${s}-title`,title:typeof r==`string`?r:void 0},[r]),i&&v(`span`,{class:`${s}-sub-title`,title:typeof i==`string`?i:void 0},[i]),a&&v(`span`,{class:`${s}-tags`},[a])]),o&&v(`span`,{class:`${s}-extra`},[v(h,null,{default:()=>[o]})])])},F=()=>{let t=e.footer??i(n.footer?.());return o(t)?null:v(`div`,{class:`${y.value}-footer`},[t])},I=e=>v(`div`,{class:`${y.value}-content`},[e]);return()=>{let t=e.breadcrumb?.routes||n.breadcrumb,i=e.footer||n.footer,o=a(n.default?.()),s=r(y.value,{"has-breadcrumb":t,"has-footer":i,[`${y.value}-ghost`]:A.value,[`${y.value}-rtl`]:C.value===`rtl`,[`${y.value}-compact`]:D.value},u.class,E.value);return T(v(l,{onResize:k},{default:()=>[v(`div`,{...u,class:s},[N(),P(),o.length?I(o):null,F()])]}))}}}));export{w as default,C as pageHeaderProps};