1import"./chunk-VT7CJSCD.js";import{a as ne}from"./chunk-65I45D2I.js";import{D as ie,G as W,M as V,c as O,h as I,i as Z,l as ee,o as E,p as te}from"./chunk-QDFFLVTB.js";import{e as Q,h as X,k as R}from"./chunk-5FWAKVG3.js";import{j as Y,k as C,l as F,m as $,z as y}from"./chunk-KAXBUATZ.js";import{Cc as c,Dc as n,Ea as B,Ec as r,Fa as U,Ja as x,Jb as s,Jc as A,Kc as j,Ob as D,Oc as _,Sa as m,Ta as g,Vc as f,Xc as l,bc as v,cc as H,g as k,gc as u,hd as G,jd as a,kd as h,ld as b,rd as M,sd as S,td as P,va as w,ve as J}from"./chunk-XW6AEKHB.js";import"./chunk-6G35VSEK.js";var se=()=>`https://api-app-${ne.stage||"dev"}.canapii.com/registration/invite`,T=(()=>{class t{constructor(){this.http=x(J),this.base=se()}start(e){return this.http.post(`${this.base}/portal/start`,e)}verifyOtp(e,i){return this.http.post(`${this.base}/portal/verify-otp`,{email:e,code:i})}decline(e,i,o){return this.http.post(`${this.base}/decline`,{token:e,reason:i,recaptchaToken:o})}validateCode(e,i){return this.http.post(`${this.base}/code/validate`,{code:e,pathwayPK:i})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=B({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function ce(t,d){if(t&1&&(n(0,"div",10),a(1),r()),t&2){let e=l(2);s(),h(e.errorMessage)}}function le(t,d){if(t&1){let e=_();n(0,"section")(1,"h1"),a(2,"Decline invitation"),r(),n(3,"p",4),a(4,"Are you sure you want to decline your invitation?"),r(),n(5,"label"),a(6," Reason (optional) "),n(7,"textarea",5),P("ngModelChange",function(o){m(e);let p=l();return S(p.reason,o)||(p.reason=o),g(o)}),r()(),u(8,ce,2,1,"div",6),n(9,"div",7)(10,"button",8),f("click",function(){m(e);let o=l();return g(o.history.back())}),a(11,"Go back"),r(),n(12,"button",9),f("click",function(){m(e);let o=l();return g(o.submit())}),a(13,"Decline invitation"),r()()()}if(t&2){let e=l();s(7),M("ngModel",e.reason),s(),c("ngIf",e.errorMessage)}}function pe(t,d){t&1&&(n(0,"section")(1,"p"),a(2,"Submitting\u2026"),r()())}function de(t,d){t&1&&(n(0,"section")(1,"h1"),a(2,"Thanks for letting us know"),r(),n(3,"p"),a(4,"You have declined your invitation. Check your inbox for a confirmation email."),r()())}function me(t,d){t&1&&(n(0,"section")(1,"h1"),a(2,"Already declined"),r(),n(3,"p"),a(4,"This invitation has already been declined. No action is required."),r()())}function ge(t,d){t&1&&(n(0,"section")(1,"h1"),a(2,"Link is no longer valid"),r(),n(3,"p"),a(4,"This decline link may have expired or already been used."),r()())}var K=(()=>{class t{constructor(){this.service=x(T),this.route=x(Q),this.destroy$=new k,this.state="confirm",this.token="",this.reason="",this.errorMessage="",this.history=window.history}ngOnInit(){this.token=this.route.snapshot.queryParamMap.get("token")||"",this.token||(this.state="invalid")}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}submit(){this.errorMessage="",this.state="submitting",this.service.decline(this.token,this.reason||void 0).pipe(w(this.destroy$)).subscribe(e=>{if(e.success===0){if(e.code==="used"){this.state="already";return}this.errorMessage=e.message||"Unable to decline. The link may have expired.",this.state="invalid";return}e.data?.alreadyDeclined?this.state="already":this.state="done"},()=>{this.errorMessage="Something went wrong. Please try again.",this.state="confirm"})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["app-decline-page"]],decls:8,vars:6,consts:[[1,"decline-page"],[1,"card"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"lede"],["rows","4","maxlength","1000","name","reason","placeholder","Let the organizer know why you can't make it.",3,"ngModelChange","ngModel"],["class","alert alert-danger",4,"ngIf"],[1,"actions"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-danger",3,"click"],[1,"alert","alert-danger"]],template:function(i,o){i&1&&(n(0,"div",0)(1,"div",1),A(2,2),u(3,le,14,2,"section",3)(4,pe,3,0,"section",3)(5,de,5,0,"section",3)(6,me,5,0,"section",3)(7,ge,5,0,"section",3),j(),r()()),i&2&&(s(2),c("ngSwitch",o.state),s(),c("ngSwitchCase","confirm"),s(),c("ngSwitchCase","submitting"),s(),c("ngSwitchCase","done"),s(),c("ngSwitchCase","already"),s(),c("ngSwitchCase","invali
1d"))},dependencies:[y,C,F,$,V,O,I,W,E],styles:[".decline-page[_ngcontent-%COMP%]{min-height:100vh;display:flex;justify-content:center;align-items:center;background:#f7f9fb;font-family:Nunito,Roboto,-apple-system,sans-serif;padding:40px 20px}.card[_ngcontent-%COMP%]{width:min(520px,100%);background:#fff;border-radius:12px;padding:40px;box-shadow:0 10px 40px #0000000f}h1[_ngcontent-%COMP%]{font-size:24px;font-weight:700;margin-bottom:8px}.lede[_ngcontent-%COMP%]{color:#5f6368;margin-bottom:24px}label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;font-weight:600;font-size:13px;margin-bottom:16px}textarea[_ngcontent-%COMP%]{padding:10px 12px;border:1px solid #ced4da;border-radius:6px;font-size:14px}.alert[_ngcontent-%COMP%]{padding:10px 12px;border-radius:6px;margin-bottom:12px}.alert-danger[_ngcontent-%COMP%]{background:#f8d7da;color:#842029}.actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:12px}.btn[_ngcontent-%COMP%]{padding:10px 16px;border-radius:6px;border:none;font-weight:600;cursor:pointer}.btn-secondary[_ngcontent-%COMP%]{background:#e9ecef;color:#212529}.btn-danger[_ngcontent-%COMP%]{background:#dc3545;color:#fff}"]})}}return t})();function fe(t,d){if(t&1&&(n(0,"div",7),a(1),r()),t&2){let e=l();s(),h(e.errorMessage)}}var re=(()=>{class t{constructor(){this.email="",this.expiresAt="",this.verified=new D,this.back=new D,this.service=x(T),this.destroy$=new k,this.code="",this.submitting=!1,this.errorMessage="",this.resendDisabledSeconds=60}ngOnInit(){this.startCountdown()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.countdown&&clearInterval(this.countdown)}onVerify(){this.errorMessage="",this.submitting=!0,this.service.verifyOtp(this.email,this.code).pipe(w(this.destroy$)).subscribe(e=>{if(this.submitting=!1,e.success===0){this.errorMessage=e.message||"Invalid verification code.";return}let i=e.data;i.mode==="single"?this.verified.emit({token:i.token,pathwayPK:i.pathwayPK}):this.verified.emit({invitations:i.invitations})})}resend(){this.resendDisabledSeconds>0||this.service.start({email:this.email}).pipe(w(this.destroy$)).subscribe(()=>{this.resendDisabledSeconds=60,this.startCountdown()})}startCountdown(){this.countdown&&clearInterval(this.countdown),this.countdown=setInterval(()=>{this.resendDisabledSeconds>0?this.resendDisabledSeconds-=1:this.countdown&&clearInterval(this.countdown)},1e3)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["app-otp-verification"]],inputs:{email:"email",expiresAt:"expiresAt"},outputs:{verified:"verified",back:"back"},decls:19,vars:7,consts:[[1,"lede"],["type","text","inputmode","numeric","maxlength","6","name","code","placeholder","123456","autocomplete","one-time-code",3,"ngModelChange","ngModel"],["class","alert alert-danger",4,"ngIf"],["type","button",1,"btn","btn-primary",3,"click","disabled"],[1,"secondary-actions"],["type","button",1,"btn","btn-link",3,"click"],["type","button",1,"btn","btn-link",3,"click","disabled"],[1,"alert","alert-danger"]],template:function(i,o){i&1&&(n(0,"section")(1,"h1"),a(2,"Verify your email"),r(),n(3,"p",0),a(4," We sent a 6-digit code to "),n(5,"strong"),a(6),r(),a(7,". "),r(),n(8,"label"),a(9," Verification code "),n(10,"input",1),P("ngModelChange",function(z){return S(o.code,z)||(o.code=z),z}),r()(),u(11,fe,2,1,"div",2),n(12,"button",3),f("click",function(){return o.onVerify()}),a(13),r(),n(14,"div",4)(15,"button",5),f("click",function(){return o.back.emit()}),a(16,"\u2190 Use a different email"),r(),n(17,"button",6),f("click",function(){return o.resend()}),a(18),r()()()),i&2&&(s(6),h(o.email),s(4),M("ngModel",o.code),s(),c("ngIf",o.errorMessage),s(),c("disabled",o.code.length!==6||o.submitting),s(),b(" ",o.submitting?"Verifying\u2026":"Verify & continue"," "),s(4),c("disabled",o.resendDisabledSeconds>0),s(),b(" ",o.resendDisabledSeconds>0?"Resend in "+o.resendDisabledSeconds+"s":"Resend code"," "))},dependencies:[y,C,V,O,I,W,E],styles:["section[_ngcontent-%COMP%]{display:flex;flex-direction:column}h1[_ngcontent-%COMP%]{font-size:24px;font-weight:700;margin-bottom:8px}.lede[_ngcontent-%COMP%]{color:#5f6368;margin-bottom:24px}label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;font-weight:600;font-size:13px;margin-bottom:16px}input[_ngcontent-%COMP%]{padding:16px;border:1px solid #ced4da;border-radius:6px;font-size:24px;text-align:center;letter-spacing:8px;font-family:ui-monospace,SF Mono,monospace}.alert[_ngcontent-%COMP%]{padding:10px 12px;border-radius:6px;margin:12px 0}.alert-danger[_ngcontent-%COMP%]{background:#f8d7da;color:#842029}.btn[_ngcontent-%COMP%]{padding:12px;border-radius:6px;font-weight:600;border:none;cursor:pointer}.btn-primary[_ngcontent-%COMP%]{background:#0d6efd;color:#fff}.btn-primary[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.secondary-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-top:12px}
1.btn-link[_ngcontent-%COMP%]{background:none;border:none;color:#0d6efd;cursor:pointer;padding:6px}.btn-link[_ngcontent-%COMP%]:disabled{color:#adb5bd;cursor:not-allowed}"]})}}return t})();function ue(t,d){if(t&1&&(n(0,"span",7),a(1),r()),t&2){let e=l().$implicit;s(),b(" (",e.status,") ")}}function he(t,d){if(t&1){let e=_();n(0,"li")(1,"div",3)(2,"strong"),a(3),r(),n(4,"span",4),a(5),r(),u(6,ue,2,1,"span",5),r(),n(7,"button",6),f("click",function(){let o=m(e).$implicit,p=l();return g(p.pick.emit(o.pathwayPK))}),a(8),r()()}if(t&2){let e=d.$implicit;G("disabled",e.status==="accepted"),s(3),h(e.pathwayPK),s(2),h(e.mode==="claim_your_spot"?"Claim your spot":"Pre-provisioned"),s(),c("ngIf",e.status!=="sent"&&e.status!=="opened"),s(),c("disabled",e.status==="accepted"),s(),b(" ",e.status==="accepted"?"Already registered":"Register"," ")}}var ae=(()=>{class t{constructor(){this.invitations=[],this.pick=new D}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["app-invitation-selection"]],inputs:{invitations:"invitations"},outputs:{pick:"pick"},decls:7,vars:1,consts:[[1,"lede"],[1,"picker"],[3,"disabled",4,"ngFor","ngForOf"],[1,"info"],[1,"mode"],["class","status",4,"ngIf"],[1,"btn","btn-primary",3,"click","disabled"],[1,"status"]],template:function(i,o){i&1&&(n(0,"section")(1,"h1"),a(2,"Choose your pathway"),r(),n(3,"p",0),a(4,"You have multiple invitations. Pick the one you'd like to register through."),r(),n(5,"ul",1),u(6,he,9,7,"li",2),r()()),i&2&&(s(6),c("ngForOf",o.invitations))},dependencies:[y,Y,C],styles:["section[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:24px;font-weight:700;margin-bottom:8px}.lede[_ngcontent-%COMP%]{color:#5f6368;margin-bottom:24px}.picker[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:12px}.picker[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:16px;border:1px solid #dee2e6;border-radius:8px}.picker[_ngcontent-%COMP%] li.disabled[_ngcontent-%COMP%]{opacity:.6}.info[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.mode[_ngcontent-%COMP%]{font-size:12px;color:#6c757d}.status[_ngcontent-%COMP%]{font-size:11px;color:#6c757d;text-transform:uppercase}.btn[_ngcontent-%COMP%]{padding:8px 16px;border-radius:4px;border:none;font-weight:600;cursor:pointer}.btn-primary[_ngcontent-%COMP%]{background:#0d6efd;color:#fff}.btn-primary[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;background:#ced4da}"]})}}return t})();function xe(t,d){if(t&1&&(n(0,"div",13),a(1),r()),t&2){let e=l(2);s(),h(e.errorMessage)}}function _e(t,d){if(t&1){let e=_();n(0,"form",7),f("ngSubmit",function(){m(e);let o=l();return g(o.onSubmit())}),n(1,"h1"),a(2,"Find your invitation"),r(),n(3,"p",8),a(4,"Enter your email and/or invite code to access your invitation."),r(),n(5,"label"),a(6," Email "),n(7,"input",9),P("ngModelChange",function(o){m(e);let p=l();return S(p.email,o)||(p.email=o),g(o)}),r()(),n(8,"label"),a(9," Invite code (optional) "),n(10,"input",10),P("ngModelChange",function(o){m(e);let p=l();return S(p.inviteCode,o)||(p.inviteCode=o),g(o)}),r()(),u(11,xe,2,1,"div",11),n(12,"button",12),a(13),r()()}if(t&2){let e=l();s(7),M("ngModel",e.email),s(3),M("ngModel",e.inviteCode),s(),c("ngIf",e.errorMessage),s(),c("disabled",!e.email||e.submitting),s(),b(" ",e.submitting?"Checking\u2026":"Continue \u2192"," ")}}function ve(t,d){if(t&1){let e=_();n(0,"app-otp-verification",14),f("verified",function(o){m(e);let p=l();return g(p.onOtpVerified(o))})("back",function(){m(e);let o=l();return g(o.retry())}),r()}if(t&2){let e=l();c("email",e.email)("expiresAt",e.otpExpiresAt)}}function be(t,d){if(t&1){let e=_();n(0,"app-invitation-selection",15),f("pick",function(o){m(e);let p=l();return g(p.onPickInvitation(o))}),r()}if(t&2){let e=l();c("invitations",e.matchedInvitations)}}function Ce(t,d){if(t&1){let e=_();n(0,"section")(1,"h1"),a(2,"No invitation found"),r(),n(3,"p"),a(4," We could not find an invitation for "),n(5,"strong"),a(6),r(),a(7,". "),r(),n(8,"div",16)(9,"button",17),f("
1click",function(){m(e);let o=l();return g(o.retry())}),a(10,"Try another email"),r()()()}if(t&2){let e=l();s(6),h(e.email)}}var L=(()=>{class t{constructor(){this.service=x(T),this.router=x(X),this.destroy$=new k,this.step="entry",this.email="",this.inviteCode="",this.recaptchaToken="",this.submitting=!1,this.errorMessage="",this.otpExpiresAt="",this.matchedInvitations=[]}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onSubmit(){this.errorMessage="",this.submitting=!0,this.service.start({email:this.email,inviteCode:this.inviteCode||void 0,recaptchaToken:this.recaptchaToken}).pipe(w(this.destroy$)).subscribe(e=>{if(this.submitting=!1,e.success===0){this.errorMessage=e.message||"Something went wrong. Please try again.";return}let i=e.data;if(i.mode==="code"&&i.pathwayPK){this.router.navigate([`/register-unified/form/${i.pathwayPK}`],{queryParamsHandling:"preserve"});return}if(i.mode==="otp"){if(i.matches===0||!i.otpSent){this.step="no-match";return}this.otpExpiresAt=i.expiresAt||"",this.step="otp"}})}onOtpVerified(e){if(e.token&&e.pathwayPK){this.router.navigate([`/register-unified/form/${e.pathwayPK}`],{queryParams:{token:e.token},queryParamsHandling:"merge"});return}this.matchedInvitations=e.invitations||[],this.step="selection"}onPickInvitation(e){this.router.navigate([`/register-unified/form/${e}`],{queryParamsHandling:"preserve"})}retry(){this.step="entry",this.email="",this.inviteCode="",this.errorMessage=""}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["app-invite-portal"]],decls:7,vars:5,consts:[[1,"invite-portal"],["role","main",1,"portal-card"],[3,"ngSwitch"],[3,"ngSubmit",4,"ngSwitchCase"],[3,"email","expiresAt","verified","back",4,"ngSwitchCase"],[3,"invitations","pick",4,"ngSwitchCase"],[4,"ngSwitchCase"],[3,"ngSubmit"],[1,"lede"],["type","email","name","email","required","","autocomplete","email","placeholder","[email protected]",3,"ngModelChange","ngModel"],["type","text","name","inviteCode","autocomplete","off","placeholder","VIP2026",3,"ngModelChange","ngModel"],["class","alert alert-danger",4,"ngIf"],["type","submit",1,"btn","btn-primary","btn-lg",3,"disabled"],[1,"alert","alert-danger"],[3,"verified","back","email","expiresAt"],[3,"pick","invitations"],[1,"actions"],[1,"btn","btn-primary",3,"click"]],template:function(i,o){i&1&&(n(0,"div",0)(1,"div",1),A(2,2),u(3,_e,14,5,"form",3)(4,ve,1,2,"app-otp-verification",4)(5,be,1,1,"app-invitation-selection",5)(6,Ce,11,1,"section",6),j(),r()()),i&2&&(s(2),c("ngSwitch",o.step),s(),c("ngSwitchCase","entry"),s(),c("ngSwitchCase","otp"),s(),c("ngSwitchCase","selection"),s(),c("ngSwitchCase","no-match"))},dependencies:[y,C,F,$,V,te,O,I,Z,ie,E,ee,re,ae],styles:[".invite-portal[_ngcontent-%COMP%]{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:40px 20px;background:#f7f9fb;font-family:Nunito,Roboto,-apple-system,sans-serif}.portal-card[_ngcontent-%COMP%]{width:min(520px,100%);background:#fff;border-radius:12px;padding:40px;box-shadow:0 10px 40px #0000000f}h1[_ngcontent-%COMP%]{font-size:24px;font-weight:700;margin-bottom:8px}.lede[_ngcontent-%COMP%]{color:#5f6368;margin-bottom:24px}label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;font-weight:600;font-size:13px;margin-bottom:16px}input[_ngcontent-%COMP%]{padding:10px 12px;border:1px solid #ced4da;border-radius:6px;font-size:15px}.alert[_ngcontent-%COMP%]{padding:10px 12px;border-radius:6px;margin:12px 0}.alert-danger[_ngcontent-%COMP%]{background:#f8d7da;color:#842029}.btn[_ngcontent-%COMP%]{width:100%;padding:12px;border-radius:6px;font-weight:600;border:none;cursor:pointer}.btn-primary[_ngcontent-%COMP%]{background:#0d6efd;color:#fff}.btn-primary[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.actions[_ngcontent-%COMP%]{display:flex;gap:12px;margin-top:24px}"]})}}return t})();var ye=[{path:"",component:L},{path:"decline",component:K}],pt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=H({type:t})}static{this.\u0275inj=U({imports:[R.forChild(ye),L,K,R]})}}return t})();export{pt as InviteModule};
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.