1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[13212],{13212:(ae,d,i)=>{i.r(d),i.d(d,{ClupikSignUpSignupVinculateModule:()=>re});var h=i(43184),g=i(38132),f=i(10467),a=i(89417),v=i(33568),b=i(69915),S=i(68010),C=i(60152),T=i(6961),k=i(45312),u=i(61688),p=i(33384),x=i(25615),e=i(73664),c=i(2615),y=i(72200),N=i(99014),V=i(5900),A=i(80954),F=i(89902),G=i(89792),_=i(69415),Y=i(72357),R=i(6328),w=i(68018);const E=()=>["module.signup.ok","module.signup.ok_desc"],U=r=>({supervised:r}),M=r=>({age:r}),$=r=>({required:!0,name:"global.placeholder.name",placeholder:"global.placeholder.name",inputType:"text",error:r,errorText:"global.validator.required"}),P=(r,n)=>({required:!0,name:"global.placeholder.surname",placeholder:"global.placeholder.surname",inputType:"text",error:r,errorText:n}),z=(r,n)=>({name:"global.placeholder.second_surname",placeholder:"global.placeholder.second_surname",inputType:"text",error:r,errorText:n}),D=(r,n)=>({required:!0,name:"global.placeholder.birthdate",placeholder:"global.placeholder.birthdate",inputType:"date",error:r,errorText:n}),I=(r,n)=>({required:!0,name:"global.placeholder.email",placeholder:"global.placeholder.email",inputType:"text",error:r,errorText:n}),j=(r,n)=>({required:!0,id:"dataPrivacyAll",name:"module.user.accept_private_policy",error:r,errorText:n,light:!0}),J=r=>({clubPublicName:r}),B=r=>({id:"clubNotificationsResponsibleAll",name:r,light:!0}),X=r=>({required:!0,password:!0,placeholder:"global.placeholder.password",inputType:"password",error:r,errorText:"global.validator.required"}),L=(r,n)=>({required:!0,password:!0,placeholder:"global.placeholder.password_confirm",inputType:"password",error:r,errorText:n});function O(r,n){1&r&&e.eu8(0)}function W(r,n){1&r&&e.nrm(0,"app-empty-space",6),2&r&&e.Y8G("size","sm")("textArray",e.lJ4(3,E))("noButton",!0)}function q(r,n){if(1&r&&(e.nrm(0,"app-clupik-state-bar",8),e.nI1(1,"translate")),2&r){const t=e.XpG(2);e.Y8G("subtitle",e.i5U(1,1,"module.signup.vinculate_error_desc",e.eq3(4,M,t.legalAge)))}}function Q(r,n){if(1&r&&(e.j41(0,"app-form-row",11),e.nrm(1,"app-input",19),e.k0s(),e.j41(2,"app-form-row",11),e.nrm(3,"app-input",20),e.k0s()),2&r){const t=e.XpG(3);e.Y8G("items",1),e.R7$(),e.Y8G("inputSize","default")("input",e.eq3(6,X,t.signupForm.get("password").touched&&t.signupForm.get("password").hasError("required"))),e.R7$(),e.Y8G("items",1),e.R7$(),e.Y8G("inputSize","default")("input",e.l_i(8,L,t.confirmPass.error,t.confirmPass.text))}}function H(r,n){}function K(r,n){if(1&r&&(e.j41(0,"form",9)(1,"app-form-row",11),e.nrm(2,"app-input",12),e.k0s(),e.j41(3,"app-form-row",11),e.nrm(4,"app-input",13),e.k0s(),e.j41(5,"app-form-row",11),e.nrm(6,"app-input",14),e.k0s(),e.j41(7,"app-form-row",11),e.nrm(8,"app-input",15),e.k0s(),e.j41(9,"app-form-row",11),e.nrm(10,"app-input",16),e.k0s(),e.nVh(11,Q,4,11)(12,H,0,0),e.nrm(13,"app-input",17)(14,"app-input",18),e.nI1(15,"translate"),e.k0s()),2&r){const t=e.XpG(2);e.Y8G("formGroup",t.signupForm),e.R7$(),e.Y8G("items",1),e.R7$(),e.Y8G("inputSize","default")("input",e.eq3(23,$,t.signupForm.get("firstName").touched&&t.signupForm.get("firstName").hasError("required"))),e.R7$(),e.Y8G("items",1),e.R7$(),e.Y8G("inputSize","default")("input",e.l_i(25,P,t.lastNameError.error,t.lastNameError.text)),e.R7$(),e.Y8G("items",1),e.R7$(),e.Y8G("inputSize","default")("input",e.l_i(28,z,t.secondSurnameError.error,t.secondSurnameError.text)),e.R7$(),e.Y8G("items",1),e.R7$(),e.Y8G("inputSize","default")("input",e.l_i(31,D,t.notAfterToday.error,t.notAfterToday.text))("maxDate",t.maxDate),e.R7$(),e.Y8G("items",1),e.R7$(),e.Y8G("inputSize","default")("input",e.l_i(34,I,t.emailError.error,t.emailError.text)),e.R7$(),e.vxM(t.forceNoPassword?12:11),e.R7$(2),e.Y8G("checkboxConfig",e.l_i(37,j,t.checkTruth.error,t.checkTruth.text)),e.R7$(),e.Y8G("checkboxConfig",e.eq3(42,B,e.i5U(15,20,"module.auth.notifications_permission_club",e.eq3(40,J,t.clubName))))}}function Z(r,n){if(1&r&&(e.nrm(0,"app-form-section",7),e.nI1(1,"translate"),e.nV
1h(2,q,2,6,"app-clupik-state-bar",8),e.nVh(3,K,16,44,"form",9),e.nrm(4,"app-clupik-actions",10)),2&r){const t=e.XpG();e.Y8G("description",e.i5U(1,5,"module.signup.new_tutor_desc",e.eq3(8,U,t.supervised)))("descriptionClass","md"),e.R7$(2),e.vxM(t.ageError?2:-1),e.R7$(),e.vxM(t.loading?-1:3),e.R7$(),e.Y8G("actionsConfig",t.actionsConfig)}}const ee=[{path:"",component:(()=>{class r{globalVars;appService;_auth;_translate;_authService;_clubService;success=!1;loading=!0;forceNoPassword=!1;_supervised;maxDate;minLength;get supervised(){return this._supervised?.firstName+" "+this._supervised?.lastName}signupForm=null;get ageError(){let t=this.signupForm?.get("birthdate").value;return!!t&&this.globalVars.getMoment()().diff(t,"years",!1)<this.legalAge+1}get clubName(){return this._clubService.getClubPublicName()}get lastNameError(){return this.signupForm.get("lastName").touched&&this.signupForm.get("lastName").hasError("required")?{error:!0,text:"global.validator.required"}:{error:!1,text:""}}get secondSurnameError(){return{error:!1,text:""}}get emailError(){return u.T.emailError(this.signupForm,"email")}get confirmPass(){return u.T.confirmPass(this.signupForm,"confirmPassword")}get checkTruth(){return u.T.checkTruth(this.signupForm,"dataPrivacyAll")}get notAfterToday(){return u.T.notAfterToday(this.signupForm,"birthdate")}get legalAge(){return k.c.legalAge}actionsConfig={centerActions:()=>!1,separator:{hasSeparator:()=>!1,class:()=>"divider"},main:{hasAction:()=>!0,disabled:()=>!1,action:()=>this.registerVinculate(),label:()=>"global.button.continue",tooltip:()=>"",type:()=>"button",config:()=>"main",size:()=>"md",class:()=>"",isExternalLink:()=>!1,isFullWidth:()=>this.globalVars.app||this.globalVars.mobile,hasIcon:()=>!1,icon:()=>""},secondary:{hasAction:()=>!1},third:{hasAction:()=>this.globalVars.desktop||this.globalVars.tablet,disabled:()=>!1,action:()=>this.backToSupevised(),label:()=>"global.button.back",tooltip:()=>"",type:()=>"link",config:()=>"main",size:()=>"md",class:()=>"",isExternalLink:()=>!1,isFullWidth:()=>this.globalVars.app||this.globalVars.mobile,hasIcon:()=>!0,icon:()=>"fa-regular fa-chevron-left"}};constructor(t,o,s,l,m,ie){this.globalVars=t,this.appService=o,this._auth=s,this._translate=l,this._authService=m,this._clubService=ie}ngOnInit(){var t=this;return(0,f.A)(function*(){t.maxDate=t.globalVars.getMoment()().toISOString(),t.minLength=yield t._translate.getTranslation("global.validator.min_length",{length:3}),t._supervised=t._authService.provisionalUser,t._supervised||t._authService.invitationEmail?(t._authService.extraData?.supervisedId&&(t._supervised={id:"",firstName:"",lastName:""},t._supervised.id=t._authService.extraData?.supervisedId,t._supervised.firstName=t._authService.extraData?.supervisedFirtsName,t._supervised.lastName=t._authService.extraData?.supervisedLastName),t.buildForm()):(console.error("Redirigido a la home porque no hay supervised ni invitationEmail guardado desde ClupikSignUpSignupVinculateComponent"),t.globalVars.clupikNavigate("/"))})()}ngOnDestroy(){}ngAfterViewInit(){}buildForm(){this.signupForm=new a.gE({firstName:new a.MJ("",a.k0.required),lastName:new a.MJ("",[a.k0.required]),secondSurname:new a.MJ("",[]),email:new a.MJ(this._authService.invitationEmail||"",[a.k0.required,p.P.email]),birthdate:new a.MJ(null,[a.k0.required,p.P.notAfterToday]),password:new a.MJ("",a.k0.required),confirmPassword:new a.MJ("",a.k0.required),dataPrivacyAll:new a.MJ(!1,p.P.checkTruth),clubNotificationsResponsibleAll:new a.MJ(!1),notification:new a.MJ(!0)},{validators:p.P.passwordMatchingValidator}),this.forceNoPassword&&(this.signupForm.removeControl("password"),this.signupForm.removeControl("confirmPassword")),this.load(!1)}load(t){this.loading=t,this.appService.broadcast("layoutLoaded",this.loading)}registerVinculate(){this.success=!1;const{valid:t,value:o}=this.signupForm;if(t&&!this.ageError){let s=this.globalVars.encrypData(o.password);o.password=s,delete o.confirmPassword,o.birthdate=this.globalVars.getMoment()(o.birthdate).format("YYYY-MM-DD"),o.newAccount=!1,o.actionName=this._authService.extraData?.action||"link_tutor_or_supervised",this._authService.setFormValue(o),this._auth.registerTutor(o,this._supervised.id).subscribe({next:l=>{l.linkedEmail?(this._authService.setAlreadyAccounts(l.accounts),this.globalVars.clupikNavigate("/authorization/signup/already")):(this.signupForm.reset(),this._authService.resetExtraData(),this._authService.resetAlreadyAccounts(),this._authService.resetFormValue(),this.success=!0)},error:l=>this.success=!1})}else for(let s in this.signupForm.controls)this.signupForm.controls[s].markAsTouched()}backToSupevised(){this.globalVars.clupikNavigate("/authorization/link/activation-supervised")}static \u0275fac=function(o){return new(o||r)(e.rXU(x.Y),e.rXU(b.d),e.rXU(v.F),e.rXU(T.T),e.rXU(S.u),e.rXU(C.X))};static \u0275cmp=e.VBU({type:r,selectors:[["app-clupik-sign-up-signup-vinculate"]],standalone:!1,decls:8,vars:6,consts:[["signupSuccess",""],["commonForm",""],[3,"whiteBorder","hasButton"],[1,"view_signup-vinculate"],[3,"backAction","mainTitle","centeredTitle","hasBack"],[4,"ngTemplateOutlet"],["svgImage","mail",3,"size","textArray","noButton"],[3,"de
1scription","descriptionClass"],["state","danger","mainTitle","module.signup.vinculate_error",3,"subtitle"],[3,"formGroup"],[3,"actionsConfig"],[3,"items"],["type","normal","formControlName","firstName",3,"inputSize","input"],["type","normal","formControlName","lastName",3,"inputSize","input"],["type","normal","formControlName","secondSurname",3,"inputSize","input"],["formControlName","birthdate","type","normal",3,"inputSize","input","maxDate"],["type","normal","formControlName","email",3,"inputSize","input"],["type","checkbox","formControlName","dataPrivacyAll",3,"checkboxConfig"],["type","checkbox","formControlName","clubNotificationsResponsibleAll",3,"checkboxConfig"],["type","normal","formControlName","password",3,"inputSize","input"],["type","normal","formControlName","confirmPassword",3,"inputSize","input"]],template:function(o,s){if(1&o){const l=e.RV6();e.j41(0,"app-block-item",2)(1,"div",3)(2,"app-form-title",4),e.bIt("backAction",function(){return c.eBV(l),c.Njj(s.backToSupevised())}),e.k0s(),e.DNE(3,O,1,0,"ng-container",5)(4,W,1,4,"ng-template",null,0,e.C5r),e.k0s()(),e.DNE(6,Z,5,10,"ng-template",null,1,e.C5r)}if(2&o){const l=e.sdS(5),m=e.sdS(7);e.Y8G("whiteBorder",!s.globalVars.desktop)("hasButton",!1),e.R7$(2),e.Y8G("mainTitle","module.signup.new_tutor")("centeredTitle",!0)("hasBack",s.globalVars.app||s.globalVars.mobile),e.R7$(),e.Y8G("ngTemplateOutlet",s.success?l:m)}},dependencies:[y.T3,a.qT,a.BC,a.cb,a.j4,a.JD,N.M,V.t,A.Y,F.S,G.a,_.p,Y.W,R.d,w.D9],encapsulation:2})}return r})()}];let te=(()=>{class r{static \u0275fac=function(o){return new(o||r)};static \u0275mod=e.$C({type:r});static \u0275inj=c.G2t({imports:[g.iI.forChild(ee),g.iI]})}return r})(),re=(()=>{class r{static \u0275fac=function(o){return new(o||r)};static \u0275mod=e.$C({type:r});static \u0275inj=c.G2t({imports:[h.Q,te]})}return r})()}}]);
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.