var pe=Object.defineProperty,be=Object.defineProperties;var _e=Object.getOwnPropertyDescriptors;var ee=Object.getOwnPropertySymbols;var He=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable;var te=(e,t,r)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,z=(e,t)=>{for(var r in t||(t={}))He.call(t,r)&&te(e,r,t[r]);if(ee)for(var r of ee(t))ye.call(t,r)&&te(e,r,t[r]);return e},ae=(e,t)=>be(e,_e(t));var ne=(e,t,r)=>new Promise((m,n)=>{var _=v=>{try{g(r.next(v))}catch(H){n(H)}},d=v=>{try{g(r.throw(v))}catch(H){n(H)}},g=v=>v.done?m(v.value):Promise.resolve(v.value).then(_,d);g((r=r.apply(e,t)).next())});import{j as h,aO as Ce,aq as Pe,a as G,aa as S,U as $e,r as O,aP as Fe,f as $,aQ as ke,S as we,J,aR as Be,aS as Re,a8 as Se,aT as Te,b as ce,aU as Oe,aG as ue,o as x,h as X,i as Z,aV as T,n as W,aW as de,ak as Ae,ac as V,aX as Ie,k as w,aY as je,aZ as Ee,V as fe,a_ as Ne,a$ as xe,b0 as C,N as We,ae as re,aI as oe,aJ as ie,b1 as ze,b2 as De,p as D,b3 as Ve,b4 as Le,F as Me,q as Ue,t as qe,b5 as Je,aK as le,b6 as ge}from"./index.6cd5baf8.js";import{B as Xe}from"./index.88cadf0e.js";import{A as Ze}from"./index.2c12ae38.js";import{u as Ge}from"./useWindowSizeFn.b111f681.js";import{u as Qe}from"./useContentViewHeight.8b78d050.js";import{A as Ye}from"./ArrowLeftOutlined.83dc660b.js";import{T as Ke}from"./transButton.3f533333.js";var et={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z"}}]},name:"arrow-right",theme:"outlined"},tt=et;function se(e){for(var t=1;t{e(),V(()=>{t=!0})}),Ie(()=>{t&&e()})}function ut(e,t,r,m,n=0,_=O(0)){const d=O(null),{footerHeightRef:g}=Qe();let v={useLayoutFooter:!0};const H=f=>{v=f};function j(){V(()=>{R()})}function F(f,k="all"){var i,a,l,u;function y(o){return Number(o.replace(/[^\d]/g,""))}let p=0;const b="0px";if(f){const o=getComputedStyle(f),s=y((i=o==null?void 0:o.marginTop)!=null?i:b),c=y((a=o==null?void 0:o.marginBottom)!=null?a:b),P=y((l=o==null?void 0:o.paddingTop)!=null?l:b),A=y((u=o==null?void 0:o.paddingBottom)!=null?u:b);k==="all"?(p+=s,p+=c,p+=P,p+=A):k==="top"?(p+=s,p+=P):(p+=c,p+=A)}return p}function B(f){return f==null?null:f instanceof HTMLDivElement?f:f.$el}function R(){return ne(this,null,function*(){var u;if(!e.value)return;yield V();const f=B(w(t));if(!f)return;const{bottomIncludeBody:k}=je(f);let y=0;r.forEach(o=>{var s,c;y+=(c=(s=B(w(o)))==null?void 0:s.offsetHeight)!=null?c:0});let p=(u=F(f))!=null?u:0;m.forEach(o=>{p+=F(B(w(o)))});let b=0;function i(o,s){if(o&&s){const c=o.parentElement;c&&(Ne(s)?c.classList.contains(s)?b+=F(c,"bottom"):(b+=F(c,"bottom"),i(c,s)):xe(s)&&s>0&&(b+=F(c,"bottom"),i(c,--s)))}}Ee(n)?i(f,w(n)):i(f,n);let a=k-w(g)-w(_)-y-p-b;const l=()=>{var o;(o=v.elements)==null||o.forEach(s=>{var c,P;a+=(P=(c=B(w(s)))==null?void 0:c.offsetHeight)!=null?P:0})};v.useLayoutFooter&&w(g)>0,l(),d.value=a})}return ct(()=>{V(()=>{R()})}),Ge(()=>{R()},50,{immediate:!0}),fe(()=>[g.value],()=>{R()},{flush:"post",immediate:!0}),{redoHeight:j,setCompensation:H,contentHeight:d}}const dt=G({name:"PageWrapper",components:{PageFooter:ve,PageHeader:it},inheritAttrs:!1,props:{title:C.string,dense:C.bool,ghost:C.bool,content:C.string,contentStyle:{type:Object},contentBackground:C.bool,contentFullHeight:C.bool,contentClass:C.string,fixedHeight:C.bool,upwardSpace:C.oneOfType([C.number,C.string]).def(0)},setup(e,{slots:t,attrs:r}){const m=O(null),n=O(null),_=O(null),d=O(null),{prefixCls:g}=ce("page-wrapper");We(vt,$(()=>e.fixedHeight));const v=$(()=>e.contentFullHeight),H=$(()=>e.upwardSpace),{redoHeight:j,setCompensation:F,contentHeight:B}=ut(v,m,[n,d],[_],H);F({useLayoutFooter:!0,elements:[d]});const R=$(()=>{var i;return[g,{[`${g}--dense`]:e.dense},(i=r.class)!=null?i:{}]}),f=$(()=>e.content||(t==null?void 0:t.headerContent)||e.title||y.value.length),k=$(()=>(t==null?void 0:t.leftFooter)||(t==null?void 0:t.rightFooter)),y=$(()=>Object.keys(re(t,"default","leftFooter","rightFooter","headerContent"))),p=$(()=>{const{contentFullHeight:i,contentStyle:a,fixedHeight:l}=e;if(!i)return z({},a);const u=`${w(B)}px`;return z(ae(z({},a),{minHeight:u}),l?{height:u}:{})}),b=$(()=>{const{contentBackground:i,contentClass:a}=e;return[`${g}-content`,a,{[`${g}-content-bg`]:i}]});return fe(()=>[k.value],()=>{j()},{flush:"post",immediate:!0}),{getContentStyle:p,wrapperRef:m,headerRef:n,contentRef:_,footerRef:d,getClass:R,getHeaderSlots:y,prefixCls:g,getShowHeader:f,getShowFooter:k,omit:re,getContentClass:b}}});function ft(e,t,r,m,n,_){const d=oe("PageHeader"),g=oe("PageFooter");return x(),X("div",{class:W(e.getClass),ref:"wrapperRef"},[e.getShowHeader?(x(),ie(d,Je({key:0,ghost:e.ghost,title:e.title},e.omit(e.$attrs,"class"),{ref:"headerRef"}),ze({default:D(()=>[e.content?(x(),X(Me,{key:0},[Ue(qe(e.content),1)],64)):T(e.$slots,"headerContent",{key:1})]),_:2},[De(e.getHeaderSlots,v=>({name:v,fn:D(H=>[T(e.$slots,v,Ve(Le(H||{})))])}))]),1040,["ghost","title"])):le("",!0),Z("div",{class:W(["overflow-hidden",e.getContentClass]),style:de(e.getContentStyle),ref:"contentRef"},[T(e.$slots,"default")],6),e.getShowFooter?(x(),ie(g,{key:1,ref:"footerRef"},{left:D(()=>[T(e.$slots,"leftFooter")]),right:D(()=>[T(e.$slots,"rightFooter")]),_:3},512)):le("",!0)],2)}var gt=ue(dt,[["render",ft]]);ge(ve);const Pt=ge(gt),vt="PageWrapperFixedHeight";export{Pt as P,vt as a,ct as o};