1import{a as T}from"./chunk-IR3IXP4R.js";import{j as O}from"./chunk-DGVY3FNH.js";import{Fb as R,Ib as b,Jb as w,Kb as M,N as d,Ra as l,Rb as S,S as n,Tb as P,ab as g,da as o,ea as u,ia as a,la as p,mb as v,nb as h,wb as f,xb as m,yb as y}from"./chunk-IIXPTABD.js";import{a as s}from"./chunk-7CGTOI24.js";var E=["turnstileContainer"];function L(r,e){if(r&1&&(f(0,"p",2),S(1),m()),r&2){let t=R();l(),P(" ",t.errorMessage()," ")}}var _="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",k=100,z=1e4,D=300,I=!1,A=class r{siteKey;tokenReceived=new o;tokenExpired=new o;containerRef;widgetState=a("loading");errorMessage=a("");platformId=n(p);ngZone=n(u);widgetId=null;pollTimer=null;renderedSize=null;resizeObserver=null;ngAfterViewInit(){O(this.platformId)&&(this.waitForTurnstileApi(),this.observeContainerWidth())}ngOnDestroy(){this.clearPollTimer(),this.resizeObserver?.disconnect(),this.resizeObserver=null,this.widgetId!==null&&window.turnstile&&(window.turnstile.remove(this.widgetId),this.widgetId=null)}reset(){this.widgetId!==null&&window.turnstile&&(window.turnstile.reset(this.widgetId),this.widgetState.set("loading"),this.errorMessage.set(""))}waitForTurnstileApi(){if(window.turnstile){this.renderWidget();return}this.loadTurnstileScript(),this.ngZone.runOutsideAngular(()=>{let e=Date.now();this.pollTimer=setInterval(()=>{if(window.turnstile){this.clearPollTimer(),this.ngZone.run(()=>this.renderWidget());return}Date.now()-e>=z&&(this.clearPollTimer(),this.ngZone.run(()=>{let t="Verification service unavailable. Please refresh the page and try again.";this.widgetState.set("error"),this.errorMessage.set(t)}))},k)})}loadTurnstileScript(){if(I)return;I=!0;let e=document.createElement("script");e.src=_,e.defer=!0,document.head.appendChild(e)}resolveSize(){let e=this.containerRef.nativeElement.clientWidth;return e===0?"normal":e<D?"compact":"normal"}observeContainerWidth(){typeof ResizeObserver>"u"||(this.resizeObserver=new ResizeObserver(()=>{this.widgetId===null||!window.turnstile||this.resolveSize()===this.renderedSize||this.ngZone.run(()=>{window.turnstile.remove(this.widgetId),this.widgetId=null,this.widgetState.set("loading"),this.errorMessage.set(""),this.renderWidget()})}),this.resizeObserver.observe(this.containerRef.nativeElement))}renderWidget(){let e=this.containerRef.nativeElement,t=this.resolveSize();this.renderedSize=t;try{this.widgetId=window.turnstile.render(e,{sitekey:this.siteKey,size:t,callback:i=>{this.ngZone.run(()=>{this.widgetState.set("ready"),this.errorMessage.set(""),this.tokenReceived.emit(i)})},"error-callback":()=>{this.ngZone.run(()=>{let i="Verification failed. Please try again.";this.widgetState.set("error"),this.errorMessage.set(i)})},"expired-callback":()=>{this.ngZone.run(()=>{this.widgetState.set("expired"),this.tokenExpired.emit()})},"timeout-callback":()=>{this.ngZone.run(()=>{let i="Verification timed out. Please try again.";this.widgetState.set("error"),this.errorMessage.set(i)})}})}catch{let i="Verification service unavailable. Please refresh the page and try again.";this.widgetState.set("error"),this.errorMessage.set(i)}}clearPollTimer(){this.pollTimer!==null&&(clearInterval(this.pollTimer),this.pollTimer=null)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=g({type:r,selectors:[["app-turnstile-widget"]],viewQuery:function(t,i){if(t&1&&b(E,7),t&2){let c;w(c=M())&&(i.containerRef=c.first)}},inputs:{siteKey:"siteKey"},outputs:{tokenReceived:"tokenReceived",tokenExpired:"tokenExpired"},decls:3,vars:1,consts:[["turnstileContainer",""],[1,"turnstile-container"],["role","alert",1,"turnstile-error"]],template:function(t,i){t&1&&(y(0,"div",1,0),v(2,L,2,1,"p",2)),t&2&&(l(2),h(i.widgetState()==="error"?2:-1))},styles:[".turnstile-container[_ngcontent-%COMP%]{margin:12px 0;max-width:100%;overflow-x:auto}.turnstile-container[_ngcontent-%COMP%]:empty{margin:0}.turnstile-error[_ngcontent-%COMP%]{font-family:var(--font-family);font-size:13px;color:var(--color-error);margin:4px 0 0}"]})};var C=class r{api=n(T);login(e){return this.api.post("/api/v2/authentication/login",e)}register(e){return this.api.post("/api/v2/authentication/register",e)}googleLogin(e,t){return this.api.post("/api/v2/oauth/google/login",s({idToken:e},t&&{returnUrl:t}))}socialAuth(e){return this.api.get(`/api/v2/oauth/${e}/login`)}facebookLogin(e,t){return this.api.post("/api/v2/oauth/facebook/login",s({accessToken:e},t&&{returnUrl:t}))}mergeAccount(e){return this.api.post("/api/v2/oauth/merge-account",e)}resendVerificationLink(e){return this.api.post("/api/v2/email-verification/resend-link",{credential:e})}forgotPassword(e,t){return this.api.post("/api/v2/authentication/forgot-password",{email:e,cloudflareToken:t})}validateResetCode(e){return this.api.get(`/api/v2/authentication/validate-reset-code?code=${e}`)}resetPassword(e,t,i){return this.api.post("/api/v2/authentication/reset-password",{code:e,newPassword:t,confirmPassword:i})}verifyMfa(e){return this.api.post("/api/v2/authentication/mfa/verify",e)}resendMfaCode(e){return this.api.post("/api/v2/authentication/mfa/resend",e)}getMfaUserData(e){return this.api.post("/api/v2/authentication/mfa/user-data",{credential:e})}getPrivacyStatus(){return this.api.get("/api/v2/authentication/privacy-status")}acceptPrivacyPolicy(){return this.api.post("/api/v2/authentication/privacy-accept",{})}declinePrivacyPolicy(){return this.api.post("/api/v2/authentication/privacy-decline",{})}static \u0275fac=function(t){return new(t||r)};static \u0275prov=d({token:r,factory:r.\u0275fac,providedIn:"root"})};export{A as a,C as b};
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.