import{d as x,r as l,q as h,a as o,o as r,b as e,e as y,j as k,F as w,g as _,t as E,f as j,E as S}from"./style-CWE_e4zZ.js";import{g as C}from"./sdk.gen-yuJ1arsq.js";const B={class:"min-h-screen bg-base-300 flex items-center justify-center px-4"},N={class:"w-full max-w-6xl"},V={key:0,class:"flex justify-center py-20"},$={key:1,class:"grid grid-cols-1 md:grid-cols-2 gap-8"},A=["onClick"],L={class:"relative h-60 bg-base-300 overflow-hidden"},M=["src","alt","onError"],P={key:1,class:"w-full h-full bg-gradient-to-br from-blue-600 to-blue-400 flex items-center justify-center text-white"},q={class:"card-body"},D={class:"card-title text-2xl"},F=x({__name:"Home",props:{marketEnabled:{type:[String,Boolean],default:!0}},setup(b){const n=b,i=l(),d=l(!0),c=l(new Set),p=s=>`https://cdn.akamai.steamstatic.com/steam/apps/${s}/header.jpg`,v=s=>{c.value.add(s)},m=s=>{window.location.href=s},g=()=>typeof n.marketEnabled=="string"?n.marketEnabled==="true":!!n.marketEnabled;return h(async()=>{const s=await C();s.data&&(i.value=s.data),d.value=!1}),(s,t)=>(r(),o("div",B,[e("div",N,[t[6]||(t[6]=e("div",{class:"text-center mb-12"},[e("h1",{class:"text-5xl font-bold mb-4"},"PolyLAN Submitter"),e("p",{class:"text-xl text-base-content/70"}," Choose a game and submit your best solutions ")],-1)),d.value?(r(),o("div",V,[...t[1]||(t[1]=[e("span",{class:"loading loading-spinner loading-lg"},null,-1)])])):(r(),o("div",$,[g()?(r(),o("div",{key:0,onClick:t[0]||(t[0]=a=>m("/market")),class:"card card-xl bg-base-200 shadow-xl hover:shadow-2xl transition-all cursor-pointer transform hover:-translate-y-2 hover:scale-[1.05] hover:bg-base-100 overflow-hidden"},[...t[2]||(t[2]=[k('<figure class="relative h-60 bg-gradient-to-br from-purple-600 to-blue-600 flex items-center justify-center"><i class="mdi mdi-chart-box text-6xl text-white opacity-80"></i><div class="absolute inset-0 bg-black/30 group-hover:bg-black/20 transition-colors"></div></figure><div class="card-body"><h2 class="card-title text-2xl">Market</h2><p class="text-base-content/70">Place your bets and compete</p><div class="card-actions justify-end mt-4"><button class="btn btn-primary"><i class="mdi mdi-arrow-right mr-2"></i> Place bets </button></div></div>',2)])])):y("",!0),(r(!0),o(w,null,_(i.value,a=>(r(),o("div",{key:a.steam_app_id,onClick:f=>m(a.path),class:"card card-xl bg-base-200 shadow-xl hover:shadow-2xl transition-all cursor-pointer transform hover:-translate-y-2 hover:scale-[1.05] hover:bg-base-100 overflow-hidden"},[e("figure",L,[c.value.has(a.steam_app_id)?(r(),o("div",P,[...t[3]||(t[3]=[e("i",{class:"mdi mdi-gamepad-variant text-5xl"},null,-1)])])):(r(),o("img",{key:0,src:p(a.steam_app_id),alt:a.name,onError:f=>v(a.steam_app_id),class:"w-full h-full object-cover"},null,40,M)),t[4]||(t[4]=e("div",{class:"absolute inset-0 bg-black/30 group-hover:bg-black/20 transition-colors"},null,-1))]),e("div",q,[e("h2",D,E(a.name),1),t[5]||(t[5]=e("div",{class:"card-actions justify-end mt-4"},[e("button",{class:"btn btn-primary"},[e("i",{class:"mdi mdi-arrow-right mr-2"}),j(" Submit results ")])],-1))])],8,A))),128))])),t[7]||(t[7]=e("div",{class:"text-center mt-12 text-base-content/50"},[e("p",null,"Select a game above to begin submitting")],-1))])]))}}),u="#app",H=document.querySelector(u),I=S(F,{...H?.dataset});I.mount(u);
