mkA~(@^_^@)~PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT p0 import{z as f,B as c,b as L,m,l as p,k as v,o as w,w as j,t as y,C as V,p as k,j as e,S as s}from"./index-DoU2MHKd.js";import{M as S}from"./index-BrNVkngO.js";import{L as T}from"./logo-shadow-nve3uAwj.js";import{u as b,B as A}from"./BlurComponent-By-zEEWf.js";import{g as I,m as _}from"./firebase-BHK5FA3w.js";import{F as E}from"./index-m30_MRwT.js";import{a as M}from"./index-CVW_SfJD.js";import{T as B}from"./index-Dx3xM2U7.js";import{P as H}from"./index-B2Phbgk6.js";import{T as C}from"./Typography-CcGLjhMP.js";import{I as d}from"./InputAdornment-dDMHAIE_.js";import"./Box-COt46hbf.js";import"./observer-B278D4P8.js";import"./ownerWindow-PUvYI-j5.js";import"./isHostComponent-BHK9_qiJ.js";import"./IconButton-58mvjT_A.js";const P="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.86466%204.6379C3.92465%203.65363%205.38503%203.25%207%203.25H17C18.615%203.25%2020.0754%203.65363%2021.1353%204.6379C22.2054%205.63152%2022.75%207.10705%2022.75%209V16C22.75%2017.893%2022.2054%2019.3685%2021.1353%2020.3621C20.0754%2021.3464%2018.615%2021.75%2017%2021.75H7C5.38503%2021.75%203.92465%2021.3464%202.86466%2020.3621C1.79462%2019.3685%201.25%2017.893%201.25%2016V9C1.25%207.10705%201.79462%205.63152%202.86466%204.6379Z'%20fill='%23CCCCCC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M19.3633%207.81026C19.6166%208.13802%2019.5562%208.60904%2019.2285%208.8623L13.6814%2013.1486C12.691%2013.9138%2011.3089%2013.9138%2010.3185%2013.1486L4.77144%208.8623C4.44367%208.60904%204.38328%208.13802%204.63655%207.81026C4.88982%207.48249%205.36083%207.4221%205.6886%207.67537L11.2356%2011.9616C11.6858%2012.3095%2012.3141%2012.3095%2012.7642%2011.9616L18.3113%207.67537C18.6391%207.4221%2019.1101%207.48249%2019.3633%207.81026Z'%20fill='%2304364A'/%3e%3c/svg%3e",q="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2012.5C2%208.72876%202%206.84315%203.17157%205.67157C4.34315%204.5%206.22876%204.5%2010%204.5H14C17.7712%204.5%2019.6569%204.5%2020.8284%205.67157C22%206.84315%2022%208.72876%2022%2012.5C22%2016.2712%2022%2018.1569%2020.8284%2019.3284C19.6569%2020.5%2017.7712%2020.5%2014%2020.5H10C6.22876%2020.5%204.34315%2020.5%203.17157%2019.3284C2%2018.1569%202%2016.2712%202%2012.5Z'%20fill='%23CCCCCC'/%3e%3cpath%20d='M12.6047%2011.0455C12.6047%2010.7442%2012.3341%2010.5%2012.0004%2010.5C11.6666%2010.5%2011.3961%2010.7442%2011.3961%2011.0455V11.5554L10.9067%2011.3004C10.6177%2011.1497%2010.2481%2011.2391%2010.0812%2011.5C9.91438%2011.7609%2010.0134%2012.0945%2010.3024%2012.2451L10.7915%2012.4999L10.3022%2012.7549C10.0132%2012.9055%209.9142%2013.2391%2010.0811%2013.5C10.2479%2013.7609%2010.6175%2013.8503%2010.9065%2013.6996L11.3961%2013.4445V13.9545C11.3961%2014.2558%2011.6666%2014.5%2012.0004%2014.5C12.3341%2014.5%2012.6047%2014.2558%2012.6047%2013.9545V13.4449L13.0934%2013.6996C13.3825%2013.8503%2013.7521%2013.7609%2013.9189%2013.5C14.0858%2013.2391%2013.9868%2012.9055%2013.6977%2012.7549L13.2086%2012.4999L13.6975%2012.2451C13.9865%2012.0945%2014.0856%2011.7609%2013.9187%2011.5C13.7518%2011.2391%2013.3823%2011.1497%2013.0933%2011.3004L12.6047%2011.555V11.0455Z'%20fill='%2304364A'/%3e%3cpath%20d='M7.00039%2010.5C7.33413%2010.5%207.60467%2010.7442%207.60467%2011.0455V11.555L8.09329%2011.3004C8.38231%2011.1497%208.75188%2011.2391%208.91875%2011.5C9.08562%2011.7609%208.98659%2012.0945%208.69757%2012.2451L8.20856%2012.4999L8.69776%2012.7549C8.98678%2012.9055%209.08581%2013.2391%208.91894%2013.5C8.75207%2013.7609%208.3825%2013.8503%208.09348%2013.6996L7.60467%2013.4449V13.9545C7.60467%2014.2558%207.33413%2014.5%207.00039%2014.5C6.66666%2014.5%206.39611%2014.2558%206.39611%2013.9545V13.4445L5.90652%2013.6996C5.6175%2013.8503%205.24792%2013.7609%205.08106%2013.5C4.91419%2013.2391%205.01322%2012.9055%205.30224%2012.7549L5.79144%2012.4999L5.30243%2012.2451C5.01341%2012.0945%204.91438%2011.7609%205.08125%2011.5C5.24812%2011.2391%205.61769%2011.1497%205.90671%2011.3004L6.39611%2011.5554V11.0455C6.39611%2010.7442%206.66666%2010.5%207.00039%2010.5Z'%20fill='%2304364A'/%3e%3cpath%20d='M17.6047%2011.0455C17.6047%2010.7442%2017.3341%2010.5%2017.0004%2010.5C16.6667%2010.5%2016.3961%2010.7442%2016.3961%2011.0455V11.5554L15.9067%2011.3004C15.6177%2011.1497%2015.2482%2011.2391%2015.0813%2011.5C14.9144%2011.7609%2015.0134%2012.0945%2015.3025%2012.2451L15.7914%2012.4999L15.3022%2012.7549C15.0132%2012.9055%2014.9142%2013.2391%2015.0811%2013.5C15.2479%2013.7609%2015.6175%2013.8503%2015.9065%2013.6996L16.3961%2013.4445V13.9545C16.3961%2014.2558%2016.6667%2014.5%2017.0004%2014.5C17.3341%2014.5%2017.6047%2014.2558%2017.6047%2013.9545V13.4449L18.0935%2013.6996C18.3825%2013.8503%2018.7521%2013.7609%2018.9189%2013.5C19.0858%2013.2391%2018.9868%2012.9055%2018.6978%2012.7549L18.2086%2012.4999L18.6975%2012.2451C18.9866%2012.0945%2019.0856%2011.7609%2018.9188%2011.5C18.7518%2011.2391%2018.3823%2011.1497%2018.0933%2011.3004L17.6047%2011.555V11.0455Z'%20fill='%2304364A'/%3e%3c/svg%3e",Z=f({email:c().required().email(),password:c().required().min(8)}),W=()=>(L.useEffect(()=>{(async()=>{try{const t=await I(_,{vapidKey:m.VAPID_KEY});t?p("device-token",t):console.log("No registration token available.")}catch(t){console.error("Error getting token:",t)}})()},[]),{}),N=()=>{W();const{t:o}=v(),t=w(),[,a]=j(),{handleError:n,fireToast:g}=b(),{loading:u,requestHandlers:h}=y();return{t:o,defaultValues:{type:"admin",password:"",email:"",device_token:""},onSubmit:async r=>{const x=V("device-token");r.type="admin",r.device_token=x;const{res:i,error:l}=await h({type:"POST",endpoint:"/login",body:r});if(l)return n(l);p(m.USER,i.data),a({type:"LOG_IN",payload:{user:i.data.user,token:i.data.token}}),g({type:"success",title:"Welcome to Dentapro!"}),t(k.analytics)},loading:u}},R=()=>{const{t:o,defaultValues:t,onSubmit:a,loading:n}=N();return e.jsxs(s,{flex:1,width:"100%",maxWidth:500,alignItems:"stretch",pt:5,children:[e.jsx("img",{src:T,style:{alignSelf:"center",maxWidth:"300px",marginBottom:"34px"}}),e.jsx(E,{defaultValues:t,onSubmit:a,schema:Z,children:e.jsxs(s,{gap:2,py:3,px:2,children:[e.jsxs(s,{gap:2,mb:1.5,children:[e.jsx(C,{variant:"h3",color:"secondary",children:o("title.login")}),e.jsx(C,{variant:"h6",color:"secondary",children:o("title.get_start_with_dentapro")})]}),e.jsx(B,{name:"email",type:"username",label:"email_or_phone",startAdornment:e.jsx(d,{position:"start",children:e.jsx("img",{src:P})})}),e.jsx(H,{name:"password",label:"password",startAdornment:e.jsx(d,{position:"start",children:e.jsx("img",{src:q})})}),e.jsx(M,{sx:{mt:6},fullWidth:!0,type:"submit",variant:"contained",loading:n,children:"login"})]})})]})},r2=()=>e.jsxs(A,{children:[e.jsx(S,{title:"login"}),e.jsx(s,{alignItems:"center",justifyContent:"flex-start",sx:{width:"100%"},children:e.jsx(R,{})})]});export{r2 as default};