1import{o as i,c as n,a as e,b as g,u as k,t as $,d,w as p,e as v,v as f,r as L,f as u,N as h}from"./app-DVhk9hEg.js";/* empty css */function C(c,r){return i(),n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.28 7.22a.75.75 0 0 0-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 1 0 1.06 1.06L10 11.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L11.06 10l1.72-1.72a.75.75 0 0 0-1.06-1.06L10 8.94 8.28 7.22Z","clip-rule":"evenodd"})])}const N={key:0,class:"rounded-md bg-red-50 p-4 my-5"},P={class:"flex"},S={class:"shrink-0"},V={class:"ml-3"},B={key:0,class:"text-sm font-medium text-red-800"},M={key:1,class:"text-sm font-medium text-red-800"},O={key:2,class:"mt-2 text-sm text-red-700"},T={role:"list",class:"list-disc space-y-1 pl-5"},y={__name:"ErrorPanel",props:{error:{type:Object,default:null}},setup(c){const r=c;return(x,l)=>{var a,t;return r.error?(i(),n("div",N,[e("div",P,[e("div",S,[g(k(C),{class:"h-5 w-5 text-red-400","aria-hidden":"true"})]),e("div",V,[((a=r.error)==null?void 0:a.source)==="danger"?(i(),n("h3",B,[...l[0]||(l[0]=[e("p",null,"ÐаннÑе не бÑли ÑоÑ
ÑаненÑ. ÐÑоблема на ÑÑоÑоне ÑеÑвеÑа.",-1),e("p",null,"ÐапÑÐ¾Ñ Ð² ÑеÑ
поддеÑжкÑ",-1),e("div",null,"ÐвÑомаÑиÑеÑки оÑпÑавиÑÑ Ð·Ð°Ð¿ÑÐ¾Ñ Ð² ÑеÑ
поддеÑжкÑ",-1)])])):(i(),n("h3",M," РваÑей заÑвке обнаÑÑÐ¶ÐµÐ½Ñ Ð¾Ñибки ")),(t=r.error)!=null&&t.message?(i(),n("div",O,[e("ul",T,[e("li",null,$(r.error.message),1)])])):d("",!0)])])])):d("",!0)}}},j={class:"flex min-h-full font-inter flex-1 flex-col justify-center pb-12 pt-16 sm:px-6 lg:px-8"},q={class:"mt-10 sm:mx-auto sm:w-full sm:max-w-[480px]"},D={class:"bg-white px-6 py-12 shadow-sm sm:rounded-lg sm:px-12"},E={class:"mt-2 relative"},U={key:0},Z={class:"mt-2 relative"},H={key:0},I={key:1},z={__name:"Login",setup(c){const r=u([]),x=u(null),l=u(null),a=u(null),t=L({email:"",password:""}),w=()=>{api.post("login",t).then(s=>{h.visit("/ru/leads"),r.value=s,localStorage.setItem("token",s.token),t.email="",t.password="",h.visit("/ru/leads")}).catch(s=>l.value=s)},_=()=>{api.post("api/login/otp",t).then(s=>{x.value=s}
1).catch(s=>l.value=s)},b=()=>{t.email.length>0&&(t.login=t.email,api.post("api/login/check",t).then(s=>a.value=200).catch(s=>{l.value=s,a.value=s.status,console.log("arnat",s.status)}))};return(s,o)=>(i(),n("div",j,[o[5]||(o[5]=e("div",{class:"sm:mx-auto sm:w-full sm:max-w-md"},[e("img",{class:"mx-auto h-10 w-auto",src:"/assets/LeadHub.png",alt:"Your Company"}),e("h2",{class:"mt-6 text-center text-2xl font-bold leading-9 tracking-tight text-gray-900"},"ÐÑ
од в аккаÑнÑ")],-1)),e("div",q,[e("div",D,[e("form",{class:"space-y-6",action:"/login",method:"POST",onSubmit:p(w,["prevent"])},[e("div",null,[o[2]||(o[2]=e("label",{for:"login",class:"block text-sm/6 font-medium text-gray-900"},"Login",-1)),e("div",E,[v(e("input",{type:"text",name:"login","onUpdate:modelValue":o[0]||(o[0]=m=>t.email=m),id:"login",autocomplete:"login",required:"",class:"block w-full rounded-md border-0 px-3 py-1.5 text-base text-gray-900 outline-1 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",placeholder:"[email protected]"},null,512),[[f,t.email]]),e("button",{type:"button",onClick:p(b,["stop","prevent"]),class:"absolute right-1.5 top-1/2 cursor-pointer text-indigo-600 -translate-y-1/2 rounded px-2 py-0.5 text-xs hover:outline-indigo-500"}," check ")])]),a.value===200?(i(),n("div",U,[e("div",null,[o[3]||(o[3]=e("label",{for:"password",class:"block text-sm/6 font-medium text-gray-900"},"Password",-1)),e("div",Z,[v(e("input",{type:"password",name:"password",id:"password",autocomplete:"current-password",required:"","onUpdate:modelValue":o[1]||(o[1]=m=>t.password=m),class:"block w-full rounded-md border-0 px-3 py-1.5 text-gray-900 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",placeholder:""},null,512),[[f,t.password]]),e("button",{type:"button",onClick:p(_,["stop","prevent"]),class:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded bg-indigo-600 px-2 py-0.5 text-xs text-white hover:bg-indigo-500"}," sent OTP ")])]),l.value?(i(),n("div",H,[g(y,{error:l.value},null,8,["error"])])):d("",!0),o[4]||(o[4]=e("div",{class:"mt-5"},[e("button",{type:"submit",class:"flex w-full justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm/6 font-semibold text-white shadow-xs hover:bg-indigo-500 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},"Sign in")],-1))])):d("",!0),a.value===422?(i(),n("div",I,[g(y,{error:l.value},null,8,["error"])])):d("",!0)],32)])])]))}};export{z as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.