import{r as v,F as y,L as h,D as w,I as a,E as s,M as d,Q as u,J as c}from"./index-CoQ-x5A8.js";import{Q as m,a as p,b as f}from"./QCard-7tL_iMin.js";import{u as Q}from"./use-quasar-D2Dr8mCf.js";import{P as g}from"./LocalStorage-Cw9j6RTB.js";import{a as _}from"./axios-BPt4fYpj.js";import"./use-dark-dqtTUvyg.js";const C={class:"q-pa-lg flex flex-center",style:{gap:"24px"}},P={__name:"gameModeSelectPage",setup(b){const n=Q(),t=y(),o=v({username:"",id:0}),l=g.getItem("user");l?(console.log(l),o.value=l):t.push("/user/username");async function i(r){console.log(o.value),_.post("/api/games",{user:o.value.id,is_local:r}).then(function(e){console.log(e),g.setItem("gameID",e.data.game.id),r?t.push("/game/local/create"):t.push("/game/online/create"),n.notify({type:"positive",message:"Success!"})}).catch(function(e){console.log(e),n.notify({type:"negative",message:e.response.data.error})})}return(r,e)=>(w(),h("div",C,[a(m,{class:"q-pa-lg shadow-3",style:{width:"400px","max-width":"90vw","border-radius":"16px"}},{default:s(()=>[a(p,{class:"text-center"},{default:s(()=>[a(u,{name:"home",size:"48px",color:"primary"}),e[2]||(e[2]=d("div",{class:"text-h6 q-mt-md"},"Local",-1))]),_:1}),a(f,{align:"center"},{default:s(()=>[a(c,{label:"Go!",color:"primary",onClick:e[0]||(e[0]=x=>i(!0)),rounded:"",unelevated:"",size:"lg",class:"full-width"})]),_:1})]),_:1}),a(m,{class:"q-pa-lg shadow-3",style:{width:"400px","max-width":"90vw","border-radius":"16px"}},{default:s(()=>[a(p,{class:"text-center"},{default:s(()=>[a(u,{name:"public",size:"48px",color:"primary"}),e[3]||(e[3]=d("div",{class:"text-h6 q-mt-md"},"Online",-1))]),_:1}),a(f,{align:"center"},{default:s(()=>[a(c,{label:"Go!",color:"primary",onClick:e[1]||(e[1]=x=>i(!1)),rounded:"",unelevated:"",size:"lg",class:"full-width"})]),_:1})]),_:1})]))}};export{P as default};
