import{i as X,r as s,d as V,j as e,L as Z}from"./react.6693569e.js";import{u as C,s as n,x as tt,y as et,r as ot,t as F}from"./index.b5b1089a.js";import{C as rt}from"./Cover.fc91526c.js";import{o as st}from"./mobxreact.esm.540cda23.js";import{L as it,E as nt,a as at,b as lt}from"./LayoutChooser.c2bdb7f5.js";import{l as m}from"./size.d81ce6e6.js";import{G as ct}from"./index.0a6cc9fb.js";import{m as dt,S as pt}from"./antd.ef9542dc.js";import"./ColorPicker.ae75796c.js";/* empty css              *//* empty css              *//* empty css              */import"./LogoForm.5f199a67.js";/* empty css               */const mt="_background_ytqfl_1",ut="_content_ytqfl_7",ht="_logo_ytqfl_13",vt="_entry_ytqfl_14",yt="_layoutChooser_ytqfl_21",gt="_layout_ytqfl_21",_t="_notice_ytqfl_41",i={background:mt,content:ut,logo:ht,entry:vt,layoutChooser:yt,layout:gt,notice:_t};function bt(){var y,g,_,b,f,w,S,O,x,L,N,k,E,R,z,q,U,I,T,$;const{T:J}=C(),u=X(),o=n.routeStore.layouts,h=(y=n.settingsStore.main.default)==null?void 0:y.colors,t=n.settingsStore.layoutChooser,v=(g=n.currentUserStore.currentUser)==null?void 0:g.status;s.exports.useEffect(()=>{var r;v===1||v===2?(r=o[0])!=null&&r.id&&u.push({pathname:`${o[0].id}/app-entry`}):o.length===1?u.push({pathname:`${o[0].id}/app-entry`}):o.length===0&&dt.info(J("layoutChoose.intercept"),0)},[u,o,v]),s.exports.useEffect(()=>{h&&tt(et({...h}))},[h]);const[P,Q]=s.exports.useState({}),a=s.exports.useCallback(()=>{var p,l,c,d,D,G,W,Y,j,A,B,H,K,M;const r=(l=(p=t==null?void 0:t.entry)==null?void 0:p.position)!=null&&l.isCenteredHorizontally?{position:"relative",top:((d=(c=t==null?void 0:t.entry)==null?void 0:c.position)==null?void 0:d.top)||void 0,right:((G=(D=t==null?void 0:t.entry)==null?void 0:D.position)==null?void 0:G.right)||void 0,width:Math.floor((window.innerWidth*.8-16)/164)>o.length?void 0:Math.floor((window.innerWidth*.8-16)/164)*164+16,maxWidth:"80vw"}:{position:"absolute",top:((Y=(W=t==null?void 0:t.entry)==null?void 0:W.position)==null?void 0:Y.top)||void 0,right:((A=(j=t==null?void 0:t.entry)==null?void 0:j.position)==null?void 0:A.right)||void 0,bottom:((H=(B=t==null?void 0:t.entry)==null?void 0:B.position)==null?void 0:H.bottom)||void 0,left:((M=(K=t==null?void 0:t.entry)==null?void 0:K.position)==null?void 0:M.left)||void 0,width:`calc(164px * ${(o==null?void 0:o.length)||0})`,maxWidth:"80vw"};Q(r)},[t]);return s.exports.useLayoutEffect(()=>{a()},[a]),s.exports.useEffect(()=>(window.addEventListener("resize",a),()=>window.removeEventListener("onresize",a)),[a]),s.exports.useEffect(()=>{ot(()=>n.noticeStore.reload,r=>{n.noticeStore.getNoticeOverview({includes:"unReads"})},{fireImmediately:!0})},[]),V(rt,{children:[e("div",{className:i.background,style:{backgroundColor:((_=t==null?void 0:t.backgroundImage)==null?void 0:_.color)||it},children:((b=t==null?void 0:t.backgroundImage)==null?void 0:b.src)&&e("div",{className:i.background,children:e("img",{src:F({url:t.backgroundImage.src}),style:{fontSize:m,width:"100%",height:"100%"},alt:""})})}),V("div",{className:i.content,children:[e("div",{className:i.logo,children:e("div",{style:{position:"absolute",top:((w=(f=t.logo)==null?void 0:f.position)==null?void 0:w.top)||void 0,right:((O=(S=t.logo)==null?void 0:S.position)==null?void 0:O.right)||void 0,bottom:((L=(x=t.logo)==null?void 0:x.position)==null?void 0:L.bottom)||void 0,left:((k=(N=t.logo)==null?void 0:N.position)==null?void 0:k.left)||void 0},children:t.logo.src?e("img",{style:{height:((R=(E=t.logo)==null?void 0:E.size)==null?void 0:R.height)||m,width:((q=(z=t.logo)==null?void 0:z.size)==null?void 0:q.width)||m},src:F({url:t.logo.src}),alt:""}):e(ct,{style:{fontSize:((I=(U=t.logo)==null?void 0:U.size)==null?void 0:I.width)||(($=(T=t.logo)==null?void 0:T.size)==null?void 0:$.height)||m}})})}),e("div",{className:i.entry,children:e("div",{style:P,children:o.length>0?e("div",{className:i.layoutChooser,children:o.map((r,p)=>{var l,c,d;return e(Z,{to:`${r.id}/app-entry`,children:e("div",{className:i.layout,style:{color:((l=t==null?void 0:t.entry)==null?void 0:l.color)||nt,borderColor:((c=t==null?void 0:t.entry)==null?void 0:c.borderColor)||at,backgroundColor:((d=t==null?void 0:t.entry)==null?void 0:d.backgroundColor)||lt},children:r.title})},p)})}):e(pt,{spinning:!0})})})]})]})}const Tt=st(bt);export{Tt as default};
