import M from"./index-1cf9ac88.js";import{z as L,ag as C,_ as P,A as $,aa as A}from"./index.js";import{c as l,S as B,J as I,u as g,d as R,Z as m,_ as d,F as S,a7 as N,a8 as b,a6 as T,m as E,A as O,a4 as p,k as w,a5 as _,q as V,af as y,al as j}from"./vue-08ef39cb.js";import{a3 as K}from"./antd-86d2ef3c.js";function k(){const e=L(),s=l(()=>e.getMultiTabsSetting.show),o=l(()=>e.getMultiTabsSetting.showQuick),r=l(()=>e.getMultiTabsSetting.showRedo),i=l(()=>e.getMultiTabsSetting.showFold);function u(t){e.setProjectConfig({multiTabsSetting:t})}return{setMultipleTabSetting:u,getShowMultipleTab:s,getShowQuick:o,getShowRedo:r,getShowFold:i}}function q(){const e=B(),{currentRoute:s}=e,{getShowMultipleTab:o}=k(),r=C(),i=l(()=>t(I(e.getRoutes()))||[]),u=l(()=>r.getTabList.reduce((n,c)=>(c.meta&&Reflect.has(c.meta,"frameSrc")&&n.push(c.name),n),[]));function t(n){let c=[];for(const F of n){const{meta:{frameSrc:v}={},children:h}=F;v&&c.push(F),h&&h.length&&c.push(...t(h))}return c=K(c,"name"),c}function a(n){return n.name===g(s).name}function f(n){return g(o)?g(u).includes(n):e.currentRoute.value.name===n}return{hasRenderFrame:f,getFramePages:i,showIframe:a,getAllFramePages:t}}const z=R({name:"FrameLayout",components:{FramePage:M},setup(){const{getFramePages:e,hasRenderFrame:s,showIframe:o}=q(),r=l(()=>g(e).length>0);return{getFramePages:e,hasRenderFrame:s,showIframe:o,showFrame:r}}}),D={key:0};function Q(e,s,o,r,i,u){const t=T("FramePage");return e.showFrame?(m(),d("div",D,[(m(!0),d(S,null,N(e.getFramePages,a=>(m(),d(S,{key:a.path},[a.meta.frameSrc&&e.hasRenderFrame(a.name)?E((m(),p(t,{key:0,frameSrc:a.meta.frameSrc},null,8,["frameSrc"])),[[O,e.showIframe(a)]]):b("",!0)],64))),128))])):b("",!0)}const J=P(z,[["render",Q]]);function Z({route:e,openCache:s,cacheTabs:o,enableTransition:r,def:i}){if(!r)return;const u=o.includes(e.name),t="fade-slide";let a=t;return s&&(a=u&&e.meta.loaded?t:void 0),a||e.meta.transitionName||i}const G=R({name:"PageLayout",components:{FrameLayout:J},setup(){const{getShowMultipleTab:e}=k(),s=C(),{getOpenKeepAlive:o,getCanEmbedIFramePage:r}=$(),{getBasicTransition:i,getEnableTransition:u}=A(),t=l(()=>g(o)&&g(e)),a=l(()=>g(o)?s.getCachedTabList:[]);return{getTransitionName:Z,openCache:t,getEnableTransition:u,getBasicTransition:i,getCaches:a,getCanEmbedIFramePage:r}}});function H(e,s,o,r,i,u){const t=T("RouterView"),a=T("FrameLayout");return m(),d(S,null,[w(t,null,{default:_(({Component:f,route:n})=>[w(V,{name:e.getTransitionName({route:n,openCache:e.openCache,enableTransition:e.getEnableTransition,cacheTabs:e.getCaches,def:e.getBasicTransition}),mode:"out-in",appear:""},{default:_(()=>[e.openCache?(m(),p(j,{key:0,include:e.getCaches},[(m(),p(y(f),{key:n.fullPath}))],1032,["include"])):(m(),p(y(f),{key:n.fullPath}))]),_:2},1032,["name"])]),_:1}),e.getCanEmbedIFramePage?(m(),p(a,{key:0})):b("",!0)],64)}const U=P(G,[["render",H]]),ee=Object.freeze(Object.defineProperty({__proto__:null,default:U},Symbol.toStringTag,{value:"Module"}));export{U as P,ee as i,k as u};