PageSourceSearch

https://app.viewsemr.com/chunk-GTFEMQKI.js

js viewsemr.com collected 2026-09-24 13:49:16 UTC 83,469 bytes, 2 lines download raw bytes

1import{a as Y,b as Wt,d as Jt,e as Kt,f as Le,g as ze,h as He,i as Ge,j as $e,l as je,m as Xt,n as Ye,o as Qt,p as qe}from"./chunk-EV6534FP.js";import{a as we,c as Ee,d as Oe}from"./chunk-JG5OBV37.js";import{a as _t,b as ht,c as nt,e as Ct,f as xt,g as vt,h as Te,i as re,j as Ae,l as Fe,v as Re,w as Ne,x as Ve,y as Be,z as Ue}from"./chunk-KMN522J6.js";import{d as Gt}from"./chunk-5KHB3FTH.js";import{c as At,d as wt,f as rt,h as Et}from"./chunk-QNQKGVSC.js";import{A as V,I as qt,a as N,b as ut,c as U,d as $t,e as ft,f as gt,g as De,h as Ie,i as jt,o as k,q as bt,s as ke,x as yt,z as Yt}from"./chunk-U2LEZ32Q.js";import{$a as oe,A as $,Cb as Ut,Db as Lt,Fb as zt,Ib as pt,Jb as Ht,Kb as j,La as F,Ma as v,Mb as E,Na as I,a as be,b as dt,d as ye,fb as Me,gc as R,i as Se,k as lt,lb as Rt,nb as it,q as A,qb as ct,rb as Nt,sb as Vt,ta as Ft,ub as X,vb as Pe,wb as Bt,x as K,z as et}from"./chunk-THWYHIGY.js";import{Bc as z,Cb as l,Cc as Z,Db as c,Dc as Pt,Fb as T,Gb as O,Hb as D,Ib as p,Jb as o,Kb as a,Lb as u,Mb as St,Nb as Mt,Ob as fe,Oc as Tt,Pc as G,Sb as P,Tb as ge,Va as L,Wb as x,Xa as Dt,Ya as r,Yb as d,da as f,gc as ot,ic as Q,ja as y,jc as _e,ka as S,lb as b,lc as s,mc as h,nc as w,oc as J,p as C,pa as pe,q as ce,qc as he,rb as st,rc as Ce,sc as xe,tc as It,uc as ve,va as at,wc as kt,xc as tt,yc as mt,za as ue}from"./chunk-MHKM3RYU.js";import{a as q,b as W,g as Ot,h as _}from"./chunk-ICSRYAQL.js";var We=Ot(jt());var Je=e=>[e];function gi(e,m){e&1&&(o(0,"p",3),s(1,"No registrations found"),a())}function _i(e,m){e&1&&(o(0,"h3",4),s(1,"Registrations"),a())}function hi(e,m){if(e&1&&(o(0,"tr")(1,"td"),u(2,"img",6),a(),o(3,"td",7),s(4),a(),o(5,"td"),s(6),a(),o(7,"td"),s(8),a(),o(9,"td"),s(10),a(),o(11,"td")(12,"button",8),s(13," Update "),a()()()),e&2){let t=m.$implicit,i=d(2);r(2),p("src",t.camp.image_url,L),r(2),h(t.camp.title),r(2),h(i.formatDateStr(t.camp.start_date)),r(2),h(i.formatDateStr(t.camp.end_date)),r(2),h(i.formatDateStr(t.created_at)),r(2),p("routerLink",tt(6,Je,"/p/registrations/"+t.id+"/edit"))}}function Ci(e,m){if(e&1&&(o(0,"table")(1,"tr"),u(2,"th"),o(3,"th"),s(4,"Program"),a(),o(5,"th"),s(6,"Start"),a(),o(7,"th"),s(8,"End"),a(),o(9,"th"),s(10,"Registered"),a(),u(11,"th"),a(),O(12,hi,14,8,"tr",null,T),a()),e&2){let t=d();r(12),D(t.camper().registrations)}}var Ke=(()=>{class e{constructor(){this.camper=G.required()}formatDateStr(t){return t?(0,We.default)(t).format("MM/DD/YYYY"):""}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-camper-panel"]],inputs:{camper:[1,"camper"]},decls:14,vars:8,consts:[[1,"example-headers-align","mb-2"],[2,"color","transparent"],["size","sm","mat-raised-button","","color","primary",1,"!mb-5",3,"routerLink"],[1,"text-gray-600"],[1,"text-theme-primary"],[2,"overflow-x","auto"],[1,"camp-img",3,"src"],[1,"camp-name-col"],["mat-raised-button","","color","primary","size","sm",1,"!mr-2.5","!mb-2.5","reg-btn",3,"routerLink"]],template:function(i,n){i&1&&(o(0,"mat-expansion-panel",0)(1,"mat-expansion-panel-header")(2,"mat-panel-title"),s(3),a(),o(4,"mat-panel-description")(5,"span",1),s(6,"."),a()()(),o(7,"div")(8,"button",2),s(9,"Edit Info"),a(),l(10,gi,2,0,"p",3),l(11,_i,2,0,"h3",4),o(12,"div",5),l(13,Ci,
114,0,"table"),a()()()),i&2&&(r(3),J(" ",n.camper().first_name," ",n.camper().last_name," "),r(5),p("routerLink",tt(6,Je,"/p/participant/"+n.camper().id+"/edit")),r(2),c(n.camper().registrations.length<1?10:-1),r(),c(n.camper().registrations.length>0?11:-1),r(2),c(n.camper().registrations.length>0?13:-1))},dependencies:[Le,ze,Ge,He,E,$],styles:[".example-action-buttons[_ngcontent-%COMP%]{padding-bottom:20px}.example-headers-align[_ngcontent-%COMP%]   .mat-expansion-panel-header-title[_ngcontent-%COMP%], .example-headers-align[_ngcontent-%COMP%]   .mat-expansion-panel-header-description[_ngcontent-%COMP%]{flex-basis:0}.example-headers-align[_ngcontent-%COMP%]   .mat-expansion-panel-header-description[_ngcontent-%COMP%]{justify-content:space-between;align-items:center}.example-headers-align[_ngcontent-%COMP%]   .mat-form-field[_ngcontent-%COMP%] + .mat-form-field[_ngcontent-%COMP%]{margin-left:8px}.camp-img[_ngcontent-%COMP%]{height:50px;width:50px;object-fit:cover;border-radius:3px}table[_ngcontent-%COMP%]{width:100%}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{text-align:left;padding-right:10px}.camp-name-col[_ngcontent-%COMP%]{max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.reg-btn[_ngcontent-%COMP%]{width:122px}"]})}}return e})();var xi=()=>["/p/participant/create"];function vi(e,m){e&1&&(o(0,"div"),u(1,"mat-spinner",9),a())}function bi(e,m){e&1&&(o(0,"h3",5),s(1,"Add your first participant using the button above"),a())}function yi(e,m){if(e&1&&u(0,"app-camper-panel",8),e&2){let t=m.$implicit;p("camper",t)}}var Xe=(()=>{class e{constructor(){this.api=f(F),this.util=f(k),this.snackbarService=f(R),this.campers=[],this.isLoading=!1}ngOnInit(){this.init()}init(){return _(this,null,function*(){this.isLoading=!0,this.campers=yield this.getCampers(),this.isLoading=!1})}getCampers(){return _(this,null,function*(){let t=yield C(this.api.get("user/camper").pipe(v()));return t instanceof A?(this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(t)),[]):t.data})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-camper-index"]],decls:17,vars:4,consts:[[1,"flex","flex-row","items-center"],[1,"flex","items-center","justify-start","pt-2.5","pb-5"],["title","Participants","icon","person"],["type","button","mat-raised-button","","color","primary",3,"routerLink"],[1,"material-symbols-rounded"],[1,"!mt-5","text-theme-primary"],[1,"!mt-5"],["multi","",1,"example-headers-align"],[3,"camper"],["diameter","30"]],template:function(i,n){i&1&&(o(0,"div")(1,"div",0)(2,"div",1),u(3,"app-icon-page-header",2),a(),l(4,vi,2,0,"div"),a(),o(5,"mat-card")(6,"mat-card-content")(7,"button",3)(8,"mat-icon",4),s(9,"add"),a(),s(10," New "),a()()(),l(11,bi,2,0,"h3",5),o(12,"mat-card",6)(13,"mat-card-content")(14,"mat-accordion",7),O(15,yi,1,1,"app-camper-panel",8,T),a()()()()),i&2&&(r(4),c(n.isLoading?4:-1),r(3),p("routerLink",kt(3,xi)),r(4),c(!n.isLoading&&n.campers.length<1?11:-1),r(4),D(n.campers))},dependencies:[Y,V,N,U,E,$,j,$e,Ke],encapsulation:2})}}return e})();var Si=()=>["/p/participant/index"],se=(()=>{class e{constructor(){this.router=f(et),this.route=f(K)}ngOnInit(){this.camperId=parseInt(this.route.snapshot.params.id,10)||void 0}onSaved(t){let i=`/p/participant/${t.id}/edit`;this.router.navigate([i])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-camper-edit"]],decls:13,vars:4,consts:[[1,"flex","items-center","justify-start","pt-2.5","pb-5"],[1,"flex","flex-row","justify-between","w-full"],["title","Participant","icon","person"],["mat-raised-button","","color","primary",3,"routerLink"],[1,"material-symbols-rounded"],[1,"flex","flex-row","!mb-5"],[1,"w-full"],[1,"p-5"],[3,"camperId","onSaved"]],template:function(i,n){i&1&&(o(0,"div")(1,"div",0)(2,"div",1),u(3,"app-icon-page-header",2),o(4,"button",3)(5,"mat-icon",4),s(6,"arrow_back"),a(),s(7," Back "),a()()(),o(8,"div",5)(9,"div",6)(10,"mat-card",7)(11,"mat-card-content"),u(12,"app-camper-form",8),a()()()()()),i&2&&(r(4),p("routerLink",kt(3,Si)),r(8),p("camperId",n.c
1amperId)("onSaved",n.onSaved.bind(n)))},dependencies:[Y,E,$,j,N,U,Qt],encapsulation:2})}}return e})();function Mi(e,m){e&1&&(o(0,"div",2),u(1,"mat-spinner",4),a()),e&2&&(r(),p("diameter",30))}function Pi(e,m){if(e&1&&(o(0,"div"),u(1,"img",26),a()),e&2){let t=d(2);r(),p("src",t.imgPreview,L)}}function wi(e,m){if(e&1&&(o(0,"mat-option",22),s(1),a()),e&2){let t=m.$implicit;p("value",t.key),r(),w(" ",t.label," ")}}function Ei(e,m){e&1&&u(0,"mat-spinner",25),e&2&&p("diameter",20)}function Oi(e,m){if(e&1){let t=P();o(0,"div",3)(1,"div",5)(2,"div",6),l(3,Pi,2,1,"div"),o(4,"div",7),s(5),a(),o(6,"input",8,0),x("change",function(){y(t);let n=ot(7),g=d();return S(g.onImageChange(n.files))}),a(),o(8,"button",9),x("click",function(){y(t);let n=ot(7);return S(n.click())}),o(9,"span"),s(10,"Update Profile Image"),a()()()(),o(11,"div",10)(12,"div",11)(13,"form",12),x("ngSubmit",function(){y(t);let n=d();return S(n.onSubmit())}),o(14,"div",13)(15,"div",14)(16,"div",14)(17,"mat-form-field",15)(18,"mat-label"),s(19,"Username"),a(),o(20,"mat-hint"),s(21,"Email can be used as username"),a(),u(22,"input",16),a()()(),o(23,"div",14)(24,"mat-form-field",15)(25,"mat-label"),s(26,"Phone"),a(),u(27,"input",17),a()(),o(28,"div",14)(29,"div",14)(30,"mat-form-field",18)(31,"mat-label"),s(32,"First Name"),a(),u(33,"input",19),a()(),o(34,"div",14)(35,"mat-form-field",18)(36,"mat-label"),s(37,"Last Name"),a(),u(38,"input",20),a()()(),o(39,"div",14)(40,"div",14)(41,"mat-form-field",18)(42,"mat-label"),s(43,"Language"),a(),o(44,"mat-select",21),O(45,wi,2,2,"mat-option",22,T),a()()()()(),o(47,"div",23)(48,"button",24),l(49,Ei,1,1,"mat-spinner",25),s(50," SAVE "),a()()()()()()}if(e&2){let t=d();r(3),c(t.imgPreview?3:-1),r(2),w(" ",t.user==null?null:t.user.email," "),r(),p("hidden",!0),r(7),p("formGroup",t.form),r(32),D(t.formOptions.locale_options),r(3),p("disabled",t.isSubmitting),r(),c(t.isSubmitting?49:-1)}}var Ze=(()=>{class e{constructor(){this.api=f(F),this.snackbarService=f(R),this.util=f(k),this.formOptions={locale_options:[]},this.form=new Vt({username:new X("",{nonNullable:!0,validators:[it.required]}),first_name:new X("",{nonNullable:!0,validators:[it.required]}),last_name:new X("",{nonNullable:!0,validators:[it.required]}),phone:new X(""),locale:new X("")}),this.compressedFile=null,this.imgPreview=null,this.isSubmitting=!1,this.isLoading=!1,this.user=null}ngOnInit(){this.init()}init(){return _(this,null,function*(){this.isLoading=!0;let t=yield this.getFormOptions();t&&(this.formOptions=t),this.user=yield this.getProfile(),this.user&&this.updateUserValues(this.user),this.isLoading=!1})}updateUserValues(t){this.form.patchValue({username:t.username,first_name:t.first_name,last_name:t.last_name,phone:t.phone,locale:t.locale}),t.img_url&&(this.imgPreview=t.img_url)}get f(){return this.form.controls}getFormOptions(){return _(this,null,function*(){let t=yield C(this.api.get("user/account/profile/form-options").pipe(v()));return I(t)?t.data:(this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(t)),null)})}getProfile(){return _(this,null,function*(){let t=yield C(this.api.get("user/account/profile").pipe(v()));return I(t)?t.data:(this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(t)),null)})}uploadPhoto(t){return _(this,null,function*(){let i=new FormData;i.append("image",t,t.name);let n=yield C(this.api.post("user/account/profile/image",i).pipe(v()));I(n)?(this.user=n.data,this.snackbarService.openSuccessSnackBar("Image saved!")):this.snackbarService.openErrorSnackBar("Error: "+this.util.parseNvdaApiError(n))})}onSubmit(){return _(this,null,function*(){if(this.form.invalid){this.snackbarService.openErrorSnackBar(this.form.status);return}this.isSubmitting=!0;let t=this.form.getRawValue(),i=new FormData;Object.keys(t).forEach(g=>i.append(g,t[g]??"")),i.append("_method","PUT");let n=yield C(this.api.post("user/account/profile",i).pipe(v()));this.isSubmitting=!1,I(n)?(this.user=n.data,this.snackbarService.openSuccessSnackBar("Profile saved!")):this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(n))})}onImageChange(t){return _(this,null,function*(){let i=t?.[0];i&&(this.compressedFile=yield this.util.compressFileV2(i),this.imgPreview=yield this.util.readFileAsDataUrl(this.compressedFile),this.uploadPhoto(this.compressedFile))})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-parent-profile"]],decls:3,vars:2,consts:[["addPhotoInput",""],[1,"!pt-10"],[1,"flex","justify-center","items-center","h-full","mb-4"],[1,"flex","flex-row","flex-wrap","!mb-5"],[3,"diameter"],[1,"xl:w-1/4","lg:w-1/4","md:w-full","w-full"],[1,"text-center"],[1,"!mt-2.5","mb-2.5","text-theme-secondary"],["id","fileInput","name","file","type","file",3,"change","hidden"],["type","button","mat-raised-button","","color","primary","mat-button","",1,"!mt-2.5","!mb-5",3,"click"],[1,"xl:w-3/4","lg:w-3/4","md:w-full","w-full"],[1,"!pl-5","!pt-5"],[3,"ngSubmit","formGroup"],[1,"flex","flex-col"],[1,"flex","flex-1","sm:flex-row","flex-col"],["appearance","outline",1,"!mr-2.5","w-full","mb-4"],["matInput","","formControlName","username","type","text","required",""],["matInput","","formControlName","phone","type","tel"],["appearance","outline",1,"!mr-2.5","w-full"],["matInput","","formControlName","first_name","type","text","required",""],["matInput","","formControlName","last_name","type","text","required",""],["formControlName","locale","required",""],[3,"value"],[1,"!mt-5","text-right","!mr-2.5"],["type","submit","mat-raised-button","","color","primary",3,"disabled"],[1,"!absolute","
1inset-x-0","mx-auto","text-center","mt-2",3,"diameter"],[1,"user-img",3,"src"]],template:function(i,n){i&1&&(o(0,"div",1),l(1,Mi,2,1,"div",2),l(2,Oi,51,6,"div",3),a()),i&2&&(r(),c(n.isLoading?1:-1),r(),c(n.isLoading?-1:2))},dependencies:[V,E,pt,Bt,Rt,ct,Nt,zt,Ht,Lt,Ut,yt,bt,ke,Yt,qt,Ft],styles:[".user-img[_ngcontent-%COMP%]{width:140px;height:140px;border-radius:100%;object-fit:cover}"]})}}return e})();function Di(e,m){e&1&&u(0,"mat-spinner",15),e&2&&p("diameter",20)}var ti=(()=>{class e{constructor(){this.api=f(F),this.snackbarService=f(R),this.util=f(k),this.form=new Vt({current_password:new X("",{nonNullable:!0,validators:[it.required]}),password:new X("",{nonNullable:!0,validators:[it.required]}),password_confirmation:new X("",{nonNullable:!0,validators:[it.required]})}),this.isSubmitting=!1}ngOnInit(){}get f(){return this.form.controls}onSubmit(){return _(this,null,function*(){if(this.form.invalid){this.snackbarService.openErrorSnackBar(this.form.status);return}this.isSubmitting=!0;let t=this.form.getRawValue(),i=new FormData;i.append("_method","PUT"),Object.keys(t).forEach(g=>i.append(g,t[g]));let n=yield C(this.api.post("v1/account/password",i).pipe(v()));this.isSubmitting=!1,I(n)?(this.form.reset(),this.snackbarService.openSuccessSnackBar("Password saved!")):this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(n))})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-parent-password"]],decls:26,vars:3,consts:[[1,"!pt-10"],[1,"flex","flex-row","flex-wrap","!mb-5"],[1,"w-full"],[1,"!pl-5","!pt-5"],[3,"ngSubmit","formGroup"],[1,"flex","flex-col"],[1,"flex","flex-1","flex-col"],["appearance","outline",1,"!mr-2.5","w-full"],["type","password","matInput","","formControlName","current_password"],[1,"!mr-2.5","w-full"],[1,"flex","flex-1","sm:flex-row","flex-col"],["type","password","matInput","","formControlName","password"],["type","password","matInput","","formControlName","password_confirmation"],[1,"!mt-5","text-right","!mr-2.5"],["type","submit","mat-raised-button","","color","primary",3,"disabled"],[1,"!absolute","inset-x-0","mx-auto","text-center","mt-2",3,"diameter"]],template:function(i,n){i&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"form",4),x("ngSubmit",function(){return n.onSubmit()}),o(5,"div",5)(6,"div",6)(7,"mat-form-field",7)(8,"mat-label"),s(9,"Current Password"),a(),u(10,"input",8),a(),u(11,"div",9),a()(),o(12,"div",5)(13,"div",10)(14,"mat-form-field",7)(15,"mat-label"),s(16,"New Password"),a(),u(17,"input",11),a(),o(18,"mat-form-field",7)(19,"mat-label"),s(20,"Confirm New Password"),a(),u(21,"input",12),a()()(),o(22,"div",13)(23,"button",14),l(24,Di,1,1,"mat-spinner",15),s(25," SAVE "),a()()()()()()()),i&2&&(r(4),p("formGroup",n.form),r(19),p("disabled",n.isSubmitting),r(),c(n.isSubmitting?24:-1))},dependencies:[V,pt,Bt,Rt,ct,Nt,Ht,Lt,Ut,yt,bt,Yt,E],encapsulation:2})}}return e})();function Ii(e,m){e&1&&u(0,"app-parent-profile")}function ki(e,m){e&1&&u(0,"app-parent-password")}var ei=(()=>{class e{constructor(){}ngOnInit(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-account-index"]],decls:10,vars:0,consts:[[1,"flex","items-center","justify-start","pt-2.5","pb-5"],["title","Account","icon","person"],["label","Profile"],["matTabContent",""],["label","Password"]],template:function(i,n){i&1&&(o(0,"div")(1,"div",0),u(2,"app-icon-page-header",1),a(),o(3,"mat-card")(4,"mat-card-content")(5,"mat-tab-group")(6,"mat-tab",2),st(7,Ii,1,0,"ng-template",3),a(),o(8,"mat-tab",4),st(9,ki,1,0,"ng-template",3),a()()()()())},dependencies:[Y,N,U,Kt,Jt,Wt,Ze,ti],encapsulation:2})}}return e})();function Ti(e,m){e&1&&(o(0,"p",2),s(1,"First, select the participant you would like to register."),a())}function Ai(e,m){if(e&1&&(o(0,"mat-option",9),s(1),a()),e&2){let t=m.$implicit;p("value",t.id),r(),J(" ",t.first_name," ",t.last_name," ")}}function Fi(e,m){if(e&1){let t=P();o(0,"mat-form-field",3)(1,"mat-label"),s(2,"Select Participant"),a(),o(3,"mat-select",8),xe("ngModelChange",function(n){y(t);let g=d();return Ce(g.camperId,n)||(g.camperId=n),S(n)}),O(4,Ai,2,3,"mat-option",9,T),a()()}if(e&2){let t=d();r(3),he("ngModel",t.camperId),r(),D(t.campers)}}function Ri(e,m){e&1&&(o(0,"p",2),s(1,"First, fill out the form to add the new participant you would like to register."),a())}function Ni(e,m){if(e&1&&(o(0,"div",6),u(1,"app-camper-form",10),a()),e&2){let t=d();r(),p("camperId",t.camperId)("onSaved",t.onNewParticipantSaved.bind(t))("useImage",!1)}}function Vi(e,m){if(e&1){let t=P();o(0,"div",7)(1,"div",11)(2,"div",12)(3,"button",13),x("click",function(){y(t);let n=d();return S(n.onSave())}),s(4," Save "),a()()()()}if(e&2){let t=d();r(3),p("disabled",!t.camperId)}}var ii=(()=>{class e{constructor(){this.dialogRef=f(_t),this.data=f(ht),this.camperId=0,this.campers=[],this.showNewParticipantForm=!1}ngOnInit(){this.camperId=this.data.camperId??0,this.campers=this.data.campers,this.campers.length==0&&(this.showNewParticipantForm=!0)}onShowNewParticipantForm(){this.camperId=0,this.showNewParticipantForm=!this.showNewParticipantForm}onNewParticipantSaved(t){this.onConfirm(t)}onSave(){let t=this.campers.find(i=>i.id===this.camperId);this.onConfirm(t)}onCamperSelected(t){let i=this.campers.find(n=>n.id===t.value);this.onConfirm(i)}onConfirm(t){this.dialogRef.close(t?{camper:t}:void 0)}onDismiss(){this.dialogRef.close(!1)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-participant-form-dialog"]],decls:11,vars:6,consts:[["mat-dialog-title",""],["mat-dialog-content",""],[1,"subheader","pb-1"],["appearance","outline",1,"w-full"],[1,"!mb-1"],["mat-raised-button","","color","primary",3,"click"],[1,"new-participant-form"],["mat-dialog-actions",""],["required","",3,"ngModelChange","ngModel"],[3,"value"],[3,"camperId","onSaved","useImage"],[1,"flex","flex-row","w-full"],[1,"w-full","text-right"],["mat-raised-button","","color","primary",2,"width","100px",3,"click","disabled"]],template:function(i,n){i&1&&(o(0,"h1",0),s(1,"Participant"),a(),o(2,"div",1),l(3,Ti,2,0,"p",2),l(4,Fi,6,1,"mat-form-field",3),o(5,"div",4)(6,"button",5),x("click",function(){return n.onShowNewParticipantForm()}),s(7),a()(),l(8,Ri,2,0,"p",2),l(9,Ni,2,3,"div",6),a(),l(10,Vi,5,1,"div",7)),i&2&&(r(3),c(n.showNewParticipantForm?-1:3),r(),c(n.showNewParticipantForm?-1:4),r(3),w(" ",n.showNewParticipantForm?"Cancel":"Add New Participant"," "),r(),c(n.showNewParticipantForm?8:-1),r(),c(n.showNewParticipantForm?9:-1),r(),c(n.showNewParticipantForm?-1:10))},dependencies:[Ct,xt,yt,bt,qt,pt,ct,zt,Pe,Ft,E,Qt,vt],styles:[".subheader[_ngcontent-%COMP%]{color:var(--text-secondary-color)}.new-participant-form[_ngcontent-%COMP%]{border:1px solid var(--border-color);border-radius:8px;padding:16px;box-shadow:0 2px 4px #0000001a;margin-bottom:16px!important}"]})}}return e})();function Bi(e,m){e&1&&(o(0,"mat-icon",23),s(1,"check_circle"),a())}function Ui(e,m){e&1&&(o(0,"mat-icon",24),s(1,"radio_button_unchecked"),a())}function Li(e,m){e&1&&(o(0,"span"),s(1,"Connect"),a())}function zi(e,m){e&1&&u(0,"mat-spinner",30)}function Hi(e,m){if(e&1){let t=P();o(0,"button",29),x("click",function(){y(t);let n=d().$implicit,g=d();return S(g.startCgmAuth(n))}),l(1,Li,2,0,"span"),l(2,zi,1,0,"mat-spinner",30),a()}if(e&2){let t=d().$implicit,i=d();p("color",t.color)("disabled",i.isLoading(t)),r(),c(i.isLoading(t)?-1:1),r(),c(i.isLoading(t)?2:-1)}}function Gi(e,m){e&1&&(o(0,"span"),s(1,"Disconnect"),a())}function $i(e,m){e&1&&u(0,"mat-spinner",30)}function ji(e,m){if(e&1){let t=P();o(0,"button",31),x("click",function(){y(t);let n=d().$implicit,g=d();return S(g.removeCgmAuth(n))}),l(1,Gi,2,0,"span"),l(2,$i,1,0,"mat-spinner",30),a()}if(e&2){let t=d().$implicit,i=d();p("disabled",i.isLoading(t)),r(),c(i.isLoading(t)?-1:1),r(),c(i.isLoading(t)?2:-1)}}function Yi(e,m){if(e&1&&(o(0,"div",6)(1,"div",16)(2,"div",17)(3,"div",18),u(4,"img",19),a(),o(5,"h4",20),s(6),a(),o(7,"p",21),s(8),a(),o(9,"div",22),l(10,Bi,2,0,"mat-icon",23),l(11,Ui,2,0,"mat-icon",24),o(12,"span",25),s(13),a()()(),o(14,"div",26),l(15,Hi,3,4,"button",27),l(16,ji,3,3,"button",28),a()()()),e&2){let t=m.$implicit,i=d();r(4),p("alt",It(t.displayName))("src",t.logo,L),r(2),h(t.displayName),r(2),h(t.description),r(2),c(i.getAccessStatus(t)?10:-1),r(),c(i.getAccessStatus(t)?-1:11),r(),p("ngClass",i.getAccessStatus(t)?"text-green-600 font-medium":"text-gray-500 dark:text-gray-200"),r(),w(" ",i.getAccessStatus(t)?"Connected":"Not Connected"," "),r(2),c(i.getAccessStatus(t)?-1:15),r(),c(i.getAccessStatus(t)?16:-1)}}function qi(e,m){if(e&1){let t=P();o(0,"button",32),x("click",function(){y(t);let n=d();return S(n.onDismiss())}),s(1," Continue Without Connecting "),a()}}function Wi(e,m){if(e&1){let t=P();o(0,"button",33),x("click",function(){y(t);let n=d();return S(n.onConfirm())}),s(1," Continue "),a()}}var ni={id:0,first_name:"",last_name:"",has_dexcom_auth:0,has_abbott_auth:0},ai=(()=>{class e{constructor(){this.api=f(F),this.util=f(k),this.snackbarService=f(R),this.dialogRef=f(_t),this.data=f(ht),this.camper=ni,this.loadingStates={},this.cgmProviders=[{id:"dexcom",name:"dexcom",logo:"assets/img/dexcom.png",displayName:"Dexcom",color:"dexcom-green",description:"Dexcom CGM provides glucose monitoring."},{id:"abbott",name:"abbott",logo:"assets/img/abbott-libre.png",displayName:"Abbott/Libre",color:"abbott-blue",description:"Abbott FreeStyle Libre provides glucose monitoring."}]}ngOnInit(){this.camper=this.data.camper?this.data.camper:ni,this.cgmProviders.forEac
1h(t=>{this.loadingStates[t.id]=!1})}checkAuthOnFocus(){this.cgmProviders.forEach(t=>{this.checkCgmAuthStatus(t)})}getAccessStatus(t){switch(t.id){case"dexcom":return!!this.camper.has_dexcom_auth;case"abbott":return!!this.camper.has_abbott_auth;default:return!1}}isLoading(t){return this.loadingStates[t.id]||!1}checkCgmAuthStatus(t){let i=`${t.name}/camper/${this.camper.id}/auth-status`;this.api.get(i).pipe(v()).subscribe(n=>{if(!I(n)){this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(n));return}let g=t.id==="dexcom"?"has_dexcom_auth"in n.data?n.data.has_dexcom_auth:0:"has_abbott_auth"in n.data?n.data.has_abbott_auth:0;if(this.getAccessStatus(t)!==!!g){let H=g?`${t.displayName} authorized!`:`${t.displayName} access removed`;this.snackbarService.openSuccessSnackBar(H),t.id==="dexcom"?this.camper.has_dexcom_auth=g?1:0:this.camper.has_abbott_auth=g?1:0}})}getCgmAuthUrl(t){return _(this,null,function*(){let i=`${t.name}/camper/${this.camper.id}/auth-url`,n=yield C(this.api.get(i).pipe(v()));return I(n)?n.data.url:(this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(n)),"")})}startCgmAuth(t){return _(this,null,function*(){this.loadingStates[t.id]=!0;let i=window.open("","_blank"),n=yield this.getCgmAuthUrl(t);this.loadingStates[t.id]=!1,n&&i?i.location.href=n:i?.close()})}hasAnyProviderAccess(){return!!this.camper.has_dexcom_auth||!!this.camper.has_abbott_auth}removeCgmAuth(t){let i=`${t.name}/camper/${this.camper.id}/remove-auth`;this.loadingStates[t.id]=!0,this.api.get(i).pipe(v()).subscribe(n=>{this.loadingStates[t.id]=!1,n instanceof A?this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(n)):this.checkCgmAuthStatus(t)})}onConfirm(){this.dialogRef.close({camper:this.camper})}onDismiss(){this.dialogRef.close(!1)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-multi-cgm-auth-dialog"]],hostBindings:function(i,n){i&1&&x("focus",function(){return n.checkAuthOnFocus()},Dt)},decls:22,vars:2,consts:[["mat-dialog-title","",1,"title","text-theme-primary"],["mat-dialog-content",""],[1,"mb-4"],[1,"text-lg","!mt-0","!mb-0","subtitle","text-theme-secondary"],[1,"mb-4","subtitle","text-theme-secondary"],[1,"flex"],[1,"provider-card","border","rounded-lg","p-4"],[1,"p-3","bg-gray-200","dark:bg-gray-800","rounded"],[1,"text-sm","subtitle","text-theme-secondary"],[1,"text-gray-500","mr-1",2,"font-size","16px","width","16px","height","16px"],["mat-dialog-actions",""],[1,"flex","flex-row","w-full"],[1,"w-full","text-left"],[1,"w-full","text-right"],["mat-raised-button","","color","warn"],["mat-raised-button","","color","primary"],[1,"flex","flex-col","items-start","justify-between","mb-3"],[1,"flex-1"],[1,"provider-logo-container","mb-2","dark:bg-white","dark:rounded-lg"],[1,"w-40","dark:ml-4",3,"src","alt"],[1,"text-lg","font-medium","mb-2","mt-0","title","text-theme-primary"],[1,"text-sm","mb-2","subtitle","text-theme-secondary"],[1,"flex","items-center","mb-4"],[1,"text-green-500","mr-2"],[1,"text-gray-400","mr-2"],[1,"text-sm",3,"ngClass"],[1,"flex","flex-col","gap-2"],["mat-raised-button","",1,"connect-button","min-w-[120px]",3,"color","disabled"],["mat-raised-button","","color","warn",1,"disconnect-button","min-w-[120px]",3,"disabled"],["mat-raised-button","",1,"connect-button","min-w-[120px]",3,"click","color","disabled"],["diameter","20"],["mat-raised-button","","color","warn",1,"disconnect-button","min-w-[120px]",3,"click","disabled"],["mat-raised-button","","color","warn",3,"click"],["mat-raised-button","","color","primary",3,"click"]],template:function(i,n){i&1&&(o(0,"h1",0),s(1,` CGM Authorization
2`),a(),o(2,"div",1)(3,"div",2)(4,"p",3),s(5,"Connect CGM Providers"),a(),o(6,"p",4),s(7," Connecting to a CGM provider allows staff to monitor glucose data during the event. This helps ensure the safety and well-being of participants. "),a()(),o(8,"div",5),O(9,Yi,17,11,"div",6,T),a(),o(11,"div",7)(12,"p",8)(13,"mat-icon",9),s(14,"info"),a(),s(15," You can connect to multiple CGM providers. Each connection will open in a new tab for authorization. "),a()()(),o(16,"div",10)(17,"div",11),u(18,"div",12),o(19,"div",13),l(20,qi,2,0,"button",14),l(21,Wi,2,0,"button",15),a()()()),i&2&&(r(9),D(n.cgmProviders),r(11),c(n.hasAnyProviderAccess()?-1:20),r(),c(n.hasAnyProviderAccess()?21:-1))},dependencies:[Ct,xt,j,dt,E,V,vt],styles:[".provider-selection-container[_ngcontent-%COMP%]{border-bottom:1px solid #e0e0e0;padding-bottom:1rem}.provider-selection-container[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin-bottom:.5rem;color:var(--text-primary-color)}.provider-content[_ngcontent-%COMP%]   .status-indicators[_ngcontent-%COMP%]{padding:1rem;background-color:var(--background-color);border-radius:8px}.provider-content[_ngcontent-%COMP%]   .status-indicators[_ngcontent-%COMP%]   .flex[_ngcontent-%COMP%]{margin-bottom:.5rem}.provider-content[_ngcontent-%COMP%]   .status-indicators[_ngcontent-%COMP%]   .flex[_ngcontent-%COMP%]:last-child{margin-bottom:0}.provider-logo-container[_ngcontent-%COMP%]{height:70px;display:flex;justify-content:start;align-items:center}.connect-button[_ngcontent-%COMP%]{min-width:180px}.connect-button.mat-dexcom-green[_ngcontent-%COMP%]{background-color:#00c851;color:#fff}.connect-button.mat-dexcom-green[_ngcontent-%COMP%]:hover{background-color:#00a840}.connect-button.mat-abbott-blue[_ngcontent-%COMP%]{background-color:#001489;color:#fff}.connect-button.mat-abbott-blue[_ngcontent-%COMP%]:hover{background-color:#041fb9}.disconnect-button[_ngcontent-%COMP%]{min-width:180px}
2.provider-name[_ngcontent-%COMP%]{font-weight:500;font-size:1rem}.dexcom-green[_ngcontent-%COMP%]{color:#00c851!important}.abbott-blue[_ngcontent-%COMP%]{color:#06c!important}.text-green-500[_ngcontent-%COMP%]{color:#00c851!important}.text-blue-500[_ngcontent-%COMP%]{color:#06c!important}@media(max-width:480px){.connect-button[_ngcontent-%COMP%]{min-width:140px;font-size:.875rem}.disconnect-button[_ngcontent-%COMP%]{min-width:120px;font-size:.875rem}.provider-selection-container[_ngcontent-%COMP%]{padding-bottom:.75rem}.provider-selection-container[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{font-size:1rem}}"]})}}return e})();var Zt=(()=>{class e{constructor(){this.imageUrl=G(""),this.organizationName=G(""),this.programTitle=G(""),this.displayDates=G("")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-register-header"]],inputs:{imageUrl:[1,"imageUrl"],organizationName:[1,"organizationName"],programTitle:[1,"programTitle"],displayDates:[1,"displayDates"]},decls:12,vars:4,consts:[[1,"flex","flex-row"],[1,"flex","items-center"],["alt","Camp",1,"camp-img",3,"src"],[1,"info-container"],[1,"main-title","text-gray-700","dark:text-gray-200"],[1,"subtitle","text-theme-secondary"],[1,"subtitle-2"]],template:function(i,n){i&1&&(St(0,"div")(1,"div",0)(2,"div",1),fe(3,"img",2),Mt(),St(4,"div",3)(5,"h1",4),s(6),Mt(),St(7,"div")(8,"h4",5),s(9),Mt(),St(10,"h4",6),s(11),Mt()()()()()),i&2&&(r(3),ge("src",n.imageUrl(),L),r(3),h(n.programTitle()),r(3),h(n.displayDates()),r(2),h(n.organizationName()))},styles:[".info-container[_ngcontent-%COMP%]{margin-left:20px;margin-top:20px;display:flex;flex-direction:column}.main-title[_ngcontent-%COMP%]{margin:0 0 12px;font-size:1.5em}.subtitle[_ngcontent-%COMP%]{margin:0 0 6px;font-weight:400}.subtitle-2[_ngcontent-%COMP%]{margin:0;font-weight:400}.camp-img[_ngcontent-%COMP%]{width:120px;height:120px;object-fit:contain;border-radius:12px}"]})}}return e})();var Ji=(e,m)=>({"text-red-500":e,"text-gray-700 dark:text-gray-200":m});function Ki(e,m){e&1&&(o(0,"span"),s(1,"*"),a())}function Xi(e,m){if(e&1){let t=P();o(0,"button",7),x("click",function(){let n=y(t).$implicit,g=d();return S(g.handleCamperSelected(n.id))}),s(1),a()}if(e&2){let t=m.$implicit;r(),w(" ",t.first_name+" "+t.last_name," ")}}function Qi(e,m){if(e&1){let t=P();o(0,"div",8)(1,"div",1)(2,"span",9),x("click",function(){y(t);let n=d();return S(n.openMultiCgmAuthDialog())}),o(3,"mat-icon",10),s(4),a(),s(5," CGM Connections "),a()()()}if(e&2){let t=d();r(2),p("ngClass",t.selectedCamper.has_dexcom_auth||t.selectedCamper.has_abbott_auth?"text-dexcom-green hover:text-green-800":"text-blue-600 hover:text-blue-800"),r(2),h(t.selectedCamper.has_dexcom_auth||t.selectedCamper.has_abbott_auth?"check":"add")}}var te={id:0,first_name:"",last_name:""},oi=(()=>{class e{constructor(){this.dialog=f(nt),this.camperId=G(null),this.campers=G([]),this.camperSelected=Tt(),this.camperCreated=Tt(),this.onManageMultiCgm=Tt(),this.selectedCamper=te}ngOnInit(){this.camperId()&&(this.selectedCamper=this.campers().find(t=>t.id===this.camperId())||te)}ngOnChanges(t){(t.camperId||t.campers)&&this.updateSelectedCamper()}updateSelectedCamper(){this.camperId()?this.selectedCamper=this.campers().find(t=>t.id===this.camperId())||te:this.selectedCamper=te}handleCamperSelected(t){this.camperSelected.emit(t)}openCreateCamperDialog(){this.dialog.open(qe,{width:"800px",data:{use_image:!1}}).afterClosed().subscribe(i=>{i&&i.camper&&this.camperCreated.emit(i.camper)})}openMultiCgmAuthDialog(){this.onManageMultiCgm.emit()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-participant-form"]],inputs:{camperId:[1,"camperId"],campers:[1,"campers"]},outputs:{camperSelected:"camperSelected",camperCreated:"camperCreated",onManageMultiCgm:"onManageMultiCgm"},features:[ue],decls:21,vars:8,consts:[["camperMenu","matMenu"],[1,"flex","flex-row","sm:justify-end"],[1,"dummy-img","sm:hidden"],[1,"info-container"],[1,"main-title",3,"ngClass"],[1,"text-blue-600","hover:text-blue-800","underline","cursor-pointer",3,"matMenuTriggerFor"],["mat-menu-item",""],["mat-menu-item","",3,"click"],[1,"mt-2"],[1,"underline","cursor-pointer","flex","flex-row","items-center",3,"click","ngClass"],[1,"material-symbols-rounded"]],template:function(i,n){if(i&1&&(o(0,"div")(1,"div",1),u(2,"div",2),o(3,"div",3)(4,"h1",4),l(5,Ki,2,0,"span"),s(6," Participant "),a(),o(7,"div",1)(8,"span",5),s(9),a(),o(10,"mat-menu",null,0),O(12,Xi,2,1,"button",6,T),u(14,"mat-divider"),o(15,"button",7),x("click",function(){return n.openCreateCamperDialog()}),o(16,"mat-icon"),s(17,"add"),a(),o(18,"span"),s(19,"Create New Participant"),a()()()(),l(20,Qi,6,2,"div",8),a()()()),i&2){let g=ot(11);r(4),p("ngClass",mt(5,Ji,!n.camperId(),n.camperId())),r(),c(n.camperId()?-1:5),r(3),p("matMenuTriggerFor",g),r(),w(" ",n.selectedCamper?n.selectedCamper.first_name+" "+n.selectedCamper.last_name:"Select Participant"," "),r(3),D(n.campers()),r(8),c(n.selectedCamper?20:-1)}}
2,dependencies:[dt,Oe,Ee,we,Gt,j],styles:[".info-container[_ngcontent-%COMP%]{margin-left:20px;margin-top:20px;display:flex;flex-direction:column}.main-title[_ngcontent-%COMP%]{margin:0 0 12px;font-size:1.5em}.dummy-img[_ngcontent-%COMP%]{width:120px;height:120px;background-color:transparent}"]})}}return e})();var Zi=(e,m)=>({form_assignment_id:e,camper_id:m});function tn(e,m){if(e&1){let t=P();o(0,"mat-card",0)(1,"div",1)(2,"div",2),u(3,"app-register-header",3),a(),o(4,"div",4)(5,"app-participant-form",5),x("camperSelected",function(n){y(t);let g=d();return S(g.handleCamperSelected(n))})("camperCreated",function(n){y(t);let g=d();return S(g.handleCamperCreated(n))})("onManageMultiCgm",function(){y(t);let n=d();return S(n.awaitMultiCgmAuthDialog())}),a()()()()}if(e&2){let t=d();p("@fadeIn",t.loading),r(3),p("imageUrl",t.camp.img_url)("organizationName",t.camp.organization_name)("programTitle",t.camp.title)("displayDates",t.camp.display_dates),r(2),p("campers",t.campers)("camperId",t.camperId)}}function en(e,m){if(e&1){let t=P();o(0,"mat-card",0)(1,"app-form-renderer",6),x("formSubmitted",function(n){y(t);let g=d();return S(g.handleFormSubmit(n))})("autoSaved",function(n){y(t);let g=d();return S(g.handleAutoSave(n))}),a()()}if(e&2){let t=d();p("@fadeIn",t.loading),r(),p("formDefinition",t.formDefinition)("defaultValues",t.inProgressSubmission)("campId",t.camp.id)("campFullPrice",t.campFullPrice)("campType",t.campType)("optionsCartItems",t.optionsCartItems)("optionalItems",t.optionalItems)("gratisCollectJsToken",t.camp.organization_gratis_collectjs_token??"")("allowAch",t.isAchEnabled(t.camp.organization_ach_enabled))("submitting",t.submitting)("enableAutoSave",!0)("autoSavePayload",mt(17,Zi,t.formDefinition.form_assignment_id,t.camperId))("allowFinancialAid",!!t.camp.allow_finaid)("campTransactionFeeMode",t.campTransactionFeeMode)("legacyFormOptions",t.legacyFormOptions)("useLinearStepper",!0)}}var ri=(()=>{class e{constructor(){this.router=f(et),this.route=f(K),this.api=f(F),this.util=f(k),this.snackbarService=f(R),this.dialog=f(nt),this.formAutosaveService=f(Te),this.formDefinition=null,this.loading=!1,this.submitting=!1,this.campId="",this.camperId=null,this.camp=null,this.campers=[],this.legacyFormOptions=null,this.campFullPrice=0,this.campType="",this.campTransactionFeeMode="none",this.optionsCartItems=[],this.optionalItems=[],this.inProgressSubmission=null,this.inProgressSubmissionId=null}isAchEnabled(t){return t===!0||t===1}ngOnInit(){this.campId=this.route.snapshot.params.campid,this.camperId=this.route.snapshot.params.camperid,this.init()}init(){return _(this,null,function*(){this.loading=!0;let t=yield this.getCamp(this.campId);if(!t)return;this.camp=W(q({},t),{display_dates:this.util.getCampDisplayDates(t.start_date,t.end_date)}),this.campers=yield this.getCampers(),this.legacyFormOptions=yield this.getLegacyFormOptions(),this.campFullPrice=parseFloat(t.price??"0"),this.campType=t.type??"",this.campTransactionFeeMode=t.transaction_fee_mode||"none",this.optionsCartItems=[{image_url:t.img_url,name:t.title,price:parseFloat(t.price??"0"),selected_id:Fe.FULL_PAYMENT,options:t.payment_options}],this.optionalItems=t.camp_fees.map(M=>({id:M.id,name:M.name,price:parseFloat(M.amount),checked:!1}));let i=yield this.getCampRegistrationForm(this.campId);if(!i)return;this.formDefinition=i;let n=yield this.awaitParticipantFormDialog();(!n||!n.camper.has_dexcom_auth||!n.camper.has_abbott_auth)&&(yield this.awaitMultiCgmAuthDialog()),(yield this.checkHasDraft())&&((yield this.awaitConfirmLoadDraftDialog())?yield this.loadInProgressForm():yield this.deleteInProgressForm()),this.loading=!1})}awaitParticipantFormDialog(){return _(this,null,function*(){let t={campers:this.campers,camperId:this.camperId},i=this.dialog.open(ii,{data:t,closeOnNavigation:!0,disableClose:!0,width:"600px",maxWidth:"600px"}),n=yield C(i.afterClosed());if(!n)return null;let g=this.campers.find(M=>M.id===n.camper.id);return g?(this.camperId=g.id,{camper:g}):(this.campers.push(n.camper),this.camperId=n.camper.id,{camper:n.camper})})}awaitMultiCgmAuthDialog(){return _(this,null,function*(){let t=this.campers.find(M=>M.id===this.camperId);if(!t)return;let i={camper:{id:t.id,first_name:t.first_name,last_name:t.last_name,has_dexcom_auth:t.has_dexcom_auth??0,has_abbott_auth:t.has_abbott_auth??0}},n=this.dialog.open(ai,{data:i,closeOnNavigation:!0,disableClose:!0,width:"600px",maxWidth:"600px"}),g=yield C(n.afterClosed());if(g){let M=g.camper;this.campers=this.campers.map(H=>H.id===M.id?W(q({},H),{has_dexcom_auth:M.has_dexcom_auth,has_abbott_auth:M.has_abbott_auth}):H)}return g})}handleCamperSelected(t){this.camperId=t}checkHasDraft(){return _(this,null,function*(){return this.formDefinition?this.formAutosaveService.hasInProgressRegistration(this.formDefinition.form_assignment_id,this.camperId||void 0):!1})}awaitConfirmLoadDraftDialog(){return _(this,null,function*(){let t=this.dialog.open(Xt,{data:{title:"Restore Saved Form",message:"We found a saved form from your previous session. Would you like to pick up where you left off?"}});return(yield C(t.afterClosed()))??!1})}loadInProgressForm(){return _(this,null,function*(){if(!this.formDefinition)return;let t=yield this.formAutosaveService.getInProgressRegistration(this.formDefinition.form_assignment_id,this.camperId||void 0);t&&(this.inProgressSubmission=W(q({},t),{submitted_at:null}),this.inProgressSubmissionId=t.id,this.snackbarService.openSuccessSnackBar("Welcome back! Your progress has been restored."))})}deleteInProgressForm(){return _(this,null,function*(){this.formDefinition&&(yield this.formAutosaveService.deleteInProgressRegistration(this.formDefinition.form_assignment_id,this.camperId||void 0))})}buildDraftPayload(t,i){let n={form_id:i.id,form_assignment_id:i.form_assignment_id,values:t.form,nvda_medical_info:t.nvda_medical_info,nvda_diabetes_info:t.nvda_diabetes_info,nvda_add_participants:t.nvda_add_participants};return this.camperId&&(n.camper_id=this.camperId),n}handleAutoSave(t){return _(this,null,function*(){if(!this.formDefinition)return;let i=this.buildDraftPayload(t,this.formDefinition);this.inProgressSubmissionId&&(i.in_progress_submission_id=this.inProgressSubmissionId);let n=yield this.formAutosaveService.saveInProgressRegistration(i);n&&(this.inProgressSubmissionId=n.id)})}handleFormSubmit(t){return _(this,null,function*(){if(!this.formDefinition)return;let i="v1/form-submission/camp-registration";this.submitting=!0;let n=W(q({},this.buildDraftPayload(t,this.formDefinition)),{payment_method:t.paymentMethod,pay_in_installments:t.pay_in_installments,pay_period:t.pay_period,payment_installments:t.payment_installments,camper_id:this.camperId,program_amount_type:t.program_amount_type,optional_items:t.optional_items,include_transaction_fee:t.include_transaction_fee||!1});try{let g=yield C(this.api.post(i,n).pipe(v()));g instanceof A?this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(g),{duration:1e4}):this.router.navigate(["/p/register/confirm-v2",g.id])}finally{this.submitting=!1}})}getCamp(t){return _(this,null,function*(){let i=yield C(this.api.get(`v1/camp/${t}`).pipe(v()));return I(i)?i.data:(this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(i)),null)})}getCampers(){return _(this,null,function*(){let t=yield C(this.api.get("v1/camper").pipe(v()));return t instanceof A?(this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(t)),[]):t.data})}getLegacyFormOptions(){return _(this,null,function*(){let t=yield C(this.api.get("user/register/form-options").pipe(v()));return I(t)?t.data:null})}handleCamperCreated(t){this.campers.push(t),this.camperId=t.id}getCampRegistrationForm(t){return _(this,null,function*(){let i=yield C(this.api.get(`v1/camp/${t}/registration-form`).pipe(v()));return i instanceof A?(this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(i)),null):i})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-register-v2"]],decls:3,vars:3,consts:[["appearance","outlined",1,"p-2","!mb-4"],[1,"flex","sm:flex-row","flex-col"],[1,"sm:w-1/2"],[3,"imageUrl","organizationName","programTitle","displayDates"],[1,"sm:w-1/2","text-right"],[3,"camperSelected","camperCreated","onManageMultiCgm","campers","camperId"],[3,"formSubmitted","autoSaved","formDefinition","defaultValues","campId","campFullPrice","campType","optionsCartItems","optionalItems","gratisCollectJsToken","allowAch","submitting","enableAutoSave","autoSavePayload","allowFinancialAid","campTransactionFeeMode","legacyFormOptions","useLinearStepper"]],template:function(i,n){i&1&&(o(0,"div"),l(1,tn,6,7,"mat-card",0),l(2,en,2,20,"mat-card",0),a()),i&2&&(p("@fadeIn",void 0),r(),c(!n.loading&&n.camp?1:-1),r(),c(!n.loading&&n.camp&&n.formDefinition?2:-1))},dependencies:[N,Zt,oi,Ue],encapsulation:2,data:{animation:[At("fadeIn",[Et(":enter",[rt({opacity:0}
2),wt("500ms ease-in",rt({opacity:1}))])])]}})}}return e})();var me=Ot(jt());function nn(e,m){e&1&&(o(0,"div",0)(1,"div"),u(2,"mat-spinner",3),a()())}function an(e,m){if(e&1&&(o(0,"mat-card",1),u(1,"app-register-header",4),a()),e&2){let t=d();r(),p("imageUrl",t.camp.img_url)("organizationName",t.camp.organization_name)("programTitle",t.camp.title)("displayDates",t.camp.display_dates)}}function on(e,m){if(e&1&&(o(0,"mat-card",2)(1,"mat-card-header",5)(2,"mat-card-title",6),s(3,"Registration"),u(4,"br"),s(5,"Completed"),a()(),o(6,"mat-card-content"),u(7,"hr"),o(8,"p",7),s(9,"Thank you for registering!"),a(),o(10,"p",7),s(11,"We have sent a confirmation email to "),o(12,"b"),s(13),a(),s(14,"."),a()(),o(15,"mat-card-actions",8)(16,"button",9),s(17,"Home"),a()()()),e&2){let t=d();r(13),h(t.registrationInfo.user_email)}}var si=(()=>{class e{constructor(){this.api=f(F),this.util=f(k),this.route=f(K),this.snackbarService=f(R),this.loading=!1,this.camp=null,this.registrationInfo=null}ngOnInit(){this.init()}init(){return _(this,null,function*(){this.loading=!0;let t=this.route.snapshot.params.regid,i=yield this.getRegistrationInfo(t);if(i){this.registrationInfo=i;let n=yield this.getCamp(i.assignable_id);this.camp=n?W(q({},n),{display_dates:this.util.getCampDisplayDates(n.start_date,n.end_date)}):null}setTimeout(()=>{this.loading=!1},1e3)})}getCamp(t){return _(this,null,function*(){let i=yield C(this.api.get(`v1/camp/${t}`).pipe(v()));return I(i)?i.data:(this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(i)),null)})}getRegistrationInfo(t){return _(this,null,function*(){let i=yield C(this.api.get(`v1/form-submission/${t}/confirmation`).pipe(v()));return i instanceof A?(this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(i)),null):i})}formatCampDates(t){let i=(0,me.default)(t.start_date).format("MMM. Do"),n=(0,me.default)(t.end_date).format("MMM. Do, YYYY");return`${i} - ${n}`}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-register-confirm-v2"]],decls:4,vars:3,consts:[[1,"flex","flex-col","items-center","justify-center",2,"margin-top","100px"],["appearance","outlined",1,"p-2","!mb-4","fadeIn"],["appearance","outlined",1,"confirmation-card","fadeIn"],["diameter","50"],[3,"imageUrl","organizationName","programTitle","displayDates"],[2,"display","block"],[1,"title","text-theme-primary"],[1,"description","text-theme-secondary"],[1,"flex","justify-center","!mt-5"],["mat-raised-button","","color","primary","routerLink","/p/home"]],template:function(i,n){i&1&&(o(0,"div"),l(1,nn,3,0,"div",0),l(2,an,2,4,"mat-card",1),l(3,on,18,1,"mat-card",2),a()),i&2&&(r(),c(n.loading?1:-1),r(),c(!n.loading&&n.camp?2:-1),r(),c(!n.loading&&n.registrationInfo?3:-1))},dependencies:[V,N,Zt,gt,ut,U,ft,E,$],styles:[".confirmation-card[_ngcontent-%COMP%]{margin:50px auto;text-align:center;padding:20px}.fadeIn[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_showConfirmation .5s ease-in-out}@keyframes _ngcontent-%COMP%_showConfirmation{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.confirmation-card[_ngcontent-%COMP%]   hr[_ngcontent-%COMP%]{width:270px;border-top:2px dotted #c0cf37;margin-top:20px;margin-bottom:30px}.confirmation-card[_ngcontent-%COMP%]   mat-card-title[_ngcontent-%COMP%]{font-size:32px;line-height:45px}.camp-image[_ngcontent-%COMP%]{height:100px;width:100px;object-fit:cover;margin-top:10px;border-radius:5px}"]})}}return e})();var de=Ot(jt());var ee="nvda_medical_info",ie="nvda_diabetes_info";function mi(e,m){if(e)return"";switch(m){case"camp_started":return"Editing is closed because the camp has started.";case"no_submission":return"There is no submitted registration to edit yet.";case"no_editable_sections":return"This registration has no editable sections.";case"not_owner":return"You don't have permission to edit this registration.";default:return"Editing is not available for this registration."}}function rn(e,m){e&1&&(o(0,"div",0),u(1,"mat-spinner",3),a())}function sn(e,m){if(e&1&&(o(0,"div",1)(1,"mat-card")(2,"mat-card-content")(3,"div",4),s(4),a()()()()),e&2){let t=d();r(4),h(t.errorMessage())}}function mn(e,m){if(e&1&&(o(0,"tr")(1,"td")(2,"b"),s(3,"Participant:"),a()(),o(4,"td"),s(5),a()()),e&2){let t=d();r(5),J("",t.camper_first_name," ",t.camper_last_name)}}function dn(e,m){if(e&1&&(o(0,"tr")(1,"td")(2,"b"),s(3,"Program:"),a()(),o(4,"td"),s(5),a()()),e&2){let t=d();r(5),h(t.camp_title)}}function ln(e,m){if(e&1&&s(0),e&2){let t=d(2),i=d(2);w(" \u2013 ",i.formatDate(t.camp_end_date)," ")}}function cn(e,m){if(e&1&&(o(0,"tr")(1,"td")(2,"b"),s(3,"Dates:"),a()(),o(4,"td"),s(5),l(6,ln,1,1),a()()),e&2){let t=d(),i=d(2);r(5),w(" ",i.formatDate(t.camp_start_date)," "),r(),c(t.camp_end_date?6:-1)}}function pn(e,m){if(e&1&&(o(0,"table",5),l(1,mn,6,2,"tr"),l(2,dn,6,1,"tr"),l(3,cn,7,2,"tr"),a()),e&2){let t=m;r(),c(t.camper_first_name||t.camper_last_name?1:-1),r(),c(t.camp_title?2:-1),r(),c(t.camp_start_date?3:-1)}}function un(e,m){if(e&1&&(o(0,"div",4),s(1),a()),e&2){let t=d(2);Q("mt-4",t.regInfo()),r(),h(t.lockMessage())}}function fn(e,m){if(e&1&&(o(0,"mat-card",8)(1,"mat-card-header")(2,"mat-card-title"),s(3,"Medical Information"),a()(),o(4,"mat-card-content"),u(5,"app-nvda-medical-info-section",9),a()()),e&2){let t=d(2);Q("section-readonly",!t.canEdit()),p("inert",!t.canEdit()),r(5),p("formGroup",t.medicalGroup)("defaultValues",t.medicalDefaults)}}function gn(e,m){if(e&1&&(o(0,"mat-card",8)(1,"mat-card-header")(2,"mat-card-title"),s(3,"Diabetes Information"),a()(),o(4,"mat-card-content"),u(5,"app-nvda-diabetes-info-section",10),a()()),e&2){let t=d(2);Q("section-readonly",!t.canEdit()),p("inert",!t.canEdit()),r(5),p("formGroup",t.diabetesGroup)("formOptions",t.formOptions)("defaultValues",t.diabetes
2Defaults)}}function _n(e,m){if(e&1){let t=P();o(0,"mat-card")(1,"mat-card-actions")(2,"button",11),x("click",function(){y(t);let n=d(2);return S(n.save())}),s(3),a()()()}if(e&2){let t=d(2);r(2),p("disabled",t.saving()||!(t.medicalGroup!=null&&t.medicalGroup.dirty||t.diabetesGroup!=null&&t.diabetesGroup.dirty)),r(),w(" ",t.saving()?"Saving\u2026":"Save Changes"," ")}}function hn(e,m){e&1&&(o(0,"mat-card")(1,"mat-card-content")(2,"div",4),s(3,"This registration has no editable sections."),a()()())}function Cn(e,m){if(e&1&&(o(0,"div",2)(1,"mat-card")(2,"mat-card-header")(3,"mat-card-title"),s(4,"Update Medical & Diabetes Information"),a()(),o(5,"mat-card-content"),l(6,pn,4,3,"table",5),l(7,un,2,3,"div",6),a()(),l(8,fn,6,5,"mat-card",7),l(9,gn,6,6,"mat-card",7),l(10,_n,4,2,"mat-card"),l(11,hn,4,0,"mat-card"),a()),e&2){let t,i=d();r(6),c((t=i.regInfo())?6:-1,t),r(),c(i.canEdit()?-1:7),r(),c(i.medicalGroup?8:-1),r(),c(i.diabetesGroup?9:-1),r(),c(i.canEdit()&&(i.medicalGroup||i.diabetesGroup)?10:-1),r(),c(i.canEdit()&&!i.medicalGroup&&!i.diabetesGroup?11:-1)}}var di=(()=>{class e{constructor(){this.route=f(K),this.destroyRef=f(pe),this.api=f(F),this.util=f(k),this.snackbar=f(R),this.dialog=f(nt),this.loading=at(!0),this.saving=at(!1),this.errorMessage=at(""),this.canEdit=at(!1),this.lockMessage=at(""),this.regInfo=at(null),this.regId="",this.formOptions=null,this.medicalGroup=null,this.diabetesGroup=null,this.medicalDefaults=null,this.diabetesDefaults=null,this.medicalSectionId=null,this.diabetesSectionId=null}ngOnInit(){this.route.paramMap.pipe(Ye(this.destroyRef)).subscribe(t=>{this.regId=t.get("regid")??"",this.load()})}load(){return _(this,null,function*(){this.loading.set(!0),this.errorMessage.set(""),this.resetSections();let[t,i,n]=yield Promise.all([C(this.api.get(`v1/registration/${this.regId}/sections`).pipe(v())),C(this.api.get("user/register/form-options").pipe(v())),C(this.api.get(`user/register/${this.regId}`).pipe(v()))]);if(!this.isContext(t)){this.errorMessage.set(this.util.parseNvdaApiError(t)),this.loading.set(!1);return}this.formOptions=I(i)?i.data:null,this.regInfo.set(I(n)?n.data:null),this.applyContext(t),this.loading.set(!1)})}resetSections(){this.regInfo.set(null),this.medicalGroup=null,this.diabetesGroup=null,this.medicalDefaults=null,this.diabetesDefaults=null,this.medicalSectionId=null,this.diabetesSectionId=null}formatDate(t){return t?(0,de.default)(t).format("MMM. Do, YYYY"):""}isContext(t){return!(t instanceof A)&&typeof t.can_edit_sections=="boolean"}applyContext(t){this.canEdit.set(t.can_edit_sections),this.lockMessage.set(mi(t.can_edit_sections,t.lock_reason));let i=t.editable_section_types??[],n=t.sections??{},g=n[ee];g&&i.includes(ee)&&(this.medicalSectionId=g.section_id,this.medicalGroup=Re(),this.medicalDefaults={nvda_medical_info:{section_value:g.values}});let M=n[ie];M&&i.includes(ie)&&(this.diabetesSectionId=M.section_id,this.diabetesGroup=Ne(),this.diabetesDefaults={nvda_diabetes_info:{section_value:M.values}})}buildPatchPayload(){let t={};if(this.medicalGroup?.dirty&&this.medicalSectionId!=null&&(t[ee]={section_id:this.medicalSectionId,values:this.medicalGroup.getRawValue()}),this.diabetesGroup?.dirty&&this.diabetesSectionId!=null){let i=this.diabetesGroup.getRawValue();i.date_of_diagnosis instanceof Date&&(i.date_of_diagnosis=(0,de.default)(i.date_of_diagnosis).format("YYYY-MM-DD")),t[ie]={section_id:this.diabetesSectionId,values:i}}return{sections:t}}save(){return _(this,null,function*(){let t=this.buildPatchPayload();if(Object.keys(t.sections).length===0){this.snackbar.openSuccessSnackBar("No changes to save.");return}this.saving.set(!0);let i=yield C(this.api.patch(`v1/registration/${this.regId}/sections`,t).pipe(v()));if(this.saving.set(!1),!this.isContext(i)){this.snackbar.openErrorSnackBar(this.util.parseNvdaApiError(i)),yield this.load();return}this.medicalGroup?.markAsPristine(),this.diabetesGroup?.markAsPristine(),this.snackbar.openSuccessSnackBar("Your information has been saved.")})}hasUnsavedChanges(){return this.canEdit()&&!!(this.medicalGroup?.dirty||this.diabetesGroup?.dirty)}canDeactivate(){return this.hasUnsavedChanges()?this.dialog.open(Xt,{maxWidth:"400px",data:{title:"Discard unsaved changes?",message:'You have unsaved changes that will be lost. To keep them, click "No", then click "Save Changes" at the bottom of the page. Leave without saving?'}}).afterClosed().pipe(ce(i=>!!i)):!0}onBeforeUnload(t){this.hasUnsavedChanges()&&(t.preventDefault(),t.returnValue=!0)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-registration-section-edit"]],hostBindings:function(i,n){i&1&&x("beforeunload",function(M){return n.onBeforeUnload(M)},Dt)},decls:3,vars:1,consts:[[1,"p-6","flex","justify-center"],[1,"p-6","max-w-4xl","mx-auto"],[1,"p-6","max-w-4xl","mx-auto","flex","flex-col","gap-6"],["diameter","40"],[1,"lock-banner"],[1,"reg-context","text-left"],[1,"lock-banner",3,"mt-4"],[3,"section-readonly","inert"],[3,"inert"],[3,"formGroup","defaultValues"],[3,"formGroup","formOptions","defaultValues"],["mat-raised-button","","color","primary",3,"click","disabled"]],template:function(i,n){i&1&&l(0,rn,2,0,"div",0)(1,sn,5,1,"div",1)(2,Cn,12,6,"div",2),i&2&&c(n.loading()?0:n.errorMessage()?1:2)},dependencies:[Ve,Be,E,V,N,gt,ut,U,ft],styles:[".lock-banner[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:.5rem;background:#fff4e5;border:1px solid #ffd8a8;color:#8a5a00}.section-readonly[_ngcontent-%COMP%]{opacity:.6}.reg-context[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:.125rem 0}.reg-context[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:first-child{padding-right:1rem;white-space:nowrap}"]})}}return e})();var ne=Ot(jt());var xn=(e,m)=>m.id;function vn(e,m){if(e&1&&u(0,"img",7),e&2){let t=d().$implicit;p("src",t.campImageUrl,L)}}function bn(e,m){if(e&1){let t=P();o(0,"div",5)(1,"div",6),l(2,vn,1,1,"img",7),o(3,"div",8)(4,"div",9)(5,"span",10),s(6),a(),s(7),a(),o(8,"div",11),s(9),a(),o(10,"div",12),s(11),a()()(),o(12,"button",13),x("click",function(){let n=y(t).$implicit,g=d();return S(g.goToEdit(n.id))}),s(13," Update Info "),a()()}if(e&2){let t=m.$implicit,i=m.$index,n=m.$count;Q("reg-divider",i!==n-1),r(2),c(t.campImageUrl?2:-1),r(4),h(t.participantName),r(),w(" \u2014 ",t.campTitle," "),r(2),h(t.campDates),r(2),w("Editable until ",t.editableUntil)}}var li=(()=>{class e{constructor(){this.dialogRef=f(_t),this.router=f(et),this.data=f(ht),this.registrations=this.data?.registrations??[]}goToEdit(t){this.dialogRef.close(),this.router.navigate(["/p/registrations",t,"edit"])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-registration-update-dialog"]],decls:10,vars:0,consts:[["mat-dialog-title",""],[1,"text-theme-secondary","mb-3"],[1,"reg-row","flex","flex-col","sm:flex-row","sm:items-center","sm:justify-between","gap-3","py-3",3,"reg
2-divider"],["align","end"],["mat-button","",3,"click"],[1,"reg-row","flex","flex-col","sm:flex-row","sm:items-center","sm:justify-between","gap-3","py-3"],[1,"flex","items-center","gap-3","min-w-0"],["alt","",1,"reg-thumb",3,"src"],[1,"min-w-0"],[1,"text-theme-secondary"],[1,"font-semibold"],[1,"reg-dates","text-theme-secondary"],[1,"reg-deadline","text-theme-secondary"],["mat-raised-button","","color","primary",3,"click"]],template:function(i,n){i&1&&(o(0,"h2",0),s(1,"Update Registration Info"),a(),o(2,"mat-dialog-content")(3,"p",1),s(4," Add or update medical details and forms for any of your upcoming programs. You can make changes any time before the program starts. "),a(),O(5,bn,14,7,"div",2,xn),a(),o(7,"mat-dialog-actions",3)(8,"button",4),x("click",function(){return n.dialogRef.close()}),s(9,"Close"),a()()),i&2&&(r(5),D(n.registrations))},dependencies:[Ct,xt,vt,E],styles:[".reg-thumb[_ngcontent-%COMP%]{width:52px;height:52px;border-radius:8px;object-fit:cover;flex-shrink:0}.reg-divider[_ngcontent-%COMP%]{border-bottom:1px solid var(--border-color)}.reg-dates[_ngcontent-%COMP%]{font-size:13px;opacity:.85}.reg-deadline[_ngcontent-%COMP%]{font-size:12px;opacity:.7}"]})}}return e})();var yn=e=>({"height.px":e}),Sn=e=>[e];function Mn(e,m){if(e&1&&(o(0,"div")(1,"h2",9),s(2),a()()),e&2){let t=d();r(2),h(t.user==null?null:t.user.organization_tagline)}}function Pn(e,m){e&1&&(o(0,"div",7),u(1,"mat-spinner",10),a())}function wn(e,m){if(e&1&&(o(0,"div")(1,"div",11)(2,"p",12),s(3,"Outstanding Balance "),o(4,"span",13),s(5),z(6,"currency"),a()(),o(7,"p"),s(8," Please note that your account has an outstanding balance. "),o(9,"a",14),s(10," Review your orders and make payments here. "),a()()()()),e&2){let t=d();p("@fadeIn",void 0),r(5),h(Z(6,2,t.outstandingBalance))}}function En(e,m){if(e&1){let t=P();o(0,"div")(1,"div",15)(2,"p",16),s(3,"Update Registration Info"),a(),o(4,"p"),s(5),o(6,"button",17),x("click",function(){y(t);let n=d();return S(n.openRegistrationDialog())}),s(7," Review and update here "),a()()()()}if(e&2){let t=d();p("@fadeIn",void 0),r(5),w(" You can update info for ",t.editableCountLabel,". ")}}function On(e,m){if(e&1&&u(0,"app-hero-card",19),e&2){let t=d(2);p("eventName",t.featuredCamp.title)("eventDates",t.featuredCamp.display_dates)("registrationUrl","/p/register/v2/"+t.featuredCamp.id)("imageUrl",t.featuredCamp.img_url)}}function Dn(e,m){e&1&&(o(0,"h2",20),s(1,"No upcoming programs found"),a())}function In(e,m){e&1&&(o(0,"h2",21),s(1,"Upcoming Programs"),a())}function kn(e,m){if(e&1&&(o(0,"div",27)(1,"mat-card",28),u(2,"img",29,0),o(4,"mat-card-content",30)(5,"mat-card-subtitle",31),s(6),a(),o(7,"mat-card-subtitle",32),s(8),a()(),o(9,"mat-card-actions")(10,"button",33),s(11,"REGISTER"),a()()()()),e&2){let t=m.$implicit,i=m.$index,n=ot(3);r(),_e(ve("--animation-order: ",i<15?i:15)),r(),p("src",t.img_url,L)("ngStyle",tt(8,yn,n.offsetWidth)),r(4),h(t.title),r(2),h(t.display_dates),r(2),p("routerLink",tt(10,Sn,"/p/register/v2/"+t.id))}}function Tn(e,m){if(e&1&&(o(0,"div",22),O(1,kn,12,12,"div",27,T),a()),e&2){let t=d(2);r(),D(t.camps.upcoming_camps)}}function An(e,m){if(e&1&&(o(0,"div",8)(1,"div",18),l(2,On,1,4,"app-hero-card",19),l(3,Dn,2,0,"h2",20),l(4,In,2,0,"h2",21),l(5,Tn,3,0,"div",22),a(),o(6,"footer",23)(7,"div",24)(8,"div",25),s(9),a(),o(10,"div")(11,"a",26),s(12,"Terms of Service"),a()()()()()),e&2){let t=d();p("@fadeIn",void 0),r(2),c(t.featuredCamp&&t.showFeaturedCamp?2:-1),r(),c(t.camps.upcoming_camps.length<1?3:-1),r(),c(t.camps.upcoming_camps.length>1?4:-1),r(),c(t.camps.upcoming_camps.length>1?5:-1),r(4),w("\xA9 ",t.currentYear," Views EMR. All rights reserved.")}}var ci=(()=>{class e{constructor(){this.api=f(F),this.util=f(k),this.userService=f(Me),this.snackbarService=f(R),this.dialog=f(nt),this.user=null,this.showFeaturedCamp=!1,this.camps={upcoming_camps:[],recent_camps:[]},this.loading=!1,this.activeTab="programs",this.featuredCamp=null,this.currentYear=new Date().getFullYear(),this.outstandingBalance=0,this.editableRegistrations=[]}get editableCountLabel(){let t=this.editableRegistrations.length;return`${t} upcoming program${t===1?"":"s"}`}openRegistrationDialog(){this.dialog.open(li,{data:{registrations:this.editableRegistrations}
2,width:"600px",maxWidth:"95vw",autoFocus:!1})}ngOnInit(){this.init()}init(){return _(this,null,function*(){this.loading=!0,this.user=this.userService.user,this.showFeaturedCamp=!!this.userService.user?.organization_show_featured_camp,yield this.getCamps(),this.editableRegistrations=this.buildEditableRegistrations(yield this.getCampers()),this.outstandingBalance=yield this.getOutstandingBalance(),this.loading=!1})}getCamps(){return _(this,null,function*(){let t=yield C(this.api.get("admin/camp/dashboard").pipe(v()));if(!I(t)){this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(t));return}this.camps=W(q({},t.data),{upcoming_camps:t.data.upcoming_camps.map(i=>W(q({},i),{display_dates:this.util.getCampDisplayDates(i.start_date,i.end_date)}))}),this.featuredCamp=this.camps.upcoming_camps.find(i=>i.featured)??this.camps.upcoming_camps[0]??null})}getCampers(){return _(this,null,function*(){let t=yield C(this.api.get("user/camper").pipe(v()));return t instanceof A?[]:t.data})}buildEditableRegistrations(t){let i=(0,ne.default)().format("YYYY-MM-DD"),n=[];return(t??[]).forEach(g=>{(g?.registrations??[]).forEach(M=>{let H=M?.camp?.start_date;if(H&&i<H){let le=M?.camp?.end_date;n.push({id:M.id,participantName:`${g.first_name??""} ${g.last_name??""}`.trim(),campTitle:M.camp?.title??"",campStartDate:H,campImageUrl:M.camp?.image_url??"",campDates:le?this.util.getCampDisplayDates(H,le):(0,ne.default)(H).format("MMM. D, YYYY"),editableUntil:(0,ne.default)(H).subtract(1,"day").format("MMM. D, YYYY")})}})}),n.sort((g,M)=>g.campStartDate.localeCompare(M.campStartDate))}getOutstandingBalance(){return _(this,null,function*(){let t=yield C(this.api.get("v1/account/outstanding-balance").pipe(v()));return t instanceof A?(this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(t),{duration:1e4}),0):Number(t.data.outstanding_balance)})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-parent-dashboard"]],decls:13,vars:7,consts:[["square",""],[1,"flex","items-center","justify-start","pt-2.5","pb-5"],[1,"flex","flex-col","sm:flex-row","sm:items-center","items-start","justify-between","w-full","gap-4"],["title","Home","icon","home"],[1,"flex","flex-col-reverse","sm:flex-row","items-center","justify-center","w-full","sm:w-auto"],[1,"org-name","mr-2","sm:mt-0","mt-2"],["alt","Organization Logo",1,"org-img","w-auto",3,"src"],[1,"flex","justify-center","items-center","h-full","mt-20"],[1,"flex","flex-col","min-h-screen"],[1,"text-center","org-tagline","mt-0","mb-6"],["diameter","30"],["role","alert",1,"bg-orange-100","border-l-4","border-orange-500","text-orange-700","p-4","rounded-md"],[1,"mb-4"],[1,"font-bold"],["routerLink","/p/orders",1,"text-blue-600","hover:text-blue-800","underline"],["role","alert",1,"update-reg-banner","bg-orange-100","border-l-4","border-orange-500","text-orange-700","p-4","rounded-md","my-5"],[1,"mb-2","font-bold"],["type","button",1,"inline","align-baseline","bg-transparent","border-0","p-0","cursor-pointer","text-blue-600","hover:text-blue-800","underline","text-lg",3,"click"],[1,"flex-grow"],[3,"eventName","eventDates","registrationUrl","imageUrl"],[1,"text-center","description","text-theme-secondary"],[1,"text-theme-primary"],[1,"flex","flex-row","flex-wrap","!mt-5","!mb-5","gap-8","justify-center","sm:justify-start"],[1,"bg-gray-300","dark:bg-gray-800","dark:text-gray-300","p-2","text-center"],[1,"flex","flex-col","items-center"],[1,"text-sm"],["href","https://campviews.org/static/media/TOS.dcbc8dcdfdf642a47d2d.pdf",1,"text-sm"],[2,"width","275px"],[1,"camp-card","!pt-0"],["mat-card-image","","alt","Camp",1,"card-img",3,"src","ngStyle"],[2,"margin","0px"],[1,"card-title"],[1,"card-subtitle"],["mat-stroked-button","",2,"margin-left","6px","margin-top","3px",3,"routerLink"]],template:function(i,n){i&1&&(o(0,"div")(1,"div",1)(2,"div",2),u(3,"app-icon-page-header",3),o(4,"div",4)(5,"div",5),s(6),a(),u(7,"img",6),a()()(),l(8,Mn,3,1,"div"),l(9,Pn,2,0,"div",7),l(10,wn,11,4,"div"),l(11,En,8,2,"div"),l(12,An,13,6,"div",8),a()),i&2&&(r(6),h(n.user==null?null:n.user.organization_name),r(),p("src",n.user==null?null:n.user.organization_img_url,L),r(),c(n.user!=null&&n.user.organization_tagline?8:-1),r(),c(n.loading?9:-1),r(),c(n.outstandingBalance>0?10:-1),r(),c(n.editableRegistrations.length>0?11:-1),r(),c(n.loading?-1:12))},dependencies:[Y,V,$,je,N,De,ye,U,$t,ft,E,lt],styles:[".card-img[_ngcontent-%COMP%]{object-fit:contain;display:block;overflow:hidden}.card-title[_ngcontent-%COMP%]{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:16px auto auto;padding-bottom:10px;font-weight:700;font-size:18px}.card-subtitle[_ngcontent-%COMP%]{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:auto;font-size:14px}
2.org-name[_ngcontent-%COMP%]{font-weight:400;font-size:1.5rem;line-height:1.334;letter-spacing:0em}.org-tagline[_ngcontent-%COMP%]{font-weight:400}.org-img[_ngcontent-%COMP%]{height:50px}@media(max-width:640px){.org-img[_ngcontent-%COMP%]{height:80px}.org-name[_ngcontent-%COMP%]{font-size:1.7rem}}mat-card[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_popIn .5s calc(var(--animation-order) * 70ms) both ease-in}@keyframes _ngcontent-%COMP%_popIn{0%{opacity:0}to{opacity:1}}.card-action[_ngcontent-%COMP%]{margin:4px!important}.tab-card[_ngcontent-%COMP%]{background-color:#fff;margin-top:20px;margin-bottom:20px}.edit-button[_ngcontent-%COMP%]{position:absolute;top:8px;right:8px}"],data:{animation:[At("fadeIn",[Et(":enter",[rt({opacity:0}),wt("300ms ease-in",rt({opacity:1}))]),Et(":leave",[wt("300ms ease-out",rt({opacity:0}))])])]}})}}return e})();var pi=e=>e&&typeof e.canDeactivate=="function"?e.canDeactivate():!0;var Fn=(e,m)=>({"text-red-600":e,"text-green-600":m}),Rn=e=>["/p/orders",e,"pay"],Nn=(e,m)=>m.id;function Vn(e,m){if(e&1&&u(0,"img",3),e&2){let t=d();p("alt",It(t.camp==null?null:t.camp.title))("src",t.camp==null?null:t.camp.image_url,L)}}function Bn(e,m){if(e&1&&(o(0,"span",6),s(1),a()),e&2){let t=d();r(),J(" \xB7 ",t.registration==null||t.registration.camper==null?null:t.registration.camper.first_name," ",t.registration==null||t.registration.camper==null?null:t.registration.camper.last_name," ")}}function Un(e,m){if(e&1&&(o(0,"div",7)(1,"span",17),s(2),a(),o(3,"span"),s(4),z(5,"date"),a()()),e&2){let t=d();r(2),w("Order #",t.order.id),r(2),h(Pt(5,2,t.order.created_at,"mediumDate"))}}function Ln(e,m){if(e&1&&(o(0,"div",9)(1,"span",18),s(2),a(),u(3,"span",19),o(4,"span",20),s(5),z(6,"currency"),a()()),e&2){let t=m.$implicit,i=d();r(2),h(i.getItemDisplayDescription(t)),r(3),h(Z(6,2,t.total_price))}}function zn(e,m){if(e&1&&(o(0,"div",12)(1,"span"),s(2,"Paid"),a(),o(3,"span",21),s(4),z(5,"currency"),a()()),e&2){let t=d();r(4),w("\u2212",Z(5,1,t.order.total_paid))}}function Hn(e,m){if(e&1&&(o(0,"div",13)(1,"span"),s(2,"Balance Due"),a(),o(3,"span",22),s(4),z(5,"currency"),a()()),e&2){let t=d();r(3),p("ngClass",mt(4,Fn,t.order.total_due>0,t.order.total_due<=0)),r(),w(" ",Z(5,2,t.order.total_due)," ")}}function Gn(e,m){if(e&1&&(o(0,"div",26)(1,"span",27),s(2),a(),o(3,"span",28),s(4),z(5,"date"),a(),o(6,"span",29),s(7),z(8,"currency"),a()()),e&2){let t=m.$implicit,i=d(3);r(2),h(i.getPaymentMethodLabel(t.payment_method)),r(2),h(Pt(5,3,t.created_at,"MMM d, yyyy")),r(3),h(Z(8,6,t.amount))}}function $n(e,m){if(e&1&&(o(0,"div",25),O(1,Gn,9,8,"div",26,T),a()),e&2){let t=d(2);r(),D(t.order.order_payments)}}function jn(e,m){if(e&1){let t=P();o(0,"div",14)(1,"button",23),x("click",function(){y(t);let n=d();return S(n.showPaymentDetails=!n.showPaymentDetails)}),o(2,"mat-icon",24),s(3,"expand_more"),a(),o(4,"span"),s(5),a()(),l(6,$n,3,0,"div",25),a()}if(e&2){let t=d();r(2),Q("rotated",t.showPaymentDetails),r(3),h(t.getPaymentsAppliedLabel()),r(),c(t.showPaymentDetails?6:-1)}}function Yn(e,m){if(e&1&&(o(0,"span"),s(1),a()),e&2){let t=d().$implicit;r(),J(" \xB7 every ",t.day_frequency," ",t.day_frequency>1?"days":"day"," ")}}function qn(e,m){if(e&1&&(o(0,"span"),s(1),a()),e&2){let t=d().$implicit;r(),w(" \xB7 monthly on day ",t.day_of_month," ")}}function Wn(e,m){if(e&1&&(o(0,"div",31)(1,"div",32),s(2),a(),o(3,"div",33),s(4),z(5,"currency"),l(6,Yn,2,2,"span"),l(7,qn,2,1,"span"),a()()),e&2){let t=m.$implicit;r(2),h(t.plan_name),r(2),J(" ",t.plan_payments," payments of ",Z(5,5,t.payment_amount)," "),r(2),c(t.day_frequency?6:-1),r(),c(t.month_frequency?7:-1)}}function Jn(e,m){if(e&1&&(o(0,"div",30),O(1,Wn,8,7,"div",31,Nn),a()),e&2){let t=d(2);r(),D(t.paymentPlans)}}function Kn(e,m){if(e&1){let t=P();o(0,"div",15)(1,"button",23),x("click",function(){y(t);let n=d();return S(n.showPlanDetails=!n.showPlanDetails)}),o(2,"mat-icon",24),s(3,"expand_more"),a(),o(4,"span"),s(5,"Payment plan active"),a()(),l(6,Jn,3,0,"div",30),a()}if(e&2){let t=d();r(2),Q("rotated",t.showPlanDetails),r(4),c(t.showPlanDetails?6:-1)}}function Xn(e,m){if(e&1&&(o(0,"div",16)(1,"a",34),s(2," Pay Now "),a()()),e&2){let t=d();r(),p("routerLink",tt(1,Rn,t.order.id))}}var ae=(()=>{class e{constructor(){this.util=f(k),this.hidePayButton=G(!1),this.camp=null,this.registration=null,this.showPaymentDetails=!1,this.showPlanDetails=!1}get paymentPlans(){return this.registration?.payment_plans??[]}ngOnInit(){this.order.registrations.length>0&&this.order.registrations[0].camp&&(this.registration=this.order.registrations[0],this.camp=this.order.registrations[0].camp)}getOutstandingAmount(){return this.order.total_due}getCampDisplayDates(){return this.camp?this.util.getCampDisplayDates(this.camp.start_date,this.camp.end_date):""}getItemDisplayDescription(t){return t.quantity>1?`${t.description} (\xD7${t.quantity}
2)`:t.description}getPaymentsAppliedLabel(){let t=this.order.order_payments?.length??0;return t===1?"1 payment applied":`${t} payments applied`}getPaymentMethodLabel(t){return{GRATIS_CARD:"Credit Card",GRATIS_ECHECK:"eCheck",EXTERNAL:"External Payment",FINANCIAL_AID:"Financial Aid"}[t]||t}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-order-card"]],inputs:{order:"order",hidePayButton:[1,"hidePayButton"]},decls:27,vars:13,consts:[[1,"order-card-wrapper"],[1,"order-card","mat-elevation-z3"],["mat-card-avatar","",1,"camp-avatar"],[3,"src","alt"],[1,"camp-title"],[1,"camp-dates"],[1,"camper-name"],[1,"order-meta"],[1,"line-items"],[1,"line-item"],[1,"totals"],[1,"total-row"],[1,"total-row","paid-row"],[1,"total-row","balance-row"],[1,"payments-applied"],[1,"payment-plan-indicator"],[1,"card-actions"],[1,"order-number"],[1,"line-item-desc"],[1,"line-item-dots"],[1,"line-item-amount"],[1,"text-green-600"],[3,"ngClass"],[1,"payments-toggle",3,"click"],[1,"toggle-icon"],[1,"payment-details"],[1,"payment-detail-row"],[1,"payment-method"],[1,"payment-date"],[1,"payment-amount"],[1,"plan-details"],[1,"plan-detail"],[1,"plan-name"],[1,"plan-info"],["mat-raised-button","","color","primary",3,"routerLink"]],template:function(i,n){i&1&&(o(0,"div",0)(1,"mat-card",1)(2,"mat-card-header")(3,"div",2),l(4,Vn,1,3,"img",3),a(),o(5,"mat-card-title",4),s(6),a(),o(7,"mat-card-subtitle",5),s(8),l(9,Bn,2,2,"span",6),a(),l(10,Un,6,5,"div",7),a(),o(11,"mat-card-content")(12,"div",8),O(13,Ln,7,4,"div",9,T),a(),o(15,"div",10)(16,"div",11)(17,"span"),s(18,"Total"),a(),o(19,"span"),s(20),z(21,"currency"),a()(),l(22,zn,6,3,"div",12),l(23,Hn,6,7,"div",13),a(),l(24,jn,7,4,"div",14),l(25,Kn,7,3,"div",15),a(),l(26,Xn,3,3,"div",16),a()()),i&2&&(r(4),c(n.camp!=null&&n.camp.image_url?4:-1),r(2),h(n.camp==null?null:n.camp.title),r(2),w(" ",n.getCampDisplayDates()," "),r(),c(!(n.registration==null||n.registration.camper==null)&&n.registration.camper.first_name?9:-1),r(),c(n.order.created_at?10:-1),r(3),D(n.order.order_items),r(7),h(Z(21,11,n.order.total_cost)),r(2),c(n.order.total_paid>0?22:-1),r(),c(n.order.total_paid>0?23:-1),r(),c(n.order.order_payments&&n.order.order_payments.length>0?24:-1),r(),c(n.paymentPlans.length?25:-1),r(),c(!n.hidePayButton()&&!n.paymentPlans.length&&n.order.total_due>0?26:-1))},dependencies:[N,gt,Ie,ut,$t,U,dt,j,E,$,lt,Se],styles:[".order-card-wrapper[_ngcontent-%COMP%]{margin-bottom:1rem}.order-card[_ngcontent-%COMP%]{display:flex;flex-direction:column}.order-card[_ngcontent-%COMP%]   mat-card-header[_ngcontent-%COMP%]{position:relative}.order-card[_ngcontent-%COMP%]   mat-card-header[_ngcontent-%COMP%]   .camp-avatar[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:4px;overflow:hidden}.order-card[_ngcontent-%COMP%]   mat-card-header[_ngcontent-%COMP%]   .camp-avatar[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover}.order-card[_ngcontent-%COMP%]   mat-card-header[_ngcontent-%COMP%]   mat-card-title[_ngcontent-%COMP%], .order-card[_ngcontent-%COMP%]   mat-card-header[_ngcontent-%COMP%]   mat-card-subtitle[_ngcontent-%COMP%]{margin-left:.5rem}.order-card[_ngcontent-%COMP%]   mat-card-header[_ngcontent-%COMP%]   .camp-title[_ngcontent-%COMP%]{font-size:1rem}.order-card[_ngcontent-%COMP%]   mat-card-header[_ngcontent-%COMP%]   .camp-dates[_ngcontent-%COMP%]{font-size:.85rem}.order-card[_ngcontent-%COMP%]   .order-meta[_ngcontent-%COMP%]{position:absolute;top:16px;right:16px;display:flex;flex-direction:column;align-items:flex-end;font-size:.8rem}.order-card[_ngcontent-%COMP%]   .order-meta[_ngcontent-%COMP%]   .order-number[_ngcontent-%COMP%]{font-weight:500}.order-card[_ngcontent-%COMP%]   .line-items[_ngcontent-%COMP%]{margin-top:.5rem}.order-card[_ngcontent-%COMP%]   .line-item[_ngcontent-%COMP%]{display:flex;align-items:baseline;padding:.2rem 0;font-size:.9rem}.order-card[_ngcontent-%COMP%]   .line-item-desc[_ngcontent-%COMP%]{white-space:nowrap;flex-shrink:0}.order-card[_ngcontent-%COMP%]   .line-item-dots[_ngcontent-%COMP%]{flex:1;border-bottom:1px dotted var(--border-color);margin:0 .5rem;min-width:1.5rem;position:relative;top:-3px}
2.order-card[_ngcontent-%COMP%]   .line-item-amount[_ngcontent-%COMP%]{white-space:nowrap;flex-shrink:0;font-variant-numeric:tabular-nums}.order-card[_ngcontent-%COMP%]   .totals[_ngcontent-%COMP%]{border-top:1px solid var(--border-color);margin-top:.5rem;margin-bottom:.5rem;padding-top:.4rem}.order-card[_ngcontent-%COMP%]   .total-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding:.15rem 0;font-size:.9rem}.order-card[_ngcontent-%COMP%]   .total-row[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:last-child{font-variant-numeric:tabular-nums}.order-card[_ngcontent-%COMP%]   .balance-row[_ngcontent-%COMP%]{border-top:1px solid var(--border-color);margin-top:.25rem;padding-top:.35rem;font-weight:600;font-size:.95rem}.order-card[_ngcontent-%COMP%]   .payments-applied[_ngcontent-%COMP%], .order-card[_ngcontent-%COMP%]   .payment-plan-indicator[_ngcontent-%COMP%]{margin-top:.5rem;margin-bottom:.5rem}.order-card[_ngcontent-%COMP%]   .payments-toggle[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.15rem;background:none;border:none;padding:.25rem 0;cursor:pointer;font-size:.8rem;color:var(--text-secondary-color)}.order-card[_ngcontent-%COMP%]   .payments-toggle[_ngcontent-%COMP%]   .toggle-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;transition:transform .2s ease}.order-card[_ngcontent-%COMP%]   .payments-toggle[_ngcontent-%COMP%]   .toggle-icon.rotated[_ngcontent-%COMP%]{transform:rotate(180deg)}.order-card[_ngcontent-%COMP%]   .payment-details[_ngcontent-%COMP%]{padding:.25rem 0 .25rem 1.5rem}.order-card[_ngcontent-%COMP%]   .payment-detail-row[_ngcontent-%COMP%]{display:flex;gap:1rem;padding:.15rem 0;font-size:.8rem}.order-card[_ngcontent-%COMP%]   .payment-detail-row[_ngcontent-%COMP%]   .payment-method[_ngcontent-%COMP%]{flex:1}.order-card[_ngcontent-%COMP%]   .payment-detail-row[_ngcontent-%COMP%]   .payment-date[_ngcontent-%COMP%]{flex-shrink:0}.order-card[_ngcontent-%COMP%]   .payment-detail-row[_ngcontent-%COMP%]   .payment-amount[_ngcontent-%COMP%]{flex-shrink:0;font-variant-numeric:tabular-nums}.order-card[_ngcontent-%COMP%]   .plan-details[_ngcontent-%COMP%]{padding:.25rem 0 .25rem 1.5rem}.order-card[_ngcontent-%COMP%]   .plan-detail[_ngcontent-%COMP%]{padding:.2rem 0}.order-card[_ngcontent-%COMP%]   .plan-detail[_ngcontent-%COMP%]   .plan-name[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500}.order-card[_ngcontent-%COMP%]   .plan-detail[_ngcontent-%COMP%]   .plan-info[_ngcontent-%COMP%]{font-size:.8rem}.order-card[_ngcontent-%COMP%]   .card-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;padding:0 16px 16px}"]})}}return e})();function Qn(e,m){e&1&&(o(0,"div"),u(1,"mat-spinner",2),a())}function Zn(e,m){e&1&&(o(0,"div")(1,"p",7),s(2,"No outstanding orders found"),a()())}function ta(e,m){if(e&1&&(o(0,"div"),u(1,"app-order-card",8),a()),e&2){let t=m.$implicit;r(),p("order",t)}}function ea(e,m){if(e&1&&(o(0,"div",6),l(1,Zn,3,0,"div"),O(2,ta,2,1,"div",null,T),a()),e&2){let t=d(2);r(),c(t.outstandingOrders.length===0?1:-1),r(),D(t.outstandingOrders)}}function ia(e,m){e&1&&(o(0,"div")(1,"p",7),s(2,"No paid orders found"),a()())}function na(e,m){if(e&1&&(o(0,"div"),u(1,"app-order-card",8),a()),e&2){let t=m.$implicit;r(),p("order",t)}}function aa(e,m){if(e&1&&(o(0,"div",6),l(1,ia,3,0,"div"),O(2,na,2,1,"div",null,T),a()),e&2){let t=d(2);r(),c(t.paidOrders.length===0?1:-1),r(),D(t.paidOrders)}}function oa(e,m){e&1&&(o(0,"div")(1,"mat-tab-group")(2,"mat-tab",3),st(3,ea,4,1,"ng-template",4),a(),o(4,"mat-tab",5),st(5,aa,4,1,"ng-template",4),a()()())}var ui=(()=>{class e{constructor(){this.api=f(F),this.util=f(k),this.snackbarService=f(R),this.loading=!1,this.orders=[],this.paidOrders=[],this.outstandingOrders=[]}ngOnInit(){this.init()}init(){return _(this,null,function*(){this.loading=!0;let t=yield this.getOrders();t&&(this.orders=[...t].sort((i,n)=>new Date(n.created_at).getTime()-new Date(i.created_at).getTime()),this.paidOrders=this.orders.filter(i=>i.status===oe.PAID),this.outstandingOrders=this.orders.filter(i=>i.status!==oe.PAID)),this.loading=!1})}getOrders(){return _(this,null,function*(){let t=yield C(this.api.get("v1/orders").pipe(v()));return t instanceof A?(this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(t)),null):t})}getOutstandingAmount(t){return t.total_due-t.total_paid}getCampDisplayDates(t){return t.camp?this.util.getCampDisplayDates(t.camp.start_date,t.camp.end_date):""}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-user-order-history"]],decls:5,vars:2,consts:[[1,"flex","items-center","justify-start","pt-2.5","pb-5"],["title","Orders","icon","receipt"],["diameter","30"],["label","Outstanding Orders"],["matTabContent",""],["label","Paid Orders"],[1,"mt-4"],[1,"text-center","text-lg","text-gray-500"],[3,"order"]],template:function(i,n){i&1&&(o(0,"div")(1,"div",0),u(2,"app-icon-page-header",1),l(3,Qn,2,0,"div"),a(),l(4,oa,6,0,"div"),a()),i&2&&(r(3),c(n.loading?3:-1),r(),c(n.loading?-1:4))},dependencies:[Y,V,Kt,Jt,Wt,ae],encapsulation:2})}}return e})();function ra(e,m){e&1&&(o(0,"div",4),u(1,"mat-spinner",6),a()),e&2&&(r(),p("diameter",40))}function sa(e,m){if(e&1&&(o(0,"div"),u(1,"app-order-card",7),o(2,"h4",8),s(3,"No outstanding balance"),a()()),e&2){let t=d();r(),p("order",t.order)("hidePayButton",!0)}}function ma(e,m){e&1&&(o(0,"span"),s(1,"Submit Payment"),a())}function da(e,m){e&1&&u(0,"mat-spinner",6),e&2&&p("diameter",20)}function la(e,m){if(e&1){let t=P();o(0,"div",5)(1,"div",9),u(2,"app-order-card",7),a(),o(3,"div",10)(4,"mat-card")(5,"mat-card-content")(6,"div",11)(7,"span",12),s(8,"Amount Due"),a(),o(9,"span",13),s(10),z(11,"currency"),a()(),u(12,"mat-divider",14),o(13,"a
2pp-payment-method-input",15),x("paymentMethodSubmitted",function(n){y(t);let g=d();return S(g.onPaymentMethodUpdated(n))}),a(),o(14,"div",16)(15,"button",17),x("click",function(){y(t);let n=d();return S(n.submitPayment())}),l(16,ma,2,0,"span"),l(17,da,1,1,"mat-spinner",6),a()()()()()()}if(e&2){let t=d();r(2),p("order",t.order)("hidePayButton",!0),r(8),h(Pt(11,8,t.order.total_due,"USD")),r(3),p("gratisCollectJsToken",t.camp.organization_gratis_collectjs_token??"")("allowAch",t.isAchEnabled(t.camp.organization_ach_enabled)),r(2),p("disabled",t.submittingPayment||!t.hasPaymentMethod()),r(),c(t.submittingPayment?-1:16),r(),c(t.submittingPayment?17:-1)}}var fi=(()=>{class e{constructor(){this.route=f(K),this.router=f(et),this.api=f(F),this.snackbarService=f(R),this.util=f(k),this.location=f(be),this.order=null,this.camp=null,this.loading=!1,this.submittingPayment=!1,this.paymentMethod={paymentMethod:re.NO_PAYMENT,token:"",bin:"",exp:"",hash:"",number:"",type:""}}isAchEnabled(t){return t===!0||t===1}ngOnInit(){this.init()}init(){return _(this,null,function*(){let t=this.route.snapshot.params.id;this.loading=!0,this.order=yield this.getOrder(t);let i=this.order?.registrations[0];i?.camp&&(this.camp=yield this.getCamp(i.camp.id)),this.loading=!1})}getOrder(t){return _(this,null,function*(){let i=yield C(this.api.get(`v1/orders/${t}`).pipe(v()));return i instanceof A?(this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(i)),null):i})}getCamp(t){return _(this,null,function*(){let i=yield C(this.api.get(`v1/camp/${t}`).pipe(v()));return I(i)?i.data:(this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(i)),null)})}onPaymentMethodUpdated(t){this.paymentMethod=t}submitPayment(){return _(this,null,function*(){if(!this.order)return;let t=`v1/orders/${this.order.id}/submit-payment`,i={payment_method:this.paymentMethod};this.submittingPayment=!0;let n=yield C(this.api.post(t,i).pipe(v()));this.submittingPayment=!1,n instanceof A?this.snackbarService.openErrorSnackBar(this.util.parseNvdaApiError(n)):(this.snackbarService.openSuccessSnackBar("Payment submitted successfully"),this.init())})}hasPaymentMethod(){return this.paymentMethod.paymentMethod!==re.NO_PAYMENT}goBack(){this.location.back()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=b({type:e,selectors:[["app-pay-order"]],decls:11,vars:3,consts:[[1,"flex","items-center","justify-start","pt-2.5","pb-5"],[1,"flex","justify-between","items-center","w-full"],["title","Pay Order","icon","receipt"],["mat-raised-button","","color","primary",3,"click"],[1,"flex","justify-center","items-center","h-full","mt-40"],[1,"pay-order-layout"],[3,"diameter"],[3,"order","hidePayButton"],[1,"text-neutral-600","dark:text-neutral-300","text-center","mt-4"],[1,"invoice-column"],[1,"payment-column"],[1,"amount-due-hero"],[1,"amount-due-label"],[1,"amount-due-value"],[1,"!my-4"],[3,"paymentMethodSubmitted","gratisCollectJsToken","allowAch"],[1,"submit-row"],["mat-raised-button","","color","primary",1,"submit-button",3,"click","disabled"]],template:function(i,n){i&1&&(o(0,"div")(1,"div",0)(2,"div",1),u(3,"app-icon-page-header",2),o(4,"button",3),x("click",function(){return n.goBack()}),o(5,"mat-icon"),s(6,"arrow_back"),a(),s(7," Back to Orders "),a()()(),l(8,ra,2,1,"div",4),l(9,sa,4,2,"div"),l(10,la,18,11,"div",5),a()),i&2&&(r(8),c(n.loading?8:-1),r(),c(!n.loading&&n.order&&n.order.total_due<=0?9:-1),r(),c(!n.loading&&n.order&&n.camp&&n.order.total_due>0?10:-1))},dependencies:[Y,E,j,V,ae,N,U,Gt,Ae,lt],styles:[".pay-order-layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}@media(min-width:1280px){.pay-order-layout[_ngcontent-%COMP%]{flex-direction:row;align-items:flex-start}}.invoice-column[_ngcontent-%COMP%]{flex:3;min-width:0}.payment-column[_ngcontent-%COMP%]{flex:2;min-width:0}@media(min-width:1280px){.payment-column[_ngcontent-%COMP%]{position:sticky;top:1rem}}.amount-due-hero[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:.5rem 0}.amount-due-label[_ngcontent-%COMP%]{font-size:.8rem;text-transform:uppercase;letter-spacing:.05em}.amount-due-value[_ngcontent-%COMP%]{font-size:2rem;font-weight:700;color:#dc2626;font-variant-numeric:tabular-nums}.submit-row[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;margin-top:1.5rem}.submit-button[_ngcontent-%COMP%]{min-width:155px}"]})}}return e})();var Ym=[{path:"home",title:"Views EMR - Home",component:ci},{path:"participant/index",component:Xe},{path:"participant/create",component:se},{path:"participant/:id/edit",component:se},{path:"register/v2/:campid",component:ri},{path:"register/confirm-v2/:regid",component:si}
2,{path:"registrations/:regid/edit",title:"Views EMR - Update Registration Info",component:di,canDeactivate:[pi]},{path:"account/index",component:ei},{path:"orders",component:ui},{path:"orders/:id/pay",component:fi}];export{Ym as PARENTS_LAYOUT_ROUTES};

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.