import{d as D,o as I,c as a,a as u,F as N,t as d,b as f,e as m,w as p,f as L,r as P,g as i,h as C,u as U,i as n,j,s as E,k as x,n as F,_ as H}from"./index-79TAGpau.js";import{g as K,a as Q}from"./index-DUo11ZWB.js";const T={class:"home-page"},A={class:"hero-section"},W=["src","alt"],$={key:1,class:"logo-text"},G={class:"search-box"},J={key:1,class:"quote-line"},O={key:0,class:"cloud-zone"},X={class:"word-cloud"},Y=["onClick"],Z={key:1,class:"empty-area"},ee={key:2,class:"site-footer"},oe={class:"footer-inner"},te=D({__name:"HomePage",setup(se){const S=U(),v=i(""),g=i(!1),_=i(""),h=i(""),y=i(""),k=i(""),z=i(""),b=i([]),M=["学而时习之，不亦说乎。","温故而知新，可以为师矣。","千里之行，始于足下。","书山有路，勤为径。","学以致用，知行合一。","路漫漫其修远兮，吾将上下而求索。"],V=["#e74c3c","#e67e22","#f39c12","#27ae60","#2980b9","#8e44ad","#2c3e50","#16a085","#d35400","#c0392b","#1abc9c","#3498db","#9b59b6","#34495e","#e91e63","#009688","#ff5722","#795548","#607d8b","#673ab7"],q=[48,42,38,34,30,28,26,24,22,20,18,17,16,15,14,13,12];function w(){const l=v.value.trim();l&&S.push("/search?q="+encodeURIComponent(l))}function R(l){S.push("/search?q="+encodeURIComponent(l))}function B(){window.open("/disclaimer/","_blank")}return I(async()=>{var l;k.value=M[Math.floor(Math.random()*M.length)],z.value="古籍经典";try{const[o,r]=await Promise.all([K(),Q()]);if(r.site_logo&&(_.value=r.site_logo),r.site_name&&(h.value=r.site_name),r.site_disclaimer&&(y.value=r.site_disclaimer),g.value=!0,o!=null&&o.categories){const c=o.categories.find(t=>t.category==="hot");if((l=c==null?void 0:c.hot)!=null&&l.length){const t=c.hot.slice(0,25).map((e,s)=>({k:e.keyword,s:q[Math.min(s,q.length-1)],c:V[s%V.length],w:s<5?800:s<10?600:400,r:(Math.random()-.5)*6,o:1-s*.02,d:s*.08}));for(let e=t.length-1;e>0;e--){const s=Math.floor(Math.random()*(e+1));[t[e],t[s]]=[t[s],t[e]]}b.value=t}}}catch(o){console.error(o)}}),(l,o)=>{const r=C("el-icon"),c=C("el-input"),t=C("el-button");return n(),a("div",T,[u("div",A,[g.value?(n(),a(N,{key:0},[_.value?(n(),a("img",{key:0,src:_.value,alt:h.value||"CloudSearch",class:"logo-img",onError:o[0]||(o[0]=e=>{e.target.style.display="none",_.value=""})},null,40,W)):(n(),a("div",$,d(h.value||"CloudSearch"),1))],64)):f("",!0),u("div",G,[m(c,{modelValue:v.value,"onUpdate:modelValue":o[1]||(o[1]=e=>v.value=e),placeholder:"搜索网盘资源...",size:"large",clearable:"",onKeyup:L(w,["enter"])},{prefix:p(()=>[m(r,null,{default:p(()=>[m(j(E))]),_:1})]),_:1},8,["modelValue"]),m(t,{type:"primary",size:"large",onClick:w,class:"search-btn"},{default:p(()=>[...o[2]||(o[2]=[x("搜索",-1)])]),_:1})]),k.value?(n(),a("div",J,"「 "+d(k.value)+" 」 ---"+d(z.value),1)):f("",!0)]),b.value.length>0?(n(),a("div",O,[o[3]||(o[3]=u("p",{class:"cloud-title"},"大家都在搜",-1)),u("div",X,[(n(!0),a(N,null,P(b.value,e=>(n(),a("span",{key:e.k,class:"wc-word",style:F({fontSize:e.s+"px",color:e.c,fontWeight:e.w,transform:"rotate("+e.r+"deg)",opacity:e.o,animationDelay:e.d+"s"}),onClick:s=>R(e.k)},d(e.k),13,Y))),128))])])):g.value?(n(),a("div",Z,[...o[4]||(o[4]=[u("p",null,"搜索脉搏采集中...",-1)])])):f("",!0),y.value?(n(),a("div",ee,[u("div",oe,d(y.value),1),m(t,{class:"footer-btn",size:"small",onClick:B},{default:p(()=>[...o[5]||(o[5]=[x("免责声明",-1)])]),_:1})])):f("",!0)])}}}),le=H(te,[["__scopeId","data-v-d8586287"]]);export{le as default};
