(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{3865:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>u});var n=a(4568),t=a(7620),r=a(7541),l=a(2982),i=a(5177);function u(){let e=(0,r.useRouter)(),[s,a]=(0,t.useState)(null),[u,c]=(0,t.useState)(!0),[d,h]=(0,t.useState)(!1);(0,t.useEffect)(()=>{(0,l.FH)("/auth/me").then(s=>{s.authenticated?e.replace("/dashboard"):c(!1)}).catch(e=>{a(e.message),c(!1)})},[e]);let o=async()=>{h(!0),a(null);try{await (0,l.bE)("/auth/dev-login"),e.replace("/dashboard")}catch(e){a(e.message),h(!1)}};return(0,n.jsx)("main",{className:"auth-screen",children:(0,n.jsxs)("div",{className:"auth-card",children:[(0,n.jsx)("img",{src:"/brand/blueout.png",alt:"",width:64,height:64,style:{borderRadius:18,margin:"0 auto",border:"1px solid var(--line)"}}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{style:{fontSize:22},children:"Bot Dashboard"}),(0,n.jsx)("p",{className:"sub",style:{marginTop:6},children:"Server ausw\xe4hlen, Module einstellen, Tickets bearbeiten."})]}),s&&(0,n.jsx)(i.Pq,{kind:"err",children:s}),!u&&(0,n.jsxs)("div",{className:"stack-sm",children:[(0,n.jsx)("a",{href:"".concat(l.tE,"/auth/login"),children:(0,n.jsx)(i.$n,{variant:"primary",className:"btn-block",children:"Mit Discord anmelden"})}),(0,n.jsx)(i.$n,{className:"btn-block",busy:d,onClick:()=>void o(),children:"Lokal anmelden"}),(0,n.jsx)("p",{className:"hint",style:{marginTop:2},children:"Die lokale Anmeldung braucht DEV_LOGIN_USER_ID in der .env und l\xe4uft nur ausserhalb von production."})]})]})})}},7541:(e,s,a)=>{"use strict";var n=a(3041);a.o(n,"usePathname")&&a.d(s,{usePathname:function(){return n.usePathname}}),a.o(n,"useRouter")&&a.d(s,{useRouter:function(){return n.useRouter}})},9278:(e,s,a)=>{Promise.resolve().then(a.bind(a,3865))}},e=>{e.O(0,[214,587,18,358],()=>e(e.s=9278)),_N_E=e.O()}]);