import{q as d,c as g,b as r,w as f,a as e,y as S,z as _,A as p,g as i,B as h,h as T,i as b,k as V,H,o as u,d as B,j,v,D as I,T as N}from"./entry.e017eb4f.js";import{_ as E}from"./Spinner.e690f222.js";import{_ as P}from"./Image.e40f281f.js";import{r as A}from"./XCircleIcon.7192006f.js";import"./_plugin-vue_export-helper.c27b6911.js";const R={class:"bg-white pb-8 lg:pb-16"},q={class:"mx-auto max-w-7xl overflow-hidden py-4 px-4 sm:py-8 sm:px-6 lg:px-8"},z=e("div",{class:"border-b border-gray-200 pb-6 mb-6 lg:pb-10 lg:mb-12"},[e("h1",{class:"text-4xl font-bold tracking-tight text-gray-900"}," Händlerlogin "),e("p",{class:"mt-4 text-base text-gray-500"}," Bitte loggen Sie sich ein, um den Händlerbereich zu betreten. Falls Sie als Händler noch nicht registriert sind, können Sie sich gerne an uns wenden. ")],-1),C={class:"flex min-h-full"},M={class:"flex flex-1 flex-col justify-center lg:pr-20 items-center lg:flex-none"},U={class:"mx-auto w-full max-w-sm lg:w-96"},D=e("div",null,[e("h2",{class:"text-xl font-bold tracking-tight text-gray-900"}," Jetzt beim Händlerportal einloggen ")],-1),J={class:"mt-4"},L={class:""},O=["onSubmit"],F=e("label",{for:"email",class:"block text-sm font-medium leading-6 text-gray-900"},"E-Mail-Adresse",-1),$={class:"mt-2"},G={class:"space-y-1"},K=e("label",{for:"password",class:"block text-sm font-medium leading-6 text-gray-900"},"Passwort",-1),Q={class:"mt-2"},W=V('<div class="hidden flex items-center justify-between"><div class="flex items-center"><input id="remember-me" name="remember-me" type="checkbox" class="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600"><label for="remember-me" class="ml-2 block text-sm text-gray-900">Eingeloggt bleiben</label></div><div class="text-sm"><a href="#" class="font-medium text-sd-blue hover:text-sd-blue-light">Passwort vergessen?</a></div></div>',1),X={class:"flex space-x-3 items-center"},Y=e("button",{type:"submit",class:"flex w-full justify-center rounded-md bg-sd-blue py-2 px-3 text-sm font-semibold text-white shadow-sm hover:bg-sd-blue-light focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"}," Einloggen ",-1),Z={key:0,class:"rounded-md bg-red-50 p-4"},ee={class:"flex"},te={class:"flex-shrink-0"},se=e("div",{class:"ml-3"},[e("h3",{class:"text-sm font-medium text-red-800"}," Leider gab es ein Problem mit Ihrer Anmeldung. Bitte überprüfen Sie Ihre Eingaben. ")],-1),oe={class:"relative hidden w-0 flex-1 lg:block"},ce={__name:"index",setup(ie){const l=d(!1),o=d(!1),n=d(""),a=d(""),x=async()=>{o.value=!0,l.value=!1,await $fetch(j().public.API_URL+"/api/vendors/login",{method:"POST",body:{email:n.value,password:a.value}}).then(t=>{if(!t.apiToken||!t.vendor){l.value=!0,o.value=!1;return}const s=v("apiToken"),c=v("activeVendor");s.value=t.apiToken,c.value=t.vendor,localStorage.setItem("apiToken",t.apiToken),localStorage.setItem("activeVendor",JSON.stringify(t.vendor)),o.value=!1,I().push("/haendlerbereich")}).catch(()=>{l.value=!0,o.value=!1})};return(t,s)=>{const c=N,w=H,y=E,k=P;return u(),g("div",R,[r(w,null,{default:f(()=>[r(c,null,{default:f(()=>[B("Händlerlogin | Solis")]),_:1})]),_:1}),e("div",q,[z,e("div",C,[e("div",M,[e("div",U,[D,e("div",J,[e("div",L,[e("form",{class:"space-y-6",onSubmit:S(x,["prevent"])},[e("div",null,[F,e("div",$,[_(e("input",{id:"email","onUpdate:modelValue":s[0]||(s[0]=m=>h(n)?n.value=m:null),name:"email",type:"email",autocomplete:"email",required:"",class:"block w-full rounded-md border-0 py-1.5 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"},null,512),[[p,i(n)]])])]),e("div",G,[K,e("div",Q,[_(e("input",{id:"password","onUpdate:modelValue":s[1]||(s[1]=m=>h(a)?a.value=m:null),name:"password",type:"password",autocomplete:"current-password",required:"",class:"block w-full rounded-md border-0 py-1.5 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"},null,512),[[p,i(a)]])])]),W,e("div",X,[Y,i(o)?(u(),T(y,{key:0,black:""})):b("",!0)]),i(l)?(u(),g("div",Z,[e("div",ee,[e("div",te,[r(i(A),{class:"h-5 w-5 text-red-400","aria-hidden":"true"})]),se])])):b("",!0)],40,O)])])])]),e("div",oe,[r(k,{width:752,class:"absolute inset-0 h-full w-full object-cover rounded-md",src:"/img/pics/bg.jpeg",alt:""})])])])])}}};export{ce as default};