import{D as O,_ as P}from"./darkSwitch-2d22b024.js";import{h as L,p as t,M as u,N as n,o as c,k as e,q as f,V as o,a6 as k,l as C,U as N,T as w,a4 as B,a2 as T,a5 as G,t as d,a7 as U,i as X,W as h,r as Y,O as J,X as K,Y as Q}from"./vue-a39e6937.js";import{x as Z,u as F,a as R,i as ee,y as te,n as W,z as j,_ as A,d as ne,h as se}from"./index-ba596ae9.js";import{h as ae,o as E}from"./router-1773feb7.js";import{a as oe}from"./useDark-be37a710.js";const le="/api/index/";function re(){Z(()=>{const v=F(),p=R();if(!v.siteName)return ee({url:le+"index",method:"get"}).then(a=>{te(a.data.site.siteName),a.data.rules&&ae(a.data.rules),v.dataFill(a.data.site),p.setStatus(a.data.openMemberCenter),a.data.openMemberCenter||p.setLayoutMode("Disable")})},100)()}const ie={class:"userinfo"},ue=["src"],ce={class:"username"},de={class:"user-menus"},_e={key:0,class:"user-menu-max-title"},me=["onClick"],pe=L({__name:"aside",setup(v){const p=G(),a=W(),_=R(),m=(g="",l)=>{document.body.clientWidth<992&&_.toggleMenuExpand(!1),g?p.push({name:g}):l&&E(l)};return(g,l)=>{const r=d("Icon"),b=d("el-button"),s=d("el-button-group"),I=d("el-aside"),y=U("blur");return t(),u(I,{class:"ba-user-layouts"},{default:n(()=>[c("div",ie,[c("div",{onClick:l[0]||(l[0]=$=>m("account/profile")),class:"user-avatar-box"},[c("img",{class:"user-avatar",src:e(j)(e(a).avatar?e(a).avatar:"/static/images/avatar.png"),alt:""},null,8,ue),f(r,{class:"user-avatar-gender",name:e(a).getGenderIcon().name,size:"14",color:e(a).getGenderIcon().color},null,8,["name","color"])]),c("p",ce,o(e(a).nickname),1),f(s,null,{default:n(()=>[k((t(),u(b,{onClick:l[1]||(l[1]=$=>m("account/integral")),class:"userinfo-button-item",title:g.$t("Integral")+" "+e(a).score,size:"default",plain:""},{default:n(()=>[c("span",null,o(g.$t("Integral")+" "+e(a).score),1)]),_:1},8,["title"])),[[y]]),k((t(),u(b,{onClick:l[2]||(l[2]=$=>m("account/balance")),class:"userinfo-button-item",title:g.$t("Balance")+" "+e(a).money,size:"default",plain:""},{default:n(()=>[c("span",null,o(g.$t("Balance")+" "+e(a).money),1)]),_:1},8,["title"])),[[y]])]),_:1})]),c("div",de,[(t(!0),C(w,null,N(e(_).state.viewRoutes,($,V)=>{var z;return t(),C(w,{key:V},[e(_).state.showHeadline?(t(),C("div",_e,o((z=$.meta)==null?void 0:z.title),1)):B("",!0),(t(!0),C(w,null,N($.children,(M,S)=>{var D,x,i;return t(),C("div",{key:S,onClick:q=>m("",M),class:T(["user-menu-item",((D=e(_).state.activeRoute)==null?void 0:D.name)==M.name?"active":""])},[f(r,{name:(x=M.meta)==null?void 0:x.icon,size:"16",color:"var(--el-text-color-secondary)"},null,8,["name"]),c("span",null,o((i=M.meta)==null?void 0:i.title),1)],10,me)}),128))],64)}),128))])]),_:1})}}});const fe=A(pe,[["__scopeId","data-v-723a7442"]]),H=L({__name:"headerDynamicMenus",props:{menus:{default:()=>[]}},setup(v){const p=v;return(a,_)=>{const m=d("el-menu-item"),g=d("el-sub-menu"),l=U("blur");return t(!0),C(w,null,N(p.menus,(r,b)=>(t(),C(w,{key:b},[e(X)(r.children)?k((t(),u(m,{key:1,onClick:s=>e(E)(r),index:"column-"+r.id},{default:n(()=>[h(o(r.title),1)]),_:2},1032,["onClick","index"])),[[l]]):k((t(),u(g,{key:0,index:`column-${r.id}`},{title:n(()=>[h(o(r.title),1)]),default:n(()=>[(t(!0),C(w,null,N(r.children,(s,I)=>k((t(),u(m,{key:I,onClick:y=>e(E)(s),index:"column-"+s.id},{default:n(()=>[h(o(s.title),1)]),_:2},1032,["onClick","index"])),[[l]])),128))]),_:2},1032,["index"])),[[l]])],64))),128)}}}),ve=v=>(K("data-v-f5c43b74"),v=v(),Q(),v),ge=ve(()=>c("img",{src:P},null,-1)),he={class:"hidden-xs-only"},ke={class:"header-user-box"},Ce=["src"],be=L({__name:"header",setup(v){const p=Y({activeMenu:""}),a=J(),_=W(),m=G(),g=ne(),l=F(),r=R();switch(a.name){case"/":p.activeMenu="";break;case"userLogin":p.activeMenu="user";break}return re(),(b,s)=>{const I=d("Icon"),y=d("el-menu-item"),$=d("el-sub-menu"),V=d("el-menu"),z=d("el-col"),M=d("el-row"),S=d("el-drawer"),D=d("el-header"),x=U("blur");return t(),u(D,{class:"header"},{default:n(()=>[f(M,{justify:"center"},{default:n(()=>[f(z,{class:"header-row",span:16,xs:24},{default:n(()=>[c("div",{class:T([e(_).isLogin()?"hidden-sm-and-down":"","header-logo"]),onClick:s[0]||(s[0]=i=>e(m).push({name:"/"}))},[ge,c("span",he,o(e(l).siteName),1)],2),e(_).isLogin()?(t(),C("div",{key:0,onClick:s[1]||(s[1]=i=>e(r).toggleMenuExpand(!0)),class:"user-menus-expand hidden-md-and-up"},[f(I,{name:"fa fa-indent",color:"var(--el-color-primary)",size:"20"})])):B("",!0),f(V,{"default-active":p.activeMenu,class:"frontend-header-menu",mode:"horizontal",ellipsis:!1},{default:n(()=>[k((t(),u(y,{onClick:s[2]||(s[2]=i=>e(m).push({name:"/"})),index:"index"},{default:n(()=>[h(o(b.$t("Home")),1)]),_:1})),[[x]]),f(H,{menus:e(l).headNav},null,8,["menus"]),e(r).state.open?(t(),C(w,{key:0},[e(_).isLogin()?k((t(),u($,{key:0,index:"user"},{title:n(()=>[c("div",ke,[c("img",{class:"header-user-avatar",src:e(j)(e(_).avatar?e(_).avatar:"/static/images/avatar.png"),alt:""},null,8,Ce),h(" "+o(e(_).nickname),1)])]),default:n(()=>[k((t(),u(y,{onClick:s[3]||(s[3]=i=>e(m).push({name:"user"})),index:"user-index"},{default:n(()=>[h(o(b.$t("Member Center")),1)]),_:1})),[[x]]),f(H,{menus:e(r).state.navUserMenus},null,8,["menus"]),k((t(),u(y,{onClick:s[4]||(s[4]=i=>e(_).logout()),index:"user-logout"},{default:n(()=>[h(o(b.$t("Logout login")),1)]),_:1})),[[x]])]),_:1})),[[x]]):k((t(),u(y,{key:1,onClick:s[5]||(s[5]=i=>e(m).push({name:"user"})),index:"user"},{default:n(()=>[h(o(b.$t("Member Center")),1)]),_:1})),[[x]])],64)):B("",!0),k((t(),u($,{index:"switch-language"},{title:n(()=>[h(o(b.$t("Language")),1)]),default:n(()=>[(t(!0),C(w,null,N(e(g).lang.langArray,i=>(t(),u(y,{onClick:q=>e(se)(i.name),key:i.name,index:"switch-language-"+i.value},{default:n(()=>[h(o(i.value),1)]),_:2},1032,["onClick","index"]))),128))]),_:1})),[[x]]),f(y,{index:"theme-switch",class:"theme-switch"},{default:n(()=>[f(O,{onClick:s[6]||(s[6]=i=>e(oe)())})]),_:1})]),_:1},8,["default-active"])]),_:1})]),_:1}),f(S,{class:"aside-drawer","append-to-body":!0,modelValue:e(r).state.menuExpand,"onUpdate:modelValue":s[7]||(s[7]=i=>e(r).state.menuExpand=i),"with-header":!1,direction:"ltr",size:"70%"},{default:n(()=>[f(fe)]),_:1},8,["modelValue"])]),_:1})}}});const ze=A(be,[["__scopeId","data-v-f5c43b74"]]),ye={href:"http://beian.miit.gov.cn/"},xe=L({__name:"footer",setup(v){const p=F();return(a,_)=>{const m=d("el-footer");return t(),u(m,{class:"footer"},{default:n(()=>[c("div",null,[h(" Copyright @ 2020~2022 "+o(e(p).siteName)+" "+o(a.$t("Copyright"))+" ",1),c("a",ye,o(e(p).recordNumber),1)])]),_:1})}}});const De=A(xe,[["__scopeId","data-v-5dadaf49"]]);export{fe as A,De as F,ze as H};