import{a as U}from"./chunk-EGPFC4LG.js";import{b as z}from"./chunk-4JEYJIQC.js";import{A as T,C as A,E as F,H as D,K as L,R as j,S as q,T as G,U as R,fa as V,p as E,w as N,x as b,z as O}from"./chunk-UET2LJ27.js";import{Ac as B,Bc as k,Fa as f,Ha as C,Ka as y,Ma as u,Qa as n,Ra as r,Sa as d,Z as v,Za as M,_a as _,bb as x,jb as l,kb as S,lb as m,rb as h,tc as P,ua as o,va as c,vb as s,wb as p,xc as I}from"./chunk-YEIQIJLV.js";import"./chunk-IA5I2OHH.js";function J(e,g){if(e&1&&(n(0,"div",0),d(1,"i",2),l(2),r()),e&2){let t=_();o(2),m(" ",t.alert.message," ")}}function K(e,g){if(e&1&&(n(0,"div",1),d(1,"i",3),l(2),r()),e&2){let t=_();o(2),m("",t.alert.message," ")}}var W=(()=>{class e{constructor(t){this.notificationService=t,this.notificationService.alertSubject.subscribe(a=>{this.alert=a})}ngOnDestroy(){this.notificationService.notification=!0}static{this.\u0275fac=function(a){return new(a||e)(c(V))}}static{this.\u0275cmp=v({type:e,selectors:[["app-alert"]],standalone:!0,features:[h],decls:2,vars:2,consts:[["role","alert",1,"alert","alert-danger","login-alert"],["role","alert",1,"alert","alert-success","login-alert"],[1,"ri-error-warning-line"],[1,"ri-check-line"]],template:function(a,i){a&1&&f(0,J,3,1,"div",0)(1,K,3,1,"div",1),a&2&&(u(0,i.alert&&i.alert.type=="error"?0:-1),o(),u(1,i.alert&&i.alert.type=="success"?1:-1))}})}}return e})();function Q(e,g){e&1&&(n(0,"div",13),l(1),s(2,"translate"),r()),e&2&&(o(),m(" ",p(2,1,"Phone Number is Required")," "))}function X(e,g){e&1&&(n(0,"div",13),l(1),s(2,"translate"),r()),e&2&&(o(),m(" ",p(2,1,"Invalid Phone Number")," "))}function Y(e,g){e&1&&(n(0,"div",13),l(1),s(2,"translate"),r()),e&2&&(o(),m(" ",p(2,1,"password_is_required")," "))}var $=(()=>{class e{constructor(t,a,i,w){this.store=t,this.router=a,this.formBuilder=i,this.loginservice=w,this.reCaptcha=!0,this.usr_data=[{id:1,admin_type:1,name:"Admin",number:"999999999",email:"admin@gmail.com",otp:0,pwd:"1234",address:null,active_status:0,d_in:0}],this.form=this.formBuilder.group({phone:["",[b.required,b.pattern("^[0-9]{10}$")]],password:new A("",[b.required])})}submit(){console.log("login in"),this.form.markAllAsTouched(),this.form.valid&&this.loginservice.login(this.form.value).subscribe(t=>{console.log(t),t.status==200?this.store.dispatch(new U(this.form.value)).subscribe({complete:()=>{console.log(t.data,t.data[0].path),t.data[0].children.length?this.router.navigateByUrl(t.data[0].children[0].path):this.router.navigateByUrl(t.data[0].path)}}):t.status==202?alert("Invalid UserName or Password"):alert("Server Error")},t=>{})}static{this.\u0275fac=function(a){return new(a||e)(c(E),c(P),c(q),c(z))}}static{this.\u0275cmp=v({type:e,selectors:[["app-login"]],standalone:!0,features:[h],decls:37,vars:22,consts:[[1,"log-in-section","section-b-space",2,"background-image","url(assets/images/bg.png)","height","100vh",`/* full height */
  
   justify-content`,"center","align-items","center","background-size","cover"],[1,"container","w-100",2,"margin-top","140px"],[1,"row"],[1,"col-xl-5","col-lg-6","m-auto"],[1,"log-in-box"],[1,"log-in-title"],["src","assets/images/logo.png","alt","",1,"img-fluid","logo-img"],[1,"input-box"],[1,"row","g-4",3,"ngSubmit","formGroup"],[1,"col-12"],[1,"form-floating","theme-form-floating","log-in-form"],["type","text","id","phone","formControlName","phone","pattern","[0-9]{10}",1,"form-control",3,"placeholder"],["for","phone"],[1,"invalid-feedback"],["type","password","id","password","formControlName","password",1,"form-control",3,"placeholder"],["for","password"],[2,"background-color","#000000","border","1px solid #000000",3,"id"],[1,"container"],[2,"text-align","center","margin-top","150px"],[2,"font-weight","bold","color","#ffffff"],["href","https://godavariinnovations.com/","target","_blank"]],template:function(a,i){a&1&&(n(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3),d(4,"app-alert"),n(5,"div",4)(6,"div",5),d(7,"img",6),r(),n(8,"div",7)(9,"form",8),M("ngSubmit",function(){return i.submit()}),n(10,"div",9)(11,"div",10),d(12,"input",11),s(13,"translate"),n(14,"label",12),l(15),s(16,"translate"),r(),f(17,Q,3,3,"div",13)(18,X,3,3,"div",13),r()(),n(19,"div",9)(20,"div",10),d(21,"input",14),s(22,"translate"),n(23,"label",15),l(24),s(25,"translate"),r(),f(26,Y,3,3,"div",13),r()(),n(27,"div",9)(28,"button",16),l(29),s(30,"translate"),r()()()()()()()(),n(31,"div",17)(32,"div",18)(33,"p",19),l(34,"Designed & Developed By "),n(35,"a",20),l(36," Godavari Wave Technologies Pvt Ltd."),r()()()()()),a&2&&(o(9),C("formGroup",i.form),o(3),x("placeholder",p(13,12,"Phone Number")),o(3),S(p(16,14,"Phone Number")),o(2),u(17,i.form.controls.phone.touched&&(i.form.controls.phone.errors!=null&&i.form.controls.phone.errors.required)?17:-1),o(),u(18,i.form.controls.phone.touched&&(i.form.controls.phone.errors!=null&&i.form.controls.phone.errors.pattern)?18:-1),o(3),x("placeholder",p(22,16,"password")),o(3),S(p(25,18,"password")),o(2),u(26,i.form.controls.password.touched&&(i.form.controls.password.errors!=null&&i.form.controls.password.errors.required)?26:-1),o(2),y("btn btn-theme w-100 justify-content-center"),C("id","login_btn"),o(),m(" ",p(30,20,"log_in")," "))},dependencies:[k,B,G,F,N,O,T,j,R,D,L,I,W],styles:[".log-in-section[_ngcontent-%COMP%]   .log-in-box[_ngcontent-%COMP%]   .logo-img[_ngcontent-%COMP%]{width:250px;margin:0 auto 20px;display:block}.log-in-section[_ngcontent-%COMP%]{overflow-x:hidden;display:block;align-items:center;position:relative;z-index:0;min-height:100vh;overflow:auto;padding:calc(25px + 35 * (100vw - 320px) / 1600) 0}.log-in-section[_ngcontent-%COMP%]   .log-in-box[_ngcontent-%COMP%]{background-color:#cba35e;padding:calc(16px + .02125*(100vw - 320px));border-radius:0}.log-in-section[_ngcontent-%COMP%]   .log-in-box[_ngcontent-%COMP%]   .btn-theme[_ngcontent-%COMP%]{transition:none;background-color:#000;border:1px solid #000000}.form-control[_ngcontent-%COMP%]{background:transparent!important}.invalid-feedback[_ngcontent-%COMP%]{font-weight:600}"]})}}return e})();var ge=[{path:"login",component:$}];export{ge as auth};
