1import{a as pe}from"./chunk-VKIO5NBM.js";import{a as K}from"./chunk-MYJSM24P.js";import{a as le}from"./chunk-7YIZYP76.js";import{a as j,b as F,c as me}from"./chunk-AXTS6PCD.js";import{a as J}from"./chunk-7IK32ZZC.js";import{a as ae,b as se}from"./chunk-2ALYGAGE.js";import{a as ne}from"./chunk-G6OBUS4O.js";import{a as re}from"./chunk-LJS4N3J2.js";import{b as oe,d as ie}from"./chunk-FSF2CDZD.js";import{b as te}from"./chunk-M42CR5P3.js";import"./chunk-6D3XJSE5.js";import{a as O}from"./chunk-OYJ3EW7T.js";import"./chunk-HD2FZGOR.js";import"./chunk-VCPOKOZX.js";import{q as ee}from"./chunk-JBRXXFOC.js";import{a as $}from"./chunk-GHI3BADO.js";import{hb as D,ib as B,kb as u,mb as G,nb as Q,qb as U,sb as W,tb as H,wb as Y,xb as X,yb as Z}from"./chunk-W5RYLE24.js";import{e as V,u as z,x as I,y as M}from"./chunk-SD4E7GE5.js";import{E as R,Eb as C,Kb as p,Pb as r,Qb as o,Rb as i,V as k,Vb as N,Xb as y,Yb as f,ac as v,ca as c,cb as l,dc as T,ec as q,fc as A,ic as h,jb as P,jc as a,lc as L,m as E,oa as w,pa as x,pb as b,wb as d}from"./chunk-CEB27IDP.js";import"./chunk-ZGVHDELW.js";var ue=["googleButtonContainer"];function ge(t,m){t&1&&i(0,"app-error",28)}function fe(t,m){if(t&1&&d(0,ge,1,0,"app-error",28),t&2){let n=f();p(!(n.firstName==null||n.firstName.errors==null)&&n.firstName.errors.required?0:-1)}}function Ce(t,m){t&1&&i(0,"app-error",29)}function _e(t,m){if(t&1&&d(0,Ce,1,0,"app-error",29),t&2){let n=f();p(!(n.lastName==null||n.lastName.errors==null)&&n.lastName.errors.required?0:-1)}}function he(t,m){t&1&&i(0,"app-error",30)}function we(t,m){t&1&&i(0,"app-error",31)}function xe(t,m){if(t&1&&d(0,he,1,0,"app-error",30)(1,we,1,0,"app-error",31),t&2){let n=f();p(!(n.email==null||n.email.errors==null)&&n.email.errors.required?0:!(n.email==null||n.email.errors==null)&&n.email.errors.email?1:-1)}}function Pe(t,m){t&1&&i(0,"app-error",8)}function be(t,m){t&1&&i(0,"app-error",32)}function ye(t,m){t&1&&i(0,"app-error",33)}function ve(t,m){if(t&1&&d(0,be,1,0,"app-error",32)(1,ye,1,0,"app-error",33),t&2){let n=f();p(!(n.password==null||n.password.errors==null)&&n.password.errors.required?0:!(n.password==null||n.password.errors==null)&&n.password.errors.weakPassword?1:-1)}}function Me(t,m){t&1&&i(0,"app-error",34)}function Oe(t,m){t&1&&i(0,"app-error",35)}function Se(t,m){if(t&1&&d(0,Me,1,0,"app-error",34)(1,Oe,1,0,"app-error",35),t&2){let n=f();p(!(n.rePassword==null||n.rePassword.errors==null)&&n.rePassword.errors.required?0:!(n.rePassword==null||n.rePassword.errors==null)&&n.rePassword.errors.notEqual?1:-1)}}function Ee(t,m){if(t&1){let n=N();r(0,"button",36),y("click",function(){w(n);let e=f();return x(e.onRegister())}),a(1," Sign up "),o()}}function Re(t,m){t&1&&i(0,"app-spinner")}var de=(()=>{class t{constructor(){this.fb=c(Y),this.userService=c(te),this.modalService=c(j),this.googleSignInService=c(pe),this.route=c(z),this.router=c(I),this.form=this.fb.group({firstName:["",[u.required]],lastName:["",[u.required]],email:["",[u.email,u.required]],password:["",[u.required,se]],rePassword:["",[u.required]],terms:[!1,[u.requiredTrue]],ageConfirmation:[!1,[u.requiredTrue]]},{validators:[ae("password","rePassword")]}),this.isLoading=P(!1),this.accountExistsError=P(!1),this.emailToSend=P(""),this.AppRoutes=O,this.faCheckCircle=ee,this.Modal=F,this.faEyeSlash=oe,this.faEye=ie}ngOnInit(){this.googleSignInService.initialize().then(()=>{this.googleButtonContainer&&this.googleSignInService.renderButton(this.googleButtonContainer.nativeElement,n=>this.handleGoogleLogin(n))}).catch(n=>console.error("Failed to initialize Google Sign-In:",n))}get firstName(){return this.form.get("firstName")}get lastName(){return this.form.get("lastName")}get email(){return this.form.get("email")}get password(){return this.form.get("password")}get rePassword(){return this.form.get("rePassword")}onRegister(){this.form.invalid||(this.accountExistsError.set(!1),this.isLoading.set(!0),this.emailToSend.set(this.email?.value),this.userService.register({email:this.email?.value,username:this.email?.value,password:this.rePassword?.value,first_name:this.firstName?.value,last_name:this.lastName?.value}).pipe(k(()=>{this.form.reset(),this.modalService.open(F.CheckEmail)}),R(n=>(n instanceof V&&n.status.toString().startsWith("4")&&this.accountExistsError.set(!0),E(null)))).subscribe(()=>this.isLoading.set(!1)))}handleGoogleLogin(n){this.isLoading.set(!0),this.userService.googleLogin(n).pipe(k(()=>{this.isLoading.set(!1);
1let s=this.route.snapshot.queryParams.next;s?this.router.navigate([s]):this.userService.isAdmin()?this.router.navigate(["/"+K.Admin]):this.router.navigate(["/"])}),R(()=>(this.isLoading.set(!1),E(null)))).subscribe()}static{this.\u0275fac=function(s){return new(s||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-register-form"]],viewQuery:function(s,e){if(s&1&&T(ue,5),s&2){let g;q(g=A())&&(e.googleButtonContainer=g.first)}},decls:56,vars:16,consts:[["pass",""],["rePass",""],["googleButtonContainer",""],[1,"form-card",3,"formGroup"],[1,"form-control"],["type","text","name","firstName","placeholder","name","formControlName","firstName","data-test","first-name"],["type","text","name","lastName","placeholder","surname","formControlName","lastName","data-test","last-name"],["type","email","name","email","placeholder","e-mail address","formControlName","email","data-test","email"],["error","Account with same email already exists!","data-test","account-exists"],[1,"password-wrapper"],["type","password","name","password","placeholder","password","formControlName","password","data-test","password"],["type","button",1,"password-toggle",3,"click"],[3,"icon"],["type","password","name","repeatPassword","placeholder","repeat password","formControlName","rePassword","data-test","re-password"],[1,"agreement"],["type","checkbox","formControlName","terms","data-test","terms-checkbox"],["href","#",1,"link"],["type","checkbox","formControlName","ageConfirmation","data-test","age-checkbox"],[1,"button-group"],["type","submit","data-test","register-button",1,"btn","btn-primary"],[1,"or-divider"],["data-test","google-register"],[3,"isSmall","tag"],[1,"text-center"],["data-test","register-modal",1,"body"],[1,"text-center","mt-2",3,"icon"],[1,"text-center","my-2"],[1,"btn","btn-primary","mt-3",3,"routerLink"],["error","Name is required"],["error","surname is required"],["error","email is required"],["error","email is not valid"],["error","password is required","data-test","password-required"],["error","use at least 6 characters with one upper case, number and special character.","data-test","weak-password"],["error","repeat password is required","data-test","re-password-required"],["error","passwords do not match","data-test","passwords-not-match"],["type","submit","data-test","register-button",1,"btn","btn-primary",3,"click"]],template:function(s,e){if(s&1){let g=N();r(0,"form",3)(1,"div",4),i(2,"input",5),d(3,fe,1,1),o(),r(4,"div",4),i(5,"input",6),d(6,_e,1,1),o(),r(7,"div",4),i(8,"input",7),d(9,xe,2,1)(10,Pe,1,0,"app-error",8),o(),r(11,"div",4)(12,"div",9),i(13,"input",10,0),r(15,"button",11),y("click",function(){w(g);let _=h(14);return x(_.type=_.type==="password"?"text":"password")}),i(16,"fa-icon",12),o()(),d(17,ve,2,1),o(),r(18,"div",4)(19,"div",9),i(20,"input",13,1),r(22,"button",11),y("click",function(){w(g);let _=h(21);return x(_.type=_.type==="password"?"text":"password")}),i(23,"fa-icon",12),o()(),d(24,Se,2,1),o(),r(25,"label",14),i(26,"input",15),r(27,"span"),a(28,"By creating an account you agree to our "),r(29,"a",16),a(30,"Terms of Service"),o(),a(31," and "),r(32,"a",16),a(33,"Privacy Policy"),o(),a(34,"."),o()(),r(35,"label",14),i(36,"input",17),r(37,"span"),a(38,"By submitting this form, I confirm that I am at least 16 years old."),o()(),r(39,"div",18),d(40,Ee,2,0,"button",19)(41,Re,1,0,"app-spinner"),o(),r(42,"div",20),a(43,"OR"),o(),i(44,"div",21,2),o(),r(46,"app-modal",22)(47,"app-modal-body",23)(48,"div",24),i(49,"fa-icon",25),r(50,"h2",26),a(51,"Verify your email!"),o(),r(52,"p",23),a(53),o(),r(54,"a",27),a(55,"Continue"),o()()()()}if(s&2){let g=h(14),S=h(21);C("formGroup",e.form),l(3),p(!(e.firstName!=null&&e.firstName.valid)&&(e.firstName!=null&&e.firstName.dirty||e.firstName!=null&&e.firstName.touched)?3:-1),l(3),p(!(e.lastName!=null&&e.lastName.valid)&&(e.lastName!=null&&e.lastName.dirty||e.lastName!=null&&e.lastName.touched)?6:-1),l(3),p(!(e.email!=null&&e.email.valid)&&(e.email!=null&&e.email.dirty||e.email!=null&&e.email.touched)?9:-1),l(),p(e.accountExistsError()?10:-1),l(6),C("icon",g.type==="password"?e.faEye:e.faEyeSlash),l(),p(!(e.password!=null&&e.password.valid)&&(e.password!=null&&e.password.dirty||e.password!=null&&e.password.touched)?17:-1),l(6),C("icon",S.type==="password"?e.faEye:e.faEyeSlash),l(),p(!(e.rePassword!=null&&e.rePassword.valid)&&(e.rePassword!=null&&e.rePassword.dirty||e.rePassword!=null&&e.rePassword.touched)?24:-1),l(16),p(e.isLoading()?41:40),l(6),C("isSmall",!0)("tag",e.Modal.CheckEmail),l(3),C("icon",e.faCheckCircle),l(4),L(" We\u2019ve sent an email to ",e.emailToSend(),". Please, check your inbox and follow the instructions to confirm your email address and complete the registration. "),l(),v("routerLink","/",e.AppRoutes.Login,"")}},dependencies:[X,U,B,D,G,Q,ne,re,M,me,le,$,Z,W,H],styles:[`[_nghost-%COMP%]{display:block;width:100%}@media (min-width: 768px){[_nghost-%COMP%]{width:fit-content}}@media (max-width: 500px){[_nghost-%COMP%] .agreement[_ngcontent-%COMP%]{font-size:.8rem}}form[_ngcontent-%COMP%]{width:100%;max-width:90vw;margin:0 auto}@media (min-width: 500px){form[_ngcontent-%COMP%]{width:25rem;margin:0}}form[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{background-color:#fff!important;border:1px solid #0C0C3A!important;border-radius:4px!important;font-size:1rem}.form-control[_ngcontent-%COMP%]{margin-bottom:1rem}.flex[_ngcontent-%COMP%]{display:flex;justify-content:center}.btn[_ngcontent-%COMP%]{width:100%}p[_ngcontent-%COMP%]{font-size:16px;font-weight:400}.name-surname[_ngcontent-%COMP%]{justify-content:space-between}.name-surname[_ngcontent-%COMP%] .surname[_ngcontent-%COMP%]:nth-child(1){display:flex;justify-content:flex-end}.name-surname[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%}.text-bottom[_ngcontent-%COMP%]{text-align:center}.text-bottom[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none;color:#111827;font-weight:600}app-spinner[_ngcontent-%COMP%]{height:2rem}app-modal[_ngcontent-%COMP%] .body[_ngcontent-%COMP%]{max-width:400px}app-modal[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:32px;color:#111827}app-modal[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#4b5563;font-size:16px}app-modal[_ngcontent-%COMP%] fa-icon[_ngcontent-%COMP%]{color:#ff0035;font-size:36px}app-modal[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#ff0035;width:100%;padding:.5rem 0}app-modal[_ngcontent-%COMP%] .text-center[_ngcontent-%COMP%]{display:flex;justify-content:center}.button-group[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;margin-bottom:1.5rem;margin-top:1rem}.btn.btn-primary[_ngcontent-%COMP%]{background-color:#f63737!important;color:#fff!important;padding:10px 44px!important;border-radius:4px!important;border:none!important;font-size:.95rem!important;text-transform:uppercase!important;font-weight:700!important;letter-spacing:.02em!important;cursor:pointer!important;transition:background-color .15s ease,color .15s ease!important;width:auto!important}.btn.btn-primary[_ngcontent-%COMP%]:hover{background-color:#fff!important;color:#ff0035!important}.spinner[_ngcontent-%COMP%]{height:2rem}.password-wrapper[_ngcontent-%COMP%]{position:relative}.password-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-right:2.5rem;width:100%}.password-toggle[_ngcontent-%COMP%]{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);background:none;border:none;padding:0;margin:0;cursor:pointer;border:none!important}fa-icon[_ngcontent-%COMP%]{font-size:1.1rem;color:#ff0035}.or-divider[_ngcontent-%COMP%]{text-align:center;margin:1.5rem 0;font-weight:600;color:#0c0c3a;position:relative}.or-divider[_ngcontent-%COMP%]:before, .or-divider[_ngcontent-%COMP%]:after{position:absolute;top:50%;width:45%;height:1px;background-color:#ddd}.or-divider[_ngcontent-%COMP%]:before{left:0}.or-divider[_ngcontent-%COMP%]:after{right:0}.btn-google[_ngcontent-%COMP%]{width:100%;background-color:#fff;border:1px solid #0C0C3A;color:#111827;font-weight:600;display:flex;align-items:center;justify-content:center;gap:.75rem;padding:.75rem;border-radius:4px!important;cursor:pointer;transition:background-color .2s}.btn-google[_ngcontent-%COMP%]:hover{background-color:#f5f5f5}.btn-google[_ngcontent-%COMP%] .google-icon[_ngcontent-%COMP%]{opacity:1!important;width:20px;height:20px}.agreement[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;margin-top:1rem;cursor:pointer}.agreement[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{border:1px solid #0C0C3A!important;border-radius:4px!important;margin-top:.2rem;cursor:pointer;flex-shrink:0}.agreement[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.85rem;color:#0c0c3a;line-height:1.4}.agreement[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]{color:#111827;text-decoration:underline}.agreement[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:hover{color:#ff0035} 2/*# sourceMappingURL=register-form.component-C2ZHE7U6.css.map */`],changeDetection:0})}}return t})();var lt=(()=>
2{class t{constructor(){this.metaService=c(J),this.AppRoutes=O,this.metaService.set({title:"Register",description:"Register to become a part of Videolectures community",image:"https://videolectures/net/assets/logo_big.png",index:!0})}static{this.\u0275fac=function(s){return new(s||t)}}static{this.\u0275cmp=b({type:t,selectors:[["app-register"]],decls:13,vars:2,consts:[["data-test","register-page",1,"container"],[1,"card"],[1,"button-wrapper"],[1,"btn","btn-primary",3,"routerLink"]],template:function(s,e){s&1&&(r(0,"div",0)(1,"div",1)(2,"h2"),a(3,"CREATE AN ACCOUNT"),o(),i(4,"app-register-form"),o(),r(5,"div",1)(6,"h2"),a(7,"ALREADY A VIEWER ?"),o(),r(8,"p"),a(9,"Go to your account."),o(),r(10,"div",2)(11,"a",3),a(12," Sign in "),o()()()()),s&2&&(l(11),v("routerLink","/",e.AppRoutes.Login,""))},dependencies:[de,M],styles:[`[_nghost-%COMP%]{width:100%;flex:1;display:flex;align-items:center;padding:2rem;background-color:#fff}.container[_ngcontent-%COMP%]{display:flex;gap:2rem;justify-content:center;align-items:flex-start;max-width:1200px;margin:0 auto;width:100%}@media (max-width: 768px){.container[_ngcontent-%COMP%]{flex-direction:column;gap:40px;align-items:center}}.card[_ngcontent-%COMP%]{border:1px solid #ff0035;border-radius:2px!important;padding:2rem;background-color:#fff;flex:1;max-width:450px}@media (max-width: 768px){.card[_ngcontent-%COMP%]{max-width:100%}}h2[_ngcontent-%COMP%]{font-size:1.5rem;font-weight:700;color:#0c0c3a;margin-bottom:2rem;text-transform:uppercase}p[_ngcontent-%COMP%]{color:#0c0c3a;margin-bottom:2rem;font-size:.95rem}.button-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:flex-start}.btn[_ngcontent-%COMP%]{border-radius:4px!important;text-transform:uppercase;font-weight:700;letter-spacing:.02em;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;cursor:pointer;text-decoration:none;transition:background-color .15s ease,color .15s ease!important}.btn-primary[_ngcontent-%COMP%]{border:1px solid transparent!important;background-color:#f63737!important;color:#fff!important;padding:10px 44px!important;font-size:.95rem!important}.btn-primary[_ngcontent-%COMP%]:hover{background-color:#fff!important;color:#ff0035!important} 3/*# sourceMappingURL=register.page-FTXMEOQR.css.map */`],changeDetection:0})}}return t})();export{lt as default}; 4//# sourceMappingURL=chunk-IUAYE46B.js.map
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.