"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("element-plus"),w=require("./types.js"),f=require("../../node_modules/.pnpm/@vueuse_core@10.9.0_vue@3.4.21/node_modules/@vueuse/core/index.js"),N=require("./symbol.js"),P={key:0},L=e.defineComponent({__name:"index",props:w.wetProPageContainerProps,emits:["update:loading","update:tabKey","update:status"],setup(k,{expose:y,emit:b}){const h=e.useSlots(),c=e.shallowRef(),d=e.shallowRef(),a=n.useNamespace("pro-page-container"),B=n.ElLoading.directive,t=k,u=b,l=e.shallowRef(!1),i=e.ref({}),g=e.computed(()=>t.status),v=e.computed(()=>l.value?l.value:t.loading),{height:E}=f.useElementBounding(c),{width:m}=f.useElementBounding(d),p=e.computed(()=>t.tabList&&t.tabList.length!==0),C=e.computed(()=>{var o;return p.value&&!((o=t.tabProps)!=null&&o.type)}),x=o=>{u("update:tabKey",o)},S=o=>{u("update:status",Object.assign(t.status,o))},V=e.computed(()=>e.h("div",{class:a.m()},{default(){return t.extra}})),s=async()=>{if(l.value=!0,t.request)try{i.value=await t.request()}catch(o){console.error(o)}l.value=!1};return e.provide(N.SymbolState,{pageInfo:i,pageStatus:g,refresh:s,setPageStatus:S}),e.onMounted(()=>{s()}),y({refresh:s}),(o,_)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(a).b()])},[e.createElementVNode("div",{style:e.normalizeStyle({width:e.unref(m)?`${e.unref(m)}px`:"auto"}),class:e.normalizeClass([e.unref(a).e("header"),e.unref(a).is("fixed",t.fixedHeader)]),ref_key:"header",ref:c},[t.breadcrumb?(e.openBlock(),e.createBlock(e.unref(n.ElBreadcrumb),{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.breadcrumb,r=>(e.openBlock(),e.createBlock(e.unref(n.ElBreadcrumbItem),{to:{path:r.path},key:r.path},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.name),1)]),_:2},1032,["to"]))),128))]),_:1})):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"header",{},()=>[t.title||t.extra&&t.extra.length!==0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(a).e("default-header"),e.unref(a).is("tabs",C.value),e.unref(a).is("fixed",t.fixedHeader)])},[e.createElementVNode("h2",null,e.toDisplayString(t.title),1),e.createElementVNode("div",null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(V.value)))])],2)):e.createCommentVNode("",!0)]),p.value?(e.openBlock(),e.createBlock(e.unref(n.ElTabs),e.mergeProps({key:1},t.tabProps,{style:{width:"100%"},"onUpdate:modelValue":x,modelValue:o.tabKey}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabList,r=>(e.openBlock(),e.createBlock(e.unref(n.ElTabPane),{key:r.key,name:r.key,label:r.tab,closable:r.closable,disabled:r.disabled},null,8,["name","label","closable","disabled"]))),128))]),_:1},16,["modelValue"])):e.createCommentVNode("",!0)],6),t.fixedHeader?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"shadowheader",ref:d,style:e.normalizeStyle({height:`${e.unref(E)}px`,marginBottom:"15px"})},null,4)):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(a).e("body"),e.unref(a).is("header-fixed",t.fixedHeader)])},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(a).e("body-innder")])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabList,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.key},[r.key===t.tabKey?(e.openBlock(),e.createElementBlock("div",P,[r.children?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.children),{key:0})):e.createCommentVNode("",!0),e.renderSlot(o.$slots,r.key)])):e.createCommentVNode("",!0)],64))),128)),e.renderSlot(o.$slots,"default")],2)],2)),[[e.unref(B),v.value]]),e.unref(h).footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([e.unref(a).e("footer"),e.unref(a).is("header-fixed",t.fixedHeader)])},[e.renderSlot(o.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}});exports.default=L;
