1import{a as oe}from"./chunk-YLN3N2MW.js";import{k as re}from"./chunk-STNFFWJM.js";import{a as K,b as Y}from"./chunk-WDX75O73.js";import{a as Z,c as J,e as Q,f as X,g as $,h as ee,i as te,k as ie,m as ne}from"./chunk-ZM4G45VJ.js";import"./chunk-VXXGCG3D.js";import"./chunk-ZYG53WLM.js";import{a as V,b as u}from"./chunk-QAZFE7LR.js";import{Ac as q,Da as H,Na as m,Oa as g,Ob as W,Ta as w,U as L,Ua as r,Va as o,Wa as C,Y as x,a as B,aa as h,ac as A,b as N,ba as f,bb as S,cc as G,db as E,f as P,fb as c,hc as z,jc as j,ma as T,qb as b,rb as l,sb as M,tb as y,ua as a,wa as O,wb as v,xb as F,xc as U,yb as k,zc as D}from"./chunk-DMOAUQEG.js";var de="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js",ce="popup_closed_by_user",me="user_cancelled_authorize",ae=(()=>{let d=class d{constructor(){this.platformId=x(T),this.scriptPromise=null,this.initialized=!1}get isEnabled(){return A(this.platformId)&&V.appleSignIn.clientId!==""}preload(){this.isEnabled&&this.loadSdk().catch(()=>{this.scriptPromise=null})}signIn(){return P(this,null,function*(){if(!this.isEnabled)return null;yield this.loadSdk();let t=window.AppleID;if(!t)throw new Error("Apple sign-in SDK unavailable");this.initialized||(this.initialized=!0,t.auth.init({clientId:V.appleSignIn.clientId,redirectURI:V.appleSignIn.redirectUri,scope:"name email",usePopup:!0}));let e;try{e=yield t.auth.signIn()}catch(_){let I=_?.error;if(I===ce||I===me)return null;throw _}let n=e?.authorization?.id_token;if(!n)throw new Error("Apple did not return an identity token");let p=e.user?.name;return{token:n,firstName:p?.firstName,lastName:p?.lastName}})}loadSdk(){return this.scriptPromise??=new Promise((t,e)=>{if(window.AppleID){t();return}let n=document.createElement("script");n.src=de,n.async=!0,n.defer=!0,n.addEventListener("load",()=>t()),n.addEventListener("error",()=>e(new Error("Failed to load Apple sign-in SDK"))),document.body.appendChild(n)}),this.scriptPromise}};d.\u0275fac=function(e){return new(e||d)},d.\u0275prov=L({token:d,factory:d.\u0275fac,providedIn:"root"});let s=d;return s})();var le=(()=>{let d=class d{constructor(){this.window=A(x(T))?window:void 0}pingHome(t){this.window?.dataLayer?.push(t)}buildUserPayload(t){return{user_id:t?.id?.toString()??"",is_user_logged:t!==null,user_hashed_email:t?.email?this.simpleHash(t.email):""}}logPageView(t){this.pingHome({event:"content-view",pageName:t})}logArticle(t){this.pingHome({event:"article-view",articleId:t.id.toString()}),t.categories?.length&&t.categories.forEach(e=>{this.pingHome({event:"category-article-view",categoryName:e.name})}),t.users?.length&&t.users.forEach(e=>{this.pingHome({event:"author-article-view",authorName:`${e.firstName} ${e.lastName}`})})}customLogArticle(t,e){this.pingHome({event:"page_view",user:this.buildUserPayload(e),page:{page_id:t.id.toString(),page_language:"ro",page_type:"article"},content:this.getContent(t)})}customLogShort(t,e){this.pingHome({event:"page_view",user:this.buildUserPayload(e),page:{page_id:t.id.toString(),page_language:"ro",page_type:"shorts"},content:this.getShortContent(t)})}customLogPage(t,e,n){this.pingHome({event:"page_view",user:this.buildUserPayload(n),page:{page_id:e,page_language:"ro",page_type:t}})}logInteraction(t,e,n,p){let _={event:"article_interaction",user:this.buildUserPayload(e),interaction_type:n,interaction_option:p};t&&(_.page={page_id:t.id.toString(),page_language:"ro",page_type:"article"},_.content=this.getContent(t)),this.pingHome(_)}logUserInteraction(t,e){this.pingHome({event:"login",user:this.buildUserPayload(t),login_using:e})}logUserRegistration(t){this.pingHome({event:"registration",user:this.buildUserPayload(t)})}logNewsletter(t,e){this.pingHome({event:"newsletter",user:this.buildUserPayload(t),newsletter_name:e})}logSearch(t,e){this.pingHome({event:"search",user:this.buildUserPayload(t),search_term:e})}logSubscriptions(t,e){this.pingHome({event:"view_item_list",user:this.buildUserPayload(t),page:{page_id:"",page_language:"ro",page_type:"membership"},ecommerce:{currency:"MDL",items:e.map(n=>({item_id:n.id,item_name:n.title,currency:"MDL",price:n.payment_discount||n.payment,quantity:1}))}})}logEvent(t,e,n,p){this.pingHome({event:t,category:e,action:n,label:p})}logCustomDimensionTest(t){this.pingHome({event:"custom-dimension",value:t})}getContent(t){let e=t.users?.[0],n=(t._categories??[]).map(p=>p.name).join(", ");return{content_type:"article",content_section:n,content_category:n,content_author:e?`${e.firstName} ${e.lastName}`:"unknown",content_published:t.published,content_has_video:this.contentHasVideo(t.content),content_has_image:this.contentHasImage(t.content),content_wordcount:this.processArticleContent(t.content)}}getShortContent(t){let e=(t.categories??[]).map(n=>n.name).join(", ");return{content_type:"short",content_section:e,content_category:e,content_published:t.published,content_has_video:!1,content_has_image:!1,
1content_wordcount:this.processArticleContent(t.content)}}simpleHash(t){let e=0;if(t.length===0)return e.toString(16);for(let n=0;n<t.length;n++){let p=t.charCodeAt(n);e=(e<<5)-e+p,e=e&e}return Math.abs(e).toString(16)}processArticleContent(t){if(!t)return 0;function e(_){let I=_.replace(/<a[^>]*>(.*?)<\/a>/gi,""),R=document.createElement("div");return R.innerHTML=I,R.textContent||R.innerText||""}function n(_){return _.split(/[\s,.!?;:()]+/).filter(Boolean).length}let p="";return Object.values(t).forEach(_=>{Object.values(_).forEach(I=>{typeof I!="string"&&Object.values(I).forEach(R=>{typeof R=="string"&&(p+=" "+e(R))})})}),n(p)}contentHasVideo(t){return this.contentHasBlockPrefix(t,"video")}contentHasImage(t){return this.contentHasBlockPrefix(t,"image")}contentHasBlockPrefix(t,e){return t?Object.values(t).some(n=>Object.keys(n).some(p=>p.startsWith(e))):!1}};d.\u0275fac=function(e){return new(e||d)},d.\u0275prov=L({token:d,factory:d.\u0275fac,providedIn:"root"});let s=d;return s})();function ge(s,d){s&1&&(r(0,"h1",4),l(1," Conecteaz\u0103-te sau creaz\u0103 un cont "),o())}function ue(s,d){s&1&&(r(0,"h1",5),l(1," Bine ai revenit pe "),r(2,"span",19),l(3,"Laziar"),o()())}function pe(s,d){s&1&&(r(0,"h1",5),l(1," Creaz\u0103 un cont "),r(2,"span",19),l(3,"Laziar"),o()())}function he(s,d){s&1&&(r(0,"h1",5),l(1," Confirm\u0103 contul t\u0103u "),r(2,"span",19),l(3,"Laziar"),o()())}function fe(s,d){s&1&&(r(0,"h1",6),l(1," Verific\u0103 adresa ta de email "),o())}function _e(s,d){if(s&1){let i=S();r(0,"div",7)(1,"div",20),l(2,"Folose\u0219ti emailul:"),o(),r(3,"div",21)(4,"div",22),l(5),o(),r(6,"app-button",23),E("click",function(){h(i);let e=c();return f(e.backToEmailStep())}),o()()()}if(s&2){let i=c();a(4),b(i.isRegisterFlow?"text-sm leading-8":"text-sm leading-5"),a(),y(" ",i.email," "),a(),w("label",i.isRegisterFlow?"Editeaz\u0103":"Schimb\u0103")("rounded",!0)}}function xe(s,d){if(s&1&&(r(0,"span",28),l(1),o()),s&2){let i=c(2);a(),M(i.resendEmailError)}}function we(s,d){if(s&1){let i=S();r(0,"section",8)(1,"p",24),l(2," Pentru a confirma contul, verific\u0103 adresa ta de email: "),r(3,"span",25),l(4),o()(),r(5,"div",26),l(6," Nu ai primit niciun email? "),r(7,"button",27),E("click",function(){h(i);let e=c();return f(e.resendConfirmationEmail())}),l(8),o(),m(9,xe,2,1,"span",28),o(),r(10,"div",26),l(11," Ai nevoie de ajutor? "),r(12,"a",29),l(13,"Contacteaz\u0103 asisten\u021Ba"),o()()()}if(s&2){let i=c();a(4),M(i.email),a(3),w("disabled",i.isResendingEmail||i.resendEmailSuccess),a(),y(" ",i.isResendingEmail?"Se retrimite...":i.resendEmailSuccess?"Email retrimis!":"Retrimite linkul"," "),a(),g(i.resendEmailError?9:-1)}}function Ce(s,d){if(s&1){let i=S();r(0,"form",30),E("ngSubmit",function(){h(i);let e=c();return f(e.continueWithEmail())}),r(1,"div")(2,"app-input-field",31),k("ngModelChange",function(e){h(i);let n=c();return F(n.email,e)||(n.email=e),f(e)}),o()(),C(3,"app-button",32),o()}if(s&2){let i=c();a(2),v("ngModel",i.email),w("error",(i.emailSubmitAttempted||i.trimmedEmail!=="")&&!i.isEmailValid)("helperText",i.emailSubmitAttempted&&i.trimmedEmail===""?"Te rog introduce emailul.":i.trimmedEmail!==""&&!i.isEmailValid?"Te rog introdu un email valid.":""),a(),w("label",i.isCheckingEmail?"Se verific\u0103...":"Continu\u0103")("rounded",!0)("disabled",!i.isEmailValid||i.isCheckingEmail)("fullWidth",!0)("type","submit")}}function be(s,d){if(s&1&&(C(0,"span",38),r(1,"span",39),l(2),o()),s&2){let i=c(2);a(2),M(i.errorMessage)}}function Ee(s,d){if(s&1&&(r(0,"p",37),l(1),o()),s&2){let i=c(2);a(),y(" ",i.forgotPasswordTriggerError," ")}}function Se(s,d){if(s&1){let i=S();r(0,"form",30),E("ngSubmit",function(){h(i);let e=c();return f(e.submitAuthVisual())}),r(1,"app-input-field",33),k("ngModelChange",function(e){h(i);let n=c();return F(n.password,e)||(n.password=e),f(e)}),o(),r(2,"div",34),m(3,be,3,1),r(4,"span",35),l(5,"Ai uitat parola?"),o(),r(6,"button",36),E("click",function(){h(i);let e=c();return f(e.enterForgotPasswordFlow())}),l(7),o()(),m(8,Ee,2,1,"p",37),C(9,"app-button",32),o()}if(s&2){let i=c();a(),v("ngModel",i.password),w("error",!!i.errorMessage),a(2),g(i.errorMessage?3:-1),a(3),w("disabled",i.isForgotPasswordInProgress),a(),y(" ",i.isForgotPasswordInProgress?"Se trimite...":"Reseteaz\u0103"," "),a(),g(i.forgotPasswordTriggerError?8:-1),a(),w("label",i.isLoginInProgress?"Se autentific\u0103...":"Autentificare")("rounded",!0)("disabled",i.password.trim()===""||i.isLoginInProgress)("fullWidth",!0)("type","submit")}}function ye(s,d){if(s&1&&(r(0,"span",43),l(1),o()),s&2){let i=c(2);a(),M(i.resendEmailError)}}function Pe(s,d){if(s&1){let i=S();r(0,"section",10)(1,"p",40),l(2," Contul t\u0103u nu a fost confirmat \xEEnc\u0103. Verific\u0103 inbox-ul sau retrimite linkul de confirmare. "),o(),r(3,"div",41)(4,"button",42),E("click",function(){h(i);let e=c();return f(e.resendConfirmationEmail())}),l(5),o(),m(6,ye,2,1,"span",43),o()()}if(s&2){let i=c();a(4),w("disabled",i.isResendingEmail||i.resendEmailSuccess),a(),y(" ",i.isResendingEmail?"Se retrimite...":i.resendEmailSuccess?"Email retrimis!":"Retrimite linkul de confirmare"," "),a(),g(i.resendEmailError?6:-1)}}function ve(s,d){if(s&1){let i=S();r(0,"section",11)(1,"div")(2,"p",26),l(3," Reseteaz\u0103 parola urm\xE2nd linkul trimis pe: "),o(),r(4,"span",44),l(5),o()(),r(6,"div",45)(7,"span",26),l(8,"Nu ai primit niciun email?"),o(),r(9,"button",46),E("click",function(){h(i);let e=c();return f(e.resendForgotPasswordEmail())}),l(10),o()(),r(11,"div")(12,"span",26),l(13,"Ai nevoie de ajutor?"),o(),r(14,"a",47),l(15,"Contacteaz\u0103 asisten\u02
11Ba"),o()(),r(16,"button",48),E("click",function(){h(i);let e=c();return f(e.backFromForgotPassword())}),C(17,"img",49),r(18,"span"),l(19,"\xCEntoarce-te \xEEnapoi"),o()()()}if(s&2){let i=c();a(5),M(i.email),a(4),w("disabled",i.isForgotPasswordResending||i.forgotPasswordResendSuccess),a(),y(" ",i.isForgotPasswordResending?"Se retrimite...":i.forgotPasswordResendSuccess?"Email retrimis!":"Retrimite linkul"," ")}}function Fe(s,d){if(s&1&&(r(0,"p",60),l(1),o()),s&2){let i=c(2);a(),y(" ",i.registerErrorMessage," ")}}function ke(s,d){if(s&1){let i=S();r(0,"form",50),E("ngSubmit",function(){h(i);let e=c();return f(e.createAccountVisual())}),r(1,"div",51)(2,"app-input-field",52),k("ngModelChange",function(e){h(i);let n=c();return F(n.firstName,e)||(n.firstName=e),f(e)}),o(),r(3,"app-input-field",53),k("ngModelChange",function(e){h(i);let n=c();return F(n.lastName,e)||(n.lastName=e),f(e)}),o()(),r(4,"app-input-field",54),k("ngModelChange",function(e){h(i);let n=c();return F(n.registerPassword,e)||(n.registerPassword=e),f(e)}),o(),r(5,"app-input-field",55),k("ngModelChange",function(e){h(i);let n=c();return F(n.confirmPassword,e)||(n.confirmPassword=e),f(e)}),o(),r(6,"div",56)(7,"div",21)(8,"span",57),l(9," \u2713 "),o(),r(10,"span"),l(11,"Trebuie s\u0103 includ\u0103 cel pu\u021Bin 8 caractere"),o()(),r(12,"div",21)(13,"span",57),l(14," \u2713 "),o(),r(15,"span"),l(16,"Trebuie s\u0103 includ\u0103 un "),r(17,"u"),l(18,"simbol"),o()()(),r(19,"div",21)(20,"span",57),l(21," \u2713 "),o(),r(22,"span"),l(23,"Confirmare parol\u0103"),o()()(),r(24,"label",58)(25,"input",59),k("ngModelChange",function(e){h(i);let n=c();return F(n.agreedToTerms,e)||(n.agreedToTerms=e),f(e)}),o(),r(26,"span"),l(27," Sunt de acord cu "),r(28,"u"),l(29,"Termenii \u0219i Condi\u021Biile"),o(),l(30," \u0219i "),r(31,"u"),l(32,"Politica de Confiden\u021Bialitate"),o(),r(33,"span",39),l(34,"*"),o()()(),C(35,"app-button",32),m(36,Fe,2,1,"p",60),o()}if(s&2){let i=c();a(2),v("ngModel",i.firstName),a(),v("ngModel",i.lastName),a(),v("ngModel",i.registerPassword),a(),v("ngModel",i.confirmPassword),a(2),b(i.hasMinPasswordLength?"text-[#20882e]":"text-gray-500"),a(),b(i.hasMinPasswordLength?"bg-[#20882e] text-white":"bg-gray-300 text-white"),a(4),b(i.hasPasswordSpecialSymbol?"text-[#20882e]":"text-gray-500"),a(),b(i.hasPasswordSpecialSymbol?"bg-[#20882e] text-white":"bg-gray-300 text-white"),a(6),b(i.isPasswordConfirmed?"text-[#20882e]":"text-gray-500"),a(),b(i.isPasswordConfirmed?"bg-[#20882e] text-white":"bg-gray-300 text-white"),a(5),v("ngModel",i.agreedToTerms),a(10),w("label",i.isRegisterInProgress?"Se creeaz\u0103 contul...":"Creaz\u0103 cont")("rounded",!0)("disabled",!i.canCreateAccount||i.isRegisterInProgress)("fullWidth",!0)("type","submit"),a(),g(i.registerErrorMessage?36:-1)}}function Ae(s,d){if(s&1){let i=S();r(0,"button",72),E("click",function(){h(i);let e=c(2);return f(e.continueWithApple())}),C(1,"img",73),r(2,"span",74),l(3," Continu\u0103 cu Apple "),o()()}if(s&2){let i=c(2);w("disabled",i.isAppleSignInInProgress)}}function Ie(s,d){if(s&1&&(r(0,"div",12)(1,"div",61),C(2,"span",62),r(3,"div",63),l(4,"sau"),o(),C(5,"span",62),o(),r(6,"div",64)(7,"div",65)(8,"div",66),C(9,"img",67),r(10,"span",68),l(11," Continu\u0103 cu Google "),o()(),C(12,"div",69),o(),m(13,Ae,4,1,"button",70),r(14,"div",71),l(15," * Pentru a v\u0103 conecta utiliz\xE2nd una dintre aceste metode, e-mailul trebuie s\u0103 se potriveasc\u0103 cu cel din contul dvs. "),o()()()),s&2){let i=c();a(7),b(i.isGoogleButtonReady?"cursor-pointer":"cursor-wait"),a(),b(i.isGoogleButtonReady?"group-hover:bg-gray-900/[0.03] group-hover:shadow-md":"opacity-60"),a(4),b(i.isGoogleButtonReady?"pointer-events-auto":"pointer-events-none"),a(),g(i.isAppleSignInEnabled?13:-1)}}var nt=(()=>{let d=class d{constructor(){this.cdr=x(W),this.httpClient=x(j),this.router=x(D),this.route=x(U),this.principal=x(Y),this.dataLayerService=x(le),this.ngZone=x(O),this.platformId=x(T),this.eventManager=x(K),this.appleSignIn=x(ae),this.currentYear=new Date().getFullYear(),this.emailPattern=/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/,this.specialSymbolPattern=/[^A-Za-z0-9]/,this.email="",this.password="",this.isEmailEntered=!1,this.isRegisterFlow=!1,this.isCheckingEmail=!1,this.emailSubmitAttempted=!1,this.errorMessage=null,this.firstName="",this.lastName="",this.registerPassword="",this.confirmPassword="",this.agreedToTerms=!1,this.isLoginInProgress=!1,this.isRegisterInProgress=!1,this.isRegisterSuccess=!1,this.registerErrorMessage=null,this.showResendConfirmationLink=!1,this.googleInitialized=!1,this.googlePollTimer=null,this.googleButtonObserver=null,this.googleReadyFallbackTimer=null,this.renderedOverlay=null,this.isGoogleButtonReady=!1,this.isAppleSign
1InInProgress=!1,this.isForgotPasswordFlow=!1,this.isForgotPasswordInProgress=!1,this.forgotPasswordTriggerError=null,this.isForgotPasswordResending=!1,this.forgotPasswordResendSuccess=!1,this.isResendingEmail=!1,this.resendEmailSuccess=!1,this.resendEmailError=null}get trimmedEmail(){return this.email.trim()}get isEmailValid(){return this.emailPattern.test(this.trimmedEmail)}get hasMinPasswordLength(){return this.registerPassword.length>=8}get hasPasswordSpecialSymbol(){return this.specialSymbolPattern.test(this.registerPassword)}get isPasswordConfirmed(){return this.registerPassword!==""&&this.confirmPassword!==""&&this.registerPassword===this.confirmPassword}get canCreateAccount(){return this.firstName.trim()!==""&&this.lastName.trim()!==""&&this.hasMinPasswordLength&&this.hasPasswordSpecialSymbol&&this.isPasswordConfirmed&&this.agreedToTerms}get isAppleSignInEnabled(){return this.appleSignIn.isEnabled}ngOnInit(){A(this.platformId)&&(this.pollForGoogleSdk(),this.appleSignIn.preload())}ngAfterViewInit(){A(this.platformId)&&this.tryInitGoogleSignIn()}ngOnDestroy(){this.googlePollTimer!==null&&(clearTimeout(this.googlePollTimer),this.googlePollTimer=null),this.googleReadyFallbackTimer!==null&&(clearTimeout(this.googleReadyFallbackTimer),this.googleReadyFallbackTimer=null),this.googleButtonObserver?.disconnect(),this.googleButtonObserver=null}pollForGoogleSdk(){this.googlePollTimer=null,!this.tryInitGoogleSignIn()&&(this.googlePollTimer=setTimeout(()=>this.pollForGoogleSdk(),d.GOOGLE_POLL_INTERVAL_MS))}tryInitGoogleSignIn(){let t=window.google?.accounts?.id;if(!t)return!1;let e=document.getElementById("google-signin-overlay");return e?(e===this.renderedOverlay||(this.googleInitialized||(this.googleInitialized=!0,t.initialize({client_id:"638405417406-68vogf9d489q49l03o7dhpfq0brb072s.apps.googleusercontent.com",ux_mode:"popup",cancel_on_tap_outside:!0,callback:({credential:n})=>{this.ngZone.run(()=>this.loginWithGoogle(n))}})),this.renderedOverlay=e,t.renderButton(e,{type:"standard",size:"large",shape:"pill",width:Math.min(Math.max(e.offsetWidth,200),400)}),this.watchGoogleButtonReady(e)),!0):!1}resetGoogleButton(){A(this.platformId)&&(this.isGoogleButtonReady=!1,this.renderedOverlay=null,this.googleButtonObserver?.disconnect(),this.googleButtonObserver=null,this.googleReadyFallbackTimer!==null&&(clearTimeout(this.googleReadyFallbackTimer),this.googleReadyFallbackTimer=null),this.googleInitialized&&this.googlePollTimer===null&&this.pollForGoogleSdk())}watchGoogleButtonReady(t){let e=()=>{this.isGoogleButtonReady||this.ngZone.run(()=>{this.isGoogleButtonReady=!0,this.cdr.markForCheck()})},n=()=>{this.googleReadyFallbackTimer=setTimeout(e,d.GOOGLE_READY_FALLBACK_MS)},p=t.querySelector("iframe");if(p){p.addEventListener("load",e,{once:!0}),n();return}this.googleButtonObserver=new MutationObserver(()=>{let _=t.querySelector("iframe");_&&(this.googleButtonObserver?.disconnect(),this.googleButtonObserver=null,_.addEventListener("load",e,{once:!0}),n())}),this.googleButtonObserver.observe(t,{childList:!0})}navigateAfterAuth(){return P(this,null,function*(){let t=this.route.snapshot.queryParamMap.get("returnUrl"),e=t!==null&&t.startsWith("/")&&!t.startsWith("//");yield this.router.navigateByUrl(e?t:"/")})}logSignIn(t){return P(this,null,function*(){this.dataLayerService.logUserInteraction(yield this.principal.getUserValue(),t)})}logSocialAuth(t,e){return P(this,null,function*(){if(e){this.dataLayerService.logUserRegistration(yield this.principal.getUserValue());return}yield this.logSignIn(t.toLowerCase())})}loginWithGoogle(t){this.httpClient.post(`${u.apiEndpoint}/auth/google-login`,{token:t},u.getHttpOptions()).subscribe({next:e=>{this.handleSocialLoginResponse(e,"Google").catch(n=>console.error(n))},error:e=>{this.errorMessage=e?.error?.message??"Autentificarea cu Google a e\u0219uat.",this.cdr.markForCheck()}})}handleSocialLoginResponse(t,e){return P(this,null,function*(){t.access_token?(u.setTwj(t.access_token),yield this.principal.getUserValue(!0),this.eventManager.broadcast({name:"authenticationSuccess",content:"Sending Authentication Success"}),yield this.logSocialAuth(e,t.is_new_user===!0),yield this.navigateAfterAuth()):(this.errorMessage=t.message??`Autentificarea cu ${e} a e\u0219uat. \xCEncearc\u0103 din nou.`,this.cdr.markForCheck())})}
1continueWithApple(){this.isAppleSignInInProgress||(this.isAppleSignInInProgress=!0,this.errorMessage=null,this.appleSignIn.signIn().then(t=>{if(!t){this.isAppleSignInInProgress=!1,this.cdr.markForCheck();return}this.loginWithApple(t)}).catch(()=>{this.isAppleSignInInProgress=!1,this.errorMessage="Autentificarea cu Apple a e\u0219uat. \xCEncearc\u0103 din nou.",this.cdr.markForCheck()}))}loginWithApple(t){this.httpClient.post(`${u.apiEndpoint}/auth/apple-login`,t,u.getHttpOptions()).subscribe({next:e=>{this.isAppleSignInInProgress=!1,this.cdr.markForCheck(),this.handleSocialLoginResponse(e,"Apple").catch(n=>console.error(n))},error:e=>{this.isAppleSignInInProgress=!1,this.errorMessage=e?.error?.message??"Autentificarea cu Apple a e\u0219uat.",this.cdr.markForCheck()}})}continueWithEmail(){this.emailSubmitAttempted=!0,this.trimmedEmail!==""&&this.isEmailValid&&(this.email=this.trimmedEmail,this.checkEmailRegistration())}backToEmailStep(){this.isEmailEntered=!1,this.isRegisterFlow=!1,this.isCheckingEmail=!1,this.isRegisterInProgress=!1,this.isRegisterSuccess=!1,this.password="",this.firstName="",this.lastName="",this.registerPassword="",this.confirmPassword="",this.agreedToTerms=!1,this.emailSubmitAttempted=!1,this.errorMessage=null,this.registerErrorMessage=null,this.showResendConfirmationLink=!1,this.resendEmailSuccess=!1,this.resendEmailError=null,this.isForgotPasswordFlow=!1,this.isForgotPasswordInProgress=!1,this.forgotPasswordTriggerError=null,this.isForgotPasswordResending=!1,this.forgotPasswordResendSuccess=!1,this.resetGoogleButton()}enterForgotPasswordFlow(){this.isForgotPasswordInProgress||(this.forgotPasswordTriggerError=null,this.errorMessage=null,this.isForgotPasswordInProgress=!0,this.httpClient.post(`${u.apiEndpoint}/auth/forgot-password`,{email:this.email},u.getHttpOptions()).subscribe({next:()=>{this.isForgotPasswordInProgress=!1,this.isForgotPasswordFlow=!0,this.isForgotPasswordResending=!1,this.forgotPasswordResendSuccess=!1,this.cdr.markForCheck()},error:t=>{this.isForgotPasswordInProgress=!1,this.forgotPasswordTriggerError=t?.error?.message||"Nu s-a putut trimite emailul. \xCEncearc\u0103 din nou.",this.cdr.markForCheck()}}))}backFromForgotPassword(){this.isForgotPasswordFlow=!1,this.isForgotPasswordInProgress=!1,this.forgotPasswordTriggerError=null,this.isForgotPasswordResending=!1,this.forgotPasswordResendSuccess=!1}resendForgotPasswordEmail(){this.isForgotPasswordResending||this.forgotPasswordResendSuccess||(this.isForgotPasswordResending=!0,this.httpClient.post(`${u.apiEndpoint}/auth/forgot-password`,{email:this.email},u.getHttpOptions()).subscribe({next:()=>{this.isForgotPasswordResending=!1,this.forgotPasswordResendSuccess=!0,this.cdr.markForCheck()},error:()=>{this.isForgotPasswordResending=!1,this.cdr.markForCheck()}}))}submitAuthVisual(){if(this.errorMessage=null,this.showResendConfirmationLink=!1,this.password.trim()===""){this.errorMessage="Te rog introduce parola.";return}this.isLoginInProgress=!0;let t={roles:[],email:this.email,password:this.password,metadata:{}};this.httpClient.post(`${u.apiEndpoint}/auth/login`,t,u.getHttpOptions()).subscribe({next:e=>{this.handleLoginSuccess(e).catch(n=>console.log(n))},error:e=>{this.isLoginInProgress=!1;let n=e;this.errorMessage=n?.error?.status?.message?.text||n?.error?.message||"Autentificarea a e\u0219uat. \xCEncearc\u0103 din nou.",this.cdr.markForCheck()}})}handleLoginSuccess(t){return P(this,null,function*(){this.isLoginInProgress=!1;let e=t?.status;if(e?.code===403&&e?.message?.field==="email"){this.showResendConfirmationLink=!0,this.resendEmailSuccess=!1,this.resendEmailError=null,this.cdr.markForCheck();return}t?.access_token&&(u.setTwj(t.access_token),yield this.principal.getUserValue(!0),this.eventManager.broadcast({name:"authenticationSuccess",content:"Sending Authentication Success"}),yield this.logSignIn("email and password")),yield this.navigateAfterAuth()})}createAccountVisual(){if(!this.canCreateAccount)return;this.registerErrorMessage=null,this.isRegisterInProgress=!0;let t={roles:[],email:this.email,password:this.registerPassword,metadata:{},firstName:this.firstName.trim(),lastName:this.lastName.trim()};this.httpClient.post(`${u.apiEndpoint}/auth/register`,t,u.getHttpOptions()).subscribe({next:()=>{this.isRegisterInProgress=!1,this.isRegisterSuccess=!0,this.dataLayerService.logUserRegistration(null),this.cdr.markForCheck()},error:e=>{this.isRegisterInProgress=!1,this.registerErrorMessage=e?.error?.message||"\xCEnregistrarea a e\u0219uat. \xCEncearc\u0103 din nou.",this.cdr.markForCheck()}})}resendConfirmationEmail(){this.isResendingEmail||(this.isResendingEmail=!0,this.resendEmailSuccess=!1,this.resendEmailError=null,this.httpClient.post(`${u.apiEndpoint}/auth/resend-confirmation`,{email:this.email},u.getHttpOptions()).subscribe({next:()=>{this.isResendingEmail=!1,this.resendEmailSuccess=!0,this.cdr.markForCheck()},error:t=>{this.isResendingEmail=!1,this.resendEmailError=t?.error?.message||"Nu s-a putut retrimite emailul. \xCEncearc\u0103 din nou.",this.cdr.markForCheck()}}))}checkEmailRegistration(){this.isCheckingEmail=!0;let t=N(B({},u.getHttpOptions()),{params:new z().set("email",this.email)});this.httpClient.get(`${u.apiEndpoint}/auth/check-email`,t).subscribe(e=>{e?.success===!0?(this.isEmailEntered=!0,this.isRegisterFlow=!1,this.isRegisterSuccess=!1,this.registerErrorMessage=null):(this.isEmailEntered=!1,this.isRegisterFlow=!0,this.isRegisterSuccess=!1,this.registerErrorMessage=null),this.isCheckingEmail=!1,this.emailSubmitAttempted=!1,this.cdr.markForCheck()},()=>{this.isCheckingEmail=!1,this.emailSubmitAttempted=!1,this.cdr.markForCheck()})}};d.GOOGLE_POLL_INTERVAL_MS=500,d.GOOGLE_READY_FALLBACK_MS=1500,d.\u0275fac=function(e){return new(e||d)},d.\u0275cmp=H({type:d,selectors:[["app-auth-page"]],decls:34,vars:16,consts:[[1,"min-h-screen","text-c121212","flex","flex-col","transition-colors","duration-300"],[1,"h-[72px]","border-b","border-gray-900/10","flex","items-center","justify-center","px-4"],[1,"flex","flex-grow","items-start","justify-center","px-4","py-10"],[1,"w-full","max-w-[448px]","mt-20"],[1,"font-lora","text-3xl","text-gray-900","font-medium","mb-8","text-center"],[1,"font-lora","text-3xl","text-gray-900","font-medium","mb-2"],[1,"font-lora","text-3xl","text-gray-900","font-medium","mb-3"],[1,"mt-2","mb-8"],[1,"grid","gap-6","pt-2"],[1,"grid","gap-4"],[1,"mt-4","rounded-xl","bg-amber-50","border","border-amber-200","px-4","py-3","grid","gap-3"],[1,"grid","gap-5"],[1,"mt-6"],[1,"h-[54px]","border-t","border-gray-900/10","px-4"],[1,"h-full","mx-auto","max-w-7xl","flex","items-center","justify-center","gap-0.5","md:gap-2","font-onest","text-xs","text-gray-600"],["aria-hidden","true"],["routerLink","/about",1,"hover:text-gray-900","transition-colors"],["routerLink","/terms-and-conditions",1,"hover:text-gray-900","transition-colors"],["routerLink","/contacts",1,"hover:text-gray-900","transition-colors"],[1,"italic"],[1,"text-sm","leading-5","font-onest","text-gray-900"],[1,"flex","items-center","gap-2"],[1,"font-semibold","font-onest","text-gray-900"],["variant","outline","size","xs",3,"click","label","rounded"],[1,"font-onest","text-sm","text-gray-800","leading-5"],[1,"font-semibold"],[1,"font-onest","text-sm","text-gray-700","leading-5"],["type","button",1,"underline","font-semibold","text-gray-800","ml-1","cursor-pointer","disabled:opacity-50","disabled:cursor-default",3,"click","disabled"],[1,"ml-1","text-red-500"],["routerLink","/contacts",1,"underline","font-semibold","text-gray-800","ml-1"],[1,"grid","gap-4",3,"ngSubmit"],["label","Email","type","email","placeholder","Introduce emailul t\u0103u","name","email","required","",3,"ngModelChange","ngModel","error","helperText"],["variant","primary","size","lg",3,"label","rounded","disabled","fullWidth","type"],["label","Parola","type","password","placeholder","Introduce parola ta","
1name","password",3,"ngModelChange","ngModel","error"],[1,"mt-2","text-sm","leading-5","font-onest","flex","items-center","flex-wrap","gap-1"],[1,"text-gray-500"],["type","button",1,"underline","font-semibold","text-gray-800","cursor-pointer","disabled:opacity-50","disabled:cursor-default",3,"click","disabled"],[1,"mt-1","text-sm","font-onest","text-red-500"],[1,"w-2","h-2","rounded-full","bg-red-500","flex-shrink-0","inline-block"],[1,"text-red-500"],[1,"font-onest","text-sm","text-amber-900","leading-5"],[1,"font-onest","text-sm","text-amber-800","leading-5"],["type","button",1,"underline","font-semibold","cursor-pointer","disabled:opacity-50","disabled:cursor-default",3,"click","disabled"],[1,"ml-1","text-red-600"],[1,"font-onest","font-semibold","text-sm","leading-6","text-[#121212]",2,"letter-spacing","-0.21px"],[1,"mt-3"],["type","button",1,"block","font-onest","font-semibold","text-sm","leading-6","underline","text-[#4F5255]","text-left","w-fit","disabled:opacity-50","disabled:cursor-default",2,"letter-spacing","-0.21px",3,"click","disabled"],["routerLink","/account/contact-support",1,"block","font-onest","font-semibold","text-sm","leading-6","underline","text-[#4F5255]","w-fit",2,"letter-spacing","-0.21px"],["type","button",1,"flex","items-center","gap-2","mt-3","font-onest","font-semibold","text-sm","leading-6","underline","text-[#4F5255]","w-fit",2,"letter-spacing","-0.21px",3,"click"],["ngSrc","assets/images/arrow-left.svg","alt","","width","24","height","24",1,"w-4","h-4"],[1,"grid","gap-5",3,"ngSubmit"],[1,"grid","grid-cols-1","md:grid-cols-2","gap-4"],["label","Prenume","type","text","placeholder","ex. Ion","name","firstName",3,"ngModelChange","ngModel"],["label","Nume","type","text","placeholder","ex. Popescu","name","lastName",3,"ngModelChange","ngModel"],["label","Parol\u0103","type","password","placeholder","","name","registerPassword",3,"ngModelChange","ngModel"],["label","Confirm\u0103 parola","type","password","placeholder","","name","confirmPassword",3,"ngModelChange","ngModel"],[1,"rounded-xl","bg-[#F4F4F6]","px-4","py-3","text-sm","font-onest","space-y-1.5"],[1,"w-3","h-3","rounded-full","flex","items-center","justify-center","text-[9px]","leading-none","font-bold"],[1,"flex","items-center","gap-3","text-sm","font-onest","text-gray-700"],["type","checkbox","name","agreedToTerms",1,"h-4","w-4","rounded","border-gray-400",3,"ngModelChange","ngModel"],[1,"font-onest","text-sm","text-red-500"],[1,"flex","w-full","items-center","pb-6"],[1,"w-full","h-px","bg-gray-900/10"],[1,"px-3","text-gray-500","text-xs","font-medium","leading-4","font-onest"],[1,"grid","gap-3"],[1,"group","relative","h-12"],[1,"pointer-events-none","absolute","inset-0","flex","items-center","justify-center","gap-2","border","border-gray-300","bg-cFFFFFA","rounded-full","px-5","shadow-sm","transition-all","duration-200"],["ngSrc","assets/images/publicator/login-page/Google.svg","alt","","width","21","height","20",1,"w-5","h-5"],[1,"text-gray-900","font-onest","font-semibold","text-sm","antialiased"],["id","google-signin-overlay",1,"absolute","inset-0","overflow-hidden","opacity-0"],["type","button",1,"h-12","flex","items-center","justify-center","border","border-gray-300","bg-cFFFFFA","hover:bg-gray-900/[0.03]","rounded-full","px-5","shadow-sm","hover:shadow-md","transition-all","duration-200","disabled:opacity-60","disabled:cursor-wait",3,"disabled"],[1,"pt-1","text-xs","font-onest","leading-4","text-gray-600"],["type","button",1,"h-12","flex","items-center","justify-center","border","border-gray-300","bg-cFFFFFA","hover:bg-gray-900/[0.03]","rounded-full","px-5","shadow-sm","hover:shadow-md","transition-all","duration-200","disabled:opacity-60","disabled:cursor-wait",3,"click","disabled"],["ngSrc","assets/images/publicator/login-page/Apple.svg","alt","","width","21","height","20",1,"w-5","h-5"],[1,"text-gray-900","font-onest","font-semibold","ml-1","text-sm","antialiased"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"header",1),C(2,"app-logo"),o(),r(3,"main",2)(4,"section",3),m(5,ge,2,0,"h1",4),m(6,ue,4,0,"h1",5),m(7,pe,4,0,"h1",5),m(8,he,4,0,"h1",5),m(9,fe,2,0,"h1",6),m(10,_e,7,5,"div",7),m(11,we,14,4,"section",8),m(12,Ce,4,8,"form",9),m(13,Se,10,11,"form",9),m(14,Pe,7,3,"section",10),m(15,ve,20,3,"section",11),m(16,ke,37,23,"form",11),m(1
17,Ie,16,7,"div",12),o()(),r(18,"footer",13)(19,"div",14)(20,"span"),l(21),o(),r(22,"span",15),l(23,"\xB7"),o(),r(24,"a",16),l(25,"Despre noi"),o(),r(26,"span",15),l(27,"\xB7"),o(),r(28,"a",17),l(29,"Termeni \u0219i condi\u021Bii"),o(),r(30,"span",15),l(31,"\xB7"),o(),r(32,"a",18),l(33,"Contacte"),o()()()()),e&2&&(b(n.errorMessage&&n.isEmailEntered&&!n.isForgotPasswordFlow?"bg-rose-50":"bg-cFFFFFA"),a(5),g(!n.isRegisterFlow&&!n.isForgotPasswordFlow&&!n.isEmailEntered?5:-1),a(),g(n.isEmailEntered&&!n.isForgotPasswordFlow?6:-1),a(),g(n.isRegisterFlow&&!n.isRegisterSuccess?7:-1),a(),g(n.isRegisterFlow&&n.isRegisterSuccess?8:-1),a(),g(n.isForgotPasswordFlow?9:-1),a(),g(n.isEmailEntered&&!n.isForgotPasswordFlow||n.isRegisterFlow&&!n.isRegisterSuccess?10:-1),a(),g(n.isRegisterFlow&&n.isRegisterSuccess?11:-1),a(),g(!n.isEmailEntered&&!n.isRegisterFlow?12:-1),a(),g(n.isEmailEntered&&!n.isForgotPasswordFlow?13:-1),a(),g(n.isEmailEntered&&n.showResendConfirmationLink?14:-1),a(),g(n.isForgotPasswordFlow?15:-1),a(),g(n.isRegisterFlow&&!n.isRegisterSuccess?16:-1),a(),g(!n.isEmailEntered&&!n.isRegisterFlow?17:-1),a(4),y("\xA9 ",n.currentYear," Laziar SRL"))},dependencies:[ne,te,J,Q,X,ie,ee,$,G,q,Z,re,oe],encapsulation:2,changeDetection:0});let s=d;return s})();export{nt as AuthComponent};
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.